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

// Graph represented as an adjacency list
#define NUM_NODES 64
#define MAX_EDGES 10 // Assuming no node has more than 10 edges

__device__ int graph[NUM_NODES][MAX_EDGES];
__device__ int graph_size[NUM_NODES];
__device__ int colors[NUM_NODES];

// Kernel to perform graph coloring
__global__ void graphColoringKernel(int numNodes) {
    int tid = threadIdx.x + blockIdx.x * blockDim.x;
    if (tid >= numNodes) return;

    // Each thread tries to assign a color to its node
    int node = tid;
    bool validColor = false;
    int color = 0;

    while (!validColor) {
        validColor = true;
        for (int i = 0; i < graph_size[node]; i++) {
            int neighbor = graph[node][i];
            if (colors[neighbor] == color) {
                validColor = false;
                break;
            }
        }
        if (!validColor) color++;
    }

    colors[node] = color;
}

int main() {
    // Initialize graph with random edges (for demonstration purposes)
    std::vector<std::vector<int>> h_graph(NUM_NODES);
    std::vector<int> h_graph_size(NUM_NODES, 0);
    std::vector<int> h_colors(NUM_NODES, -1);

    // Randomly generate edges for each node
    for (int i = 0; i < NUM_NODES; i++) {
        int numEdges = rand() % MAX_EDGES;
        for (int j = 0; j < numEdges; j++) {
            int neighbor = rand() % NUM_NODES;
            if (neighbor != i) { // No self-loops
                h_graph[i].push_back(neighbor);
                h_graph_size[i]++;
            }
        }
    }

    // Allocate and copy data to device
    int *d_graph, *d_graph_size, *d_colors;
    cudaError_t err;

    err = cudaMalloc(&d_graph, NUM_NODES * MAX_EDGES * sizeof(int));
    if (err != cudaSuccess) {
        std::cerr << "Error allocating memory for graph: " << cudaGetErrorString(err) << std::endl;
        return -1;
    }

    err = cudaMalloc(&d_graph_size, NUM_NODES * sizeof(int));
    if (err != cudaSuccess) {
        std::cerr << "Error allocating memory for graph sizes: " << cudaGetErrorString(err) << std::endl;
        return -1;
    }

    err = cudaMalloc(&d_colors, NUM_NODES * sizeof(int));
    if (err != cudaSuccess) {
        std::cerr << "Error allocating memory for colors: " << cudaGetErrorString(err) << std::endl;
        return -1;
    }

    // Copy graph data to device
    for (int i = 0; i < NUM_NODES; i++) {
        cudaMemcpy(d_graph + i * MAX_EDGES, h_graph[i].data(), h_graph_size[i] * sizeof(int), cudaMemcpyHostToDevice);
    }
    cudaMemcpy(d_graph_size, h_graph_size.data(), NUM_NODES * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(d_colors, h_colors.data(), NUM_NODES * sizeof(int), cudaMemcpyHostToDevice);

    // Launch kernel
    int threadsPerBlock = 256;
    int blocksPerGrid = (NUM_NODES + threadsPerBlock - 1) / threadsPerBlock;
    graphColoringKernel<<<blocksPerGrid, threadsPerBlock>>>(NUM_NODES);

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

    // Copy results back to host
    cudaMemcpy(h_colors.data(), d_colors, NUM_NODES * sizeof(int), cudaMemcpyDeviceToHost);

    // Print the colors assigned to each node
    std::cout << "Colors assigned to nodes:\n";
    for (int i = 0; i < NUM_NODES; i++) {
        std::cout << "Node " << i << ": Color " << h_colors[i] << "\n";
    }

    // Free device memory
    cudaFree(d_graph);
    cudaFree(d_graph_size);
    cudaFree(d_colors);

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

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4001:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4001:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z38__device_stub__Z19graphColoringKernelii
	.type	_Z38__device_stub__Z19graphColoringKernelii, @function
_Z38__device_stub__Z19graphColoringKernelii:
.LFB4023:
	.cfi_startproc
	endbr64
	subq	$104, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 12(%rsp)
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	44(%rsp), %rsi
	leaq	32(%rsp), %rdi
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rax
	movl	$1, 40(%rsp)
	movq	%rax, 80(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	movq	%rax, 44(%rsp)
	movl	$1, 52(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L2
	pushq	24(%rsp)
	.cfi_def_cfa_offset 120
	leaq	_Z19graphColoringKerneli(%rip), %rdi
	pushq	24(%rsp)
	.cfi_def_cfa_offset 128
	movq	60(%rsp), %rcx
	movl	68(%rsp), %r8d
	movq	48(%rsp), %rsi
	movl	56(%rsp), %edx
	leaq	96(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 120
	popq	%rdx
	.cfi_def_cfa_offset 112
.L2:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$104, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4023:
	.size	_Z38__device_stub__Z19graphColoringKernelii, .-_Z38__device_stub__Z19graphColoringKernelii
	.globl	_Z19graphColoringKerneli
	.type	_Z19graphColoringKerneli, @function
_Z19graphColoringKerneli:
.LFB4024:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z19graphColoringKernelii
	.cfi_endproc
.LFE4024:
	.size	_Z19graphColoringKerneli, .-_Z19graphColoringKerneli
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"_Z19graphColoringKerneli"
.LC1:
	.string	"graph"
.LC2:
	.string	"graph_size"
.LC3:
	.string	"colors"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4026:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z19graphColoringKerneli(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdx
	movl	$2560, %r9d
	leaq	_ZL5graph(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	call	__cudaRegisterVar@PLT
	popq	%rax
	.cfi_def_cfa_offset 24
	popq	%rdx
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC2(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movq	%rdx, %rcx
	movl	$256, %r9d
	leaq	_ZL10graph_size(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rcx
	.cfi_def_cfa_offset 24
	popq	%rsi
	.cfi_def_cfa_offset 16
	pushq	$0
	.cfi_def_cfa_offset 24
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC3(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movl	$256, %r9d
	movq	%rdx, %rcx
	leaq	_ZL6colors(%rip), %rsi
	call	__cudaRegisterVar@PLT
	popq	%rdi
	.cfi_def_cfa_offset 24
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	popq	%r8
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4026:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4348:
	.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
.LFE4348:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev, @function
_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev:
.LFB4336:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	8(%rdi), %r12
	movq	%rdi, %rbx
	movq	(%rdi), %rbp
.L13:
	cmpq	%rbp, %r12
	je	.L17
	movq	%rbp, %rdi
	addq	$24, %rbp
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L13
.L17:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L12
	movq	16(%rbx), %rsi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	subq	%rdi, %rsi
	jmp	_ZdlPvm@PLT
.L12:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4336:
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev, .-_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev
	.set	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev,_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.section	.rodata._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC4:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, @function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_:
.LFB4539:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L19
	leaq	.LC4(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L19:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L29
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L24
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L23
.L29:
	movq	%rcx, %rbx
.L23:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L24:
	movl	(%rdx), %eax
	movl	%eax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L25
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L25:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L26
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L26:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L27
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L27:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %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
.LFE4539:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.section	.rodata.str1.1
.LC5:
	.string	"Error allocating memory for graph: "
.LC6:
	.string	"Error allocating memory for graph sizes: "
.LC7:
	.string	"Error allocating memory for colors: "
.LC8:
	.string	"Kernel launch error: "
.LC9:
	.string	"Colors assigned to nodes:\n"
.LC10:
	.string	"Node "
.LC11:
	.string	": Color "
.LC12:
	.string	"\n"
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1536, %edi
	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	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
.LEHB0:
	call	_Znwm@PLT
.LEHE0:
	leaq	1536(%rax), %rdx
	movq	%rax, 64(%rsp)
	movq	%rax, %r12
	movq	%rdx, 80(%rsp)
.L37:
	xorl	%edi, %edi
	addq	$24, %rax
	movq	%rdi, -24(%rax)
	movq	%rdi, -16(%rax)
	movq	%rdi, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L37
	xorl	%esi, %esi
	movl	$256, %edi
	movq	%rdx, 72(%rsp)
	movq	%rsi, 96(%rsp)
	movq	%rsi, 104(%rsp)
.LEHB1:
	call	_Znwm@PLT
.LEHE1:
	leaq	256(%rax), %rdx
	movq	%rax, 88(%rsp)
	movq	%rax, %rbx
	xorl	%eax, %eax
	movq	%rdx, 104(%rsp)
.L38:
	xorl	%ecx, %ecx
	movl	%ecx, (%rbx,%rax)
	addq	$4, %rax
	cmpq	$256, %rax
	jne	.L38
	xorl	%eax, %eax
	movl	$256, %edi
	movq	%rdx, 96(%rsp)
	movq	%rax, 120(%rsp)
	movq	%rax, 128(%rsp)
.LEHB2:
	call	_Znwm@PLT
.LEHE2:
	leaq	256(%rax), %rdx
	movq	%rax, 112(%rsp)
	movq	%rax, %rbp
	xorl	%eax, %eax
	movq	%rdx, 128(%rsp)
.L39:
	movl	$-1, 0(%rbp,%rax)
	addq	$4, %rax
	cmpq	$256, %rax
	jne	.L39
	movq	%rdx, 120(%rsp)
	movq	%r12, %r14
	xorl	%r13d, %r13d
.L45:
	call	rand@PLT
	movl	$10, %ecx
	xorl	%r15d, %r15d
	cltd
	idivl	%ecx
	movl	%edx, 12(%rsp)
.L40:
	movl	12(%rsp), %eax
	cmpl	%eax, %r15d
	jge	.L91
	call	rand@PLT
	movl	$64, %ecx
	cltd
	idivl	%ecx
	movl	%edx, 52(%rsp)
	cmpl	%r13d, %edx
	je	.L41
	movq	8(%r14), %rsi
	cmpq	16(%r14), %rsi
	je	.L42
	movl	%edx, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 8(%r14)
	jmp	.L43
.L42:
	leaq	52(%rsp), %rdx
	movq	%r14, %rdi
.LEHB3:
	call	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.L43:
	incl	(%rbx,%r13,4)
.L41:
	incl	%r15d
	jmp	.L40
.L91:
	incq	%r13
	addq	$24, %r14
	cmpq	$64, %r13
	jne	.L45
	leaq	16(%rsp), %rdi
	movl	$2560, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	testl	%eax, %eax
	je	.L46
	leaq	.LC5(%rip), %rsi
.L90:
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rbx
	movl	%r13d, %edi
.L86:
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbx, %rdi
.L84:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	orl	$-1, %ebx
	jmp	.L47
.L46:
	leaq	24(%rsp), %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r13d
	leaq	.LC6(%rip), %rsi
	testl	%eax, %eax
	jne	.L90
	leaq	32(%rsp), %rdi
	movl	$256, %esi
	call	cudaMalloc@PLT
	movl	%eax, %r14d
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	.L50
	leaq	.LC7(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rbx
	movl	%r14d, %edi
	jmp	.L86
.L93:
	incq	%r13
	cmpq	$64, %r13
	je	.L92
.L50:
	imulq	$24, %r13, %rax
	movslq	(%rbx,%r13,4), %rdx
	movl	$1, %ecx
	imulq	$40, %r13, %rdi
	addq	16(%rsp), %rdi
	salq	$2, %rdx
	movq	(%r12,%rax), %rsi
	call	cudaMemcpy@PLT
	jmp	.L93
.L92:
	movq	24(%rsp), %rdi
	movl	$1, %ecx
	movl	$256, %edx
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movq	32(%rsp), %rdi
	movl	$1, %ecx
	movl	$256, %edx
	movq	%rbp, %rsi
	call	cudaMemcpy@PLT
	movl	$16777217, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	salq	$8, %rdx
	movl	$1, %esi
	movabsq	$4294967297, %rdi
	movl	$1, 60(%rsp)
	movq	%rdx, 52(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	je	.L51
.L53:
	call	cudaGetLastError@PLT
	movl	%eax, %ebx
	testl	%eax, %eax
	je	.L54
	jmp	.L94
.L51:
	movl	$64, %edi
	call	_Z38__device_stub__Z19graphColoringKernelii
	jmp	.L53
.L94:
	leaq	.LC8(%rip), %rsi
	leaq	_ZSt4cerr(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%ebx, %edi
	movq	%rax, %rbp
	call	cudaGetErrorString@PLT
	movq	%rax, %rsi
	movq	%rbp, %rdi
	jmp	.L84
.L54:
	movq	32(%rsp), %rsi
	movl	$2, %ecx
	movl	$256, %edx
	movq	%rbp, %rdi
	call	cudaMemcpy@PLT
	leaq	_ZSt4cout(%rip), %r12
	leaq	.LC9(%rip), %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%ebx, %ebx
	leaq	.LC10(%rip), %r13
.L55:
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	%ebx, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC11(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	0(%rbp,%rbx,4), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC12(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	incq	%rbx
	cmpq	$64, %rbx
	jne	.L55
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	24(%rsp), %rdi
	call	cudaFree@PLT
	movq	32(%rsp), %rdi
	call	cudaFree@PLT
.LEHE3:
	xorl	%ebx, %ebx
.L47:
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	88(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	leaq	64(%rsp), %rdi
	call	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L60
	jmp	.L74
.L64:
	endbr64
	movq	%rax, %rbx
.L56:
	leaq	112(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L57
.L63:
	endbr64
	movq	%rax, %rbx
.L57:
	leaq	88(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L58
.L62:
	endbr64
	movq	%rax, %rbx
.L58:
	leaq	64(%rsp), %rdi
	call	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	movq	%rbx, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
.L74:
	call	__stack_chk_fail@PLT
.L60:
	addq	$152, %rsp
	.cfi_def_cfa_offset 56
	movl	%ebx, %eax
	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
.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 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3998
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L62-.LFB3998
	.uleb128 0
	.uleb128 .LEHB2-.LFB3998
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L63-.LFB3998
	.uleb128 0
	.uleb128 .LEHB3-.LFB3998
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L64-.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
	.local	_ZL6colors
	.comm	_ZL6colors,256,32
	.local	_ZL10graph_size
	.comm	_ZL10graph_size,256,32
	.local	_ZL5graph
	.comm	_ZL5graph,2560,32
	.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 <hip/hip_runtime.h>
#include <vector>

// Graph represented as an adjacency list
#define NUM_NODES 64
#define MAX_EDGES 10 // Assuming no node has more than 10 edges

__device__ int graph[NUM_NODES][MAX_EDGES];
__device__ int graph_size[NUM_NODES];
__device__ int colors[NUM_NODES];

// Kernel to perform graph coloring
__global__ void graphColoringKernel(int numNodes) {
    int tid = threadIdx.x + blockIdx.x * blockDim.x;
    if (tid >= numNodes) return;

    // Each thread tries to assign a color to its node
    int node = tid;
    bool validColor = false;
    int color = 0;

    while (!validColor) {
        validColor = true;
        for (int i = 0; i < graph_size[node]; i++) {
            int neighbor = graph[node][i];
            if (colors[neighbor] == color) {
                validColor = false;
                break;
            }
        }
        if (!validColor) color++;
    }

    colors[node] = color;
}

int main() {
    // Initialize graph with random edges (for demonstration purposes)
    std::vector<std::vector<int>> h_graph(NUM_NODES);
    std::vector<int> h_graph_size(NUM_NODES, 0);
    std::vector<int> h_colors(NUM_NODES, -1);

    // Randomly generate edges for each node
    for (int i = 0; i < NUM_NODES; i++) {
        int numEdges = rand() % MAX_EDGES;
        for (int j = 0; j < numEdges; j++) {
            int neighbor = rand() % NUM_NODES;
            if (neighbor != i) { // No self-loops
                h_graph[i].push_back(neighbor);
                h_graph_size[i]++;
            }
        }
    }

    // Allocate and copy data to device
    int *d_graph, *d_graph_size, *d_colors;
    hipError_t err;

    err = hipMalloc(&d_graph, NUM_NODES * MAX_EDGES * sizeof(int));
    if (err != hipSuccess) {
        std::cerr << "Error allocating memory for graph: " << hipGetErrorString(err) << std::endl;
        return -1;
    }

    err = hipMalloc(&d_graph_size, NUM_NODES * sizeof(int));
    if (err != hipSuccess) {
        std::cerr << "Error allocating memory for graph sizes: " << hipGetErrorString(err) << std::endl;
        return -1;
    }

    err = hipMalloc(&d_colors, NUM_NODES * sizeof(int));
    if (err != hipSuccess) {
        std::cerr << "Error allocating memory for colors: " << hipGetErrorString(err) << std::endl;
        return -1;
    }

    // Copy graph data to device
    for (int i = 0; i < NUM_NODES; i++) {
        hipMemcpy(d_graph + i * MAX_EDGES, h_graph[i].data(), h_graph_size[i] * sizeof(int), hipMemcpyHostToDevice);
    }
    hipMemcpy(d_graph_size, h_graph_size.data(), NUM_NODES * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(d_colors, h_colors.data(), NUM_NODES * sizeof(int), hipMemcpyHostToDevice);

    // Launch kernel
    int threadsPerBlock = 256;
    int blocksPerGrid = (NUM_NODES + threadsPerBlock - 1) / threadsPerBlock;
    graphColoringKernel<<<blocksPerGrid, threadsPerBlock>>>(NUM_NODES);

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

    // Copy results back to host
    hipMemcpy(h_colors.data(), d_colors, NUM_NODES * sizeof(int), hipMemcpyDeviceToHost);

    // Print the colors assigned to each node
    std::cout << "Colors assigned to nodes:\n";
    for (int i = 0; i < NUM_NODES; i++) {
        std::cout << "Node " << i << ": Color " << h_colors[i] << "\n";
    }

    // Free device memory
    hipFree(d_graph);
    hipFree(d_graph_size);
    hipFree(d_colors);

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

                                        # End of file scope inline assembly
	.globl	_Z34__device_stub__graphColoringKerneli # -- Begin function _Z34__device_stub__graphColoringKerneli
	.type	_Z34__device_stub__graphColoringKerneli,@function
_Z34__device_stub__graphColoringKerneli: # @_Z34__device_stub__graphColoringKerneli
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$80, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	12(%rsp), %rax
	movl	%edi, (%rax)
	leaq	16(%rsp), %rbx
	movq	%rax, (%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	40(%rsp), %r12
	leaq	32(%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	$_Z19graphColoringKerneli, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$96, %rsp
	.cfi_adjust_cfa_offset -96
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z34__device_stub__graphColoringKerneli, .Lfunc_end0-_Z34__device_stub__graphColoringKerneli
	.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	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	$1536, %edi                     # imm = 0x600
	callq	_Znwm
	movq	%rax, 32(%rsp)
	leaq	1536(%rax), %rbx
	movq	%rbx, 48(%rsp)
	movl	$1536, %edx                     # imm = 0x600
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movq	%rbx, 40(%rsp)
.Ltmp0:
	movl	$256, %edi                      # imm = 0x100
	callq	_Znwm
.Ltmp1:
# %bb.1:                                # %.lr.ph.i.i.i.i.i.i.i.i.i.preheader
	movq	%rax, %rbx
	movl	$256, %edx                      # imm = 0x100
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
.Ltmp3:
	movl	$256, %edi                      # imm = 0x100
	callq	_Znwm
.Ltmp4:
# %bb.2:                                # %.lr.ph.i.i.i.i.i.i.i.i.i62.preheader
	movq	%rax, %r14
	movl	$256, %edx                      # imm = 0x100
	movq	%rax, %rdi
	movl	$255, %esi
	callq	memset@PLT
	xorl	%r12d, %r12d
	leaq	8(%rsp), %r15
.LBB1_3:                                # %_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_.exit66.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_11 Depth 2
	callq	rand
	movslq	%eax, %r13
	imulq	$1717986919, %r13, %rax         # imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
	subl	%eax, %r13d
	testl	%r13d, %r13d
	jle	.LBB1_4
.LBB1_11:                               #   Parent Loop BB1_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
                                        # kill: def $eax killed $eax def $rax
	leal	63(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-64, %ecx
	subl	%ecx, %eax
	movl	%eax, 8(%rsp)
	cmpq	%rax, %r12
	je	.LBB1_16
# %bb.12:                               #   in Loop: Header=BB1_11 Depth=2
	movq	32(%rsp), %rcx
	leaq	(%r12,%r12,2), %rdx
	leaq	(%rcx,%rdx,8), %rdi
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.LBB1_14
# %bb.13:                               #   in Loop: Header=BB1_11 Depth=2
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 8(%rdi)
	jmp	.LBB1_15
.LBB1_14:                               #   in Loop: Header=BB1_11 Depth=2
.Ltmp6:
	movq	%r15, %rdx
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp7:
.LBB1_15:                               # %_ZNSt6vectorIiSaIiEE9push_backERKi.exit
                                        #   in Loop: Header=BB1_11 Depth=2
	incl	(%rbx,%r12,4)
.LBB1_16:                               #   in Loop: Header=BB1_11 Depth=2
	decl	%r13d
	jne	.LBB1_11
.LBB1_4:                                # %_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_.exit66
                                        #   in Loop: Header=BB1_3 Depth=1
	incq	%r12
	cmpq	$64, %r12
	jne	.LBB1_3
# %bb.5:
.Ltmp9:
	leaq	8(%rsp), %rdi
	movl	$2560, %esi                     # imm = 0xA00
	callq	hipMalloc
.Ltmp10:
# %bb.6:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_17
# %bb.7:
.Ltmp11:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str, %esi
	movl	$35, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp12:
# %bb.8:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp13:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp14:
	jmp	.LBB1_39
.LBB1_17:
.Ltmp15:
	leaq	24(%rsp), %rdi
	movl	$256, %esi                      # imm = 0x100
	callq	hipMalloc
.Ltmp16:
# %bb.18:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit76
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_21
# %bb.19:
.Ltmp17:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.1, %esi
	movl	$41, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp18:
# %bb.20:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit78
.Ltmp19:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp20:
	jmp	.LBB1_39
.LBB1_21:
.Ltmp21:
	leaq	16(%rsp), %rdi
	movl	$256, %esi                      # imm = 0x100
	callq	hipMalloc
.Ltmp22:
# %bb.22:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit86
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_23
# %bb.37:
.Ltmp23:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.2, %esi
	movl	$36, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp24:
# %bb.38:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit88
.Ltmp25:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp26:
.LBB1_39:
	movq	%rax, %r15
	testq	%rax, %rax
	je	.LBB1_40
# %bb.41:                               # %.invoke
	movq	%r15, %rdi
	callq	strlen
.Ltmp27:
	movl	$_ZSt4cerr, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp28:
	jmp	.LBB1_42
.LBB1_40:                               # %.invoke170
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp29:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp30:
.LBB1_42:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit92.invoke
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp31:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp32:
# %bb.43:                               # %.noexc128.invoke
.Ltmp33:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp34:
# %bb.44:                               # %.noexc129.invoke
	movl	$-1, %ebp
.Ltmp35:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp36:
.LBB1_63:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit112
	movq	%r14, %rdi
	callq	_ZdlPv
	movq	%rbx, %rdi
	callq	_ZdlPv
	leaq	32(%rsp), %rdi
	callq	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	movl	%ebp, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB1_23:                               # %.preheader.preheader
	.cfi_def_cfa_offset 112
	xorl	%r15d, %r15d
	movq	%rbx, %r12
	xorl	%r13d, %r13d
.LBB1_24:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	8(%rsp), %rdi
	addq	%r13, %rdi
	movq	32(%rsp), %rax
	movq	(%rax,%r15,4), %rsi
	movslq	(%r12), %rdx
	shlq	$2, %rdx
.Ltmp37:
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp38:
# %bb.25:                               #   in Loop: Header=BB1_24 Depth=1
	addq	$40, %r13
	addq	$6, %r15
	addq	$4, %r12
	cmpq	$384, %r15                      # imm = 0x180
	jne	.LBB1_24
# %bb.26:
	movq	24(%rsp), %rdi
.Ltmp40:
	movl	$256, %edx                      # imm = 0x100
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp41:
# %bb.27:
	movq	16(%rsp), %rdi
.Ltmp42:
	movl	$256, %edx                      # imm = 0x100
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp43:
# %bb.28:
.Ltmp45:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294967552, %rdx               # imm = 0x100000100
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp46:
# %bb.29:
	testl	%eax, %eax
	jne	.LBB1_31
# %bb.30:
.Ltmp47:
	movl	$64, %edi
	callq	_Z34__device_stub__graphColoringKerneli
.Ltmp48:
.LBB1_31:
.Ltmp49:
	callq	hipGetLastError
.Ltmp50:
# %bb.32:
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.LBB1_51
# %bb.33:
.Ltmp51:
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.3, %esi
	movl	$21, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp52:
# %bb.34:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit96
.Ltmp53:
	movl	%ebp, %edi
	callq	hipGetErrorString
.Ltmp54:
# %bb.35:
	movq	%rax, %r15
	testq	%rax, %rax
	je	.LBB1_36
# %bb.47:
	movq	%r15, %rdi
	callq	strlen
.Ltmp55:
	movl	$_ZSt4cerr, %edi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp56:
	jmp	.LBB1_48
.LBB1_51:
	movq	16(%rsp), %rsi
.Ltmp65:
	movl	$256, %edx                      # imm = 0x100
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp66:
# %bb.52:
.Ltmp67:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$26, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp68:
# %bb.53:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit104.preheader.preheader
	xorl	%r15d, %r15d
.LBB1_54:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit104.preheader
                                        # =>This Inner Loop Header: Depth=1
.Ltmp69:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.5, %esi
	movl	$5, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp70:
# %bb.55:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit106
                                        #   in Loop: Header=BB1_54 Depth=1
.Ltmp71:
	movl	$_ZSt4cout, %edi
	movl	%r15d, %esi
	callq	_ZNSolsEi
.Ltmp72:
# %bb.56:                               #   in Loop: Header=BB1_54 Depth=1
.Ltmp73:
	movq	%rax, %r12
	movl	$.L.str.6, %esi
	movl	$8, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp74:
# %bb.57:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit108
                                        #   in Loop: Header=BB1_54 Depth=1
	movl	(%r14,%r15,4), %esi
.Ltmp75:
	movq	%r12, %rdi
	callq	_ZNSolsEi
.Ltmp76:
# %bb.58:                               #   in Loop: Header=BB1_54 Depth=1
.Ltmp77:
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp78:
# %bb.59:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit110
                                        #   in Loop: Header=BB1_54 Depth=1
	incq	%r15
	cmpq	$64, %r15
	jne	.LBB1_54
# %bb.60:
	movq	8(%rsp), %rdi
.Ltmp80:
	callq	hipFree
.Ltmp81:
# %bb.61:
	movq	24(%rsp), %rdi
.Ltmp82:
	callq	hipFree
.Ltmp83:
# %bb.62:
	xorl	%ebp, %ebp
	movq	16(%rsp), %rdi
.Ltmp84:
	callq	hipFree
.Ltmp85:
	jmp	.LBB1_63
.LBB1_36:
	movq	_ZSt4cerr(%rip), %rax
	movq	-24(%rax), %rax
	leaq	_ZSt4cerr(%rax), %rdi
	movl	32(%rdi), %esi
	orl	$1, %esi
.Ltmp57:
	callq	_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
.Ltmp58:
.LBB1_48:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit100
	movq	_ZSt4cerr(%rip), %rax
	movl	$_ZSt4cerr, %edi
	addq	-24(%rax), %rdi
.Ltmp59:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp60:
# %bb.49:                               # %.noexc132
.Ltmp61:
	movsbl	%al, %esi
	movl	$_ZSt4cerr, %edi
	callq	_ZNSo3putEc
.Ltmp62:
# %bb.50:                               # %.noexc133
	movl	$-1, %ebp
.Ltmp63:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp64:
	jmp	.LBB1_63
.LBB1_46:
.Ltmp86:
	jmp	.LBB1_65
.LBB1_10:
.Ltmp5:
	movq	%rax, %r15
	jmp	.LBB1_66
.LBB1_9:
.Ltmp2:
	movq	%rax, %r15
	jmp	.LBB1_67
.LBB1_45:
.Ltmp39:
	jmp	.LBB1_65
.LBB1_69:
.Ltmp79:
	jmp	.LBB1_65
.LBB1_64:
.Ltmp44:
	jmp	.LBB1_65
.LBB1_68:
.Ltmp8:
.LBB1_65:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit114
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_ZdlPv
.LBB1_66:                               # %_ZNSt6vectorIiSaIiEED2Ev.exit116
	movq	%rbx, %rdi
	callq	_ZdlPv
.LBB1_67:
	leaq	32(%rsp), %rdi
	callq	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	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 .Ltmp1-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp3-.Ltmp1                  #   Call between .Ltmp1 and .Ltmp3
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 4 <<
	.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 5 <<
	.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 6 <<
	.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 7 <<
	.uleb128 .Ltmp36-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp36
	.uleb128 .Ltmp44-.Lfunc_begin0          #     jumps to .Ltmp44
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp37-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Ltmp38-.Ltmp37                #   Call between .Ltmp37 and .Ltmp38
	.uleb128 .Ltmp39-.Lfunc_begin0          #     jumps to .Ltmp39
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp40-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp43-.Ltmp40                #   Call between .Ltmp40 and .Ltmp43
	.uleb128 .Ltmp44-.Lfunc_begin0          #     jumps to .Ltmp44
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp68-.Ltmp45                #   Call between .Ltmp45 and .Ltmp68
	.uleb128 .Ltmp86-.Lfunc_begin0          #     jumps to .Ltmp86
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp69-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp78-.Ltmp69                #   Call between .Ltmp69 and .Ltmp78
	.uleb128 .Ltmp79-.Lfunc_begin0          #     jumps to .Ltmp79
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp80-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp64-.Ltmp80                #   Call between .Ltmp80 and .Ltmp64
	.uleb128 .Ltmp86-.Lfunc_begin0          #     jumps to .Ltmp86
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp64-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Lfunc_end1-.Ltmp64            #   Call between .Ltmp64 and .Lfunc_end1
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,comdat
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev # -- Begin function _ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.p2align	1, 0x90
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,@function
_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev:    # @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.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	(%rdi), %rbx
	movq	8(%rdi), %r15
	cmpq	%r15, %rbx
	je	.LBB2_6
# %bb.1:                                # %.lr.ph.i.i.i.preheader
	movq	%rdi, %r14
.LBB2_2:                                # %.lr.ph.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB2_4
# %bb.3:                                #   in Loop: Header=BB2_2 Depth=1
	callq	_ZdlPv
.LBB2_4:                                # %_ZSt8_DestroyISt6vectorIiSaIiEEEvPT_.exit.i.i.i
                                        #   in Loop: Header=BB2_2 Depth=1
	addq	$24, %rbx
	cmpq	%r15, %rbx
	jne	.LBB2_2
# %bb.5:                                # %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exitthread-pre-split
	movq	(%r14), %rbx
.LBB2_6:                                # %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit
	testq	%rbx, %rbx
	je	.LBB2_7
# %bb.8:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.LBB2_7:                                # %_ZNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EED2Ev.exit
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev, .Lfunc_end2-_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.cfi_endproc
                                        # -- 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._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_ # -- Begin function _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,@function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_: # @_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.9, %edx
	callq	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB4_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB4_3
.LBB4_1:
	xorl	%ebp, %ebp
.LBB4_3:                                # %_ZNSt12_Vector_baseIiSaIiEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB4_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB4_5:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB4_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB4_7:                                # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB4_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB4_9:                                # %_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPim.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .Lfunc_end4-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB5_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB5_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end5:
	.size	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc, .Lfunc_end5-_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	subq	$32, %rsp
	.cfi_adjust_cfa_offset 32
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z19graphColoringKerneli, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	addq	$32, %rsp
	.cfi_adjust_cfa_offset -32
	movl	$graph, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movl	$2560, %r9d                     # imm = 0xA00
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$graph_size, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movl	$256, %r9d                      # imm = 0x100
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$colors, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movl	$256, %r9d                      # imm = 0x100
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	pushq	$0
	.cfi_adjust_cfa_offset 8
	pushq	$0
	.cfi_adjust_cfa_offset 8
	callq	__hipRegisterVar
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	$__hip_module_dtor, %edi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB7_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	graph,@object                   # @graph
	.local	graph
	.comm	graph,2560,16
	.type	graph_size,@object              # @graph_size
	.local	graph_size
	.comm	graph_size,256,16
	.type	colors,@object                  # @colors
	.local	colors
	.comm	colors,256,16
	.type	_Z19graphColoringKerneli,@object # @_Z19graphColoringKerneli
	.section	.rodata,"a",@progbits
	.globl	_Z19graphColoringKerneli
	.p2align	3, 0x0
_Z19graphColoringKerneli:
	.quad	_Z34__device_stub__graphColoringKerneli
	.size	_Z19graphColoringKerneli, 8

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Error allocating memory for graph: "
	.size	.L.str, 36

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Error allocating memory for graph sizes: "
	.size	.L.str.1, 42

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Error allocating memory for colors: "
	.size	.L.str.2, 37

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Kernel launch error: "
	.size	.L.str.3, 22

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Colors assigned to nodes:\n"
	.size	.L.str.4, 27

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"Node "
	.size	.L.str.5, 6

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	": Color "
	.size	.L.str.6, 9

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"\n"
	.size	.L.str.7, 2

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.9, 26

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"graph"
	.size	.L__unnamed_2, 6

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"graph_size"
	.size	.L__unnamed_3, 11

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"colors"
	.size	.L__unnamed_4, 7

	.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 _Z34__device_stub__graphColoringKerneli
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym graph
	.addrsig_sym graph_size
	.addrsig_sym colors
	.addrsig_sym _Z19graphColoringKerneli
	.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	_Z19graphColoringKerneli ; -- Begin function _Z19graphColoringKerneli
	.globl	_Z19graphColoringKerneli
	.p2align	8
	.type	_Z19graphColoringKerneli,@function
_Z19graphColoringKerneli:               ; @_Z19graphColoringKerneli
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x14
	s_load_b32 s0, s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s1, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[6:7], null, s15, s1, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s0, v6
	s_and_saveexec_b32 s0, vcc_lo
	s_cbranch_execz .LBB0_12
; %bb.1:                                ; %.preheader23
	v_ashrrev_i32_e32 v7, 31, v6
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, graph_size@rel32@lo+4
	s_addc_u32 s1, s1, graph_size@rel32@hi+12
	v_mov_b32_e32 v9, 0
	v_lshlrev_b64 v[0:1], 2, v[6:7]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, v0, s0
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v1, vcc_lo
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, graph@rel32@lo+4
	s_addc_u32 s1, s1, graph@rel32@hi+12
	s_getpc_b64 s[2:3]
	s_add_u32 s2, s2, graph@rel32@lo+8
	s_addc_u32 s3, s3, graph@rel32@hi+16
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_i64_i32 v[4:5], null, v6, 40, s[2:3]
	global_load_b32 v8, v[2:3], off
	v_mad_i64_i32 v[2:3], null, v6, 40, s[0:1]
	s_mov_b32 s2, 0
                                        ; implicit-def: $sgpr3
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, 0, v8
.LBB0_2:                                ; %.preheader
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	s_and_not1_b32 s3, s3, exec_lo
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB0_10
; %bb.3:                                ; %.lr.ph.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	global_load_b32 v6, v[2:3], off
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, colors@rel32@lo+4
	s_addc_u32 s1, s1, colors@rel32@hi+12
	s_mov_b32 s5, exec_lo
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v7, 31, v6
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[6:7], 2, v[6:7]
	v_add_co_u32 v6, s0, v6, s0
	s_delay_alu instid0(VALU_DEP_1)
	v_add_co_ci_u32_e64 v7, s0, s1, v7, s0
	s_mov_b32 s1, -1
	global_load_b32 v6, v[6:7], off
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u32_e64 v6, v9
	s_cbranch_execz .LBB0_9
; %bb.4:                                ; %.lr.ph30.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_dual_mov_b32 v7, v5 :: v_dual_mov_b32 v6, v4
	s_mov_b32 s7, 1
	s_mov_b32 s6, 0
                                        ; implicit-def: $sgpr8
.LBB0_5:                                ; %.lr.ph30
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_or_b32 s8, s8, exec_lo
	s_mov_b32 s9, exec_lo
                                        ; implicit-def: $sgpr1
	v_cmpx_ne_u32_e64 s7, v8
	s_cbranch_execz .LBB0_7
; %bb.6:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_5 Depth=2
	global_load_b32 v10, v[6:7], off
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, colors@rel32@lo+4
	s_addc_u32 s1, s1, colors@rel32@hi+12
	s_and_not1_b32 s8, s8, exec_lo
	s_waitcnt vmcnt(0)
	v_ashrrev_i32_e32 v11, 31, v10
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[10:11], 2, v[10:11]
	v_add_co_u32 v10, s0, v10, s0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v11, s0, s1, v11, s0
	v_add_co_u32 v6, s1, v6, 4
	v_add_co_ci_u32_e64 v7, s1, 0, v7, s1
	global_load_b32 v10, v[10:11], off
	s_add_i32 s1, s7, 1
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e64 s0, v10, v9
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, s0, exec_lo
	s_or_b32 s8, s8, s0
.LBB0_7:                                ; %Flow
                                        ;   in Loop: Header=BB0_5 Depth=2
	s_or_b32 exec_lo, exec_lo, s9
	v_mov_b32_e32 v10, s7
	s_and_b32 s0, exec_lo, s8
	s_mov_b32 s7, s1
	s_or_b32 s6, s0, s6
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s6
	s_cbranch_execnz .LBB0_5
; %bb.8:                                ; %._crit_edge.loopexit
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s6
	v_cmp_lt_i32_e64 s0, v10, v8
	s_delay_alu instid0(VALU_DEP_1)
	s_or_not1_b32 s1, s0, exec_lo
.LBB0_9:                                ; %Flow40
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, s3, exec_lo
	s_and_b32 s1, s1, exec_lo
	s_or_b32 s3, s0, s1
.LBB0_10:                               ; %._crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	v_cndmask_b32_e64 v6, 0, 1, s3
	s_xor_b32 s0, s3, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s0, exec_lo, s0
	s_or_b32 s2, s0, s2
	s_delay_alu instid0(VALU_DEP_1)
	v_add_nc_u32_e32 v9, v9, v6
	s_and_not1_b32 exec_lo, exec_lo, s2
	s_cbranch_execnz .LBB0_2
; %bb.11:
	s_or_b32 exec_lo, exec_lo, s2
	s_getpc_b64 s[0:1]
	s_add_u32 s0, s0, colors@rel32@lo+4
	s_addc_u32 s1, s1, colors@rel32@hi+12
	v_add_co_u32 v0, vcc_lo, v0, s0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v9, off
.LBB0_12:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z19graphColoringKerneli
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 264
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 12
		.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	_Z19graphColoringKerneli, .Lfunc_end0-_Z19graphColoringKerneli
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 632
; NumSgprs: 18
; NumVgprs: 12
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 12
; 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
	.protected	graph                   ; @graph
	.type	graph,@object
	.section	.bss,"aw",@nobits
	.globl	graph
	.p2align	4, 0x0
graph:
	.zero	2560
	.size	graph, 2560

	.protected	graph_size              ; @graph_size
	.type	graph_size,@object
	.globl	graph_size
	.p2align	4, 0x0
graph_size:
	.zero	256
	.size	graph_size, 256

	.protected	colors                  ; @colors
	.type	colors,@object
	.globl	colors
	.p2align	4, 0x0
colors:
	.zero	256
	.size	colors, 256

	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.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 graph
	.addrsig_sym graph_size
	.addrsig_sym colors
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         8
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         12
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         16
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         20
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         22
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         24
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         26
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         28
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         30
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         48
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         56
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         72
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 264
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z19graphColoringKerneli
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z19graphColoringKerneli.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     12
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
