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

// Define constants
#define NUM_NODES 512
#define WARP_SIZE 32

// Kernel to perform BFS traversal
__global__ void bfsKernel(int *frontier, int *next_frontier, int *visited, int *edge_list, int *edge_offsets, int *frontier_size) {
    int tid = threadIdx.x + blockIdx.x * blockDim.x;
    int warp_id = tid / WARP_SIZE;
    int lane_id = tid % WARP_SIZE;

    // Shared memory to store frontier nodes for the current warp
    __shared__ int warp_frontier[WARP_SIZE];

    // Load frontier nodes into shared memory
    if (tid < *frontier_size) {
        warp_frontier[lane_id] = frontier[tid];
    }
    __syncthreads();

    // Process each node in the frontier
    for (int i = 0; i < WARP_SIZE; ++i) {
        int node = warp_frontier[i];
        if (node >= 0 && node < NUM_NODES) {
            // Traverse all neighbors of the current node
            for (int j = edge_offsets[node]; j < edge_offsets[node + 1]; ++j) {
                int neighbor = edge_list[j];
                // Use atomic operation to avoid race conditions
                if (!atomicExch(&visited[neighbor], 1)) {
                    int pos = atomicAdd(frontier_size, 1);
                    next_frontier[pos] = neighbor;
                }
            }
        }
    }
}

int main() {
    // Initialize host data
    std::vector<int> edge_list = { /* example edge list */ };
    std::vector<int> edge_offsets = { /* example edge offsets */ };
    std::vector<int> visited(NUM_NODES, 0);
    std::vector<int> frontier = {0}; // Start BFS from node 0
    std::vector<int> next_frontier(NUM_NODES, -1);
    int frontier_size = 1;

    // Allocate device memory
    int *d_edge_list, *d_edge_offsets, *d_visited, *d_frontier, *d_next_frontier, *d_frontier_size;
    cudaMalloc(&d_edge_list, edge_list.size() * sizeof(int));
    cudaMalloc(&d_edge_offsets, edge_offsets.size() * sizeof(int));
    cudaMalloc(&d_visited, NUM_NODES * sizeof(int));
    cudaMalloc(&d_frontier, NUM_NODES * sizeof(int));
    cudaMalloc(&d_next_frontier, NUM_NODES * sizeof(int));
    cudaMalloc(&d_frontier_size, sizeof(int));

    // Copy data to device
    cudaMemcpy(d_edge_list, edge_list.data(), edge_list.size() * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(d_edge_offsets, edge_offsets.data(), edge_offsets.size() * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(d_visited, visited.data(), NUM_NODES * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(d_frontier, frontier.data(), frontier.size() * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(d_frontier_size, &frontier_size, sizeof(int), cudaMemcpyHostToDevice);

    // Launch kernel
    int blockSize = 256;
    int numBlocks = (NUM_NODES + blockSize - 1) / blockSize;
    bfsKernel<<<numBlocks, blockSize>>>(d_frontier, d_next_frontier, d_visited, d_edge_list, d_edge_offsets, d_frontier_size);

    // Check for errors in kernel launch
    cudaError_t err = cudaGetLastError();
    if (err != cudaSuccess) {
        std::cerr << "CUDA error: " << cudaGetErrorString(err) << std::endl;
        return -1;
    }

    // Copy results back to host
    cudaMemcpy(frontier.data(), d_frontier, NUM_NODES * sizeof(int), cudaMemcpyDeviceToHost);
    cudaMemcpy(next_frontier.data(), d_next_frontier, NUM_NODES * sizeof(int), cudaMemcpyDeviceToHost);
    cudaMemcpy(&frontier_size, d_frontier_size, sizeof(int), cudaMemcpyDeviceToHost);

    // Print results
    std::cout << "Frontier size: " << frontier_size << std::endl;
    std::cout << "Frontier nodes: ";
    for (int i = 0; i < frontier_size; ++i) {
        std::cout << frontier[i] << " ";
    }
    std::cout << std::endl;

    // Free device memory
    cudaFree(d_edge_list);
    cudaFree(d_edge_offsets);
    cudaFree(d_visited);
    cudaFree(d_frontier);
    cudaFree(d_next_frontier);
    cudaFree(d_frontier_size);

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4011:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4011:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_
	.type	_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_, @function
_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_:
.LFB4033:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%rsp, %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z9bfsKernelPiS_S_S_S_S_(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L2:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4033:
	.size	_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_, .-_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_
	.globl	_Z9bfsKernelPiS_S_S_S_S_
	.type	_Z9bfsKernelPiS_S_S_S_S_, @function
_Z9bfsKernelPiS_S_S_S_S_:
.LFB4034:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_
	.cfi_endproc
.LFE4034:
	.size	_Z9bfsKernelPiS_S_S_S_S_, .-_Z9bfsKernelPiS_S_S_S_S_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z9bfsKernelPiS_S_S_S_S_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4036:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z9bfsKernelPiS_S_S_S_S_(%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
.LFE4036:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt12_Vector_baseIiSaIiEED2Ev,"axG",@progbits,_ZNSt12_Vector_baseIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt12_Vector_baseIiSaIiEED2Ev
	.type	_ZNSt12_Vector_baseIiSaIiEED2Ev, @function
_ZNSt12_Vector_baseIiSaIiEED2Ev:
.LFB4343:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L10
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L10:
	ret
	.cfi_endproc
.LFE4343:
	.size	_ZNSt12_Vector_baseIiSaIiEED2Ev, .-_ZNSt12_Vector_baseIiSaIiEED2Ev
	.weak	_ZNSt12_Vector_baseIiSaIiEED1Ev
	.set	_ZNSt12_Vector_baseIiSaIiEED1Ev,_ZNSt12_Vector_baseIiSaIiEED2Ev
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4346:
	.cfi_startproc
	endbr64
	jmp	_ZNSt12_Vector_baseIiSaIiEED2Ev
	.cfi_endproc
.LFE4346:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.rodata.str1.1
.LC1:
	.string	"CUDA error: "
.LC2:
	.string	"Frontier size: "
.LC3:
	.string	"Frontier nodes: "
.LC4:
	.string	" "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3998:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3998
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%r8d, %r8d
	movl	$2048, %edi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$216, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%r8, 80(%rsp)
	movq	%r8, 88(%rsp)
	movq	%r8, 96(%rsp)
	movq	%r8, 104(%rsp)
	movq	%r8, 112(%rsp)
	movq	%r8, 120(%rsp)
	movq	%r8, 136(%rsp)
	movq	%r8, 144(%rsp)
.LEHB0:
	call	_Znwm@PLT
.LEHE0:
	leaq	2048(%rax), %rdx
	movq	%rax, 128(%rsp)
	movq	%rax, %r12
	xorl	%eax, %eax
	movq	%rdx, 144(%rsp)
.L14:
	xorl	%edi, %edi
	movl	%edi, (%r12,%rax)
	addq	$4, %rax
	cmpq	$2048, %rax
	jne	.L14
	xorl	%esi, %esi
	movl	$4, %edi
	movq	%rdx, 136(%rsp)
	movq	%rsi, 152(%rsp)
	movq	%rsi, 160(%rsp)
	movq	%rsi, 168(%rsp)
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	movq	%rax, %rbx
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rax, 152(%rsp)
	movl	%edx, (%rbx)
	leaq	4(%rax), %rax
	movl	$2048, %edi
	movq	%rax, 168(%rsp)
	movq	%rax, 160(%rsp)
	movq	%rcx, 184(%rsp)
	movq	%rcx, 192(%rsp)
.LEHB2:
	call	_Znwm@PLT
.LEHE2:
	leaq	2048(%rax), %rdx
	movq	%rax, 176(%rsp)
	movq	%rax, %rbp
	xorl	%eax, %eax
	movq	%rdx, 192(%rsp)
	jmp	.L18
.L36:
	endbr64
	movq	%rax, %rbx
.L16:
	leaq	152(%rsp), %rdi
	call	_ZNSt12_Vector_baseIiSaIiEED2Ev
	jmp	.L17
.L18:
	movl	$-1, 0(%rbp,%rax)
	addq	$4, %rax
	cmpq	$2048, %rax
	jne	.L18
	leaq	8(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rdx, 184(%rsp)
	movl	$1, 4(%rsp)
.LEHB3:
	call	cudaMalloc@PLT
	leaq	16(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaMalloc@PLT
	leaq	24(%rsp), %rdi
	movl	$2048, %esi
	call	cudaMalloc@PLT
	leaq	32(%rsp), %rdi
	movl	$2048, %esi
	call	cudaMalloc@PLT
	leaq	40(%rsp), %rdi
	movl	$2048, %esi
	call	cudaMalloc@PLT
	leaq	48(%rsp), %rdi
	movl	$4, %esi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	movl	$1, %ecx
	xorl	%edx, %edx
	xorl	%esi, %esi
	call	cudaMemcpy@PLT
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movl	$2048, %edx
	movq	%r12, %rsi
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	leaq	4(%rsp), %r13
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	movq	%r13, %rsi
	call	cudaMemcpy@PLT
	movl	$16777217, %edx
	movl	$2147483649, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	movl	$1, %ecx
	addq	%rdi, %rdi
	movl	$1, %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L19
.L21:
	call	cudaGetLastError@PLT
	movl	%eax, %r12d
	testl	%eax, %eax
	je	.L22
	jmp	.L44
.L19:
	movq	48(%rsp), %r9
	movq	16(%rsp), %r8
	movq	8(%rsp), %rcx
	movq	24(%rsp), %rdx
	movq	40(%rsp), %rsi
	movq	32(%rsp), %rdi
	call	_Z38__device_stub__Z9bfsKernelPiS_S_S_S_S_PiS_S_S_S_S_
	jmp	.L21
.L44:
	leaq	.LC1(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %edi
	movq	%rax, %rbx
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	orl	$-1, %ebx
	jmp	.L23
.L22:
	movq	32(%rsp), %rsi
	movl	$2, %ecx
	movl	$2048, %edx
	movq	%rbx, %rdi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rsi
	movl	$2, %ecx
	movl	$2048, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	movq	48(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	movq	%r13, %rdi
	call	cudaMemcpy@PLT
	leaq	_ZSt4cout(%rip), %rbp
	leaq	.LC2(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	4(%rsp), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	leaq	.LC3(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%r12d, %r12d
	leaq	.LC4(%rip), %r13
.L24:
	cmpl	%r12d, 4(%rsp)
	jle	.L45
	movl	(%rbx,%r12,4), %esi
	movq	%rbp, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	movq	%r13, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incq	%r12
	jmp	.L24
.L45:
	movq	%rbp, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rdi
	call	cudaFree@PLT
	movq	48(%rsp), %rdi
	call	cudaFree@PLT
.LEHE3:
	xorl	%ebx, %ebx
.L23:
	leaq	176(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	152(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	128(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	104(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	80(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L30
	jmp	.L42
.L35:
	endbr64
	movq	%rax, %rbx
.L26:
	leaq	176(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L27
.L34:
	endbr64
	movq	%rax, %rbx
.L27:
	leaq	152(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
.L17:
	leaq	128(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L28
.L33:
	endbr64
	movq	%rax, %rbx
.L28:
	leaq	104(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	80(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L42:
	call	__stack_chk_fail@PLT
.L30:
	addq	$216, %rsp
	.cfi_def_cfa_offset 40
	movl	%ebx, %eax
	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
.LFE3998:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3998:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3998-.LLSDACSB3998
.LLSDACSB3998:
	.uleb128 .LEHB0-.LFB3998
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L33-.LFB3998
	.uleb128 0
	.uleb128 .LEHB1-.LFB3998
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L36-.LFB3998
	.uleb128 0
	.uleb128 .LEHB2-.LFB3998
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L34-.LFB3998
	.uleb128 0
	.uleb128 .LEHB3-.LFB3998
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L35-.LFB3998
	.uleb128 0
	.uleb128 .LEHB4-.LFB3998
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE3998:
	.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:

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

// Define constants
#define NUM_NODES 512
#define WARP_SIZE 32

// Kernel to perform BFS traversal
__global__ void bfsKernel(int *frontier, int *next_frontier, int *visited, int *edge_list, int *edge_offsets, int *frontier_size) {
    int tid = threadIdx.x + blockIdx.x * blockDim.x;
    int warp_id = tid / WARP_SIZE;
    int lane_id = tid % WARP_SIZE;

    // Shared memory to store frontier nodes for the current warp
    __shared__ int warp_frontier[WARP_SIZE];

    // Load frontier nodes into shared memory
    if (tid < *frontier_size) {
        warp_frontier[lane_id] = frontier[tid];
    }
    __syncthreads();

    // Process each node in the frontier
    for (int i = 0; i < WARP_SIZE; ++i) {
        int node = warp_frontier[i];
        if (node >= 0 && node < NUM_NODES) {
            // Traverse all neighbors of the current node
            for (int j = edge_offsets[node]; j < edge_offsets[node + 1]; ++j) {
                int neighbor = edge_list[j];
                // Use atomic operation to avoid race conditions
                if (!atomicExch(&visited[neighbor], 1)) {
                    int pos = atomicAdd(frontier_size, 1);
                    next_frontier[pos] = neighbor;
                }
            }
        }
    }
}

int main() {
    // Initialize host data
    std::vector<int> edge_list = { /* example edge list */ };
    std::vector<int> edge_offsets = { /* example edge offsets */ };
    std::vector<int> visited(NUM_NODES, 0);
    std::vector<int> frontier = {0}; // Start BFS from node 0
    std::vector<int> next_frontier(NUM_NODES, -1);
    int frontier_size = 1;

    // Allocate device memory
    int *d_edge_list, *d_edge_offsets, *d_visited, *d_frontier, *d_next_frontier, *d_frontier_size;
    hipMalloc(&d_edge_list, edge_list.size() * sizeof(int));
    hipMalloc(&d_edge_offsets, edge_offsets.size() * sizeof(int));
    hipMalloc(&d_visited, NUM_NODES * sizeof(int));
    hipMalloc(&d_frontier, NUM_NODES * sizeof(int));
    hipMalloc(&d_next_frontier, NUM_NODES * sizeof(int));
    hipMalloc(&d_frontier_size, sizeof(int));

    // Copy data to device
    hipMemcpy(d_edge_list, edge_list.data(), edge_list.size() * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(d_edge_offsets, edge_offsets.data(), edge_offsets.size() * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(d_visited, visited.data(), NUM_NODES * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(d_frontier, frontier.data(), frontier.size() * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(d_frontier_size, &frontier_size, sizeof(int), hipMemcpyHostToDevice);

    // Launch kernel
    int blockSize = 256;
    int numBlocks = (NUM_NODES + blockSize - 1) / blockSize;
    bfsKernel<<<numBlocks, blockSize>>>(d_frontier, d_next_frontier, d_visited, d_edge_list, d_edge_offsets, d_frontier_size);

    // Check for errors in kernel launch
    hipError_t err = hipGetLastError();
    if (err != hipSuccess) {
        std::cerr << "CUDA error: " << hipGetErrorString(err) << std::endl;
        return -1;
    }

    // Copy results back to host
    hipMemcpy(frontier.data(), d_frontier, NUM_NODES * sizeof(int), hipMemcpyDeviceToHost);
    hipMemcpy(next_frontier.data(), d_next_frontier, NUM_NODES * sizeof(int), hipMemcpyDeviceToHost);
    hipMemcpy(&frontier_size, d_frontier_size, sizeof(int), hipMemcpyDeviceToHost);

    // Print results
    std::cout << "Frontier size: " << frontier_size << std::endl;
    std::cout << "Frontier nodes: ";
    for (int i = 0; i < frontier_size; ++i) {
        std::cout << frontier[i] << " ";
    }
    std::cout << std::endl;

    // Free device memory
    hipFree(d_edge_list);
    hipFree(d_edge_offsets);
    hipFree(d_visited);
    hipFree(d_frontier);
    hipFree(d_next_frontier);
    hipFree(d_frontier_size);

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

                                        # End of file scope inline assembly
	.globl	_Z24__device_stub__bfsKernelPiS_S_S_S_S_ # -- Begin function _Z24__device_stub__bfsKernelPiS_S_S_S_S_
	.type	_Z24__device_stub__bfsKernelPiS_S_S_S_S_,@function
_Z24__device_stub__bfsKernelPiS_S_S_S_S_: # @_Z24__device_stub__bfsKernelPiS_S_S_S_S_
	.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	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	32(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	24(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	16(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z9bfsKernelPiS_S_S_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	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	_Z24__device_stub__bfsKernelPiS_S_S_S_S_, .Lfunc_end0-_Z24__device_stub__bfsKernelPiS_S_S_S_S_
	.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:                                # %.noexc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$88, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$2048, %edi                     # imm = 0x800
	callq	_Znwm
	movq	%rax, %rbx
	movl	$2048, %edx                     # imm = 0x800
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	leaq	40(%rsp), %rsi
	movl	$0, (%rsi)
.Ltmp0:
	leaq	64(%rsp), %rdi
	leaq	32(%rsp), %rcx
	movl	$1, %edx
	callq	_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_
.Ltmp1:
# %bb.1:
.Ltmp3:
	movl	$2048, %edi                     # imm = 0x800
	callq	_Znwm
.Ltmp4:
# %bb.2:                                # %.lr.ph.i.i.i.i.i.i.i.i.i31.preheader
	movq	%rax, %r14
	movl	$2048, %edx                     # imm = 0x800
	movq	%rax, %rdi
	movl	$255, %esi
	callq	memset@PLT
	movl	$1, 12(%rsp)
.Ltmp6:
	leaq	40(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipMalloc
.Ltmp7:
# %bb.3:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
.Ltmp8:
	leaq	32(%rsp), %rdi
	xorl	%esi, %esi
	callq	hipMalloc
.Ltmp9:
# %bb.4:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit38
.Ltmp10:
	leaq	56(%rsp), %rdi
	movl	$2048, %esi                     # imm = 0x800
	callq	hipMalloc
.Ltmp11:
# %bb.5:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit40
.Ltmp12:
	leaq	24(%rsp), %rdi
	movl	$2048, %esi                     # imm = 0x800
	callq	hipMalloc
.Ltmp13:
# %bb.6:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit42
.Ltmp14:
	leaq	48(%rsp), %rdi
	movl	$2048, %esi                     # imm = 0x800
	callq	hipMalloc
.Ltmp15:
# %bb.7:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit44
.Ltmp16:
	leaq	16(%rsp), %rdi
	movl	$4, %esi
	callq	hipMalloc
.Ltmp17:
# %bb.8:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit46
	movq	40(%rsp), %rdi
.Ltmp18:
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp19:
# %bb.9:
	movq	32(%rsp), %rdi
.Ltmp20:
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp21:
# %bb.10:
	movq	56(%rsp), %rdi
.Ltmp22:
	movl	$2048, %edx                     # imm = 0x800
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp23:
# %bb.11:
	movq	24(%rsp), %rdi
	movq	64(%rsp), %rsi
	movq	72(%rsp), %rdx
	subq	%rsi, %rdx
.Ltmp24:
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp25:
# %bb.12:
	movq	16(%rsp), %rdi
.Ltmp26:
	leaq	12(%rsp), %rsi
	movl	$4, %edx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp27:
# %bb.13:
.Ltmp29:
	movabsq	$4294967298, %rdi               # imm = 0x100000002
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp30:
# %bb.14:
	testl	%eax, %eax
	jne	.LBB1_16
# %bb.15:
	movq	24(%rsp), %rdi
	movq	48(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	40(%rsp), %rcx
	movq	32(%rsp), %r8
	movq	16(%rsp), %r9
.Ltmp31:
	callq	_Z24__device_stub__bfsKernelPiS_S_S_S_S_
.Ltmp32:
.LBB1_16:
.Ltmp34:
	callq	hipGetLastError
.Ltmp35:
# %bb.17:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_30
# %bb.18:
.Ltmp36:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp37:
# %bb.19:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp38:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp39:
# %bb.20:
	movq	%rax, %r15
	testq	%rax, %rax
	je	.LBB1_21
# %bb.25:
	movq	%r15, %rdi
	callq	strlen
.Ltmp40:
	movl	$_ZSt4cerr, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp41:
	jmp	.LBB1_26
.LBB1_30:
	movq	64(%rsp), %rdi
	movq	24(%rsp), %rsi
.Ltmp50:
	movl	$2048, %edx                     # imm = 0x800
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp51:
# %bb.31:
	movq	48(%rsp), %rsi
.Ltmp52:
	movl	$2048, %edx                     # imm = 0x800
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp53:
# %bb.32:
	movq	16(%rsp), %rsi
.Ltmp54:
	leaq	12(%rsp), %rdi
	movl	$4, %edx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp55:
# %bb.33:
.Ltmp56:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$15, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp57:
# %bb.34:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit53
	movl	12(%rsp), %esi
.Ltmp58:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp59:
# %bb.35:
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp60:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp61:
# %bb.36:                               # %.noexc86
.Ltmp62:
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp63:
# %bb.37:                               # %.noexc87
.Ltmp64:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp65:
# %bb.38:                               # %_ZNSolsEPFRSoS_E.exit55
.Ltmp66:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$16, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp67:
# %bb.39:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit57.preheader
	cmpl	$0, 12(%rsp)
	jle	.LBB1_44
# %bb.40:                               # %.lr.ph.preheader
	xorl	%r15d, %r15d
.LBB1_41:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	64(%rsp), %rax
	movl	(%rax,%r15,4), %esi
.Ltmp68:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp69:
# %bb.42:                               #   in Loop: Header=BB1_41 Depth=1
.Ltmp70:
	movl	$.L.str.3, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp71:
# %bb.43:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit61
                                        #   in Loop: Header=BB1_41 Depth=1
	incq	%r15
	movslq	12(%rsp), %rax
	cmpq	%rax, %r15
	jl	.LBB1_41
.LBB1_44:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit57._crit_edge
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %edi
	addq	-24(%rax), %rdi
.Ltmp73:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp74:
# %bb.45:                               # %.noexc90
.Ltmp75:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp76:
# %bb.46:                               # %.noexc91
.Ltmp77:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp78:
# %bb.47:                               # %_ZNSolsEPFRSoS_E.exit59
	movq	40(%rsp), %rdi
.Ltmp79:
	callq	hipFree
.Ltmp80:
# %bb.48:
	movq	32(%rsp), %rdi
.Ltmp81:
	callq	hipFree
.Ltmp82:
# %bb.49:
	movq	56(%rsp), %rdi
.Ltmp83:
	callq	hipFree
.Ltmp84:
# %bb.50:
	movq	24(%rsp), %rdi
.Ltmp85:
	callq	hipFree
.Ltmp86:
# %bb.51:
	movq	48(%rsp), %rdi
.Ltmp87:
	callq	hipFree
.Ltmp88:
# %bb.52:
	xorl	%ebp, %ebp
	movq	16(%rsp), %rdi
.Ltmp89:
	callq	hipFree
.Ltmp90:
	jmp	.LBB1_53
.LBB1_21:
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp42:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp43:
.LBB1_26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit50
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp44:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp45:
# %bb.27:                               # %.noexc83
.Ltmp46:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp47:
# %bb.28:                               # %.noexc84
	movl	$-1, %ebp
.Ltmp48:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp49:
.LBB1_53:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB1_55
# %bb.54:
	callq	_ZdlPv
.LBB1_55:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit69
	movq	%rbx, %rdi
	callq	_ZdlPv
	movl	%ebp, %eax
	addq	$88, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_23:
	.cfi_def_cfa_offset 128
.Ltmp5:
	movq	%rax, %r15
	jmp	.LBB1_58
.LBB1_22:
.Ltmp2:
	movq	%rax, %r15
	jmp	.LBB1_60
.LBB1_24:
.Ltmp33:
	jmp	.LBB1_57
.LBB1_56:
.Ltmp28:
	jmp	.LBB1_57
.LBB1_29:
.Ltmp91:
	jmp	.LBB1_57
.LBB1_61:
.Ltmp72:
.LBB1_57:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit71
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB1_58:
	movq	64(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB1_60
# %bb.59:
	callq	_ZdlPv
.LBB1_60:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit75
	movq	%rbx, %rdi
	callq	_ZdlPv
	movq	%r15, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table1:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .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 .Ltmp4-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp6-.Ltmp4                  #   Call between .Ltmp4 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp27-.Ltmp6                 #   Call between .Ltmp6 and .Ltmp27
	.uleb128 .Ltmp28-.Lfunc_begin0          #     jumps to .Ltmp28
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp32-.Ltmp29                #   Call between .Ltmp29 and .Ltmp32
	.uleb128 .Ltmp33-.Lfunc_begin0          #     jumps to .Ltmp33
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp34-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp67-.Ltmp34                #   Call between .Ltmp34 and .Ltmp67
	.uleb128 .Ltmp91-.Lfunc_begin0          #     jumps to .Ltmp91
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp71-.Ltmp68                #   Call between .Ltmp68 and .Ltmp71
	.uleb128 .Ltmp72-.Lfunc_begin0          #     jumps to .Ltmp72
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp73-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp49-.Ltmp73                #   Call between .Ltmp73 and .Ltmp49
	.uleb128 .Ltmp91-.Lfunc_begin0          #     jumps to .Ltmp91
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Lfunc_end1-.Ltmp49            #   Call between .Ltmp49 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_ # -- Begin function _ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_,@function
_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_: # @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	leaq	(%rsi,%rdx,4), %rdx
.Ltmp92:
	callq	_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag
.Ltmp93:
# %bb.1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB2_2:
	.cfi_def_cfa_offset 32
.Ltmp94:
	movq	%rax, %r14
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB2_4
# %bb.3:
	callq	_ZdlPv
.LBB2_4:                                # %_ZNSt12_Vector_baseIiSaIiEED2Ev.exit
	movq	%r14, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_, .Lfunc_end2-_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_,"aG",@progbits,_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_,comdat
	.p2align	2, 0x0
GCC_except_table2:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp92-.Lfunc_begin1          # >> Call Site 1 <<
	.uleb128 .Ltmp93-.Ltmp92                #   Call between .Ltmp92 and .Ltmp93
	.uleb128 .Ltmp94-.Lfunc_begin1          #     jumps to .Ltmp94
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp93-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Lfunc_end2-.Ltmp93            #   Call between .Ltmp93 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB3_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB3_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB3_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB3_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end3:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end3-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag,"axG",@progbits,_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag,comdat
	.weak	_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag # -- Begin function _ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag,@function
_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag: # @_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	subq	%rsi, %r14
	movq	%r14, %r13
	sarq	$2, %r13
	movq	%r13, %rax
	shrq	$61, %rax
	jne	.LBB4_9
# %bb.1:                                # %_ZNSt6vectorIiSaIiEE17_S_check_init_lenEmRKS0_.exit
	movq	%rsi, %r15
	movq	%rdi, %rbx
	cmpq	%rsi, %rdx
	je	.LBB4_2
# %bb.3:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %r12
	jmp	.LBB4_4
.LBB4_2:
	xorl	%r12d, %r12d
.LBB4_4:                                # %_ZNSt12_Vector_baseIiSaIiEE11_M_allocateEm.exit
	movq	%r12, (%rbx)
	leaq	(%r12,%r13,4), %rax
	movq	%rax, 16(%rbx)
	cmpq	$5, %r14
	jl	.LBB4_6
# %bb.5:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB4_8:                                # %_ZSt22__uninitialized_copy_aIPKiPiiET0_T_S4_S3_RSaIT1_E.exit
	addq	%r14, %r12
	movq	%r12, 8(%rbx)
	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
.LBB4_6:
	.cfi_def_cfa_offset 48
	cmpq	$4, %r14
	jne	.LBB4_8
# %bb.7:
	movl	(%r15), %eax
	movl	%eax, (%r12)
	jmp	.LBB4_8
.LBB4_9:
	movl	$.L.str.4, %edi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end4:
	.size	_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag, .Lfunc_end4-_ZNSt6vectorIiSaIiEE19_M_range_initializeIPKiEEvT_S5_St20forward_iterator_tag
	.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	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z9bfsKernelPiS_S_S_S_S_, %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_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z9bfsKernelPiS_S_S_S_S_,@object # @_Z9bfsKernelPiS_S_S_S_S_
	.section	.rodata,"a",@progbits
	.globl	_Z9bfsKernelPiS_S_S_S_S_
	.p2align	3, 0x0
_Z9bfsKernelPiS_S_S_S_S_:
	.quad	_Z24__device_stub__bfsKernelPiS_S_S_S_S_
	.size	_Z9bfsKernelPiS_S_S_S_S_, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"CUDA error: "
	.size	.L.str, 13

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

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Frontier nodes: "
	.size	.L.str.2, 17

	.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	"cannot create std::vector larger than max_size()"
	.size	.L.str.4, 49

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z9bfsKernelPiS_S_S_S_S_"
	.size	.L__unnamed_1, 25

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

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z9bfsKernelPiS_S_S_S_S_ ; -- Begin function _Z9bfsKernelPiS_S_S_S_S_
	.globl	_Z9bfsKernelPiS_S_S_S_S_
	.p2align	8
	.type	_Z9bfsKernelPiS_S_S_S_S_,@function
_Z9bfsKernelPiS_S_S_S_S_:               ; @_Z9bfsKernelPiS_S_S_S_S_
; %bb.0:
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x20
	s_load_b32 s12, s[0:1], 0x3c
	s_waitcnt lgkmcnt(0)
	s_load_b32 s13, s[10:11], 0x0
	s_load_b256 s[0:7], s[0:1], 0x0
	s_and_b32 s12, s12, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s12, v[0:1]
	s_mov_b32 s12, exec_lo
	s_waitcnt lgkmcnt(0)
	v_cmpx_gt_i32_e64 s13, v1
	s_cbranch_execz .LBB0_2
; %bb.1:
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[1:2]
	v_lshrrev_b32_e32 v2, 27, v2
	v_add_nc_u32_e32 v2, v1, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v3, vcc_lo, s0, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s1, v4, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_and_b32_e32 v2, 0x3fffffe0, v2
	global_load_b32 v0, v[3:4], off
	v_sub_nc_u32_e32 v1, v1, v2
	v_lshlrev_b32_e32 v1, 2, v1
	s_waitcnt vmcnt(0)
	ds_store_b32 v1, v0
.LBB0_2:
	s_or_b32 exec_lo, exec_lo, s12
	v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v6, 1
	s_mov_b32 s14, 0
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
.LBB0_3:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	s_lshl_b32 s0, s14, 2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v0, s0
	ds_load_b32 v0, v0
	s_waitcnt lgkmcnt(0)
	v_cmp_lt_u32_e32 vcc_lo, 0x1ff, v0
	s_cbranch_vccnz .LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	v_lshlrev_b64 v[2:3], 2, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s8, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v3, vcc_lo
	global_load_b64 v[4:5], v[2:3], off
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s0, v4
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ge_i32_e32 vcc_lo, s0, v5
	s_cbranch_vccnz .LBB0_11
; %bb.5:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_ashr_i32 s1, s0, 31
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[12:13], s[0:1], 2
	s_add_u32 s12, s6, s12
	s_addc_u32 s13, s7, s13
.LBB0_6:                                ; %.lr.ph
                                        ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b32 v4, v1, s[12:13]
	s_mov_b32 s1, exec_lo
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v5, 31, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[7:8], 2, v[4:5]
	v_add_co_u32 v7, vcc_lo, s4, v7
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v8, vcc_lo
	global_atomic_swap_b32 v0, v[7:8], v6, off glc
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	s_mov_b32 s16, exec_lo
	s_mov_b32 s15, exec_lo
	v_mbcnt_lo_u32_b32 v0, s16, 0
                                        ; implicit-def: $vgpr5
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	s_bcnt1_i32_b32 s16, s16
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mov_b32_e32 v5, s16
	global_atomic_add_u32 v5, v1, v5, s[10:11] glc
.LBB0_9:                                ;   in Loop: Header=BB0_6 Depth=2
	s_or_b32 exec_lo, exec_lo, s15
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s15, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v7, s15, v0
	v_ashrrev_i32_e32 v8, 31, v7
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[7:8], 2, v[7:8]
	v_add_co_u32 v7, vcc_lo, s2, v7
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v8, vcc_lo, s3, v8, vcc_lo
	global_store_b32 v[7:8], v4, off
.LBB0_10:                               ; %Flow
                                        ;   in Loop: Header=BB0_6 Depth=2
	s_or_b32 exec_lo, exec_lo, s1
	global_load_b32 v0, v[2:3], off offset:4
	s_add_i32 s0, s0, 1
	s_add_u32 s12, s12, 4
	s_addc_u32 s13, s13, 0
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, s0, v0
	s_cbranch_vccnz .LBB0_6
.LBB0_11:                               ; %.loopexit
                                        ;   in Loop: Header=BB0_3 Depth=1
	s_add_i32 s14, s14, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s14, 32
	s_cbranch_scc0 .LBB0_3
; %bb.12:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z9bfsKernelPiS_S_S_S_S_
		.amdhsa_group_segment_fixed_size 128
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.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 9
		.amdhsa_next_free_sgpr 17
		.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	_Z9bfsKernelPiS_S_S_S_S_, .Lfunc_end0-_Z9bfsKernelPiS_S_S_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 540
; NumSgprs: 19
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 128 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 19
; NumVGPRsForWavesPerEU: 9
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 128
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z9bfsKernelPiS_S_S_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     19
    .sgpr_spill_count: 0
    .symbol:         _Z9bfsKernelPiS_S_S_S_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
