// video_processing.cu
// A CUDA implementation for real-time video processing of 8K frames with multi-GPU scaling
// Target architecture: Turing

#include <iostream>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <vector>
#include <chrono>

// Define frame dimensions
#define WIDTH 7680
#define HEIGHT 4320
#define CHANNELS 3  // Assuming RGB

// Kernel to process a frame (dummy processing for demonstration)
__global__ void processFrameKernel(unsigned char* frame, int width, int height, int channels) {
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;
    int idx = (y * width + x) * channels;

    if (x < width && y < height) {
        // Simple grayscale conversion for demonstration
        unsigned char r = frame[idx];
        unsigned char g = frame[idx + 1];
        unsigned char b = frame[idx + 2];
        unsigned char gray = static_cast<unsigned char>(0.299f * r + 0.587f * g + 0.114f * b);
        frame[idx] = frame[idx + 1] = frame[idx + 2] = gray;
    }
}

// Function to initialize a frame with random values
void initializeFrame(unsigned char* frame, int size) {
    for (int i = 0; i < size; ++i) {
        frame[i] = static_cast<unsigned char>(rand() % 256);
    }
}

// Function to print basic device information
void printDeviceInfo(int device) {
    cudaDeviceProp prop;
    cudaGetDeviceProperties(&prop, device);
    std::cout << "Device " << device << ": " << prop.name << std::endl;
    std::cout << "  Compute Capability: " << prop.major << "." << prop.minor << std::endl;
    std::cout << "  Global Memory: " << prop.totalGlobalMem / (1024 * 1024) << " MB" << std::endl;
    std::cout << "  MultiProcessors: " << prop.multiProcessorCount << std::endl;
}

// Main function to demonstrate the kernel's usage
int main() {
    int deviceCount;
    cudaGetDeviceCount(&deviceCount);
    if (deviceCount == 0) {
        std::cerr << "No CUDA devices found!" << std::endl;
        return -1;
    }

    std::vector<cudaStream_t> streams(deviceCount);
    std::vector<unsigned char*> d_frames(deviceCount);
    std::vector<unsigned char*> h_frames(deviceCount);
    std::vector<cudaEvent_t> startEvents(deviceCount);
    std::vector<cudaEvent_t> stopEvents(deviceCount);

    // Allocate and initialize host and device memory for each GPU
    for (int i = 0; i < deviceCount; ++i) {
        cudaSetDevice(i);
        printDeviceInfo(i);

        // Allocate memory for frame
        size_t frameSize = WIDTH * HEIGHT * CHANNELS;
        cudaMalloc(&d_frames[i], frameSize);
        h_frames[i] = new unsigned char[frameSize];
        initializeFrame(h_frames[i], frameSize);

        // Allocate streams and events
        cudaStreamCreate(&streams[i]);
        cudaEventCreate(&startEvents[i]);
        cudaEventCreate(&stopEvents[i]);

        // Copy data from host to device
        cudaMemcpyAsync(d_frames[i], h_frames[i], frameSize, cudaMemcpyHostToDevice, streams[i]);
    }

    // Launch kernels on each GPU
    dim3 blockSize(16, 16);
    dim3 gridSize((WIDTH + blockSize.x - 1) / blockSize.x, (HEIGHT + blockSize.y - 1) / blockSize.y);

    for (int i = 0; i < deviceCount; ++i) {
        cudaSetDevice(i);
        cudaEventRecord(startEvents[i], streams[i]);
        processFrameKernel<<<gridSize, blockSize, 0, streams[i]>>>(d_frames[i], WIDTH, HEIGHT, CHANNELS);
        cudaEventRecord(stopEvents[i], streams[i]);
    }

    // Wait for all kernels to complete and measure time
    float elapsedTime = 0.0f;
    for (int i = 0; i < deviceCount; ++i) {
        cudaSetDevice(i);
        cudaEventSynchronize(stopEvents[i]);
        cudaEventElapsedTime(&elapsedTime, startEvents[i], stopEvents[i]);
        std::cout << "Device " << i << " processing time: " << elapsedTime << " ms" << std::endl;

        // Copy results back to host
        cudaMemcpyAsync(h_frames[i], d_frames[i], WIDTH * HEIGHT * CHANNELS, cudaMemcpyDeviceToHost, streams[i]);
        cudaStreamSynchronize(streams[i]);
    }

    // Clean up
    for (int i = 0; i < deviceCount; ++i) {
        cudaSetDevice(i);
        cudaFree(d_frames[i]);
        delete[] h_frames[i];
        cudaStreamDestroy(streams[i]);
        cudaEventDestroy(startEvents[i]);
        cudaEventDestroy(stopEvents[i]);
    }

    return 0;
}
	.file	"tmpxft_001824a3_00000000-6_cuda_code_051230.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4102:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4102:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0, @function
_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0:
.LFB5021:
	.cfi_startproc
	movabsq	$1152921504606846975, %rax
	cmpq	%rdi, %rax
	jnb	.L3
	pushq	%rax
	.cfi_def_cfa_offset 16
	movabsq	$2305843009213693951, %rax
	cmpq	%rdi, %rax
	jnb	.L4
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L4:
	call	_ZSt17__throw_bad_allocv@PLT
.L3:
	.cfi_def_cfa_offset 8
	salq	$3, %rdi
	jmp	_Znwm@PLT
	.cfi_endproc
.LFE5021:
	.size	_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0, .-_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5023:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5023:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.globl	_Z15initializeFramePhi
	.type	_Z15initializeFramePhi, @function
_Z15initializeFramePhi:
.LFB4097:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$256, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	pushq	%rdx
	.cfi_def_cfa_offset 48
.L11:
	cmpl	%ebx, %ebp
	jle	.L14
	call	rand@PLT
	cltd
	idivl	%r13d
	movb	%dl, (%r12,%rbx)
	incq	%rbx
	jmp	.L11
.L14:
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4097:
	.size	_Z15initializeFramePhi, .-_Z15initializeFramePhi
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Device "
.LC1:
	.string	": "
.LC2:
	.string	"  Compute Capability: "
.LC3:
	.string	"."
.LC4:
	.string	"  Global Memory: "
.LC5:
	.string	" MB"
.LC6:
	.string	"  MultiProcessors: "
	.text
	.globl	_Z15printDeviceInfoi
	.type	_Z15printDeviceInfoi, @function
_Z15printDeviceInfoi:
.LFB4098:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%edi, %esi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	_ZSt4cout(%rip), %rbx
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1072
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	movq	%r12, %rdi
	call	cudaGetDeviceProperties_v2@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebp, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC1(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%r12, %rsi
	movq	%rax, %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
	leaq	.LC2(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	360(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	364(%rsp), %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	.LC4(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	288(%rsp), %rsi
	movq	%rax, %rdi
	shrq	$20, %rsi
	call	_ZNSo9_M_insertImEERSoT_@PLT
	leaq	.LC5(%rip), %rsi
	movq	%rax, %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
	leaq	.LC6(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	388(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	addq	$1040, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4098:
	.size	_Z15printDeviceInfoi, .-_Z15printDeviceInfoi
	.globl	_Z41__device_stub__Z18processFrameKernelPhiiiPhiii
	.type	_Z41__device_stub__Z18processFrameKernelPhiiiPhiii, @function
_Z41__device_stub__Z18processFrameKernelPhiiiPhiii:
.LFB4124:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movl	%esi, 20(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 16(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 12(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L18
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z18processFrameKernelPhiii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L18:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4124:
	.size	_Z41__device_stub__Z18processFrameKernelPhiiiPhiii, .-_Z41__device_stub__Z18processFrameKernelPhiiiPhiii
	.globl	_Z18processFrameKernelPhiii
	.type	_Z18processFrameKernelPhiii, @function
_Z18processFrameKernelPhiii:
.LFB4125:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z18processFrameKernelPhiiiPhiii
	.cfi_endproc
.LFE4125:
	.size	_Z18processFrameKernelPhiii, .-_Z18processFrameKernelPhiii
	.section	.rodata.str1.1
.LC7:
	.string	"_Z18processFrameKernelPhiii"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4127:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z18processFrameKernelPhiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4127:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIP11CUstream_stSaIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev
	.type	_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev, @function
_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev:
.LFB4469:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L25
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L25:
	ret
	.cfi_endproc
.LFE4469:
	.size	_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev, .-_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev
	.weak	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev
	.set	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev,_ZNSt6vectorIP11CUstream_stSaIS1_EED2Ev
	.section	.rodata._ZNSt6vectorIPhSaIS0_EEC2EmRKS1_.str1.1,"aMS",@progbits,1
.LC8:
	.string	"cannot create std::vector larger than max_size()"
	.section	.text._ZNSt6vectorIPhSaIS0_EEC2EmRKS1_,"axG",@progbits,_ZNSt6vectorIPhSaIS0_EEC5EmRKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
	.type	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_, @function
_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_:
.LFB4478:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%r8
	.cfi_def_cfa_offset 32
	cmpq	%rsi, %rax
	jnb	.L28
	leaq	.LC8(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L28:
	movq	%rdi, %rbx
	xorl	%edi, %edi
	movq	%rsi, %rbp
	xorl	%eax, %eax
	movq	%rdi, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rdi, 16(%rbx)
	testq	%rsi, %rsi
	je	.L29
	movq	%rsi, %rdi
	call	_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0
.L29:
	leaq	(%rax,%rbp,8), %rdx
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%rdx, 16(%rbx)
	testq	%rbp, %rbp
	je	.L30
	xorl	%esi, %esi
	addq	$8, %rax
	movq	%rsi, -8(%rax)
	decq	%rbp
	je	.L30
.L31:
	cmpq	%rax, %rdx
	je	.L30
	xorl	%ecx, %ecx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	jmp	.L31
.L30:
	movq	%rax, 8(%rbx)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4478:
	.size	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_, .-_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
	.weak	_ZNSt6vectorIPhSaIS0_EEC1EmRKS1_
	.set	_ZNSt6vectorIPhSaIS0_EEC1EmRKS1_,_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
	.section	.text._ZNSt6vectorIPhSaIS0_EED2Ev,"axG",@progbits,_ZNSt6vectorIPhSaIS0_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIPhSaIS0_EED2Ev
	.type	_ZNSt6vectorIPhSaIS0_EED2Ev, @function
_ZNSt6vectorIPhSaIS0_EED2Ev:
.LFB4481:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L42
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L42:
	ret
	.cfi_endproc
.LFE4481:
	.size	_ZNSt6vectorIPhSaIS0_EED2Ev, .-_ZNSt6vectorIPhSaIS0_EED2Ev
	.weak	_ZNSt6vectorIPhSaIS0_EED1Ev
	.set	_ZNSt6vectorIPhSaIS0_EED1Ev,_ZNSt6vectorIPhSaIS0_EED2Ev
	.section	.text._ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_,"axG",@progbits,_ZNSt6vectorIP10CUevent_stSaIS1_EEC5EmRKS2_,comdat
	.align 2
	.weak	_ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_
	.type	_ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_, @function
_ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_:
.LFB4490:
	.cfi_startproc
	endbr64
	movabsq	$1152921504606846975, %rax
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	pushq	%r8
	.cfi_def_cfa_offset 32
	cmpq	%rsi, %rax
	jnb	.L45
	leaq	.LC8(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L45:
	movq	%rdi, %rbx
	xorl	%edi, %edi
	movq	%rsi, %rbp
	xorl	%eax, %eax
	movq	%rdi, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rdi, 16(%rbx)
	testq	%rsi, %rsi
	je	.L46
	movq	%rsi, %rdi
	call	_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0
.L46:
	leaq	(%rax,%rbp,8), %rdx
	movq	%rax, (%rbx)
	movq	%rax, 8(%rbx)
	movq	%rdx, 16(%rbx)
	testq	%rbp, %rbp
	je	.L47
	xorl	%esi, %esi
	addq	$8, %rax
	movq	%rsi, -8(%rax)
	decq	%rbp
	je	.L47
.L48:
	cmpq	%rax, %rdx
	je	.L47
	xorl	%ecx, %ecx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	jmp	.L48
.L47:
	movq	%rax, 8(%rbx)
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4490:
	.size	_ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_, .-_ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_
	.weak	_ZNSt6vectorIP10CUevent_stSaIS1_EEC1EmRKS2_
	.set	_ZNSt6vectorIP10CUevent_stSaIS1_EEC1EmRKS2_,_ZNSt6vectorIP10CUevent_stSaIS1_EEC2EmRKS2_
	.section	.text._ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIP10CUevent_stSaIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev
	.type	_ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev, @function
_ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev:
.LFB4493:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L59
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L59:
	ret
	.cfi_endproc
.LFE4493:
	.size	_ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev, .-_ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev
	.weak	_ZNSt6vectorIP10CUevent_stSaIS1_EED1Ev
	.set	_ZNSt6vectorIP10CUevent_stSaIS1_EED1Ev,_ZNSt6vectorIP10CUevent_stSaIS1_EED2Ev
	.section	.rodata.str1.1
.LC9:
	.string	"No CUDA devices found!"
.LC11:
	.string	" processing time: "
.LC12:
	.string	" ms"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4099:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4099
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdi
.LEHB0:
	call	cudaGetDeviceCount@PLT
	movslq	32(%rsp), %rbp
	testl	%ebp, %ebp
	jne	.L62
	leaq	.LC9(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %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
	orl	$-1, %eax
	jmp	.L61
.L62:
	movabsq	$1152921504606846975, %rax
	cmpq	%rbp, %rax
	jnb	.L64
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L102
	leaq	.LC8(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L64:
	movq	%rbp, %rdi
	call	_ZNSt12_Vector_baseIP11CUstream_stSaIS1_EE11_M_allocateEm.part.0.isra.0
.LEHE0:
	xorl	%esi, %esi
	leaq	(%rax,%rbp,8), %rdx
	decq	%rbp
	movq	%rax, 64(%rsp)
	movq	%rax, %rbx
	movq	%rsi, (%rax)
	leaq	8(%rax), %rax
	movq	%rdx, 80(%rsp)
	je	.L66
.L67:
	cmpq	%rax, %rdx
	je	.L66
	xorl	%ecx, %ecx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	jmp	.L67
.L66:
	movq	%rax, 72(%rsp)
	leaq	160(%rsp), %rax
	movslq	32(%rsp), %rsi
	movq	%rax, (%rsp)
	leaq	88(%rsp), %rax
	movq	(%rsp), %rdx
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
.LEHB1:
	call	_ZNSt6vectorIPhSaIS0_EEC1EmRKS1_
.LEHE1:
	leaq	112(%rsp), %rax
	movslq	32(%rsp), %rsi
	movq	(%rsp), %rdx
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB2:
	call	_ZNSt6vectorIPhSaIS0_EEC1EmRKS1_
.LEHE2:
	leaq	136(%rsp), %rax
	movslq	32(%rsp), %rsi
	movq	(%rsp), %rdx
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
.LEHB3:
	call	_ZNSt6vectorIP10CUevent_stSaIS1_EEC1EmRKS2_
.LEHE3:
	movslq	32(%rsp), %rsi
	movq	(%rsp), %rdi
	leaq	52(%rsp), %rdx
.LEHB4:
	call	_ZNSt6vectorIP10CUevent_stSaIS1_EEC1EmRKS2_
.LEHE4:
	movq	%rbx, %r13
	xorl	%r12d, %r12d
.L69:
	movl	%r12d, %ebp
	cmpl	%r12d, 32(%rsp)
	jle	.L103
	movl	%ebp, %edi
.LEHB5:
	call	cudaSetDevice@PLT
	movl	%ebp, %edi
	call	_Z15printDeviceInfoi
	movq	88(%rsp), %r14
	leaq	0(,%r12,8), %rbp
	movl	$99532800, %esi
	addq	%rbp, %r14
	movq	%r14, %rdi
	call	cudaMalloc@PLT
	movl	$99532800, %edi
	call	_Znam@PLT
	movq	112(%rsp), %r15
	movq	%rax, %rdi
	movl	$99532800, %esi
	addq	%rbp, %r15
	movq	%rax, (%r15)
	call	_Z15initializeFramePhi
	movq	%r13, %rdi
	call	cudaStreamCreate@PLT
	movq	136(%rsp), %rdi
	addq	%rbp, %rdi
	call	cudaEventCreate@PLT
	movq	160(%rsp), %rdi
	addq	%rbp, %rdi
	call	cudaEventCreate@PLT
	movq	(%r15), %rsi
	movq	(%r14), %rdi
	movl	$1, %ecx
	movl	$99532800, %edx
	movq	0(%r13), %r8
	call	cudaMemcpyAsync@PLT
	incq	%r12
	addq	$8, %r13
	jmp	.L69
.L103:
	movabsq	$1159641170400, %rax
	movl	$1, 48(%rsp)
	xorl	%ebp, %ebp
	movabsq	$68719476752, %r12
	movq	%rax, 52(%rsp)
	movl	$1, 60(%rsp)
.L71:
	movl	%ebp, %edi
	cmpl	%ebp, 32(%rsp)
	jle	.L104
	call	cudaSetDevice@PLT
	movq	136(%rsp), %rax
	movq	(%rbx,%rbp,8), %rsi
	leaq	0(,%rbp,8), %r13
	movq	(%rax,%rbp,8), %rdi
	call	cudaEventRecord@PLT
	movl	48(%rsp), %ecx
	movq	(%rbx,%rbp,8), %r9
	xorl	%r8d, %r8d
	movq	%r12, %rdx
	movq	52(%rsp), %rdi
	movl	60(%rsp), %esi
	movq	%r12, 40(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L72
.L74:
	movq	160(%rsp), %rax
	movq	(%rbx,%rbp,8), %rsi
	movq	(%rax,%r13), %rdi
	call	cudaEventRecord@PLT
	incq	%rbp
	jmp	.L71
.L72:
	movq	88(%rsp), %rax
	movl	$3, %ecx
	movl	$4320, %edx
	movl	$7680, %esi
	movq	(%rax,%r13), %rdi
	call	_Z41__device_stub__Z18processFrameKernelPhiiiPhiii
	jmp	.L74
.L104:
	movl	$0x00000000, 36(%rsp)
	xorl	%ebp, %ebp
	leaq	.LC0(%rip), %r15
.L76:
	movl	%ebp, %r13d
	cmpl	%ebp, 32(%rsp)
	jle	.L105
	movl	%r13d, %edi
	call	cudaSetDevice@PLT
	movq	160(%rsp), %r14
	leaq	0(,%rbp,8), %r12
	addq	%r12, %r14
	movq	(%r14), %rdi
	call	cudaEventSynchronize@PLT
	movq	136(%rsp), %rax
	movq	(%r14), %rdx
	leaq	36(%rsp), %rdi
	movq	(%rax,%rbp,8), %rsi
	call	cudaEventElapsedTime@PLT
	movq	%r15, %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%r13d, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	cvtss2sd	36(%rsp), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	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	88(%rsp), %rax
	movq	(%rbx,%rbp,8), %r8
	movl	$2, %ecx
	movl	$99532800, %edx
	movq	(%rax,%r12), %rsi
	movq	112(%rsp), %rax
	movq	(%rax,%r12), %rdi
	call	cudaMemcpyAsync@PLT
	movq	(%rbx,%rbp,8), %rdi
	call	cudaStreamSynchronize@PLT
	incq	%rbp
	jmp	.L76
.L105:
	xorl	%ebp, %ebp
.L78:
	movl	%ebp, %edi
	cmpl	%ebp, 32(%rsp)
	jle	.L106
	call	cudaSetDevice@PLT
	movq	88(%rsp), %rax
	leaq	0(,%rbp,8), %r12
	movq	(%rax,%rbp,8), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rax
	movq	(%rax,%rbp,8), %rdi
	testq	%rdi, %rdi
	je	.L79
	call	_ZdaPv@PLT
.L79:
	movq	(%rbx,%rbp,8), %rdi
	call	cudaStreamDestroy@PLT
	movq	136(%rsp), %rax
	movq	(%rax,%r12), %rdi
	call	cudaEventDestroy@PLT
	movq	160(%rsp), %rax
	movq	(%rax,%r12), %rdi
	call	cudaEventDestroy@PLT
.LEHE5:
	incq	%rbp
	jmp	.L78
.L106:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIP10CUevent_stSaIS1_EED1Ev
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIP10CUevent_stSaIS1_EED1Ev
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIPhSaIS0_EED1Ev
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorIPhSaIS0_EED1Ev
	leaq	64(%rsp), %rdi
	call	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev
	xorl	%eax, %eax
	jmp	.L61
.L92:
	endbr64
	movq	%rax, %rbx
.L81:
	movq	(%rsp), %rdi
	call	_ZNSt6vectorIP10CUevent_stSaIS1_EED1Ev
	jmp	.L82
.L91:
	endbr64
	movq	%rax, %rbx
.L82:
	movq	24(%rsp), %rdi
	call	_ZNSt6vectorIP10CUevent_stSaIS1_EED1Ev
	jmp	.L83
.L90:
	endbr64
	movq	%rax, %rbx
.L83:
	movq	16(%rsp), %rdi
	call	_ZNSt6vectorIPhSaIS0_EED1Ev
	jmp	.L84
.L89:
	endbr64
	movq	%rax, %rbx
.L84:
	movq	8(%rsp), %rdi
	call	_ZNSt6vectorIPhSaIS0_EED1Ev
	jmp	.L85
.L88:
	endbr64
	movq	%rax, %rbx
.L85:
	leaq	64(%rsp), %rdi
	call	_ZNSt6vectorIP11CUstream_stSaIS1_EED1Ev
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L102
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L61:
	movq	184(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L87
.L102:
	call	__stack_chk_fail@PLT
.L87:
	addq	$200, %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
.LFE4099:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4099:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4099-.LLSDACSB4099
.LLSDACSB4099:
	.uleb128 .LEHB0-.LFB4099
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4099
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L88-.LFB4099
	.uleb128 0
	.uleb128 .LEHB2-.LFB4099
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L89-.LFB4099
	.uleb128 0
	.uleb128 .LEHB3-.LFB4099
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L90-.LFB4099
	.uleb128 0
	.uleb128 .LEHB4-.LFB4099
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L91-.LFB4099
	.uleb128 0
	.uleb128 .LEHB5-.LFB4099
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L92-.LFB4099
	.uleb128 0
	.uleb128 .LEHB6-.LFB4099
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE4099:
	.section	.text.startup
	.size	main, .-main
	.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
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.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:

// video_processing.cu
// A CUDA implementation for real-time video processing of 8K frames with multi-GPU scaling
// Target architecture: Turing

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

#include <vector>
#include <chrono>

// Define frame dimensions
#define WIDTH 7680
#define HEIGHT 4320
#define CHANNELS 3  // Assuming RGB

// Kernel to process a frame (dummy processing for demonstration)
__global__ void processFrameKernel(unsigned char* frame, int width, int height, int channels) {
    int x = blockIdx.x * blockDim.x + threadIdx.x;
    int y = blockIdx.y * blockDim.y + threadIdx.y;
    int idx = (y * width + x) * channels;

    if (x < width && y < height) {
        // Simple grayscale conversion for demonstration
        unsigned char r = frame[idx];
        unsigned char g = frame[idx + 1];
        unsigned char b = frame[idx + 2];
        unsigned char gray = static_cast<unsigned char>(0.299f * r + 0.587f * g + 0.114f * b);
        frame[idx] = frame[idx + 1] = frame[idx + 2] = gray;
    }
}

// Function to initialize a frame with random values
void initializeFrame(unsigned char* frame, int size) {
    for (int i = 0; i < size; ++i) {
        frame[i] = static_cast<unsigned char>(rand() % 256);
    }
}

// Function to print basic device information
void printDeviceInfo(int device) {
    hipDeviceProp_t prop;
    hipGetDeviceProperties(&prop, device);
    std::cout << "Device " << device << ": " << prop.name << std::endl;
    std::cout << "  Compute Capability: " << prop.major << "." << prop.minor << std::endl;
    std::cout << "  Global Memory: " << prop.totalGlobalMem / (1024 * 1024) << " MB" << std::endl;
    std::cout << "  MultiProcessors: " << prop.multiProcessorCount << std::endl;
}

// Main function to demonstrate the kernel's usage
int main() {
    int deviceCount;
    hipGetDeviceCount(&deviceCount);
    if (deviceCount == 0) {
        std::cerr << "No CUDA devices found!" << std::endl;
        return -1;
    }

    std::vector<hipStream_t> streams(deviceCount);
    std::vector<unsigned char*> d_frames(deviceCount);
    std::vector<unsigned char*> h_frames(deviceCount);
    std::vector<hipEvent_t> startEvents(deviceCount);
    std::vector<hipEvent_t> stopEvents(deviceCount);

    // Allocate and initialize host and device memory for each GPU
    for (int i = 0; i < deviceCount; ++i) {
        hipSetDevice(i);
        printDeviceInfo(i);

        // Allocate memory for frame
        size_t frameSize = WIDTH * HEIGHT * CHANNELS;
        hipMalloc(&d_frames[i], frameSize);
        h_frames[i] = new unsigned char[frameSize];
        initializeFrame(h_frames[i], frameSize);

        // Allocate streams and events
        hipStreamCreate(&streams[i]);
        hipEventCreate(&startEvents[i]);
        hipEventCreate(&stopEvents[i]);

        // Copy data from host to device
        hipMemcpyAsync(d_frames[i], h_frames[i], frameSize, hipMemcpyHostToDevice, streams[i]);
    }

    // Launch kernels on each GPU
    dim3 blockSize(16, 16);
    dim3 gridSize((WIDTH + blockSize.x - 1) / blockSize.x, (HEIGHT + blockSize.y - 1) / blockSize.y);

    for (int i = 0; i < deviceCount; ++i) {
        hipSetDevice(i);
        hipEventRecord(startEvents[i], streams[i]);
        processFrameKernel<<<gridSize, blockSize, 0, streams[i]>>>(d_frames[i], WIDTH, HEIGHT, CHANNELS);
        hipEventRecord(stopEvents[i], streams[i]);
    }

    // Wait for all kernels to complete and measure time
    float elapsedTime = 0.0f;
    for (int i = 0; i < deviceCount; ++i) {
        hipSetDevice(i);
        hipEventSynchronize(stopEvents[i]);
        hipEventElapsedTime(&elapsedTime, startEvents[i], stopEvents[i]);
        std::cout << "Device " << i << " processing time: " << elapsedTime << " ms" << std::endl;

        // Copy results back to host
        hipMemcpyAsync(h_frames[i], d_frames[i], WIDTH * HEIGHT * CHANNELS, hipMemcpyDeviceToHost, streams[i]);
        hipStreamSynchronize(streams[i]);
    }

    // Clean up
    for (int i = 0; i < deviceCount; ++i) {
        hipSetDevice(i);
        hipFree(d_frames[i]);
        delete[] h_frames[i];
        hipStreamDestroy(streams[i]);
        hipEventDestroy(startEvents[i]);
        hipEventDestroy(stopEvents[i]);
    }

    return 0;
}
	.text
	.file	"cuda_code_051230.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z33__device_stub__processFrameKernelPhiii # -- Begin function _Z33__device_stub__processFrameKernelPhiii
	.type	_Z33__device_stub__processFrameKernelPhiii,@function
_Z33__device_stub__processFrameKernelPhiii: # @_Z33__device_stub__processFrameKernelPhiii
	.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	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	20(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	16(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	12(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%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	$_Z18processFrameKernelPhiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	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	_Z33__device_stub__processFrameKernelPhiii, .Lfunc_end0-_Z33__device_stub__processFrameKernelPhiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z15initializeFramePhi          # -- Begin function _Z15initializeFramePhi
	.type	_Z15initializeFramePhi,@function
_Z15initializeFramePhi:                 # @_Z15initializeFramePhi
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	jle	.LBB1_4
# %bb.1:                                # %.lr.ph.preheader
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	%esi, %r14d
	xorl	%r15d, %r15d
.LBB1_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	movb	%al, (%rbx,%r15)
	incq	%r15
	cmpq	%r15, %r14
	jne	.LBB1_2
# %bb.3:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	.cfi_restore %rbx
	.cfi_restore %r14
	.cfi_restore %r15
.LBB1_4:                                # %._crit_edge
	retq
.Lfunc_end1:
	.size	_Z15initializeFramePhi, .Lfunc_end1-_Z15initializeFramePhi
	.cfi_endproc
                                        # -- End function
	.globl	_Z15printDeviceInfoi            # -- Begin function _Z15printDeviceInfoi
	.type	_Z15printDeviceInfoi,@function
_Z15printDeviceInfoi:                   # @_Z15printDeviceInfoi
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$1472, %rsp                     # imm = 0x5C0
	.cfi_def_cfa_offset 1504
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	%edi, %ebp
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	movl	%ebp, %esi
	callq	hipGetDevicePropertiesR0600
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	%ebp, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.1, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbx, %rdi
	callq	strlen
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	360(%rbx), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	364(%rbx), %esi
	movq	%r14, %rdi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$17, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	288(%rbx), %rsi
	shrq	$20, %rsi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertImEERSoT_
	movq	%rax, %r14
	movl	$.L.str.5, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r14), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r14, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$19, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	388(%rbx), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$1472, %rsp                     # imm = 0x5C0
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z15printDeviceInfoi, .Lfunc_end2-_Z15printDeviceInfoi
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$136, %rsp
	.cfi_def_cfa_offset 176
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
	callq	hipGetDeviceCount
	movslq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	.LBB3_1
# %bb.2:
	leaq	16(%rsp), %rdi
	leaq	88(%rsp), %rdx
	callq	_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_
	movslq	8(%rsp), %rsi
.Ltmp0:
	leaq	88(%rsp), %rdi
	leaq	64(%rsp), %rdx
	callq	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
.Ltmp1:
# %bb.3:
	movslq	8(%rsp), %rsi
.Ltmp3:
	leaq	64(%rsp), %rdi
	leaq	112(%rsp), %rdx
	callq	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
.Ltmp4:
# %bb.4:
	movslq	8(%rsp), %rsi
.Ltmp6:
	leaq	112(%rsp), %rdi
	leaq	40(%rsp), %rdx
	callq	_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_
.Ltmp7:
# %bb.5:
	movslq	8(%rsp), %rsi
.Ltmp9:
	leaq	40(%rsp), %rdi
	leaq	12(%rsp), %rdx
	callq	_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_
.Ltmp10:
# %bb.6:
	cmpl	$0, 8(%rsp)
	jle	.LBB3_54
# %bb.7:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
.LBB3_8:                                # %.lr.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_13 Depth 2
.Ltmp12:
	movl	%ebx, %edi
	callq	hipSetDevice
.Ltmp13:
# %bb.9:                                #   in Loop: Header=BB3_8 Depth=1
.Ltmp14:
	movl	%ebx, %edi
	callq	_Z15printDeviceInfoi
.Ltmp15:
# %bb.10:                               #   in Loop: Header=BB3_8 Depth=1
	leaq	(,%rbx,8), %r14
	movq	88(%rsp), %rdi
	addq	%r14, %rdi
.Ltmp17:
	movl	$99532800, %esi                 # imm = 0x5EEC000
	callq	hipMalloc
.Ltmp18:
# %bb.11:                               # %_ZL9hipMallocIhE10hipError_tPPT_m.exit
                                        #   in Loop: Header=BB3_8 Depth=1
.Ltmp19:
	movl	$99532800, %edi                 # imm = 0x5EEC000
	callq	_Znam
.Ltmp20:
# %bb.12:                               #   in Loop: Header=BB3_8 Depth=1
	movq	64(%rsp), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	64(%rsp), %rax
	movq	(%rax,%rbx,8), %r15
	xorl	%r12d, %r12d
.LBB3_13:                               # %.lr.ph.i
                                        #   Parent Loop BB3_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	movb	%al, (%r15,%r12)
	incq	%r12
	cmpq	$99532800, %r12                 # imm = 0x5EEC000
	jne	.LBB3_13
# %bb.14:                               # %_Z15initializeFramePhi.exit
                                        #   in Loop: Header=BB3_8 Depth=1
	movq	16(%rsp), %rdi
	addq	%r14, %rdi
.Ltmp21:
	callq	hipStreamCreate
.Ltmp22:
# %bb.15:                               #   in Loop: Header=BB3_8 Depth=1
	movq	112(%rsp), %rdi
	addq	%r14, %rdi
.Ltmp23:
	callq	hipEventCreate
.Ltmp24:
# %bb.16:                               #   in Loop: Header=BB3_8 Depth=1
	addq	40(%rsp), %r14
.Ltmp25:
	movq	%r14, %rdi
	callq	hipEventCreate
.Ltmp26:
# %bb.17:                               #   in Loop: Header=BB3_8 Depth=1
	movq	88(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	64(%rsp), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %r8
.Ltmp27:
	movl	$99532800, %edx                 # imm = 0x5EEC000
	movl	$1, %ecx
	callq	hipMemcpyAsync
.Ltmp28:
# %bb.18:                               #   in Loop: Header=BB3_8 Depth=1
	incq	%rbx
	movslq	8(%rsp), %rax
	cmpq	%rax, %rbx
	jl	.LBB3_8
# %bb.19:                               # %.preheader101
	testl	%eax, %eax
	jle	.LBB3_54
# %bb.20:                               # %.lr.ph104.preheader
	xorl	%ebx, %ebx
	movabsq	$1159641170400, %r14            # imm = 0x10E000001E0
	movabsq	$68719476752, %r15              # imm = 0x1000000010
.LBB3_21:                               # %.lr.ph104
                                        # =>This Inner Loop Header: Depth=1
.Ltmp30:
	movl	%ebx, %edi
	callq	hipSetDevice
.Ltmp31:
# %bb.22:                               #   in Loop: Header=BB3_21 Depth=1
	movq	112(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %rsi
.Ltmp32:
	callq	hipEventRecord
.Ltmp33:
# %bb.23:                               #   in Loop: Header=BB3_21 Depth=1
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %r9
.Ltmp34:
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	__hipPushCallConfiguration
.Ltmp35:
# %bb.24:                               #   in Loop: Header=BB3_21 Depth=1
	testl	%eax, %eax
	jne	.LBB3_26
# %bb.25:                               #   in Loop: Header=BB3_21 Depth=1
	movq	88(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp36:
	movl	$7680, %esi                     # imm = 0x1E00
	movl	$4320, %edx                     # imm = 0x10E0
	movl	$3, %ecx
	callq	_Z33__device_stub__processFrameKernelPhiii
.Ltmp37:
.LBB3_26:                               #   in Loop: Header=BB3_21 Depth=1
	movq	40(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %rsi
.Ltmp38:
	callq	hipEventRecord
.Ltmp39:
# %bb.27:                               #   in Loop: Header=BB3_21 Depth=1
	incq	%rbx
	movslq	8(%rsp), %rax
	cmpq	%rax, %rbx
	jl	.LBB3_21
# %bb.28:                               # %._crit_edge
	movl	$0, 12(%rsp)
	testl	%eax, %eax
	jle	.LBB3_54
# %bb.29:                               # %.lr.ph107.preheader
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
.LBB3_30:                               # %.lr.ph107
                                        # =>This Inner Loop Header: Depth=1
.Ltmp41:
	movl	%ebx, %edi
	callq	hipSetDevice
.Ltmp42:
# %bb.31:                               #   in Loop: Header=BB3_30 Depth=1
	movq	40(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp43:
	callq	hipEventSynchronize
.Ltmp44:
# %bb.32:                               #   in Loop: Header=BB3_30 Depth=1
	movq	112(%rsp), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	40(%rsp), %rax
	movq	(%rax,%rbx,8), %rdx
.Ltmp45:
	movq	%r14, %rdi
	callq	hipEventElapsedTime
.Ltmp46:
# %bb.33:                               #   in Loop: Header=BB3_30 Depth=1
.Ltmp47:
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp48:
# %bb.34:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB3_30 Depth=1
.Ltmp49:
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
.Ltmp50:
# %bb.35:                               #   in Loop: Header=BB3_30 Depth=1
.Ltmp51:
	movq	%rax, %r15
	movl	$.L.str.8, %esi
	movl	$18, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp52:
# %bb.36:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit79
                                        #   in Loop: Header=BB3_30 Depth=1
	cvtss2sd	12(%rsp), %xmm0
.Ltmp53:
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp54:
# %bb.37:                               # %_ZNSolsEf.exit
                                        #   in Loop: Header=BB3_30 Depth=1
.Ltmp55:
	movq	%rax, %r15
	movl	$.L.str.9, %esi
	movl	$3, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp56:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit80
                                        #   in Loop: Header=BB3_30 Depth=1
	movq	(%r15), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp57:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp58:
# %bb.39:                               # %.noexc
                                        #   in Loop: Header=BB3_30 Depth=1
.Ltmp59:
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp60:
# %bb.40:                               # %.noexc97
                                        #   in Loop: Header=BB3_30 Depth=1
.Ltmp61:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp62:
# %bb.41:                               # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB3_30 Depth=1
	movq	64(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
	movq	88(%rsp), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %r8
.Ltmp63:
	movl	$99532800, %edx                 # imm = 0x5EEC000
	movl	$2, %ecx
	callq	hipMemcpyAsync
.Ltmp64:
# %bb.42:                               #   in Loop: Header=BB3_30 Depth=1
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp65:
	callq	hipStreamSynchronize
.Ltmp66:
# %bb.43:                               #   in Loop: Header=BB3_30 Depth=1
	incq	%rbx
	movslq	8(%rsp), %rax
	cmpq	%rax, %rbx
	jl	.LBB3_30
# %bb.44:                               # %.preheader
	testl	%eax, %eax
	jle	.LBB3_54
# %bb.45:                               # %.lr.ph109.preheader
	xorl	%ebx, %ebx
.LBB3_46:                               # %.lr.ph109
                                        # =>This Inner Loop Header: Depth=1
.Ltmp68:
	movl	%ebx, %edi
	callq	hipSetDevice
.Ltmp69:
# %bb.47:                               #   in Loop: Header=BB3_46 Depth=1
	movq	88(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp70:
	callq	hipFree
.Ltmp71:
# %bb.48:                               #   in Loop: Header=BB3_46 Depth=1
	movq	64(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	.LBB3_50
# %bb.49:                               #   in Loop: Header=BB3_46 Depth=1
	callq	_ZdaPv
.LBB3_50:                               #   in Loop: Header=BB3_46 Depth=1
	movq	16(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp72:
	callq	hipStreamDestroy
.Ltmp73:
# %bb.51:                               #   in Loop: Header=BB3_46 Depth=1
	movq	112(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp74:
	callq	hipEventDestroy
.Ltmp75:
# %bb.52:                               #   in Loop: Header=BB3_46 Depth=1
	movq	40(%rsp), %rax
	movq	(%rax,%rbx,8), %rdi
.Ltmp76:
	callq	hipEventDestroy
.Ltmp77:
# %bb.53:                               #   in Loop: Header=BB3_46 Depth=1
	incq	%rbx
	movslq	8(%rsp), %rax
	cmpq	%rax, %rbx
	jl	.LBB3_46
.LBB3_54:                               # %._crit_edge110
	movq	40(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_56
# %bb.55:
	callq	_ZdlPv
.LBB3_56:                               # %_ZNSt6vectorIP11ihipEvent_tSaIS1_EED2Ev.exit
	movq	112(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_58
# %bb.57:
	callq	_ZdlPv
.LBB3_58:                               # %_ZNSt6vectorIP11ihipEvent_tSaIS1_EED2Ev.exit82
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_60
# %bb.59:
	callq	_ZdlPv
.LBB3_60:                               # %_ZNSt6vectorIPhSaIS0_EED2Ev.exit
	movq	88(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_62
# %bb.61:
	callq	_ZdlPv
.LBB3_62:                               # %_ZNSt6vectorIPhSaIS0_EED2Ev.exit85
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_64
# %bb.63:
	callq	_ZdlPv
.LBB3_64:                               # %_ZNSt6vectorIP12ihipStream_tSaIS1_EED2Ev.exit
	xorl	%eax, %eax
	jmp	.LBB3_65
.LBB3_1:
	movl	$_ZSt4cerr, %ebx
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.7, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$-1, %eax
.LBB3_65:
	addq	$136, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB3_69:
	.cfi_def_cfa_offset 176
.Ltmp11:
	movq	%rax, %rbx
	jmp	.LBB3_77
.LBB3_68:
.Ltmp8:
	movq	%rax, %rbx
	jmp	.LBB3_79
.LBB3_67:
.Ltmp5:
	movq	%rax, %rbx
	jmp	.LBB3_81
.LBB3_66:
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB3_83
.LBB3_74:
.Ltmp78:
	jmp	.LBB3_75
.LBB3_70:
.Ltmp16:
	jmp	.LBB3_75
.LBB3_72:
.Ltmp40:
	jmp	.LBB3_75
.LBB3_73:
.Ltmp67:
	jmp	.LBB3_75
.LBB3_71:
.Ltmp29:
.LBB3_75:
	movq	%rax, %rbx
	movq	40(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_77
# %bb.76:
	callq	_ZdlPv
.LBB3_77:                               # %_ZNSt6vectorIP11ihipEvent_tSaIS1_EED2Ev.exit88
	movq	112(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_79
# %bb.78:
	callq	_ZdlPv
.LBB3_79:                               # %_ZNSt6vectorIP11ihipEvent_tSaIS1_EED2Ev.exit90
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_81
# %bb.80:
	callq	_ZdlPv
.LBB3_81:                               # %_ZNSt6vectorIPhSaIS0_EED2Ev.exit92
	movq	88(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_83
# %bb.82:
	callq	_ZdlPv
.LBB3_83:                               # %_ZNSt6vectorIPhSaIS0_EED2Ev.exit94
	movq	16(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB3_85
# %bb.84:
	callq	_ZdlPv
.LBB3_85:                               # %_ZNSt6vectorIP12ihipStream_tSaIS1_EED2Ev.exit96
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table3:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp15-.Ltmp12                #   Call between .Ltmp12 and .Ltmp15
	.uleb128 .Ltmp16-.Lfunc_begin0          #     jumps to .Ltmp16
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp17-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp28-.Ltmp17                #   Call between .Ltmp17 and .Ltmp28
	.uleb128 .Ltmp29-.Lfunc_begin0          #     jumps to .Ltmp29
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp30-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp39-.Ltmp30                #   Call between .Ltmp30 and .Ltmp39
	.uleb128 .Ltmp40-.Lfunc_begin0          #     jumps to .Ltmp40
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp41-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp66-.Ltmp41                #   Call between .Ltmp41 and .Ltmp66
	.uleb128 .Ltmp67-.Lfunc_begin0          #     jumps to .Ltmp67
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp77-.Ltmp68                #   Call between .Ltmp68 and .Ltmp77
	.uleb128 .Ltmp78-.Lfunc_begin0          #     jumps to .Ltmp78
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp77-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Lfunc_end3-.Ltmp77            #   Call between .Ltmp77 and .Lfunc_end3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_,"axG",@progbits,_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_,comdat
	.weak	_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_ # -- Begin function _ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_,@function
_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_: # @_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB4_7
# %bb.1:                                # %_ZNSt6vectorIP12ihipStream_tSaIS1_EE17_S_check_init_lenEmRKS2_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB4_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,8), %r15
	movq	%r15, 16(%rbx)
	movq	$0, (%rax)
	addq	$8, %rax
	cmpq	$1, %r14
	jne	.LBB4_5
# %bb.4:
	movq	%rax, %r15
	jmp	.LBB4_6
.LBB4_2:                                # %_ZNSt12_Vector_baseIP12ihipStream_tSaIS1_EEC2EmRKS2_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r15d, %r15d
	jmp	.LBB4_6
.LBB4_5:                                # %_ZSt6fill_nIPP12ihipStream_tmS1_ET_S3_T0_RKT1_.exit.loopexit.i.i.i.i
	leaq	-8(,%r14,8), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB4_6:
	movq	%r15, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB4_7:
	.cfi_def_cfa_offset 32
	movl	$.L.str.10, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end4:
	.size	_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_, .Lfunc_end4-_ZNSt6vectorIP12ihipStream_tSaIS1_EEC2EmRKS2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIPhSaIS0_EEC2EmRKS1_,"axG",@progbits,_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_,comdat
	.weak	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_ # -- Begin function _ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_,@function
_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_:       # @_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB5_7
# %bb.1:                                # %_ZNSt6vectorIPhSaIS0_EE17_S_check_init_lenEmRKS1_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB5_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIPhE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,8), %r15
	movq	%r15, 16(%rbx)
	movq	$0, (%rax)
	addq	$8, %rax
	cmpq	$1, %r14
	jne	.LBB5_5
# %bb.4:
	movq	%rax, %r15
	jmp	.LBB5_6
.LBB5_2:                                # %_ZNSt12_Vector_baseIPhSaIS0_EEC2EmRKS1_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r15d, %r15d
	jmp	.LBB5_6
.LBB5_5:                                # %_ZSt6fill_nIPPhmS0_ET_S2_T0_RKT1_.exit.loopexit.i.i.i.i
	leaq	-8(,%r14,8), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB5_6:
	movq	%r15, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB5_7:
	.cfi_def_cfa_offset 32
	movl	$.L.str.10, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end5:
	.size	_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_, .Lfunc_end5-_ZNSt6vectorIPhSaIS0_EEC2EmRKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_,"axG",@progbits,_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_,comdat
	.weak	_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_ # -- Begin function _ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_,@function
_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_: # @_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB6_7
# %bb.1:                                # %_ZNSt6vectorIP11ihipEvent_tSaIS1_EE17_S_check_init_lenEmRKS2_.exit
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	testq	%rsi, %rsi
	je	.LBB6_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv
	movq	%rax, (%rbx)
	leaq	(%rax,%r14,8), %r15
	movq	%r15, 16(%rbx)
	movq	$0, (%rax)
	addq	$8, %rax
	cmpq	$1, %r14
	jne	.LBB6_5
# %bb.4:
	movq	%rax, %r15
	jmp	.LBB6_6
.LBB6_2:                                # %_ZNSt12_Vector_baseIP11ihipEvent_tSaIS1_EEC2EmRKS2_.exit.thread
	movups	%xmm0, (%rbx)
	movq	$0, 16(%rbx)
	xorl	%r15d, %r15d
	jmp	.LBB6_6
.LBB6_5:                                # %_ZSt6fill_nIPP11ihipEvent_tmS1_ET_S3_T0_RKT1_.exit.loopexit.i.i.i.i
	leaq	-8(,%r14,8), %rdx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.LBB6_6:
	movq	%r15, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB6_7:
	.cfi_def_cfa_offset 32
	movl	$.L.str.10, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end6:
	.size	_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_, .Lfunc_end6-_ZNSt6vectorIP11ihipEvent_tSaIS1_EEC2EmRKS2_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv,@function
_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv: # @_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB7_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB7_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB7_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB7_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end7:
	.size	_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv, .Lfunc_end7-_ZNSt15__new_allocatorIP12ihipStream_tE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIPhE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIPhE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIPhE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIPhE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIPhE8allocateEmPKv,@function
_ZNSt15__new_allocatorIPhE8allocateEmPKv: # @_ZNSt15__new_allocatorIPhE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB8_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB8_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB8_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB8_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end8:
	.size	_ZNSt15__new_allocatorIPhE8allocateEmPKv, .Lfunc_end8-_ZNSt15__new_allocatorIPhE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv,@function
_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv: # @_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$60, %rax
	jne	.LBB9_1
# %bb.3:
	shlq	$3, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB9_1:
	.cfi_def_cfa_offset 16
	shrq	$61, %rsi
	je	.LBB9_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB9_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end9:
	.size	_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv, .Lfunc_end9-_ZNSt15__new_allocatorIP11ihipEvent_tE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB10_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB10_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z18processFrameKernelPhiii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end10:
	.size	__hip_module_ctor, .Lfunc_end10-__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	.LBB11_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
.LBB11_2:
	retq
.Lfunc_end11:
	.size	__hip_module_dtor, .Lfunc_end11-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z18processFrameKernelPhiii,@object # @_Z18processFrameKernelPhiii
	.section	.rodata,"a",@progbits
	.globl	_Z18processFrameKernelPhiii
	.p2align	3, 0x0
_Z18processFrameKernelPhiii:
	.quad	_Z33__device_stub__processFrameKernelPhiii
	.size	_Z18processFrameKernelPhiii, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Device "
	.size	.L.str, 8

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"  Compute Capability: "
	.size	.L.str.2, 23

	.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	"  Global Memory: "
	.size	.L.str.4, 18

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"  MultiProcessors: "
	.size	.L.str.6, 20

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"No CUDA devices found!"
	.size	.L.str.7, 23

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	" processing time: "
	.size	.L.str.8, 19

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	" ms"
	.size	.L.str.9, 4

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"cannot create std::vector larger than max_size()"
	.size	.L.str.10, 49

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z18processFrameKernelPhiii"
	.size	.L__unnamed_1, 28

	.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 _Z33__device_stub__processFrameKernelPhiii
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _Z18processFrameKernelPhiii
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt4cerr
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z18processFrameKernelPhiii ; -- Begin function _Z18processFrameKernelPhiii
	.globl	_Z18processFrameKernelPhiii
	.p2align	8
	.type	_Z18processFrameKernelPhiii,@function
_Z18processFrameKernelPhiii:            ; @_Z18processFrameKernelPhiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b128 s[4:7], s[0:1], 0x8
	v_and_b32_e32 v2, 0x3ff, v0
	v_bfe_u32 v3, v0, 10, 10
	s_waitcnt lgkmcnt(0)
	s_lshr_b32 s3, s2, 16
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[0:1], null, s14, s2, v[2:3]
	v_mad_u64_u32 v[1:2], null, s15, s3, v[3:4]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_gt_i32_e32 vcc_lo, s4, v0
	v_cmp_gt_i32_e64 s2, s5, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_2
; %bb.1:
	s_load_b64 s[0:1], s[0:1], 0x0
	v_mad_u64_u32 v[2:3], null, v1, s4, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_lo_u32 v0, v2, s6
	v_ashrrev_i32_e32 v1, 31, v0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_clause 0x1
	global_load_u16 v2, v[0:1], off
	global_load_u8 v3, v[0:1], off offset:2
	s_waitcnt vmcnt(1)
	v_cvt_f32_ubyte1_e32 v4, v2
	v_cvt_f32_ubyte0_e32 v2, v2
	s_waitcnt vmcnt(0)
	v_cvt_f32_ubyte0_e32 v3, v3
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v4, 0x3f1645a2, v4
	v_fmamk_f32 v2, v2, 0x3e991687, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v2, v3, 0x3de978d5, v2
	v_cvt_i32_f32_e32 v2, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b16 v3, 8, v2
	v_or_b32_e32 v3, v2, v3
	s_clause 0x1
	global_store_b8 v[0:1], v2, off offset:2
	global_store_b16 v[0:1], v3, off
.LBB0_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z18processFrameKernelPhiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 1
		.amdhsa_next_free_vgpr 5
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z18processFrameKernelPhiii, .Lfunc_end0-_Z18processFrameKernelPhiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 280
; NumSgprs: 18
; NumVgprs: 5
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 5
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 1
	.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
      - .offset:         12
        .size:           4
        .value_kind:     by_value
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z18processFrameKernelPhiii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z18processFrameKernelPhiii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     5
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
