// double indirection, ie float **, in kernel parameter

// this test cuts all gpu buffers from one single gpu buffer

#include <iostream>
#include <memory>
#include <cassert>

using namespace std;

#include <cuda.h>

struct BoundedArray {
    float *bounded_array[8];
};

__global__ void wipe(int *buffer, int length) {
    length >>= 5;
    int tid = threadIdx.x;
    for(int i = 0; i < length; i++) {
        buffer[(i << 5) + tid] = -1;
    }
}

__global__ void run_bounded_array(struct BoundedArray boundedArray, int numBuffers, int N) {
    for(int i = 0; i < numBuffers; i++) {
        for(int j = 0; j < N; j++) {
            boundedArray.bounded_array[i][j] = 123.0f + i + 1 + j;
        }
    }
}

void test1() {
    int N = 1024;

    CUstream stream;
    cuStreamCreate(&stream, 0);

    const int numBuffers = 3;

    char *gpuArena;
    int mallocSize = numBuffers * N * sizeof(float) + 256 + 1024;
    std::cout << "mallocSize=" << mallocSize << std::endl;
    cudaMalloc((void **)&gpuArena, mallocSize);
    wipe<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>((int *)gpuArena, mallocSize >> 2);

    struct BoundedArray boundedArray;
    float *hostFloats[numBuffers];

    for(int i = 0; i < numBuffers; i++) {
        boundedArray.bounded_array[i] = (float *)(gpuArena + 256 + i * N * sizeof(float));
        std::cout << "bounded_array[" << i << "]=" << (long)boundedArray.bounded_array[i] << std::endl;
        hostFloats[i] = new float[N];
    }

    run_bounded_array<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>(boundedArray, numBuffers, N);

    for(int i = 0; i < numBuffers; i++) {
        cudaMemcpy(hostFloats[i], boundedArray.bounded_array[i], N * sizeof(float), cudaMemcpyDeviceToHost);
    }
    cuStreamSynchronize(stream);

    std::cout << std::endl;
    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < 4; j++) {
            cout << hostFloats[i][j] << " ";
        }
        cout << endl;
    }

    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < N; j++) {
            float expected = 123.0f + 1 + i + j;
            float actual = hostFloats[i][j];
            if(actual != expected) {
                std::cout << "mismatch for i=" << i << " j=" << j << " expected=" << expected << " actual=" << actual << std::endl;
                assert(false);
            }
        }
    }

    for(int i=0; i < numBuffers; i++) {
        delete[] hostFloats[i];
    }
    cudaFree(gpuArena);

    cuStreamDestroy(stream);
    std::cout << "test1 finished ok" << std::endl;
}

struct BoundedArrayUnion {
    float *bounded_array[8];
    float **unbounded_array;
};

__global__ void run_bounded_array_two(struct BoundedArrayUnion mystruct, int useUnbounded, int numBuffers, int N) {
    float **starstar = useUnbounded ? mystruct.unbounded_array : mystruct.bounded_array;
    for(int i = 0; i < numBuffers; i++) {
        for(int j = 0; j < N; j++) {
            starstar[i][j] = 123.0f + i + 1 + j;
        }
    }
}

void test2_bounded() {
    int N = 1024;

    CUstream stream;
    cuStreamCreate(&stream, 0);

    const int numBuffers = 3;

    char *gpuArena;
    int mallocSize = numBuffers * N * sizeof(float) + 256 + 1024;
    std::cout << "mallocSize=" << mallocSize << std::endl;
    cudaMalloc((void **)&gpuArena, mallocSize);
    wipe<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>((int *)gpuArena, mallocSize >> 2);

    struct BoundedArrayUnion boundedArray;
    float *hostFloats[numBuffers];

    for(int i = 0; i < numBuffers; i++) {
        boundedArray.bounded_array[i] = (float *)(gpuArena + 256 + i * N * sizeof(float));
        std::cout << "bounded_array[" << i << "]=" << (long)boundedArray.bounded_array[i] << std::endl;
        hostFloats[i] = new float[N];
    }

    run_bounded_array_two<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>(boundedArray, 0, numBuffers, N);

    for(int i = 0; i < numBuffers; i++) {
        cudaMemcpy(hostFloats[i], boundedArray.bounded_array[i], N * sizeof(float), cudaMemcpyDeviceToHost);
    }
    cuStreamSynchronize(stream);

    std::cout << std::endl;
    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < 4; j++) {
            cout << hostFloats[i][j] << " ";
        }
        cout << endl;
    }

    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < N; j++) {
            float expected = 123.0f + 1 + i + j;
            float actual = hostFloats[i][j];
            if(actual != expected) {
                std::cout << "mismatch for i=" << i << " j=" << j << " expected=" << expected << " actual=" << actual << std::endl;
                assert(false);
            }
        }
    }

    for(int i=0; i < numBuffers; i++) {
        delete[] hostFloats[i];
    }
    cudaFree(gpuArena);

    cuStreamDestroy(stream);
    std::cout << "finished test2_bounded" << std::endl;
}

void test3_unbounded() {
    int N = 1024;

    CUstream stream;
    cuStreamCreate(&stream, 0);

    const int numBuffers = 3;

    char *gpuArena;
    int mallocSize = numBuffers * N * sizeof(float) + 256 + 1024;
    std::cout << "mallocSize=" << mallocSize << std::endl;
    cudaMalloc((void **)&gpuArena, mallocSize);
    wipe<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>((int *)gpuArena, mallocSize >> 2);

    struct BoundedArrayUnion boundedArray;
    float *hostFloats[numBuffers];

    for(int i = 0; i < numBuffers; i++) {
        boundedArray.bounded_array[i] = (float *)(gpuArena + 256 + i * N * sizeof(float));
        std::cout << "bounded_array[" << i << "]=" << (long)boundedArray.bounded_array[i] << std::endl;
        hostFloats[i] = new float[N];
    }

    run_bounded_array_two<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>(boundedArray, 1, numBuffers, N);

    for(int i = 0; i < numBuffers; i++) {
        cudaMemcpy(hostFloats[i], boundedArray.bounded_array[i], N * sizeof(float), cudaMemcpyDeviceToHost);
    }
    cuStreamSynchronize(stream);

    std::cout << std::endl;
    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < 4; j++) {
            cout << hostFloats[i][j] << " ";
        }
        cout << endl;
    }

    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < N; j++) {
            float expected = 123.0f + 1 + i + j;
            float actual = hostFloats[i][j];
            if(actual != expected) {
                std::cout << "mismatch for i=" << i << " j=" << j << " expected=" << expected << " actual=" << actual << std::endl;
                assert(false);
            }
        }
    }

    for(int i=0; i < numBuffers; i++) {
        delete[] hostFloats[i];
    }
    cudaFree(gpuArena);

    cuStreamDestroy(stream);
    std::cout << "finished test3_unbounded" << std::endl;
}

int main(int argc, char *argv[]) {
    test1();
    test2_bounded();
    // test3_unbounded();
    return 0;
}

	.file	"tmpxft_00265891_00000000-6_test_floatstarstar.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4285:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4285:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4966:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4966:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z24__device_stub__Z4wipePiiPii
	.type	_Z24__device_stub__Z4wipePiiPii, @function
_Z24__device_stub__Z4wipePiiPii:
.LFB4307:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movq	%rdi, 8(%rsp)
	leaq	32(%rsp), %rcx
	leaq	24(%rsp), %rdx
	movl	%esi, 4(%rsp)
	leaq	40(%rsp), %rdi
	leaq	52(%rsp), %rsi
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	$1, 48(%rsp)
	movq	%rax, 88(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L3
	pushq	32(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z4wipePii(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 144
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L3:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4307:
	.size	_Z24__device_stub__Z4wipePiiPii, .-_Z24__device_stub__Z4wipePiiPii
	.globl	_Z4wipePii
	.type	_Z4wipePii, @function
_Z4wipePii:
.LFB4308:
	.cfi_startproc
	endbr64
	jmp	_Z24__device_stub__Z4wipePiiPii
	.cfi_endproc
.LFE4308:
	.size	_Z4wipePii, .-_Z4wipePii
	.globl	_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii
	.type	_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii, @function
_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii:
.LFB4309:
	.cfi_startproc
	endbr64
	subq	$120, %rsp
	.cfi_def_cfa_offset 128
	movl	%esi, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	44(%rsp), %rsi
	movl	%edx, 8(%rsp)
	leaq	16(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movq	%rdi, 80(%rsp)
	leaq	32(%rsp), %rdi
	movq	%rax, 88(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 96(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movl	$1, 40(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L9
	pushq	24(%rsp)
	.cfi_def_cfa_offset 136
	leaq	_Z17run_bounded_array12BoundedArrayii(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 144
	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 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L9:
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	addq	$120, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4309:
	.size	_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii, .-_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii
	.globl	_Z17run_bounded_array12BoundedArrayii
	.type	_Z17run_bounded_array12BoundedArrayii, @function
_Z17run_bounded_array12BoundedArrayii:
.LFB4310:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	%esi, %edx
	movl	%edi, %esi
	leaq	16(%rsp), %rdi
	call	_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4310:
	.size	_Z17run_bounded_array12BoundedArrayii, .-_Z17run_bounded_array12BoundedArrayii
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"mallocSize="
.LC1:
	.string	"bounded_array["
.LC2:
	.string	"]="
.LC3:
	.string	" "
.LC5:
	.string	"mismatch for i="
.LC6:
	.string	" j="
.LC7:
	.string	" expected="
.LC8:
	.string	" actual="
.LC9:
	.string	"test1 finished ok"
	.text
	.globl	_Z5test1v
	.type	_Z5test1v, @function
_Z5test1v:
.LFB4279:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	_ZSt4cout(%rip), %rbx
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rdi
	call	cuStreamCreate@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$13568, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	32(%rsp), %rdi
	movl	$13568, %esi
	call	cudaMalloc@PLT
	movl	$134217729, %edx
	movq	24(%rsp), %r9
	movabsq	$4294967297, %rdi
	salq	$5, %rdx
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 52(%rsp)
	movl	$1, 60(%rsp)
	movq	%rdi, 40(%rsp)
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	movq	32(%rsp), %rdi
	movl	$3392, %esi
	call	_Z24__device_stub__Z4wipePiiPii
.L16:
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
.L17:
	movq	32(%rsp), %rdx
	movq	%rbp, %rax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	salq	$12, %rax
	leaq	88(%rsp), %r13
	leaq	256(%rdx,%rax), %r12
	movq	%r12, 0(%r13,%rbp,8)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	leaq	64(%rsp), %r12
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$4096, %edi
	call	_Znam@PLT
	movq	%rax, (%r12,%rbp,8)
	incq	%rbp
	cmpq	$3, %rbp
	jne	.L17
	movl	$134217729, %edx
	movq	24(%rsp), %r9
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$5, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 60(%rsp)
	movq	%rdx, 52(%rsp)
	movq	%rdi, 40(%rsp)
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	leaq	152(%rsp), %rdi
	movl	$16, %ecx
	movq	%r13, %rsi
	movl	$1024, %edx
	rep movsl
	leaq	152(%rsp), %rdi
	movl	$3, %esi
	call	_Z51__device_stub__Z17run_bounded_array12BoundedArrayiiR12BoundedArrayii
.L18:
	xorl	%ebp, %ebp
.L19:
	movq	0(%r13,%rbp), %rsi
	movq	(%r12,%rbp), %rdi
	movl	$2, %ecx
	movl	$4096, %edx
	addq	$8, %rbp
	call	cudaMemcpy@PLT
	cmpq	$24, %rbp
	jne	.L19
	movq	24(%rsp), %rdi
	xorl	%r13d, %r13d
	leaq	.LC3(%rip), %r14
	call	cuStreamSynchronize@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L20:
	xorl	%ebp, %ebp
.L21:
	movq	(%r12,%r13,8), %rax
	movq	%rbx, %rdi
	cvtss2sd	(%rax,%rbp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	addq	$4, %rbp
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$16, %rbp
	jne	.L21
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	incq	%r13
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpq	$3, %r13
	jne	.L20
	xorl	%r15d, %r15d
.L22:
	cvtsi2ssl	%r15d, %xmm0
	addss	.LC4(%rip), %xmm0
	movl	%r15d, %r13d
	xorl	%ebp, %ebp
	movss	%xmm0, 4(%rsp)
.L25:
	movq	(%r12,%r15,8), %rax
	cvtsi2ssl	%ebp, %xmm0
	addss	4(%rsp), %xmm0
	movl	%ebp, %r14d
	movss	(%rax,%rbp,4), %xmm1
	ucomiss	%xmm1, %xmm0
	jp	.L31
	je	.L23
.L31:
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	movss	%xmm1, 12(%rsp)
	movss	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r14d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	8(%rsp), %xmm0
	movq	%rax, %rdi
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	12(%rsp), %xmm1
	movq	%rax, %rdi
	cvtss2sd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L23:
	incq	%rbp
	cmpq	$1024, %rbp
	jne	.L25
	incq	%r15
	cmpq	$3, %r15
	jne	.L22
	xorl	%ebp, %ebp
.L26:
	movq	(%r12,%rbp,8), %rdi
	testq	%rdi, %rdi
	je	.L27
	call	_ZdaPv@PLT
.L27:
	incq	%rbp
	cmpq	$3, %rbp
	jne	.L26
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cuStreamDestroy_v2@PLT
	leaq	.LC9(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	addq	$232, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.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
	ret
	.cfi_endproc
.LFE4279:
	.size	_Z5test1v, .-_Z5test1v
	.globl	_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii
	.type	_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii, @function
_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii:
.LFB4311:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%esi, 12(%rsp)
	leaq	52(%rsp), %rsi
	movl	%edx, 8(%rsp)
	leaq	24(%rsp), %rdx
	movl	%ecx, 4(%rsp)
	leaq	32(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movq	%rdi, 88(%rsp)
	leaq	40(%rsp), %rdi
	movq	%rax, 96(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	4(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 40(%rsp)
	movl	$1, 48(%rsp)
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L41
	pushq	32(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z21run_bounded_array_two17BoundedArrayUnioniii(%rip), %rdi
	pushq	32(%rsp)
	.cfi_def_cfa_offset 160
	movq	68(%rsp), %rcx
	movl	76(%rsp), %r8d
	movq	56(%rsp), %rsi
	movl	64(%rsp), %edx
	leaq	104(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L41:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4311:
	.size	_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii, .-_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii
	.globl	_Z21run_bounded_array_two17BoundedArrayUnioniii
	.type	_Z21run_bounded_array_two17BoundedArrayUnioniii, @function
_Z21run_bounded_array_two17BoundedArrayUnioniii:
.LFB4312:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	%edx, %ecx
	movl	%esi, %edx
	movl	%edi, %esi
	leaq	16(%rsp), %rdi
	call	_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4312:
	.size	_Z21run_bounded_array_two17BoundedArrayUnioniii, .-_Z21run_bounded_array_two17BoundedArrayUnioniii
	.section	.rodata.str1.1
.LC10:
	.string	"finished test2_bounded"
	.text
	.globl	_Z13test2_boundedv
	.type	_Z13test2_boundedv, @function
_Z13test2_boundedv:
.LFB4280:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	_ZSt4cout(%rip), %rbx
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rdi
	call	cuStreamCreate@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$13568, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	32(%rsp), %rdi
	movl	$13568, %esi
	call	cudaMalloc@PLT
	movl	$134217729, %edx
	movq	24(%rsp), %r9
	movabsq	$4294967297, %rdi
	salq	$5, %rdx
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 52(%rsp)
	movl	$1, 60(%rsp)
	movq	%rdi, 40(%rsp)
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L48
	movq	32(%rsp), %rdi
	movl	$3392, %esi
	call	_Z24__device_stub__Z4wipePiiPii
.L48:
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
.L49:
	movq	32(%rsp), %rdx
	movq	%rbp, %rax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	salq	$12, %rax
	leaq	88(%rsp), %r13
	leaq	256(%rdx,%rax), %r12
	movq	%r12, 0(%r13,%rbp,8)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	leaq	64(%rsp), %r12
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$4096, %edi
	call	_Znam@PLT
	movq	%rax, (%r12,%rbp,8)
	incq	%rbp
	cmpq	$3, %rbp
	jne	.L49
	movl	$134217729, %edx
	movq	24(%rsp), %r9
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$5, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 60(%rsp)
	movq	%rdx, 52(%rsp)
	movq	%rdi, 40(%rsp)
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L50
	leaq	160(%rsp), %rdi
	movl	$18, %ecx
	movq	%r13, %rsi
	movl	$3, %edx
	rep movsl
	leaq	160(%rsp), %rdi
	movl	$1024, %ecx
	xorl	%esi, %esi
	call	_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii
.L50:
	xorl	%ebp, %ebp
.L51:
	movq	0(%r13,%rbp), %rsi
	movq	(%r12,%rbp), %rdi
	movl	$2, %ecx
	movl	$4096, %edx
	addq	$8, %rbp
	call	cudaMemcpy@PLT
	cmpq	$24, %rbp
	jne	.L51
	movq	24(%rsp), %rdi
	xorl	%r13d, %r13d
	leaq	.LC3(%rip), %r14
	call	cuStreamSynchronize@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L52:
	xorl	%ebp, %ebp
.L53:
	movq	(%r12,%r13,8), %rax
	movq	%rbx, %rdi
	cvtss2sd	(%rax,%rbp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	addq	$4, %rbp
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$16, %rbp
	jne	.L53
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	incq	%r13
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpq	$3, %r13
	jne	.L52
	xorl	%r15d, %r15d
.L54:
	cvtsi2ssl	%r15d, %xmm0
	addss	.LC4(%rip), %xmm0
	movl	%r15d, %r13d
	xorl	%ebp, %ebp
	movss	%xmm0, 4(%rsp)
.L57:
	movq	(%r12,%r15,8), %rax
	cvtsi2ssl	%ebp, %xmm0
	addss	4(%rsp), %xmm0
	movl	%ebp, %r14d
	movss	(%rax,%rbp,4), %xmm1
	ucomiss	%xmm1, %xmm0
	jp	.L63
	je	.L55
.L63:
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	movss	%xmm1, 12(%rsp)
	movss	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r14d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	8(%rsp), %xmm0
	movq	%rax, %rdi
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	12(%rsp), %xmm1
	movq	%rax, %rdi
	cvtss2sd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L55:
	incq	%rbp
	cmpq	$1024, %rbp
	jne	.L57
	incq	%r15
	cmpq	$3, %r15
	jne	.L54
	xorl	%ebp, %ebp
.L58:
	movq	(%r12,%rbp,8), %rdi
	testq	%rdi, %rdi
	je	.L59
	call	_ZdaPv@PLT
.L59:
	incq	%rbp
	cmpq	$3, %rbp
	jne	.L58
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cuStreamDestroy_v2@PLT
	leaq	.LC10(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	je	.L60
	call	__stack_chk_fail@PLT
.L60:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.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
	ret
	.cfi_endproc
.LFE4280:
	.size	_Z13test2_boundedv, .-_Z13test2_boundedv
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB4282:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z5test1v
	call	_Z13test2_boundedv
	xorl	%eax, %eax
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4282:
	.size	main, .-main
	.section	.rodata.str1.1
.LC11:
	.string	"finished test3_unbounded"
	.text
	.globl	_Z15test3_unboundedv
	.type	_Z15test3_unboundedv, @function
_Z15test3_unboundedv:
.LFB4281:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	_ZSt4cout(%rip), %rbx
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rdi
	call	cuStreamCreate@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$13568, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	32(%rsp), %rdi
	movl	$13568, %esi
	call	cudaMalloc@PLT
	movl	$134217729, %edx
	movq	24(%rsp), %r9
	movabsq	$4294967297, %rdi
	salq	$5, %rdx
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 52(%rsp)
	movl	$1, 60(%rsp)
	movq	%rdi, 40(%rsp)
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L76
	movq	32(%rsp), %rdi
	movl	$3392, %esi
	call	_Z24__device_stub__Z4wipePiiPii
.L76:
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
.L77:
	movq	32(%rsp), %rdx
	movq	%rbp, %rax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	salq	$12, %rax
	leaq	88(%rsp), %r13
	leaq	256(%rdx,%rax), %r12
	movq	%r12, 0(%r13,%rbp,8)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	leaq	64(%rsp), %r12
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$4096, %edi
	call	_Znam@PLT
	movq	%rax, (%r12,%rbp,8)
	incq	%rbp
	cmpq	$3, %rbp
	jne	.L77
	movl	$134217729, %edx
	movq	24(%rsp), %r9
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$5, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 60(%rsp)
	movq	%rdx, 52(%rsp)
	movq	%rdi, 40(%rsp)
	movl	$1, 48(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L78
	leaq	160(%rsp), %rdi
	movl	$18, %ecx
	movq	%r13, %rsi
	movl	$3, %edx
	rep movsl
	leaq	160(%rsp), %rdi
	movl	$1024, %ecx
	movl	$1, %esi
	call	_Z61__device_stub__Z21run_bounded_array_two17BoundedArrayUnioniiiR17BoundedArrayUnioniii
.L78:
	xorl	%ebp, %ebp
.L79:
	movq	0(%r13,%rbp), %rsi
	movq	(%r12,%rbp), %rdi
	movl	$2, %ecx
	movl	$4096, %edx
	addq	$8, %rbp
	call	cudaMemcpy@PLT
	cmpq	$24, %rbp
	jne	.L79
	movq	24(%rsp), %rdi
	xorl	%r13d, %r13d
	leaq	.LC3(%rip), %r14
	call	cuStreamSynchronize@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L80:
	xorl	%ebp, %ebp
.L81:
	movq	(%r12,%r13,8), %rax
	movq	%rbx, %rdi
	cvtss2sd	(%rax,%rbp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	addq	$4, %rbp
	movq	%r14, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$16, %rbp
	jne	.L81
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	incq	%r13
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpq	$3, %r13
	jne	.L80
	xorl	%r15d, %r15d
.L82:
	cvtsi2ssl	%r15d, %xmm0
	addss	.LC4(%rip), %xmm0
	movl	%r15d, %r13d
	xorl	%ebp, %ebp
	movss	%xmm0, 4(%rsp)
.L85:
	movq	(%r12,%r15,8), %rax
	cvtsi2ssl	%ebp, %xmm0
	addss	4(%rsp), %xmm0
	movl	%ebp, %r14d
	movss	(%rax,%rbp,4), %xmm1
	ucomiss	%xmm1, %xmm0
	jp	.L91
	je	.L83
.L91:
	leaq	.LC5(%rip), %rsi
	movq	%rbx, %rdi
	movss	%xmm1, 12(%rsp)
	movss	%xmm0, 8(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r13d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC6(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r14d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	8(%rsp), %xmm0
	movq	%rax, %rdi
	cvtss2sd	%xmm0, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC8(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movss	12(%rsp), %xmm1
	movq	%rax, %rdi
	cvtss2sd	%xmm1, %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L83:
	incq	%rbp
	cmpq	$1024, %rbp
	jne	.L85
	incq	%r15
	cmpq	$3, %r15
	jne	.L82
	xorl	%ebp, %ebp
.L86:
	movq	(%r12,%rbp,8), %rdi
	testq	%rdi, %rdi
	je	.L87
	call	_ZdaPv@PLT
.L87:
	incq	%rbp
	cmpq	$3, %rbp
	jne	.L86
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cuStreamDestroy_v2@PLT
	leaq	.LC11(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	je	.L88
	call	__stack_chk_fail@PLT
.L88:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.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
	ret
	.cfi_endproc
.LFE4281:
	.size	_Z15test3_unboundedv, .-_Z15test3_unboundedv
	.section	.rodata.str1.1
.LC12:
	.string	"_Z21run_bounded_array_two17BoundedArrayUnioniii"
.LC13:
	.string	"_Z17run_bounded_array12BoundedArrayii"
.LC14:
	.string	"_Z4wipePii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4314:
	.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	.LC12(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z21run_bounded_array_two17BoundedArrayUnioniii(%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	.LC13(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17run_bounded_array12BoundedArrayii(%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
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC14(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z4wipePii(%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
.LFE4314:
	.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
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.long	1123549184
	.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:

// double indirection, ie float **, in kernel parameter

// this test cuts all gpu buffers from one single gpu buffer

#include <iostream>
#include <memory>
#include <cassert>

using namespace std;

#include <hip/hip_runtime.h>

struct BoundedArray {
    float *bounded_array[8];
};

__global__ void wipe(int *buffer, int length) {
    length >>= 5;
    int tid = threadIdx.x;
    for(int i = 0; i < length; i++) {
        buffer[(i << 5) + tid] = -1;
    }
}

__global__ void run_bounded_array(struct BoundedArray boundedArray, int numBuffers, int N) {
    for(int i = 0; i < numBuffers; i++) {
        for(int j = 0; j < N; j++) {
            boundedArray.bounded_array[i][j] = 123.0f + i + 1 + j;
        }
    }
}

void test1() {
    int N = 1024;

    hipStream_t stream;
    hipStreamCreateWithFlags(&stream, 0);

    const int numBuffers = 3;

    char *gpuArena;
    int mallocSize = numBuffers * N * sizeof(float) + 256 + 1024;
    std::cout << "mallocSize=" << mallocSize << std::endl;
    hipMalloc((void **)&gpuArena, mallocSize);
    wipe<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>((int *)gpuArena, mallocSize >> 2);

    struct BoundedArray boundedArray;
    float *hostFloats[numBuffers];

    for(int i = 0; i < numBuffers; i++) {
        boundedArray.bounded_array[i] = (float *)(gpuArena + 256 + i * N * sizeof(float));
        std::cout << "bounded_array[" << i << "]=" << (long)boundedArray.bounded_array[i] << std::endl;
        hostFloats[i] = new float[N];
    }

    run_bounded_array<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>(boundedArray, numBuffers, N);

    for(int i = 0; i < numBuffers; i++) {
        hipMemcpy(hostFloats[i], boundedArray.bounded_array[i], N * sizeof(float), hipMemcpyDeviceToHost);
    }
    hipStreamSynchronize(stream);

    std::cout << std::endl;
    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < 4; j++) {
            cout << hostFloats[i][j] << " ";
        }
        cout << endl;
    }

    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < N; j++) {
            float expected = 123.0f + 1 + i + j;
            float actual = hostFloats[i][j];
            if(actual != expected) {
                std::cout << "mismatch for i=" << i << " j=" << j << " expected=" << expected << " actual=" << actual << std::endl;
                assert(false);
            }
        }
    }

    for(int i=0; i < numBuffers; i++) {
        delete[] hostFloats[i];
    }
    hipFree(gpuArena);

    hipStreamDestroy(stream);
    std::cout << "test1 finished ok" << std::endl;
}

struct BoundedArrayUnion {
    float *bounded_array[8];
    float **unbounded_array;
};

__global__ void run_bounded_array_two(struct BoundedArrayUnion mystruct, int useUnbounded, int numBuffers, int N) {
    float **starstar = useUnbounded ? mystruct.unbounded_array : mystruct.bounded_array;
    for(int i = 0; i < numBuffers; i++) {
        for(int j = 0; j < N; j++) {
            starstar[i][j] = 123.0f + i + 1 + j;
        }
    }
}

void test2_bounded() {
    int N = 1024;

    hipStream_t stream;
    hipStreamCreateWithFlags(&stream, 0);

    const int numBuffers = 3;

    char *gpuArena;
    int mallocSize = numBuffers * N * sizeof(float) + 256 + 1024;
    std::cout << "mallocSize=" << mallocSize << std::endl;
    hipMalloc((void **)&gpuArena, mallocSize);
    wipe<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>((int *)gpuArena, mallocSize >> 2);

    struct BoundedArrayUnion boundedArray;
    float *hostFloats[numBuffers];

    for(int i = 0; i < numBuffers; i++) {
        boundedArray.bounded_array[i] = (float *)(gpuArena + 256 + i * N * sizeof(float));
        std::cout << "bounded_array[" << i << "]=" << (long)boundedArray.bounded_array[i] << std::endl;
        hostFloats[i] = new float[N];
    }

    run_bounded_array_two<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>(boundedArray, 0, numBuffers, N);

    for(int i = 0; i < numBuffers; i++) {
        hipMemcpy(hostFloats[i], boundedArray.bounded_array[i], N * sizeof(float), hipMemcpyDeviceToHost);
    }
    hipStreamSynchronize(stream);

    std::cout << std::endl;
    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < 4; j++) {
            cout << hostFloats[i][j] << " ";
        }
        cout << endl;
    }

    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < N; j++) {
            float expected = 123.0f + 1 + i + j;
            float actual = hostFloats[i][j];
            if(actual != expected) {
                std::cout << "mismatch for i=" << i << " j=" << j << " expected=" << expected << " actual=" << actual << std::endl;
                assert(false);
            }
        }
    }

    for(int i=0; i < numBuffers; i++) {
        delete[] hostFloats[i];
    }
    hipFree(gpuArena);

    hipStreamDestroy(stream);
    std::cout << "finished test2_bounded" << std::endl;
}

void test3_unbounded() {
    int N = 1024;

    hipStream_t stream;
    hipStreamCreateWithFlags(&stream, 0);

    const int numBuffers = 3;

    char *gpuArena;
    int mallocSize = numBuffers * N * sizeof(float) + 256 + 1024;
    std::cout << "mallocSize=" << mallocSize << std::endl;
    hipMalloc((void **)&gpuArena, mallocSize);
    wipe<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>((int *)gpuArena, mallocSize >> 2);

    struct BoundedArrayUnion boundedArray;
    float *hostFloats[numBuffers];

    for(int i = 0; i < numBuffers; i++) {
        boundedArray.bounded_array[i] = (float *)(gpuArena + 256 + i * N * sizeof(float));
        std::cout << "bounded_array[" << i << "]=" << (long)boundedArray.bounded_array[i] << std::endl;
        hostFloats[i] = new float[N];
    }

    run_bounded_array_two<<<dim3(1,1,1), dim3(32,1,1), 0, stream>>>(boundedArray, 1, numBuffers, N);

    for(int i = 0; i < numBuffers; i++) {
        hipMemcpy(hostFloats[i], boundedArray.bounded_array[i], N * sizeof(float), hipMemcpyDeviceToHost);
    }
    hipStreamSynchronize(stream);

    std::cout << std::endl;
    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < 4; j++) {
            cout << hostFloats[i][j] << " ";
        }
        cout << endl;
    }

    for(int i = 0; i < numBuffers; i++) {
        for(int j=0; j < N; j++) {
            float expected = 123.0f + 1 + i + j;
            float actual = hostFloats[i][j];
            if(actual != expected) {
                std::cout << "mismatch for i=" << i << " j=" << j << " expected=" << expected << " actual=" << actual << std::endl;
                assert(false);
            }
        }
    }

    for(int i=0; i < numBuffers; i++) {
        delete[] hostFloats[i];
    }
    hipFree(gpuArena);

    hipStreamDestroy(stream);
    std::cout << "finished test3_unbounded" << std::endl;
}

int main(int argc, char *argv[]) {
    test1();
    test2_bounded();
    // test3_unbounded();
    return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z19__device_stub__wipePii      # -- Begin function _Z19__device_stub__wipePii
	.type	_Z19__device_stub__wipePii,@function
_Z19__device_stub__wipePii:             # @_Z19__device_stub__wipePii
	.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	$80, %rsp
	.cfi_def_cfa_offset 128
	.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)
	leaq	4(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	64(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%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	$_Z4wipePii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	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__wipePii, .Lfunc_end0-_Z19__device_stub__wipePii
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__run_bounded_array12BoundedArrayii # -- Begin function _Z32__device_stub__run_bounded_array12BoundedArrayii
	.type	_Z32__device_stub__run_bounded_array12BoundedArrayii,@function
_Z32__device_stub__run_bounded_array12BoundedArrayii: # @_Z32__device_stub__run_bounded_array12BoundedArrayii
	.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	$96, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	8(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	144(%rsp), %rdx
	leaq	64(%rsp), %rbx
	movq	%rdx, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%rcx, 16(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z17run_bounded_array12BoundedArrayii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	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	_Z32__device_stub__run_bounded_array12BoundedArrayii, .Lfunc_end1-_Z32__device_stub__run_bounded_array12BoundedArrayii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z5test1v
.LCPI2_0:
	.long	0x42f80000                      # float 124
	.text
	.globl	_Z5test1v
	.type	_Z5test1v,@function
_Z5test1v:                              # @_Z5test1v
	.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	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	leaq	72(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	hipStreamCreateWithFlags
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$13568, %esi                    # imm = 0x3500
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	64(%rsp), %rdi
	movl	$13568, %esi                    # imm = 0x3500
	callq	hipMalloc
	movq	(%r14), %r9
	leaq	31(%rbx), %r14
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_2
# %bb.1:
	movq	64(%rsp), %rdi
	movl	$3392, %esi                     # imm = 0xD40
	callq	_Z19__device_stub__wipePii
.LBB2_2:
	movl	$256, %ebp                      # imm = 0x100
	xorl	%r15d, %r15d
.LBB2_3:                                # =>This Inner Loop Header: Depth=1
	movq	64(%rsp), %r12
	addq	%rbp, %r12
	movq	%r12, 120(%rsp,%r15,8)
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$14, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r13
	movl	$.L.str.2, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$4096, %edi                     # imm = 0x1000
	callq	_Znam
	movq	%rax, 96(%rsp,%r15,8)
	incq	%r15
	addq	$4096, %rbp                     # imm = 0x1000
	cmpq	$3, %r15
	jne	.LBB2_3
# %bb.4:
	movq	72(%rsp), %r9
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB2_5
# %bb.22:
	movups	120(%rsp), %xmm0
	movups	136(%rsp), %xmm1
	movups	152(%rsp), %xmm2
	movups	168(%rsp), %xmm3
	movups	%xmm3, 48(%rsp)
	movups	%xmm2, 32(%rsp)
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$3, %edi
	movl	$1024, %esi                     # imm = 0x400
	callq	_Z32__device_stub__run_bounded_array12BoundedArrayii
.LBB2_5:                                # %.preheader102
	xorl	%ebx, %ebx
.LBB2_6:                                # =>This Inner Loop Header: Depth=1
	movq	96(%rsp,%rbx,8), %rdi
	movq	120(%rsp,%rbx,8), %rsi
	movl	$4096, %edx                     # imm = 0x1000
	movl	$2, %ecx
	callq	hipMemcpy
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB2_6
# %bb.7:
	movq	72(%rsp), %rdi
	callq	hipStreamSynchronize
	movl	$_ZSt4cout, %ebx
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%r14d, %r14d
.LBB2_8:                                # %.preheader69
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_9 Depth 2
	movq	96(%rsp,%r14,8), %r15
	xorl	%r12d, %r12d
.LBB2_9:                                #   Parent Loop BB2_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15,%r12,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	$4, %r12
	jne	.LBB2_9
# %bb.10:                               #   in Loop: Header=BB2_8 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB2_8
# %bb.11:                               # %.preheader67.preheader
	xorl	%ebx, %ebx
.LBB2_12:                               # %.preheader67
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_13 Depth 2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	addss	.LCPI2_0(%rip), %xmm0
	movss	%xmm0, 84(%rsp)                 # 4-byte Spill
	movq	96(%rsp,%rbx,8), %r12
	xorl	%r14d, %r14d
.LBB2_13:                               #   Parent Loop BB2_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r14d, %xmm1
	addss	84(%rsp), %xmm1                 # 4-byte Folded Reload
	movss	(%r12,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jne	.LBB2_14
	jnp	.LBB2_15
.LBB2_14:                               #   in Loop: Header=BB2_13 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$15, %edx
	movss	%xmm0, 92(%rsp)                 # 4-byte Spill
	movss	%xmm1, 88(%rsp)                 # 4-byte Spill
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.5, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.6, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	88(%rsp), %xmm0                 # 4-byte Folded Reload
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.7, %esi
	movl	$8, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	92(%rsp), %xmm0                 # 4-byte Folded Reload
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB2_15:                               #   in Loop: Header=BB2_13 Depth=2
	incq	%r14
	cmpq	$1024, %r14                     # imm = 0x400
	jne	.LBB2_13
# %bb.16:                               #   in Loop: Header=BB2_12 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB2_12
# %bb.17:                               # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB2_18:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	96(%rsp,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	.LBB2_20
# %bb.19:                               #   in Loop: Header=BB2_18 Depth=1
	callq	_ZdaPv
.LBB2_20:                               #   in Loop: Header=BB2_18 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB2_18
# %bb.21:
	movq	64(%rsp), %rdi
	callq	hipFree
	movq	72(%rsp), %rdi
	callq	hipStreamDestroy
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$184, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.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	_Z5test1v, .Lfunc_end2-_Z5test1v
	.cfi_endproc
                                        # -- End function
	.globl	_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii # -- Begin function _Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
	.type	_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii,@function
_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii: # @_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
	.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	$96, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	8(%rsp), %rcx
	movl	%esi, (%rcx)
	leaq	4(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	144(%rsp), %rdx
	leaq	64(%rsp), %rbx
	movq	%rdx, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%rcx, 16(%rbx)
	movq	%rsi, 24(%rbx)
	leaq	48(%rsp), %r14
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%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	$_Z21run_bounded_array_two17BoundedArrayUnioniii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$112, %rsp
	.cfi_adjust_cfa_offset -112
	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_end3:
	.size	_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii, .Lfunc_end3-_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z13test2_boundedv
.LCPI4_0:
	.long	0x42f80000                      # float 124
	.text
	.globl	_Z13test2_boundedv
	.type	_Z13test2_boundedv,@function
_Z13test2_boundedv:                     # @_Z13test2_boundedv
	.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	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	leaq	88(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	hipStreamCreateWithFlags
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$13568, %esi                    # imm = 0x3500
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	80(%rsp), %rdi
	movl	$13568, %esi                    # imm = 0x3500
	callq	hipMalloc
	movq	(%r14), %r9
	leaq	31(%rbx), %r14
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_2
# %bb.1:
	movq	80(%rsp), %rdi
	movl	$3392, %esi                     # imm = 0xD40
	callq	_Z19__device_stub__wipePii
.LBB4_2:
	movl	$256, %ebp                      # imm = 0x100
	xorl	%r15d, %r15d
.LBB4_3:                                # =>This Inner Loop Header: Depth=1
	movq	80(%rsp), %r12
	addq	%rbp, %r12
	movq	%r12, 144(%rsp,%r15,8)
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$14, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r13
	movl	$.L.str.2, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$4096, %edi                     # imm = 0x1000
	callq	_Znam
	movq	%rax, 112(%rsp,%r15,8)
	incq	%r15
	addq	$4096, %rbp                     # imm = 0x1000
	cmpq	$3, %r15
	jne	.LBB4_3
# %bb.4:
	movq	88(%rsp), %r9
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_5
# %bb.22:
	leaq	144(%rsp), %rsi
	movl	$9, %ecx
	movq	%rsp, %rdi
	rep;movsq (%rsi), %es:(%rdi)
	xorl	%edi, %edi
	movl	$3, %esi
	movl	$1024, %edx                     # imm = 0x400
	callq	_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
.LBB4_5:                                # %.preheader102
	xorl	%ebx, %ebx
.LBB4_6:                                # =>This Inner Loop Header: Depth=1
	movq	112(%rsp,%rbx,8), %rdi
	movq	144(%rsp,%rbx,8), %rsi
	movl	$4096, %edx                     # imm = 0x1000
	movl	$2, %ecx
	callq	hipMemcpy
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB4_6
# %bb.7:
	movq	88(%rsp), %rdi
	callq	hipStreamSynchronize
	movl	$_ZSt4cout, %ebx
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%r14d, %r14d
.LBB4_8:                                # %.preheader69
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_9 Depth 2
	movq	112(%rsp,%r14,8), %r15
	xorl	%r12d, %r12d
.LBB4_9:                                #   Parent Loop BB4_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15,%r12,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	$4, %r12
	jne	.LBB4_9
# %bb.10:                               #   in Loop: Header=BB4_8 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB4_8
# %bb.11:                               # %.preheader67.preheader
	xorl	%ebx, %ebx
.LBB4_12:                               # %.preheader67
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_13 Depth 2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	addss	.LCPI4_0(%rip), %xmm0
	movss	%xmm0, 100(%rsp)                # 4-byte Spill
	movq	112(%rsp,%rbx,8), %r12
	xorl	%r14d, %r14d
.LBB4_13:                               #   Parent Loop BB4_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r14d, %xmm1
	addss	100(%rsp), %xmm1                # 4-byte Folded Reload
	movss	(%r12,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jne	.LBB4_14
	jnp	.LBB4_15
.LBB4_14:                               #   in Loop: Header=BB4_13 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$15, %edx
	movss	%xmm0, 108(%rsp)                # 4-byte Spill
	movss	%xmm1, 104(%rsp)                # 4-byte Spill
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.5, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.6, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	104(%rsp), %xmm0                # 4-byte Folded Reload
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.7, %esi
	movl	$8, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	108(%rsp), %xmm0                # 4-byte Folded Reload
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB4_15:                               #   in Loop: Header=BB4_13 Depth=2
	incq	%r14
	cmpq	$1024, %r14                     # imm = 0x400
	jne	.LBB4_13
# %bb.16:                               #   in Loop: Header=BB4_12 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB4_12
# %bb.17:                               # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB4_18:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	112(%rsp,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	.LBB4_20
# %bb.19:                               #   in Loop: Header=BB4_18 Depth=1
	callq	_ZdaPv
.LBB4_20:                               #   in Loop: Header=BB4_18 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB4_18
# %bb.21:
	movq	80(%rsp), %rdi
	callq	hipFree
	movq	88(%rsp), %rdi
	callq	hipStreamDestroy
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.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_end4:
	.size	_Z13test2_boundedv, .Lfunc_end4-_Z13test2_boundedv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z15test3_unboundedv
.LCPI5_0:
	.long	0x42f80000                      # float 124
	.text
	.globl	_Z15test3_unboundedv
	.type	_Z15test3_unboundedv,@function
_Z15test3_unboundedv:                   # @_Z15test3_unboundedv
	.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	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	leaq	88(%rsp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	hipStreamCreateWithFlags
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$11, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$13568, %esi                    # imm = 0x3500
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	leaq	80(%rsp), %rdi
	movl	$13568, %esi                    # imm = 0x3500
	callq	hipMalloc
	movq	(%r14), %r9
	leaq	31(%rbx), %r14
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_2
# %bb.1:
	movq	80(%rsp), %rdi
	movl	$3392, %esi                     # imm = 0xD40
	callq	_Z19__device_stub__wipePii
.LBB5_2:
	movl	$256, %ebp                      # imm = 0x100
	xorl	%r15d, %r15d
.LBB5_3:                                # =>This Inner Loop Header: Depth=1
	movq	80(%rsp), %r12
	addq	%rbp, %r12
	movq	%r12, 144(%rsp,%r15,8)
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$14, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r13
	movl	$.L.str.2, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ZNSo9_M_insertIlEERSoT_
	movq	%rax, %r12
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r12, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$4096, %edi                     # imm = 0x1000
	callq	_Znam
	movq	%rax, 112(%rsp,%r15,8)
	incq	%r15
	addq	$4096, %rbp                     # imm = 0x1000
	cmpq	$3, %r15
	jne	.LBB5_3
# %bb.4:
	movq	88(%rsp), %r9
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB5_5
# %bb.22:
	leaq	144(%rsp), %rsi
	movl	$9, %ecx
	movq	%rsp, %rdi
	rep;movsq (%rsi), %es:(%rdi)
	movl	$1, %edi
	movl	$3, %esi
	movl	$1024, %edx                     # imm = 0x400
	callq	_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
.LBB5_5:                                # %.preheader102
	xorl	%ebx, %ebx
.LBB5_6:                                # =>This Inner Loop Header: Depth=1
	movq	112(%rsp,%rbx,8), %rdi
	movq	144(%rsp,%rbx,8), %rsi
	movl	$4096, %edx                     # imm = 0x1000
	movl	$2, %ecx
	callq	hipMemcpy
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB5_6
# %bb.7:
	movq	88(%rsp), %rdi
	callq	hipStreamSynchronize
	movl	$_ZSt4cout, %ebx
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%r14d, %r14d
.LBB5_8:                                # %.preheader69
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_9 Depth 2
	movq	112(%rsp,%r14,8), %r15
	xorl	%r12d, %r12d
.LBB5_9:                                #   Parent Loop BB5_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r15,%r12,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%r12
	cmpq	$4, %r12
	jne	.LBB5_9
# %bb.10:                               #   in Loop: Header=BB5_8 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB5_8
# %bb.11:                               # %.preheader67.preheader
	xorl	%ebx, %ebx
.LBB5_12:                               # %.preheader67
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB5_13 Depth 2
	xorps	%xmm0, %xmm0
	cvtsi2ss	%ebx, %xmm0
	addss	.LCPI5_0(%rip), %xmm0
	movss	%xmm0, 100(%rsp)                # 4-byte Spill
	movq	112(%rsp,%rbx,8), %r12
	xorl	%r14d, %r14d
.LBB5_13:                               #   Parent Loop BB5_12 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm1, %xmm1
	cvtsi2ss	%r14d, %xmm1
	addss	100(%rsp), %xmm1                # 4-byte Folded Reload
	movss	(%r12,%r14,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	ucomiss	%xmm1, %xmm0
	jne	.LBB5_14
	jnp	.LBB5_15
.LBB5_14:                               #   in Loop: Header=BB5_13 Depth=2
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$15, %edx
	movss	%xmm0, 108(%rsp)                # 4-byte Spill
	movss	%xmm1, 104(%rsp)                # 4-byte Spill
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.5, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movl	$.L.str.6, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	104(%rsp), %xmm0                # 4-byte Folded Reload
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.7, %esi
	movl	$8, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	108(%rsp), %xmm0                # 4-byte Folded Reload
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.LBB5_15:                               #   in Loop: Header=BB5_13 Depth=2
	incq	%r14
	cmpq	$1024, %r14                     # imm = 0x400
	jne	.LBB5_13
# %bb.16:                               #   in Loop: Header=BB5_12 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB5_12
# %bb.17:                               # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB5_18:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	112(%rsp,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	.LBB5_20
# %bb.19:                               #   in Loop: Header=BB5_18 Depth=1
	callq	_ZdaPv
.LBB5_20:                               #   in Loop: Header=BB5_18 Depth=1
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB5_18
# %bb.21:
	movq	80(%rsp), %rdi
	callq	hipFree
	movq	88(%rsp), %rdi
	callq	hipStreamDestroy
	movl	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.10, %esi
	movl	$24, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$216, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.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_end5:
	.size	_Z15test3_unboundedv, .Lfunc_end5-_Z15test3_unboundedv
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	_Z5test1v
	callq	_Z13test2_boundedv
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
                                        # -- End function
	.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	.LBB7_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB7_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z4wipePii, %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	$_Z17run_bounded_array12BoundedArrayii, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z21run_bounded_array_two17BoundedArrayUnioniii, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %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_end7:
	.size	__hip_module_ctor, .Lfunc_end7-__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	.LBB8_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
.LBB8_2:
	retq
.Lfunc_end8:
	.size	__hip_module_dtor, .Lfunc_end8-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z4wipePii,@object              # @_Z4wipePii
	.section	.rodata,"a",@progbits
	.globl	_Z4wipePii
	.p2align	3, 0x0
_Z4wipePii:
	.quad	_Z19__device_stub__wipePii
	.size	_Z4wipePii, 8

	.type	_Z17run_bounded_array12BoundedArrayii,@object # @_Z17run_bounded_array12BoundedArrayii
	.globl	_Z17run_bounded_array12BoundedArrayii
	.p2align	3, 0x0
_Z17run_bounded_array12BoundedArrayii:
	.quad	_Z32__device_stub__run_bounded_array12BoundedArrayii
	.size	_Z17run_bounded_array12BoundedArrayii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"mallocSize="
	.size	.L.str, 12

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"bounded_array["
	.size	.L.str.1, 15

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"]="
	.size	.L.str.2, 3

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	" "
	.size	.L.str.3, 2

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"mismatch for i="
	.size	.L.str.4, 16

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	" j="
	.size	.L.str.5, 4

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	" expected="
	.size	.L.str.6, 11

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	" actual="
	.size	.L.str.7, 9

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"test1 finished ok"
	.size	.L.str.8, 18

	.type	_Z21run_bounded_array_two17BoundedArrayUnioniii,@object # @_Z21run_bounded_array_two17BoundedArrayUnioniii
	.section	.rodata,"a",@progbits
	.globl	_Z21run_bounded_array_two17BoundedArrayUnioniii
	.p2align	3, 0x0
_Z21run_bounded_array_two17BoundedArrayUnioniii:
	.quad	_Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
	.size	_Z21run_bounded_array_two17BoundedArrayUnioniii, 8

	.type	.L.str.9,@object                # @.str.9
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.9:
	.asciz	"finished test2_bounded"
	.size	.L.str.9, 23

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"finished test3_unbounded"
	.size	.L.str.10, 25

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z4wipePii"
	.size	.L__unnamed_1, 11

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z17run_bounded_array12BoundedArrayii"
	.size	.L__unnamed_2, 38

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z21run_bounded_array_two17BoundedArrayUnioniii"
	.size	.L__unnamed_3, 48

	.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__wipePii
	.addrsig_sym _Z32__device_stub__run_bounded_array12BoundedArrayii
	.addrsig_sym _Z36__device_stub__run_bounded_array_two17BoundedArrayUnioniii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z4wipePii
	.addrsig_sym _Z17run_bounded_array12BoundedArrayii
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z21run_bounded_array_two17BoundedArrayUnioniii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z4wipePii              ; -- Begin function _Z4wipePii
	.globl	_Z4wipePii
	.p2align	8
	.type	_Z4wipePii,@function
_Z4wipePii:                             ; @_Z4wipePii
; %bb.0:
	s_load_b32 s2, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_ashr_i32 s2, s2, 5
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB0_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b64 s[0:1], s[0:1], 0x0
	v_lshlrev_b32_e32 v0, 2, v0
	v_mov_b32_e32 v2, -1
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_co_u32 v0, s0, s0, v0
	v_add_co_ci_u32_e64 v1, null, s1, 0, s0
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_store_b32 v[0:1], v2, off
	v_add_co_u32 v0, vcc_lo, 0x80, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
	s_add_i32 s2, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s2, 0
	s_cbranch_scc0 .LBB0_2
.LBB0_3:                                ; %._crit_edge
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z4wipePii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 12
		.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 3
		.amdhsa_next_free_sgpr 3
		.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	_Z4wipePii, .Lfunc_end0-_Z4wipePii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 120
; NumSgprs: 5
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 0
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 5
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; 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
	.protected	_Z17run_bounded_array12BoundedArrayii ; -- Begin function _Z17run_bounded_array12BoundedArrayii
	.globl	_Z17run_bounded_array12BoundedArrayii
	.p2align	8
	.type	_Z17run_bounded_array12BoundedArrayii,@function
_Z17run_bounded_array12BoundedArrayii:  ; @_Z17run_bounded_array12BoundedArrayii
; %bb.0:
	s_load_b64 s[4:5], s[0:1], 0x40
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s4, 1
	s_cbranch_scc1 .LBB1_6
; %bb.1:                                ; %.preheader.lr.ph
	s_cmp_gt_i32 s5, 0
	s_mov_b32 s7, 0
	s_cselect_b32 s2, -1, 0
	s_mov_b32 s6, s7
	v_cndmask_b32_e64 v0, 0, 1, s2
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e64 s2, 1, v0
	v_mov_b32_e32 v0, 0
.LBB1_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_4 Depth 2
	s_delay_alu instid0(VALU_DEP_2)
	s_and_b32 vcc_lo, exec_lo, s2
	s_cbranch_vccnz .LBB1_5
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB1_2 Depth=1
	s_lshl_b64 s[8:9], s[6:7], 3
	v_cvt_f32_i32_e32 v1, s6
	s_add_u32 s8, s0, s8
	s_addc_u32 s9, s1, s9
	s_mov_b32 s3, 0
	s_load_b64 s[8:9], s[8:9], 0x0
	v_add_f32_e32 v1, 0x42f60000, v1
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v1, 1.0, v1
.LBB1_4:                                ;   Parent Loop BB1_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_cvt_f32_i32_e32 v2, s3
	s_add_i32 s3, s3, 1
	s_delay_alu instid0(VALU_DEP_1)
	v_add_f32_e32 v2, v1, v2
	s_waitcnt lgkmcnt(0)
	global_store_b32 v0, v2, s[8:9]
	s_add_u32 s8, s8, 4
	s_addc_u32 s9, s9, 0
	s_cmp_eq_u32 s5, s3
	s_cbranch_scc0 .LBB1_4
.LBB1_5:                                ; %._crit_edge
                                        ;   in Loop: Header=BB1_2 Depth=1
	s_add_i32 s6, s6, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s6, s4
	s_cbranch_scc0 .LBB1_2
.LBB1_6:                                ; %._crit_edge13
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17run_bounded_array12BoundedArrayii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 72
		.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 3
		.amdhsa_next_free_sgpr 10
		.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	_Z17run_bounded_array12BoundedArrayii, .Lfunc_end1-_Z17run_bounded_array12BoundedArrayii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 188
; NumSgprs: 12
; NumVgprs: 3
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 12
; NumVGPRsForWavesPerEU: 3
; Occupancy: 16
; WaveLimiterHint : 0
; 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
	.protected	_Z21run_bounded_array_two17BoundedArrayUnioniii ; -- Begin function _Z21run_bounded_array_two17BoundedArrayUnioniii
	.globl	_Z21run_bounded_array_two17BoundedArrayUnioniii
	.p2align	8
	.type	_Z21run_bounded_array_two17BoundedArrayUnioniii,@function
_Z21run_bounded_array_two17BoundedArrayUnioniii: ; @_Z21run_bounded_array_two17BoundedArrayUnioniii
; %bb.0:
	s_load_b128 s[4:7], s[0:1], 0x48
	s_waitcnt lgkmcnt(0)
	s_cmp_lt_i32 s5, 1
	s_cbranch_scc1 .LBB2_6
; %bb.1:                                ; %.preheader.lr.ph
	s_load_b64 s[2:3], s[0:1], 0x40
	s_cmp_eq_u32 s4, 0
	s_waitcnt lgkmcnt(0)
	s_cselect_b32 s1, s1, s3
	s_cselect_b32 s4, s0, s2
	s_cmp_gt_i32 s6, 0
	s_mov_b32 s3, 0
	s_cselect_b32 s0, -1, 0
	s_mov_b32 s2, s3
	v_cndmask_b32_e64 v0, 0, 1, s0
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ne_u32_e64 s0, 1, v0
.LBB2_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB2_4 Depth 2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccnz .LBB2_5
; %bb.3:                                ; %.lr.ph
                                        ;   in Loop: Header=BB2_2 Depth=1
	s_lshl_b64 s[8:9], s[2:3], 3
	v_cvt_f32_i32_e32 v2, s2
	s_add_u32 s8, s4, s8
	s_addc_u32 s9, s1, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_mov_b32 v0, s8 :: v_dual_mov_b32 v1, s9
	v_add_f32_e32 v2, 0x42f60000, v2
	s_mov_b32 s7, 0
	flat_load_b64 v[0:1], v[0:1]
	v_add_f32_e32 v2, 1.0, v2
.LBB2_4:                                ;   Parent Loop BB2_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_cvt_f32_i32_e32 v3, s7
	s_add_i32 s7, s7, 1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_cmp_eq_u32 s6, s7
	v_add_f32_e32 v3, v2, v3
	s_waitcnt vmcnt(0) lgkmcnt(0)
	flat_store_b32 v[0:1], v3
	v_add_co_u32 v0, vcc_lo, v0, 4
	v_add_co_ci_u32_e32 v1, vcc_lo, 0, v1, vcc_lo
	s_cbranch_scc0 .LBB2_4
.LBB2_5:                                ; %._crit_edge
                                        ;   in Loop: Header=BB2_2 Depth=1
	s_add_i32 s2, s2, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s2, s5
	s_cbranch_scc0 .LBB2_2
.LBB2_6:                                ; %._crit_edge14
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z21run_bounded_array_two17BoundedArrayUnioniii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 84
		.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 10
		.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_end2:
	.size	_Z21run_bounded_array_two17BoundedArrayUnioniii, .Lfunc_end2-_Z21run_bounded_array_two17BoundedArrayUnioniii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 212
; NumSgprs: 12
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 12
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 0
; 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:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 12
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z4wipePii
    .private_segment_fixed_size: 0
    .sgpr_count:     5
    .sgpr_spill_count: 0
    .symbol:         _Z4wipePii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           64
        .value_kind:     by_value
      - .offset:         64
        .size:           4
        .value_kind:     by_value
      - .offset:         68
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 72
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17run_bounded_array12BoundedArrayii
    .private_segment_fixed_size: 0
    .sgpr_count:     12
    .sgpr_spill_count: 0
    .symbol:         _Z17run_bounded_array12BoundedArrayii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     3
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           72
        .value_kind:     by_value
      - .offset:         72
        .size:           4
        .value_kind:     by_value
      - .offset:         76
        .size:           4
        .value_kind:     by_value
      - .offset:         80
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 84
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z21run_bounded_array_two17BoundedArrayUnioniii
    .private_segment_fixed_size: 0
    .sgpr_count:     12
    .sgpr_spill_count: 0
    .symbol:         _Z21run_bounded_array_two17BoundedArrayUnioniii.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
