#define SIZE     60000000
#define BLOCKDIM 1024

struct Test
{
    Test(unsigned size)
    {
        data = new int[size];
        this->size = size;
    }

    ~Test()
    {
        delete[] data;
    }

    int *data;
    unsigned size;
};

struct Pool
{
    Pool(unsigned size)
    {
        cudaMalloc(&d_test, sizeof(struct Test));
        cudaMalloc(&d_data, size * sizeof(int));
        cudaMemcpy(&(d_test->data), &d_data, sizeof(int *), cudaMemcpyHostToDevice);
        cudaMemcpy(&(d_test->size), &(size), sizeof(unsigned), cudaMemcpyHostToDevice);
    }
    ~Pool()
    {
        cudaFree(d_test);
        cudaFree(d_data);
    }
    Test *d_test;
    int *d_data;
};

__global__ void init(struct Test *t)
{
    unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx >= t->size)
      return;

    t->data[idx] = idx;
}

void initTest()
{
    Test t(SIZE);

    unsigned size = (SIZE + BLOCKDIM - 1) / BLOCKDIM;

    static Pool p(SIZE);

    init<<<size, BLOCKDIM>>> (p.d_test);

    cudaMemcpy(t.data, p.d_data, SIZE * sizeof(int), cudaMemcpyDeviceToHost);
}


int main()
{
    for (unsigned i = 0; i < 10; ++i)
        initTest();

    return 0;
}

	.file	"tmpxft_0033f6ef_00000000-6_main.cudafe1.cpp"
	.text
#APP

#NO_APP
	.section	.text._ZN4PoolD2Ev,"axG",@progbits,_ZN4PoolD5Ev,comdat
	.align 2
	.weak	_ZN4PoolD2Ev
	.type	_ZN4PoolD2Ev, @function
_ZN4PoolD2Ev:
.LFB2018:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA2018
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	call	cudaFree@PLT
	movq	8(%rbx), %rdi
	call	cudaFree@PLT
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2018:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZN4PoolD2Ev,"aG",@progbits,_ZN4PoolD5Ev,comdat
.LLSDA2018:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE2018-.LLSDACSB2018
.LLSDACSB2018:
.LLSDACSE2018:
	.section	.text._ZN4PoolD2Ev,"axG",@progbits,_ZN4PoolD5Ev,comdat
	.size	_ZN4PoolD2Ev, .-_ZN4PoolD2Ev
	.weak	_ZN4PoolD1Ev
	.set	_ZN4PoolD1Ev,_ZN4PoolD2Ev
	.text
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2024:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2024:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z27__device_stub__Z4initP4TestP4Test
	.type	_Z27__device_stub__Z4initP4TestP4Test, @function
_Z27__device_stub__Z4initP4TestP4Test:
.LFB2046:
	.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	.L4
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z4initP4Test(%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
.L4:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2046:
	.size	_Z27__device_stub__Z4initP4TestP4Test, .-_Z27__device_stub__Z4initP4TestP4Test
	.globl	_Z4initP4Test
	.type	_Z4initP4Test, @function
_Z4initP4Test:
.LFB2047:
	.cfi_startproc
	endbr64
	jmp	_Z27__device_stub__Z4initP4TestP4Test
	.cfi_endproc
.LFE2047:
	.size	_Z4initP4Test, .-_Z4initP4Test
	.globl	_Z8initTestv
	.type	_Z8initTestv, @function
_Z8initTestv:
.LFB2020:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA2020
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$240000000, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
.LEHB0:
	call	_Znam@PLT
.LEHE0:
	movq	%rax, %rbp
	movb	_ZGVZ8initTestvE1p(%rip), %al
	testb	%al, %al
	jne	.L12
	leaq	_ZGVZ8initTestvE1p(%rip), %r12
	movq	%r12, %rdi
	call	__cxa_guard_acquire@PLT
	testl	%eax, %eax
	je	.L12
	leaq	_ZZ8initTestvE1p(%rip), %rbx
	movl	$16, %esi
	movl	$60000000, 12(%rsp)
	movq	%rbx, %rdi
.LEHB1:
	call	cudaMalloc@PLT
	movl	12(%rsp), %esi
	leaq	8(%rbx), %r13
	movq	%r13, %rdi
	salq	$2, %rsi
	call	cudaMalloc@PLT
	movq	_ZZ8initTestvE1p(%rip), %rdi
	movl	$1, %ecx
	movl	$8, %edx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	leaq	12(%rsp), %rsi
	movl	$1, %ecx
	movl	$4, %edx
	movq	_ZZ8initTestvE1p(%rip), %rax
	leaq	8(%rax), %rdi
	call	cudaMemcpy@PLT
.LEHE1:
	leaq	_ZN4PoolD1Ev(%rip), %rdi
	leaq	__dso_handle(%rip), %rdx
	movq	%rbx, %rsi
	call	__cxa_atexit@PLT
	movq	%r12, %rdi
	call	__cxa_guard_release@PLT
.L12:
	movl	$4194305, %edx
	movl	$2147512945, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$10, %rdx
	movl	$1, %ecx
	addq	%rdi, %rdi
	movl	$1, %esi
	movq	%rdx, 12(%rsp)
	movl	$1, 20(%rsp)
.LEHB2:
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L14
.L16:
	movq	8+_ZZ8initTestvE1p(%rip), %rsi
	movl	$2, %ecx
	movl	$240000000, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	jmp	.L30
.L14:
	movq	_ZZ8initTestvE1p(%rip), %rdi
	call	_Z27__device_stub__Z4initP4TestP4Test
.LEHE2:
	jmp	.L16
.L30:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rbp, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	_ZdaPv@PLT
.L22:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbx
.L18:
	movq	%r12, %rdi
	call	__cxa_guard_abort@PLT
	jmp	.L19
.L23:
	endbr64
	movq	%rax, %rbx
.L19:
	movq	%rbp, %rdi
	call	_ZdaPv@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
.L29:
	call	__stack_chk_fail@PLT
.L20:
	movq	%rbx, %rdi
.LEHB3:
	call	_Unwind_Resume@PLT
.LEHE3:
	.cfi_endproc
.LFE2020:
	.section	.gcc_except_table,"a",@progbits
.LLSDA2020:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE2020-.LLSDACSB2020
.LLSDACSB2020:
	.uleb128 .LEHB0-.LFB2020
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB2020
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L22-.LFB2020
	.uleb128 0
	.uleb128 .LEHB2-.LFB2020
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L23-.LFB2020
	.uleb128 0
	.uleb128 .LEHB3-.LFB2020
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE2020:
	.text
	.size	_Z8initTestv, .-_Z8initTestv
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2021:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$10, %ebx
.L32:
	call	_Z8initTestv
	decl	%ebx
	jne	.L32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2021:
	.size	main, .-main
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z4initP4Test"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2049:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 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	.LC0(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z4initP4Test(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	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	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2049:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.local	_ZGVZ8initTestvE1p
	.comm	_ZGVZ8initTestvE1p,8,8
	.local	_ZZ8initTestvE1p
	.comm	_ZZ8initTestvE1p,16,16
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.hidden	__dso_handle
	.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>
#define SIZE     60000000
#define BLOCKDIM 1024

struct Test
{
    Test(unsigned size)
    {
        data = new int[size];
        this->size = size;
    }

    ~Test()
    {
        delete[] data;
    }

    int *data;
    unsigned size;
};

struct Pool
{
    Pool(unsigned size)
    {
        hipMalloc(&d_test, sizeof(struct Test));
        hipMalloc(&d_data, size * sizeof(int));
        hipMemcpy(&(d_test->data), &d_data, sizeof(int *), hipMemcpyHostToDevice);
        hipMemcpy(&(d_test->size), &(size), sizeof(unsigned), hipMemcpyHostToDevice);
    }
    ~Pool()
    {
        hipFree(d_test);
        hipFree(d_data);
    }
    Test *d_test;
    int *d_data;
};

__global__ void init(struct Test *t)
{
    unsigned int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx >= t->size)
      return;

    t->data[idx] = idx;
}

void initTest()
{
    Test t(SIZE);

    unsigned size = (SIZE + BLOCKDIM - 1) / BLOCKDIM;

    static Pool p(SIZE);

    init<<<size, BLOCKDIM>>> (p.d_test);

    hipMemcpy(t.data, p.d_data, SIZE * sizeof(int), hipMemcpyDeviceToHost);
}


int main()
{
    for (unsigned i = 0; i < 10; ++i)
        initTest();

    return 0;
}

	.text
	.file	"main.hip"
	.globl	_Z19__device_stub__initP4Test   # -- Begin function _Z19__device_stub__initP4Test
	.type	_Z19__device_stub__initP4Test,@function
_Z19__device_stub__initP4Test:          # @_Z19__device_stub__initP4Test
	.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	$_Z4initP4Test, %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	_Z19__device_stub__initP4Test, .Lfunc_end0-_Z19__device_stub__initP4Test
	.cfi_endproc
                                        # -- End function
	.globl	_Z8initTestv                    # -- Begin function _Z8initTestv
	.type	_Z8initTestv,@function
_Z8initTestv:                           # @_Z8initTestv
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$240000000, %edi                # imm = 0xE4E1C00
	callq	_Znam
	movq	%rax, %rbx
	movb	_ZGVZ8initTestvE1p(%rip), %al
	testb	%al, %al
	je	.LBB1_1
.LBB1_4:
.Ltmp3:
	movabsq	$4295025890, %rdi               # imm = 0x10000E4E2
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp4:
# %bb.5:
	testl	%eax, %eax
	jne	.LBB1_7
# %bb.6:
	movq	_ZZ8initTestvE1p(%rip), %rdi
.Ltmp5:
	callq	_Z19__device_stub__initP4Test
.Ltmp6:
.LBB1_7:
	movq	_ZZ8initTestvE1p+8(%rip), %rsi
.Ltmp7:
	movl	$240000000, %edx                # imm = 0xE4E1C00
	movq	%rbx, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp8:
# %bb.8:                                # %_ZN4TestD2Ev.exit
	movq	%rbx, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZdaPv                          # TAILCALL
.LBB1_1:
	.cfi_def_cfa_offset 32
	movl	$_ZGVZ8initTestvE1p, %edi
	callq	__cxa_guard_acquire
	testl	%eax, %eax
	je	.LBB1_4
# %bb.2:
.Ltmp0:
	movl	$_ZZ8initTestvE1p, %edi
	movl	$60000000, %esi                 # imm = 0x3938700
	callq	_ZN4PoolC2Ej
.Ltmp1:
# %bb.3:
	movl	$_ZN4PoolD2Ev, %edi
	movl	$_ZZ8initTestvE1p, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	movl	$_ZGVZ8initTestvE1p, %edi
	callq	__cxa_guard_release
	jmp	.LBB1_4
.LBB1_9:
.Ltmp2:
	movq	%rax, %r14
	movl	$_ZGVZ8initTestvE1p, %edi
	callq	__cxa_guard_abort
	jmp	.LBB1_10
.LBB1_11:
.Ltmp9:
	movq	%rax, %r14
.LBB1_10:                               # %_ZN4TestD2Ev.exit7
	movq	%rbx, %rdi
	callq	_ZdaPv
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	_Z8initTestv, .Lfunc_end1-_Z8initTestv
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp3-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp8-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp8
	.uleb128 .Ltmp9-.Lfunc_begin0           #     jumps to .Ltmp9
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp1-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Lfunc_end1-.Ltmp1             #   Call between .Ltmp1 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZN4PoolC2Ej,"axG",@progbits,_ZN4PoolC2Ej,comdat
	.weak	_ZN4PoolC2Ej                    # -- Begin function _ZN4PoolC2Ej
	.p2align	1, 0x90
	.type	_ZN4PoolC2Ej,@function
_ZN4PoolC2Ej:                           # @_ZN4PoolC2Ej
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %r14
	leaq	4(%rsp), %rbx
	movl	%esi, (%rbx)
	movl	$16, %esi
	callq	hipMalloc
	leaq	8(%r14), %r15
	movl	%ebp, %esi
	shlq	$2, %rsi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r14), %rdi
	movl	$8, %edx
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r14), %rdi
	addq	$8, %rdi
	movl	$4, %edx
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_ZN4PoolC2Ej, .Lfunc_end2-_ZN4PoolC2Ej
	.cfi_endproc
                                        # -- End function
	.section	.text._ZN4PoolD2Ev,"axG",@progbits,_ZN4PoolD2Ev,comdat
	.weak	_ZN4PoolD2Ev                    # -- Begin function _ZN4PoolD2Ev
	.p2align	1, 0x90
	.type	_ZN4PoolD2Ev,@function
_ZN4PoolD2Ev:                           # @_ZN4PoolD2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
.Ltmp10:
	callq	hipFree
.Ltmp11:
# %bb.1:
	movq	8(%rbx), %rdi
.Ltmp12:
	callq	hipFree
.Ltmp13:
# %bb.2:
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB3_3:
	.cfi_def_cfa_offset 16
.Ltmp14:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end3:
	.size	_ZN4PoolD2Ev, .Lfunc_end3-_ZN4PoolD2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZN4PoolD2Ev,"aG",@progbits,_ZN4PoolD2Ev,comdat
	.p2align	2, 0x0
GCC_except_table3:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp10-.Lfunc_begin1          # >> Call Site 1 <<
	.uleb128 .Ltmp13-.Ltmp10                #   Call between .Ltmp10 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	1                               #   On action: 1
.Lcst_end1:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	$10, %ebx
.LBB4_1:                                # =>This Inner Loop Header: Depth=1
	callq	_Z8initTestv
	decl	%ebx
	jne	.LBB4_1
# %bb.2:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end5:
	.size	__clang_call_terminate, .Lfunc_end5-__clang_call_terminate
	.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:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4initP4Test, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z4initP4Test,@object           # @_Z4initP4Test
	.section	.rodata,"a",@progbits
	.globl	_Z4initP4Test
	.p2align	3, 0x0
_Z4initP4Test:
	.quad	_Z19__device_stub__initP4Test
	.size	_Z4initP4Test, 8

	.type	_ZZ8initTestvE1p,@object        # @_ZZ8initTestvE1p
	.local	_ZZ8initTestvE1p
	.comm	_ZZ8initTestvE1p,16,8
	.type	_ZGVZ8initTestvE1p,@object      # @_ZGVZ8initTestvE1p
	.local	_ZGVZ8initTestvE1p
	.comm	_ZGVZ8initTestvE1p,8,8
	.hidden	__dso_handle
	.type	.L__unnamed_1,@object           # @0
	.section	.rodata.str1.1,"aMS",@progbits,1
.L__unnamed_1:
	.asciz	"_Z4initP4Test"
	.size	.L__unnamed_1, 14

	.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 _Z19__device_stub__initP4Test
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z4initP4Test
	.addrsig_sym _ZZ8initTestvE1p
	.addrsig_sym _ZGVZ8initTestvE1p
	.addrsig_sym __dso_handle
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4initP4Test           ; -- Begin function _Z4initP4Test
	.globl	_Z4initP4Test
	.p2align	8
	.type	_Z4initP4Test,@function
_Z4initP4Test:                          ; @_Z4initP4Test
; %bb.0:
	s_clause 0x1
	s_load_b64 s[2:3], s[0:1], 0x0
	s_load_b32 s0, s[0:1], 0x14
	s_waitcnt lgkmcnt(0)
	s_load_b32 s1, s[2:3], 0x8
	s_and_b32 s0, s0, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s0, v[0:1]
	s_mov_b32 s0, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_u32_e64 s1, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b64 s[0:1], s[2:3], 0x0
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s0, v2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	global_store_b32 v[2:3], v1, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4initP4Test
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 4
		.amdhsa_next_free_sgpr 16
		.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	_Z4initP4Test, .Lfunc_end0-_Z4initP4Test
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 136
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.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
    .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:           _Z4initP4Test
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z4initP4Test.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
