#include <cstdio>
#include <cstring>
#include<iostream>

using namespace std;

class Myclass 
{
public:
  
  
  Myclass(int a=0,int b=0)
  {_a=a;_b=b;}
  virtual __host__ __device__ void printValues() 
  {
    
    printf("a = %d, b = %d\n", _a, _b);
    
  }

private:
  int _a;
  int _b;

};

__global__ void virtualFunctions(Myclass *vf) 
{
  Myclass vf_local = Myclass(*vf);
 memcpy(vf, &vf_local, sizeof(Myclass));
  vf->printValues();
}

__global__ void callVFunc(Myclass *vf) 
{
  vf->printValues();
}

int main() {
  //CPU
  Myclass vf_host(4,5);
  

  //GPU
  Myclass *vf;
  cudaMalloc(&vf, sizeof(Myclass));
  
  // CPU --> GPU
  cudaMemcpy(vf, &vf_host, sizeof(Myclass), cudaMemcpyHostToDevice);


  virtualFunctions<<<1, 1>>>(vf);
  cudaDeviceSynchronize();
  
  callVFunc<<<1, 1>>>(vf);
  cudaDeviceSynchronize();
  
  return 0;
}

	.file	"tmpxft_00286bc0_00000000-6_vfunc_ub.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

	.section	.rodata._ZN7Myclass11printValuesEv.str1.1,"aMS",@progbits,1
.LC0:
	.string	"a = %d, b = %d\n"
#NO_APP
	.section	.text._ZN7Myclass11printValuesEv,"axG",@progbits,_ZN7Myclass11printValuesEv,comdat
	.align 2
	.weak	_ZN7Myclass11printValuesEv
	.type	_ZN7Myclass11printValuesEv, @function
_ZN7Myclass11printValuesEv:
.LFB3638:
	.cfi_startproc
	endbr64
	movl	12(%rdi), %ecx
	movl	8(%rdi), %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE3638:
	.size	_ZN7Myclass11printValuesEv, .-_ZN7Myclass11printValuesEv
	.text
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3642:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3642:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass
	.type	_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass, @function
_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass:
.LFB3664:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L3
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z16virtualFunctionsP7Myclass(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L3:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3664:
	.size	_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass, .-_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass
	.globl	_Z16virtualFunctionsP7Myclass
	.type	_Z16virtualFunctionsP7Myclass, @function
_Z16virtualFunctionsP7Myclass:
.LFB3665:
	.cfi_startproc
	endbr64
	jmp	_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass
	.cfi_endproc
.LFE3665:
	.size	_Z16virtualFunctionsP7Myclass, .-_Z16virtualFunctionsP7Myclass
	.globl	_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass
	.type	_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass, @function
_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass:
.LFB3666:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movq	%rdi, 8(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L9
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z9callVFuncP7Myclass(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L9:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3666:
	.size	_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass, .-_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass
	.globl	_Z9callVFuncP7Myclass
	.type	_Z9callVFuncP7Myclass, @function
_Z9callVFuncP7Myclass:
.LFB3667:
	.cfi_startproc
	endbr64
	jmp	_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass
	.cfi_endproc
.LFE3667:
	.size	_Z9callVFuncP7Myclass, .-_Z9callVFuncP7Myclass
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3639:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	movl	$16, %esi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	leaq	16+_ZTV7Myclass(%rip), %rax
	leaq	8(%rsp), %rdi
	movq	%rax, 40(%rsp)
	movabsq	$21474836484, %rax
	movq	%rax, 48(%rsp)
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	leaq	40(%rsp), %rsi
	movl	$1, %ecx
	movl	$16, %edx
	call	cudaMemcpy@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 36(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 28(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L15
	movq	8(%rsp), %rdi
	call	_Z43__device_stub__Z16virtualFunctionsP7MyclassP7Myclass
.L15:
	call	cudaDeviceSynchronize@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	movl	$1, 36(%rsp)
	movq	%rdi, %rdx
	movq	%rdi, 28(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	movq	8(%rsp), %rdi
	call	_Z35__device_stub__Z9callVFuncP7MyclassP7Myclass
.L16:
	call	cudaDeviceSynchronize@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	xorl	%eax, %eax
	addq	$72, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3639:
	.size	main, .-main
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"_Z9callVFuncP7Myclass"
.LC2:
	.string	"_Z16virtualFunctionsP7Myclass"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3669:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC1(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z9callVFuncP7Myclass(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC2(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z16virtualFunctionsP7Myclass(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3669:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.weak	_ZTS7Myclass
	.section	.rodata._ZTS7Myclass,"aG",@progbits,_ZTS7Myclass,comdat
	.align 8
	.type	_ZTS7Myclass, @object
	.size	_ZTS7Myclass, 9
_ZTS7Myclass:
	.string	"7Myclass"
	.weak	_ZTI7Myclass
	.section	.data.rel.ro._ZTI7Myclass,"awG",@progbits,_ZTI7Myclass,comdat
	.align 8
	.type	_ZTI7Myclass, @object
	.size	_ZTI7Myclass, 16
_ZTI7Myclass:
	.quad	_ZTVN10__cxxabiv117__class_type_infoE+16
	.quad	_ZTS7Myclass
	.weak	_ZTV7Myclass
	.section	.data.rel.ro.local._ZTV7Myclass,"awG",@progbits,_ZTV7Myclass,comdat
	.align 8
	.type	_ZTV7Myclass, @object
	.size	_ZTV7Myclass, 24
_ZTV7Myclass:
	.quad	0
	.quad	_ZTI7Myclass
	.quad	_ZN7Myclass11printValuesEv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <cstdio>
#include <cstring>
#include<iostream>

using namespace std;

class Myclass 
{
public:
  
  
  Myclass(int a=0,int b=0)
  {_a=a;_b=b;}
  virtual __host__ __device__ void printValues() 
  {
    
    printf("a = %d, b = %d\n", _a, _b);
    
  }

private:
  int _a;
  int _b;

};

__global__ void virtualFunctions(Myclass *vf) 
{
  Myclass vf_local = Myclass(*vf);
 memcpy(vf, &vf_local, sizeof(Myclass));
  vf->printValues();
}

__global__ void callVFunc(Myclass *vf) 
{
  vf->printValues();
}

int main() {
  //CPU
  Myclass vf_host(4,5);
  

  //GPU
  Myclass *vf;
  hipMalloc(&vf, sizeof(Myclass));
  
  // CPU --> GPU
  hipMemcpy(vf, &vf_host, sizeof(Myclass), hipMemcpyHostToDevice);


  virtualFunctions<<<1, 1>>>(vf);
  hipDeviceSynchronize();
  
  callVFunc<<<1, 1>>>(vf);
  hipDeviceSynchronize();
  
  return 0;
}

	.text
	.file	"vfunc_ub.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z31__device_stub__virtualFunctionsP7Myclass # -- Begin function _Z31__device_stub__virtualFunctionsP7Myclass
	.type	_Z31__device_stub__virtualFunctionsP7Myclass,@function
_Z31__device_stub__virtualFunctionsP7Myclass: # @_Z31__device_stub__virtualFunctionsP7Myclass
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	movq	%rsp, %rbx
	movq	%rax, (%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z16virtualFunctionsP7Myclass, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$80, %rsp
	.cfi_adjust_cfa_offset -80
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z31__device_stub__virtualFunctionsP7Myclass, .Lfunc_end0-_Z31__device_stub__virtualFunctionsP7Myclass
	.cfi_endproc
                                        # -- End function
	.globl	_Z24__device_stub__callVFuncP7Myclass # -- Begin function _Z24__device_stub__callVFuncP7Myclass
	.type	_Z24__device_stub__callVFuncP7Myclass,@function
_Z24__device_stub__callVFuncP7Myclass:  # @_Z24__device_stub__callVFuncP7Myclass
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$64, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	24(%rsp), %rax
	movq	%rdi, (%rax)
	movq	%rsp, %rbx
	movq	%rax, (%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z9callVFuncP7Myclass, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$80, %rsp
	.cfi_adjust_cfa_offset -80
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z24__device_stub__callVFuncP7Myclass, .Lfunc_end1-_Z24__device_stub__callVFuncP7Myclass
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	leaq	16(%rsp), %r14
	movq	$_ZTV7Myclass+16, (%r14)
	movabsq	$21474836484, %rax              # imm = 0x500000004
	movq	%rax, 8(%r14)
	leaq	8(%rsp), %r15
	movl	$16, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	movl	$16, %edx
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.1:
	movq	8(%rsp), %rdi
	callq	_Z31__device_stub__virtualFunctionsP7Myclass
.LBB2_2:
	callq	hipDeviceSynchronize
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_4
# %bb.3:
	movq	8(%rsp), %rdi
	callq	_Z24__device_stub__callVFuncP7Myclass
.LBB2_4:
	callq	hipDeviceSynchronize
	xorl	%eax, %eax
	addq	$32, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
                                        # -- End function
	.section	.text._ZN7Myclass11printValuesEv,"axG",@progbits,_ZN7Myclass11printValuesEv,comdat
	.weak	_ZN7Myclass11printValuesEv      # -- Begin function _ZN7Myclass11printValuesEv
	.p2align	1, 0x90
	.type	_ZN7Myclass11printValuesEv,@function
_ZN7Myclass11printValuesEv:             # @_ZN7Myclass11printValuesEv
	.cfi_startproc
# %bb.0:
	movl	8(%rdi), %esi
	movl	12(%rdi), %edx
	movl	$.L.str, %edi
	xorl	%eax, %eax
	jmp	printf                          # TAILCALL
.Lfunc_end3:
	.size	_ZN7Myclass11printValuesEv, .Lfunc_end3-_ZN7Myclass11printValuesEv
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB4_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB4_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z16virtualFunctionsP7Myclass, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9callVFuncP7Myclass, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end4:
	.size	__hip_module_ctor, .Lfunc_end4-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB5_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB5_2:
	retq
.Lfunc_end5:
	.size	__hip_module_dtor, .Lfunc_end5-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z16virtualFunctionsP7Myclass,@object # @_Z16virtualFunctionsP7Myclass
	.section	.rodata,"a",@progbits
	.globl	_Z16virtualFunctionsP7Myclass
	.p2align	3, 0x0
_Z16virtualFunctionsP7Myclass:
	.quad	_Z31__device_stub__virtualFunctionsP7Myclass
	.size	_Z16virtualFunctionsP7Myclass, 8

	.type	_Z9callVFuncP7Myclass,@object   # @_Z9callVFuncP7Myclass
	.globl	_Z9callVFuncP7Myclass
	.p2align	3, 0x0
_Z9callVFuncP7Myclass:
	.quad	_Z24__device_stub__callVFuncP7Myclass
	.size	_Z9callVFuncP7Myclass, 8

	.type	_ZTV7Myclass,@object            # @_ZTV7Myclass
	.section	.rodata._ZTV7Myclass,"aG",@progbits,_ZTV7Myclass,comdat
	.weak	_ZTV7Myclass
	.p2align	3, 0x0
_ZTV7Myclass:
	.quad	0
	.quad	_ZTI7Myclass
	.quad	_ZN7Myclass11printValuesEv
	.size	_ZTV7Myclass, 24

	.type	_ZTS7Myclass,@object            # @_ZTS7Myclass
	.section	.rodata._ZTS7Myclass,"aG",@progbits,_ZTS7Myclass,comdat
	.weak	_ZTS7Myclass
_ZTS7Myclass:
	.asciz	"7Myclass"
	.size	_ZTS7Myclass, 9

	.type	_ZTI7Myclass,@object            # @_ZTI7Myclass
	.section	.rodata._ZTI7Myclass,"aG",@progbits,_ZTI7Myclass,comdat
	.weak	_ZTI7Myclass
	.p2align	3, 0x0
_ZTI7Myclass:
	.quad	_ZTVN10__cxxabiv117__class_type_infoE+16
	.quad	_ZTS7Myclass
	.size	_ZTI7Myclass, 16

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"a = %d, b = %d\n"
	.size	.L.str, 16

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z16virtualFunctionsP7Myclass"
	.size	.L__unnamed_1, 30

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z9callVFuncP7Myclass"
	.size	.L__unnamed_2, 22

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z31__device_stub__virtualFunctionsP7Myclass
	.addrsig_sym _Z24__device_stub__callVFuncP7Myclass
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z16virtualFunctionsP7Myclass
	.addrsig_sym _Z9callVFuncP7Myclass
	.addrsig_sym _ZTVN10__cxxabiv117__class_type_infoE
	.addrsig_sym _ZTS7Myclass
	.addrsig_sym _ZTI7Myclass
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z16virtualFunctionsP7Myclass ; -- Begin function _Z16virtualFunctionsP7Myclass
	.globl	_Z16virtualFunctionsP7Myclass
	.p2align	8
	.type	_Z16virtualFunctionsP7Myclass,@function
_Z16virtualFunctionsP7Myclass:          ; @_Z16virtualFunctionsP7Myclass
; %bb.0:
	s_load_b64 s[42:43], s[2:3], 0x0
	s_mov_b64 s[36:37], s[0:1]
	v_mov_b32_e32 v1, 0
	s_mov_b32 s33, s15
	s_mov_b32 s40, s14
	s_mov_b32 s41, s13
	s_mov_b64 s[34:35], s[4:5]
	s_mov_b32 s32, 32
	s_waitcnt lgkmcnt(0)
	s_load_b64 s[0:1], s[42:43], 0x8
	v_dual_mov_b32 v31, v0 :: v_dual_mov_b32 v0, 8
	s_waitcnt lgkmcnt(0)
	v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
	s_mov_b64 s[0:1], 0
	scratch_store_b64 off, v[2:3], off offset:16
.LBB0_1:                                ; =>This Inner Loop Header: Depth=1
	s_clause 0x3
	scratch_load_u8 v2, v0, off offset:1
	scratch_load_u8 v3, v0, off offset:3
	scratch_load_u8 v4, v0, off
	scratch_load_u8 v5, v0, off offset:2
	s_add_u32 s4, s42, s0
	s_addc_u32 s5, s43, s1
	v_add_nc_u32_e32 v0, 4, v0
	s_add_u32 s0, s0, 4
	s_addc_u32 s1, s1, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u64 s[0:1], 16
	s_waitcnt vmcnt(3)
	v_lshlrev_b16 v2, 8, v2
	s_waitcnt vmcnt(2)
	v_lshlrev_b16 v3, 8, v3
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_or_b32_e32 v2, v4, v2
	s_waitcnt vmcnt(0)
	v_or_b32_e32 v3, v5, v3
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_and_b32_e32 v2, 0xffff, v2
	v_lshlrev_b32_e32 v3, 16, v3
	s_delay_alu instid0(VALU_DEP_1)
	v_or_b32_e32 v2, v2, v3
	global_store_b32 v1, v2, s[4:5]
	s_cbranch_scc1 .LBB0_1
; %bb.2:                                ; %_ZL6memcpyPvPKvm.exit
	s_load_b64 s[0:1], s[42:43], 0x0
	v_mov_b32_e32 v0, 0
	s_add_u32 s38, s2, 8
	s_addc_u32 s39, s3, 0
	s_waitcnt lgkmcnt(0)
	global_load_b64 v[0:1], v0, s[0:1]
	s_mov_b32 s0, exec_lo
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s0, v0
	v_readfirstlane_b32 s1, v1
	s_mov_b32 s44, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u64_e64 s[0:1], v[0:1]
	v_dual_mov_b32 v0, s42 :: v_dual_mov_b32 v1, s43
	s_mov_b64 s[4:5], s[36:37]
	s_mov_b64 s[8:9], s[38:39]
	s_mov_b64 s[10:11], s[34:35]
	s_mov_b32 s12, s41
	s_mov_b32 s13, s40
	s_mov_b32 s14, s33
	s_swappc_b64 s[30:31], s[0:1]
                                        ; implicit-def: $vgpr0_vgpr1
                                        ; implicit-def: $vgpr31
	s_xor_b32 exec_lo, exec_lo, s44
	s_cbranch_execnz .LBB0_3
; %bb.4:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z16virtualFunctionsP7Myclass
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 32
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 13
		.amdhsa_user_sgpr_dispatch_ptr 1
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 1
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 1
		.amdhsa_enable_private_segment 1
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 1
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 2
		.amdhsa_next_free_vgpr 32
		.amdhsa_next_free_sgpr 45
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z16virtualFunctionsP7Myclass, .Lfunc_end0-_Z16virtualFunctionsP7Myclass
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 336
; NumSgprs: 47
; NumVgprs: 32
; ScratchSize: 32
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 5
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 47
; NumVGPRsForWavesPerEU: 32
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 13
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 1
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 2
	.text
	.protected	_Z9callVFuncP7Myclass   ; -- Begin function _Z9callVFuncP7Myclass
	.globl	_Z9callVFuncP7Myclass
	.p2align	8
	.type	_Z9callVFuncP7Myclass,@function
_Z9callVFuncP7Myclass:                  ; @_Z9callVFuncP7Myclass
; %bb.0:
	s_load_b64 s[6:7], s[2:3], 0x0
	s_mov_b64 s[10:11], s[4:5]
	v_mov_b32_e32 v31, v0
	s_add_u32 s8, s2, 8
	s_mov_b32 s12, s13
	s_addc_u32 s9, s3, 0
	s_mov_b32 s13, s14
	s_mov_b32 s14, s15
	s_mov_b32 s32, 0
	s_waitcnt lgkmcnt(0)
	v_mov_b32_e32 v0, s6
	s_load_b64 s[4:5], s[6:7], 0x0
	v_mov_b32_e32 v1, s7
	s_waitcnt lgkmcnt(0)
	s_load_b64 s[16:17], s[4:5], 0x0
	s_mov_b64 s[4:5], s[0:1]
	s_waitcnt lgkmcnt(0)
	s_swappc_b64 s[30:31], s[16:17]
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9callVFuncP7Myclass
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 13
		.amdhsa_user_sgpr_dispatch_ptr 1
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 1
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 1
		.amdhsa_enable_private_segment 1
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 1
		.amdhsa_system_sgpr_workgroup_id_z 1
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 2
		.amdhsa_next_free_vgpr 32
		.amdhsa_next_free_sgpr 33
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z9callVFuncP7Myclass, .Lfunc_end1-_Z9callVFuncP7Myclass
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 88
; NumSgprs: 35
; NumVgprs: 32
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 4
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 35
; NumVGPRsForWavesPerEU: 32
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 13
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 1
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 2
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         88
        .size:           8
        .value_kind:     hidden_hostcall_buffer
      - .offset:         96
        .size:           8
        .value_kind:     hidden_multigrid_sync_arg
      - .offset:         104
        .size:           8
        .value_kind:     hidden_heap_v1
      - .offset:         112
        .size:           8
        .value_kind:     hidden_default_queue
      - .offset:         208
        .size:           8
        .value_kind:     hidden_queue_ptr
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z16virtualFunctionsP7Myclass
    .private_segment_fixed_size: 32
    .sgpr_count:     47
    .sgpr_spill_count: 0
    .symbol:         _Z16virtualFunctionsP7Myclass.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: true
    .vgpr_count:     32
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .offset:         8
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
      - .offset:         88
        .size:           8
        .value_kind:     hidden_hostcall_buffer
      - .offset:         96
        .size:           8
        .value_kind:     hidden_multigrid_sync_arg
      - .offset:         104
        .size:           8
        .value_kind:     hidden_heap_v1
      - .offset:         112
        .size:           8
        .value_kind:     hidden_default_queue
      - .offset:         208
        .size:           8
        .value_kind:     hidden_queue_ptr
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9callVFuncP7Myclass
    .private_segment_fixed_size: 0
    .sgpr_count:     35
    .sgpr_spill_count: 0
    .symbol:         _Z9callVFuncP7Myclass.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: true
    .vgpr_count:     32
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
