/*
 * Do not change this file
 */

#include <iostream>
#include <fstream>
#include <cassert>
#include <cstring>
#include <string>
#include <chrono>
#include <cstdlib>
#include <ctime>
#define MAX_LENGTH 4096

/**
 * Read file, save edges to array (x_x) and 
 * record the size of each type of edge array (x_x_count).
 */
namespace utils {
	int target;
	int len;
	int *list;

	int read_file(std::string filename) {
		std::ifstream inputf(filename, std::ifstream::in);
		len = 0;
		list = (int*)malloc(sizeof(int) * MAX_LENGTH);
		if(inputf) {
			while (!inputf.eof()){
				inputf >> list[len];
				len++;
			}
		} else {
			return -1;
		}
		inputf.close();
		return 0;
	}

	int read_target() {
		std::cout << "Your Input Target n : " <<std::endl;
		std::cin >> utils::target;
		std::cout << "FrequencyPrefixSum of target " << utils::target << " array is output to out.txt." << std::endl;
		std::cout << "Please compare the out.txt with the groundtruth answer_for_n_is_2.txt by command:" << std::endl;
		std::cout << "\tdiff out.txt answer_for_n_is_2.txt" << std::endl;
		return 0;
	}

	int write_file(std::string filename, int *out){
		std::ofstream outputf(filename, std::ofstream::out);
		if(outputf.is_open()){
			for(int i = 0; i < len; i++){
				outputf << out[i] << std::endl;
			}
		} else {
			return -1;
		}
		outputf.close();
		return 0;
	}
}

/**
 * Global function: prefix sum
 * d_in:              original array
 * d_out:             prefix sum array (need to be allocated before)
 * numElems:          the sum of the array.
 */
__global__ void prefix_sum_kernel(int *d_out, int *d_in, int numElems) {
	unsigned int d_hist_idx = blockDim.x * blockIdx.x + threadIdx.x;

	if (d_hist_idx >= numElems)
	{
		return;
	}

	unsigned int cdf_val = 0;
	for (int i = 0; i <= d_hist_idx; ++i)
	{
		cdf_val = cdf_val + d_in[i];
	}
	d_out[d_hist_idx] = cdf_val;
}

__global__ void improved_prefix_sum_kernel(int *out, int *in, int n)
{
	__shared__ int temp[2049];

	int threadId = threadIdx.x;
	int offset = 1;

	//load input into shared memory
	temp[2 * threadId] = in[2 * threadId];
	temp[2 * threadId + 1] = in[2 * threadId + 1];
	__syncthreads();

	for(int d = n/2; d > 0; d /= 2) // build sum in place up the tree
	{
		__syncthreads();
		if(threadId < d)
		{
			int ai = offset * (2 * threadId + 1) - 1;
			int bi = offset * (2 * threadId + 2) - 1;
			temp[bi] += temp[ai];
		}
		offset *= 2;
	}

	if(threadId == 0) // clear the last element
		temp[n-1] = 0;

	for(int d = 1; d < n; d *= 2)
	{
		offset /= 2;
		__syncthreads();

		if(threadId < d)
		{
			int ai = offset * (2 * threadId + 1) - 1;
			int bi = offset * (2 * threadId + 2) - 1;
			int t = temp[ai];
			temp[ai] = temp[bi];
			temp[bi] += t;
		}
	}
	__syncthreads();

	out[2 * threadId] = temp[2 * threadId + 1];
	out[2 * threadId + 1] = temp[2 * threadId + 2];
	if (threadId == 0) {
		out[n - 1] = out[n - 2] + in[n - 1];
	}
}

__global__ void map_kernel(int *out, int *in, int numElems, int target_n){
	unsigned int d_hist_idx = blockDim.x * blockIdx.x + threadIdx.x;
	unsigned int num_threads = blockDim.x * gridDim.x;

	for (int i = d_hist_idx; i < numElems; i += num_threads)
	{
		if(target_n == in[i]){
			out[i] = 1;
		} else {
			out[i] = 0;
		}
	}
}

int main(int argc, char **argv) {
    assert(argc == 3 && "Input format error!");
    std::string filename = argv[1];
    std::string out_filename = argv[2];

    assert(utils::read_file(
        	filename
    		) == 0
		);
    assert(utils::read_target() == 0);

	dim3 grid(1);
	dim3 block(1024);

	int numElems = utils::len;
	int *h_in = utils::list;
	int *h_out = (int*)malloc(sizeof(int) * numElems);
	int *d_in;
	int *d_out;

	cudaMalloc((void**)&d_in, sizeof(int) * numElems);
	cudaMalloc((void**)&d_out, sizeof(int) * numElems);
	cudaMemcpy(d_in, h_in, sizeof(int) * numElems, cudaMemcpyHostToDevice);

	/*begin--- fill your code here to achieve functionality of frequencyPrefixSum */

	int *d_map_out;
	cudaMalloc((void**)&d_map_out, sizeof(int) * numElems);
	int *h_map_out = (int*) malloc(sizeof(int) * numElems);

	map_kernel<<<grid, block>>>(
			d_map_out,
			d_in,
			numElems,
			utils::target
	);

	cudaDeviceSynchronize();
	improved_prefix_sum_kernel<<<grid, block>>>(
			d_out,
			d_map_out,
			numElems
	);

	/*end ---- fill your code here to achieve functionality of frequencyPrefixSum */

	cudaMemcpy(h_out, d_out, sizeof(int) * numElems, cudaMemcpyDeviceToHost);
	assert(
			utils::write_file(
					out_filename,
					h_out
					) == 0
			);

	cudaFree(d_out);
	cudaFree(d_in);
	free(h_out);
    return 0;
}
	.file	"tmpxft_002fb640_00000000-6_lab12_solution.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3871:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3871:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB4653:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE4653:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Your Input Target n : "
.LC1:
	.string	"FrequencyPrefixSum of target "
.LC2:
	.string	" array is output to out.txt."
.LC3:
	.string	"Please compare the out.txt with the groundtruth answer_for_n_is_2.txt by command:"
.LC4:
	.string	"\tdiff out.txt answer_for_n_is_2.txt"
	.text
	.globl	_ZN5utils11read_targetEv
	.type	_ZN5utils11read_targetEv, @function
_ZN5utils11read_targetEv:
.LFB3866:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZSt4cout(%rip), %rbx
	leaq	.LC0(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	_ZN5utils6targetE(%rip), %rsi
	leaq	_ZSt3cin(%rip), %rdi
	call	_ZNSirsERi@PLT
	movq	%rbx, %rdi
	leaq	.LC1(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	_ZN5utils6targetE(%rip), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	leaq	.LC2(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%rbx, %rdi
	leaq	.LC3(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%rbx, %rdi
	leaq	.LC4(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3866:
	.size	_ZN5utils11read_targetEv, .-_ZN5utils11read_targetEv
	.globl	_Z40__device_stub__Z17prefix_sum_kernelPiS_iPiS_i
	.type	_Z40__device_stub__Z17prefix_sum_kernelPiS_iPiS_i, @function
_Z40__device_stub__Z17prefix_sum_kernelPiS_iPiS_i:
.LFB3893:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L5
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z17prefix_sum_kernelPiS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L5:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3893:
	.size	_Z40__device_stub__Z17prefix_sum_kernelPiS_iPiS_i, .-_Z40__device_stub__Z17prefix_sum_kernelPiS_iPiS_i
	.globl	_Z17prefix_sum_kernelPiS_i
	.type	_Z17prefix_sum_kernelPiS_i, @function
_Z17prefix_sum_kernelPiS_i:
.LFB3894:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z17prefix_sum_kernelPiS_iPiS_i
	.cfi_endproc
.LFE3894:
	.size	_Z17prefix_sum_kernelPiS_i, .-_Z17prefix_sum_kernelPiS_i
	.globl	_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i
	.type	_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i, @function
_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i:
.LFB3895:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L11
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z26improved_prefix_sum_kernelPiS_i(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L11:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3895:
	.size	_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i, .-_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i
	.globl	_Z26improved_prefix_sum_kernelPiS_i
	.type	_Z26improved_prefix_sum_kernelPiS_i, @function
_Z26improved_prefix_sum_kernelPiS_i:
.LFB3896:
	.cfi_startproc
	endbr64
	jmp	_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i
	.cfi_endproc
.LFE3896:
	.size	_Z26improved_prefix_sum_kernelPiS_i, .-_Z26improved_prefix_sum_kernelPiS_i
	.globl	_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii
	.type	_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii, @function
_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii:
.LFB3897:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L16
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10map_kernelPiS_ii(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L16:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3897:
	.size	_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii, .-_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii
	.globl	_Z10map_kernelPiS_ii
	.type	_Z10map_kernelPiS_ii, @function
_Z10map_kernelPiS_ii:
.LFB3898:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii
	.cfi_endproc
.LFE3898:
	.size	_Z10map_kernelPiS_ii, .-_Z10map_kernelPiS_ii
	.section	.rodata.str1.1
.LC5:
	.string	"_Z10map_kernelPiS_ii"
.LC6:
	.string	"_Z26improved_prefix_sum_kernelPiS_i"
.LC7:
	.string	"_Z17prefix_sum_kernelPiS_i"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3900:
	.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	.LC5(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z10map_kernelPiS_ii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC6(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z26improved_prefix_sum_kernelPiS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC7(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17prefix_sum_kernelPiS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3900:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.text
	.globl	_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, @function
_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
.LFB3865:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3865
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rsi
	movl	$8, %edx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$536, %rsp
	.cfi_def_cfa_offset 560
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode@PLT
.LEHE0:
	xorl	%eax, %eax
	movl	$16384, %edi
	movl	%eax, _ZN5utils3lenE(%rip)
	call	malloc@PLT
	movl	288(%rsp), %ebx
	movq	%rax, _ZN5utils4listE(%rip)
	andl	$5, %ebx
	je	.L24
	orl	$-1, %ebx
	jmp	.L25
.L26:
	movslq	_ZN5utils3lenE(%rip), %rdx
	movq	_ZN5utils4listE(%rip), %rax
	movq	%rbp, %rdi
	leaq	(%rax,%rdx,4), %rsi
.LEHB1:
	call	_ZNSirsERi@PLT
	incl	_ZN5utils3lenE(%rip)
.L24:
	testb	$2, 288(%rsp)
	je	.L26
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE1:
.L25:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	je	.L29
	jmp	.L34
.L30:
	endbr64
	movq	%rax, %rbx
.L27:
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L34:
	call	__stack_chk_fail@PLT
.L29:
	addq	$536, %rsp
	.cfi_def_cfa_offset 24
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3865:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3865:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3865-.LLSDACSB3865
.LLSDACSB3865:
	.uleb128 .LEHB0-.LFB3865
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3865
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L30-.LFB3865
	.uleb128 0
	.uleb128 .LEHB2-.LFB3865
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3865:
	.text
	.size	_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .-_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.globl	_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi
	.type	_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi, @function
_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi:
.LFB3867:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3867
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$16, %edx
	movq	%rsi, %r12
	movq	%rdi, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	orl	$-1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$528, %rsp
	.cfi_def_cfa_offset 560
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
.LEHB3:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode@PLT
.LEHE3:
	leaq	120(%rsp), %rdi
	call	_ZNKSt12__basic_fileIcE7is_openEv@PLT
	testb	%al, %al
	je	.L38
	xorl	%ebp, %ebp
.L37:
	cmpl	%ebp, _ZN5utils3lenE(%rip)
	jle	.L49
	movl	(%r12,%rbp,4), %esi
	movq	%rbx, %rdi
.LEHB4:
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	incq	%rbp
	jmp	.L37
.L49:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE4:
	xorl	%ebp, %ebp
.L38:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	je	.L42
	jmp	.L46
.L44:
	endbr64
	movq	%rax, %rbp
.L40:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	movq	%rbp, %rdi
.LEHB5:
	call	_Unwind_Resume@PLT
.LEHE5:
.L46:
	call	__stack_chk_fail@PLT
.L42:
	addq	$528, %rsp
	.cfi_def_cfa_offset 32
	movl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3867:
	.section	.gcc_except_table
.LLSDA3867:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3867-.LLSDACSB3867
.LLSDACSB3867:
	.uleb128 .LEHB3-.LFB3867
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB3867
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L44-.LFB3867
	.uleb128 0
	.uleb128 .LEHB5-.LFB3867
	.uleb128 .LEHE5-.LEHB5
	.uleb128 0
	.uleb128 0
.LLSDACSE3867:
	.text
	.size	_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi, .-_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC8:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4267:
	.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
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L51
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	leaq	.LC8(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L51:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L53
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L53:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
.L56:
	call	__stack_chk_fail@PLT
.L54:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4267:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3868:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3868
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	8(%rsi), %rsi
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %r12
	leaq	56(%rsp), %rbp
	movq	%r12, %rdx
	movq	%rbp, %rdi
	leaq	88(%rsp), %r13
.LEHB6:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE6:
	movq	16(%rbx), %rsi
	movq	%r12, %rdx
	movq	%r13, %rdi
.LEHB7:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE7:
	movslq	_ZN5utils3lenE(%rip), %rbx
	movl	$1, 40(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 32(%rsp)
	addq	$1023, %rax
	movq	_ZN5utils4listE(%rip), %r15
	movq	%rbx, %r14
	salq	$2, %rbx
	movq	%rax, 44(%rsp)
	movq	%rbx, %rdi
	movl	$1, 52(%rsp)
	call	malloc@PLT
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	movq	%rax, %r12
.LEHB8:
	call	cudaMalloc@PLT
	leaq	16(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%rbx, %rdx
	movq	%r15, %rsi
	call	cudaMemcpy@PLT
	leaq	24(%rsp), %rdi
	movq	%rbx, %rsi
	call	cudaMalloc@PLT
	movl	52(%rsp), %ecx
	movq	44(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L58
	movl	_ZN5utils6targetE(%rip), %ecx
	movq	8(%rsp), %rsi
	movl	%r14d, %edx
	movq	24(%rsp), %rdi
	call	_Z34__device_stub__Z10map_kernelPiS_iiPiS_ii
.L58:
	call	cudaDeviceSynchronize@PLT
	movl	52(%rsp), %ecx
	movq	44(%rsp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	32(%rsp), %rdi
	movl	40(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	movq	16(%rsp), %rdi
	testl	%eax, %eax
	jne	.L59
	movq	24(%rsp), %rsi
	movl	%r14d, %edx
	call	_Z49__device_stub__Z26improved_prefix_sum_kernelPiS_iPiS_i
.L59:
	movq	16(%rsp), %rsi
	movl	$2, %ecx
	movq	%rbx, %rdx
	movq	%r12, %rdi
	call	cudaMemcpy@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
.LEHE8:
	movq	%r12, %rdi
	call	free@PLT
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L63
	jmp	.L66
.L65:
	endbr64
	movq	%rax, %rbx
.L60:
	movq	%r13, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L61
.L64:
	endbr64
	movq	%rax, %rbx
.L61:
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	movq	%rbx, %rdi
.LEHB9:
	call	_Unwind_Resume@PLT
.LEHE9:
.L66:
	call	__stack_chk_fail@PLT
.L63:
	addq	$136, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %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
.LFE3868:
	.section	.gcc_except_table
.LLSDA3868:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3868-.LLSDACSB3868
.LLSDACSB3868:
	.uleb128 .LEHB6-.LFB3868
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB7-.LFB3868
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L64-.LFB3868
	.uleb128 0
	.uleb128 .LEHB8-.LFB3868
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L65-.LFB3868
	.uleb128 0
	.uleb128 .LEHB9-.LFB3868
	.uleb128 .LEHE9-.LEHB9
	.uleb128 0
	.uleb128 0
.LLSDACSE3868:
	.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
	.globl	_ZN5utils4listE
	.bss
	.align 8
	.type	_ZN5utils4listE, @object
	.size	_ZN5utils4listE, 8
_ZN5utils4listE:
	.zero	8
	.globl	_ZN5utils3lenE
	.align 4
	.type	_ZN5utils3lenE, @object
	.size	_ZN5utils3lenE, 4
_ZN5utils3lenE:
	.zero	4
	.globl	_ZN5utils6targetE
	.align 4
	.type	_ZN5utils6targetE, @object
	.size	_ZN5utils6targetE, 4
_ZN5utils6targetE:
	.zero	4
	.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:

/*
 * Do not change this file
 */


#include <hip/hip_runtime.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include <cstring>
#include <string>
#include <chrono>
#include <cstdlib>
#include <ctime>
#define MAX_LENGTH 4096

/**
 * Read file, save edges to array (x_x) and 
 * record the size of each type of edge array (x_x_count).
 */
namespace utils {
	int target;
	int len;
	int *list;

	int read_file(std::string filename) {
		std::ifstream inputf(filename, std::ifstream::in);
		len = 0;
		list = (int*)malloc(sizeof(int) * MAX_LENGTH);
		if(inputf) {
			while (!inputf.eof()){
				inputf >> list[len];
				len++;
			}
		} else {
			return -1;
		}
		inputf.close();
		return 0;
	}

	int read_target() {
		std::cout << "Your Input Target n : " <<std::endl;
		std::cin >> utils::target;
		std::cout << "FrequencyPrefixSum of target " << utils::target << " array is output to out.txt." << std::endl;
		std::cout << "Please compare the out.txt with the groundtruth answer_for_n_is_2.txt by command:" << std::endl;
		std::cout << "\tdiff out.txt answer_for_n_is_2.txt" << std::endl;
		return 0;
	}

	int write_file(std::string filename, int *out){
		std::ofstream outputf(filename, std::ofstream::out);
		if(outputf.is_open()){
			for(int i = 0; i < len; i++){
				outputf << out[i] << std::endl;
			}
		} else {
			return -1;
		}
		outputf.close();
		return 0;
	}
}

/**
 * Global function: prefix sum
 * d_in:              original array
 * d_out:             prefix sum array (need to be allocated before)
 * numElems:          the sum of the array.
 */
__global__ void prefix_sum_kernel(int *d_out, int *d_in, int numElems) {
	unsigned int d_hist_idx = blockDim.x * blockIdx.x + threadIdx.x;

	if (d_hist_idx >= numElems)
	{
		return;
	}

	unsigned int cdf_val = 0;
	for (int i = 0; i <= d_hist_idx; ++i)
	{
		cdf_val = cdf_val + d_in[i];
	}
	d_out[d_hist_idx] = cdf_val;
}

__global__ void improved_prefix_sum_kernel(int *out, int *in, int n)
{
	__shared__ int temp[2049];

	int threadId = threadIdx.x;
	int offset = 1;

	//load input into shared memory
	temp[2 * threadId] = in[2 * threadId];
	temp[2 * threadId + 1] = in[2 * threadId + 1];
	__syncthreads();

	for(int d = n/2; d > 0; d /= 2) // build sum in place up the tree
	{
		__syncthreads();
		if(threadId < d)
		{
			int ai = offset * (2 * threadId + 1) - 1;
			int bi = offset * (2 * threadId + 2) - 1;
			temp[bi] += temp[ai];
		}
		offset *= 2;
	}

	if(threadId == 0) // clear the last element
		temp[n-1] = 0;

	for(int d = 1; d < n; d *= 2)
	{
		offset /= 2;
		__syncthreads();

		if(threadId < d)
		{
			int ai = offset * (2 * threadId + 1) - 1;
			int bi = offset * (2 * threadId + 2) - 1;
			int t = temp[ai];
			temp[ai] = temp[bi];
			temp[bi] += t;
		}
	}
	__syncthreads();

	out[2 * threadId] = temp[2 * threadId + 1];
	out[2 * threadId + 1] = temp[2 * threadId + 2];
	if (threadId == 0) {
		out[n - 1] = out[n - 2] + in[n - 1];
	}
}

__global__ void map_kernel(int *out, int *in, int numElems, int target_n){
	unsigned int d_hist_idx = blockDim.x * blockIdx.x + threadIdx.x;
	unsigned int num_threads = blockDim.x * gridDim.x;

	for (int i = d_hist_idx; i < numElems; i += num_threads)
	{
		if(target_n == in[i]){
			out[i] = 1;
		} else {
			out[i] = 0;
		}
	}
}

int main(int argc, char **argv) {
    assert(argc == 3 && "Input format error!");
    std::string filename = argv[1];
    std::string out_filename = argv[2];

    assert(utils::read_file(
        	filename
    		) == 0
		);
    assert(utils::read_target() == 0);

	dim3 grid(1);
	dim3 block(1024);

	int numElems = utils::len;
	int *h_in = utils::list;
	int *h_out = (int*)malloc(sizeof(int) * numElems);
	int *d_in;
	int *d_out;

	hipMalloc((void**)&d_in, sizeof(int) * numElems);
	hipMalloc((void**)&d_out, sizeof(int) * numElems);
	hipMemcpy(d_in, h_in, sizeof(int) * numElems, hipMemcpyHostToDevice);

	/*begin--- fill your code here to achieve functionality of frequencyPrefixSum */

	int *d_map_out;
	hipMalloc((void**)&d_map_out, sizeof(int) * numElems);
	int *h_map_out = (int*) malloc(sizeof(int) * numElems);

	map_kernel<<<grid, block>>>(
			d_map_out,
			d_in,
			numElems,
			utils::target
	);

	hipDeviceSynchronize();
	improved_prefix_sum_kernel<<<grid, block>>>(
			d_out,
			d_map_out,
			numElems
	);

	/*end ---- fill your code here to achieve functionality of frequencyPrefixSum */

	hipMemcpy(h_out, d_out, sizeof(int) * numElems, hipMemcpyDeviceToHost);
	assert(
			utils::write_file(
					out_filename,
					h_out
					) == 0
			);

	hipFree(d_out);
	hipFree(d_in);
	free(h_out);
    return 0;
}
	.text
	.file	"lab12_solution.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE # -- Begin function _ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.type	_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE,@function
_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: # @_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$528, %rsp                      # imm = 0x210
	.cfi_def_cfa_offset 544
	.cfi_offset %rbx, -16
	movq	%rdi, %rsi
	leaq	8(%rsp), %rbx
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
	movl	$0, _ZN5utils3lenE(%rip)
	movl	$16384, %edi                    # imm = 0x4000
	callq	malloc
	movq	%rax, _ZN5utils4listE(%rip)
	movq	(%rbx), %rax
	movq	-24(%rax), %rax
	movl	40(%rsp,%rax), %eax
	movl	$-1, %ebx
	testb	$5, %al
	jne	.LBB0_6
# %bb.1:                                # %.preheader
	testb	$2, %al
	jne	.LBB0_5
# %bb.2:                                # %.lr.ph.preheader
	xorl	%eax, %eax
	leaq	8(%rsp), %rbx
.LBB0_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movslq	%eax, %rsi
	shlq	$2, %rsi
	addq	_ZN5utils4listE(%rip), %rsi
.Ltmp0:
	movq	%rbx, %rdi
	callq	_ZNSirsERi
.Ltmp1:
# %bb.4:                                #   in Loop: Header=BB0_3 Depth=1
	movl	_ZN5utils3lenE(%rip), %eax
	incl	%eax
	movl	%eax, _ZN5utils3lenE(%rip)
	movq	8(%rsp), %rcx
	movq	-24(%rcx), %rcx
	testb	$2, 40(%rsp,%rcx)
	je	.LBB0_3
.LBB0_5:                                # %._crit_edge
	xorl	%ebx, %ebx
.Ltmp3:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp4:
.LBB0_6:
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movl	%ebx, %eax
	addq	$528, %rsp                      # imm = 0x210
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB0_8:                                # %.loopexit.split-lp
	.cfi_def_cfa_offset 544
.Ltmp5:
	jmp	.LBB0_9
.LBB0_7:                                # %.loopexit
.Ltmp2:
.LBB0_9:
	movq	%rax, %rbx
	leaq	8(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, .Lfunc_end0-_ZN5utils9read_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.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 .Lfunc_end0-.Ltmp4             #   Call between .Ltmp4 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_ZN5utils11read_targetEv        # -- Begin function _ZN5utils11read_targetEv
	.type	_ZN5utils11read_targetEv,@function
_ZN5utils11read_targetEv:               # @_ZN5utils11read_targetEv
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	$_ZSt4cout, %r14d
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$22, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt3cin, %edi
	movl	$_ZN5utils6targetE, %esi
	callq	_ZNSirsERi
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$29, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	_ZN5utils6targetE(%rip), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movl	$28, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$81, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.4, %esi
	movl	$35, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_ZN5utils11read_targetEv, .Lfunc_end1-_ZN5utils11read_targetEv
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi # -- Begin function _ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi
	.type	_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi,@function
_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi: # @_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$512, %rsp                      # imm = 0x200
	.cfi_def_cfa_offset 560
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rsi, %rbx
	movq	%rdi, %rsi
	movq	%rsp, %rdi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode
	leaq	112(%rsp), %rdi
	callq	_ZNKSt12__basic_fileIcE7is_openEv
	movl	$-1, %ebp
	testb	%al, %al
	je	.LBB2_9
# %bb.1:                                # %.preheader
	cmpl	$0, _ZN5utils3lenE(%rip)
	jle	.LBB2_8
# %bb.2:                                # %.lr.ph.preheader
	xorl	%r12d, %r12d
	movq	%rsp, %r14
.LBB2_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r12,4), %esi
.Ltmp6:
	movq	%r14, %rdi
	callq	_ZNSolsEi
.Ltmp7:
# %bb.4:                                #   in Loop: Header=BB2_3 Depth=1
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp8:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp9:
# %bb.5:                                # %.noexc
                                        #   in Loop: Header=BB2_3 Depth=1
.Ltmp10:
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp11:
# %bb.6:                                # %.noexc10
                                        #   in Loop: Header=BB2_3 Depth=1
.Ltmp12:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp13:
# %bb.7:                                # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB2_3 Depth=1
	incq	%r12
	movslq	_ZN5utils3lenE(%rip), %rax
	cmpq	%rax, %r12
	jl	.LBB2_3
.LBB2_8:                                # %._crit_edge
	xorl	%ebp, %ebp
.Ltmp15:
	movq	%rsp, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
.Ltmp16:
.LBB2_9:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %rax
	leaq	8(%rsp), %rdi
	movq	%rax, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %rcx
	movq	-24(%rax), %rax
	movq	%rcx, (%rsp,%rax)
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	leaq	248(%rsp), %rdi
	callq	_ZNSt8ios_baseD2Ev
	movl	%ebp, %eax
	addq	$512, %rsp                      # imm = 0x200
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.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
.LBB2_10:
	.cfi_def_cfa_offset 560
.Ltmp17:
	jmp	.LBB2_11
.LBB2_12:
.Ltmp14:
.LBB2_11:
	movq	%rax, %rbx
	movq	%rsp, %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi, .Lfunc_end2-_ZN5utils10write_fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPi
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.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 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp6-.Lfunc_begin1           #   Call between .Lfunc_begin1 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin1           # >> Call Site 2 <<
	.uleb128 .Ltmp13-.Ltmp6                 #   Call between .Ltmp6 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin1          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp16-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Lfunc_end2-.Ltmp16            #   Call between .Ltmp16 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z32__device_stub__prefix_sum_kernelPiS_i # -- Begin function _Z32__device_stub__prefix_sum_kernelPiS_i
	.type	_Z32__device_stub__prefix_sum_kernelPiS_i,@function
_Z32__device_stub__prefix_sum_kernelPiS_i: # @_Z32__device_stub__prefix_sum_kernelPiS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z17prefix_sum_kernelPiS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z32__device_stub__prefix_sum_kernelPiS_i, .Lfunc_end3-_Z32__device_stub__prefix_sum_kernelPiS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z41__device_stub__improved_prefix_sum_kernelPiS_i # -- Begin function _Z41__device_stub__improved_prefix_sum_kernelPiS_i
	.type	_Z41__device_stub__improved_prefix_sum_kernelPiS_i,@function
_Z41__device_stub__improved_prefix_sum_kernelPiS_i: # @_Z41__device_stub__improved_prefix_sum_kernelPiS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z26improved_prefix_sum_kernelPiS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z41__device_stub__improved_prefix_sum_kernelPiS_i, .Lfunc_end4-_Z41__device_stub__improved_prefix_sum_kernelPiS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z25__device_stub__map_kernelPiS_ii # -- Begin function _Z25__device_stub__map_kernelPiS_ii
	.type	_Z25__device_stub__map_kernelPiS_ii,@function
_Z25__device_stub__map_kernelPiS_ii:    # @_Z25__device_stub__map_kernelPiS_ii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z10map_kernelPiS_ii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z25__device_stub__map_kernelPiS_ii, .Lfunc_end5-_Z25__device_stub__map_kernelPiS_ii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$88, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %rbx
	movq	8(%rsi), %rsi
	leaq	56(%rsp), %rdi
	leaq	24(%rsp), %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	movq	16(%rbx), %rsi
.Ltmp18:
	leaq	24(%rsp), %rdi
	movq	%rsp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
.Ltmp19:
# %bb.1:
	movslq	_ZN5utils3lenE(%rip), %r15
	movq	_ZN5utils4listE(%rip), %r12
	leaq	(,%r15,4), %r14
	movq	%r14, %rdi
	callq	malloc
	movq	%rax, %rbx
.Ltmp21:
	movq	%rsp, %rdi
	movq	%r14, %rsi
	callq	hipMalloc
.Ltmp22:
# %bb.2:
.Ltmp23:
	leaq	8(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
.Ltmp24:
# %bb.3:
	movq	(%rsp), %rdi
.Ltmp25:
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp26:
# %bb.4:
.Ltmp28:
	leaq	16(%rsp), %rdi
	movq	%r14, %rsi
	callq	hipMalloc
.Ltmp29:
# %bb.5:
.Ltmp31:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp32:
# %bb.6:
	testl	%eax, %eax
	jne	.LBB6_8
# %bb.7:
	movq	16(%rsp), %rdi
	movq	(%rsp), %rsi
	movl	_ZN5utils6targetE(%rip), %ecx
.Ltmp33:
	movl	%r15d, %edx
	callq	_Z25__device_stub__map_kernelPiS_ii
.Ltmp34:
.LBB6_8:
.Ltmp35:
	callq	hipDeviceSynchronize
.Ltmp36:
# %bb.9:
.Ltmp37:
	movabsq	$4294967297, %rdi               # imm = 0x100000001
	movabsq	$4294968320, %rdx               # imm = 0x100000400
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp38:
# %bb.10:
	testl	%eax, %eax
	jne	.LBB6_12
# %bb.11:
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rsi
.Ltmp39:
	movl	%r15d, %edx
	callq	_Z41__device_stub__improved_prefix_sum_kernelPiS_i
.Ltmp40:
.LBB6_12:
	movq	8(%rsp), %rsi
.Ltmp41:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp42:
# %bb.13:
	movq	8(%rsp), %rdi
.Ltmp43:
	callq	hipFree
.Ltmp44:
# %bb.14:
	movq	(%rsp), %rdi
.Ltmp45:
	callq	hipFree
.Ltmp46:
# %bb.15:
	movq	%rbx, %rdi
	callq	free
	leaq	40(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB6_17
# %bb.16:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB6_17:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	72(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB6_19
# %bb.18:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i39
	callq	_ZdlPv
.LBB6_19:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit41
	xorl	%eax, %eax
	addq	$88, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB6_23:
	.cfi_def_cfa_offset 128
.Ltmp30:
	jmp	.LBB6_24
.LBB6_20:
.Ltmp20:
	movq	%rax, %rbx
	jmp	.LBB6_26
.LBB6_21:
.Ltmp27:
	jmp	.LBB6_24
.LBB6_22:
.Ltmp47:
.LBB6_24:
	movq	%rax, %rbx
	leaq	40(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB6_26
# %bb.25:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i42
	callq	_ZdlPv
.LBB6_26:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit44
	leaq	72(%rsp), %rax
	movq	-16(%rax), %rdi
	cmpq	%rax, %rdi
	je	.LBB6_28
# %bb.27:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i45
	callq	_ZdlPv
.LBB6_28:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit47
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end6:
	.size	main, .Lfunc_end6-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table6:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp18-.Lfunc_begin2          #   Call between .Lfunc_begin2 and .Ltmp18
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin2          #     jumps to .Ltmp20
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp21-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Ltmp26-.Ltmp21                #   Call between .Ltmp21 and .Ltmp26
	.uleb128 .Ltmp27-.Lfunc_begin2          #     jumps to .Ltmp27
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp28-.Lfunc_begin2          # >> Call Site 4 <<
	.uleb128 .Ltmp29-.Ltmp28                #   Call between .Ltmp28 and .Ltmp29
	.uleb128 .Ltmp30-.Lfunc_begin2          #     jumps to .Ltmp30
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp31-.Lfunc_begin2          # >> Call Site 5 <<
	.uleb128 .Ltmp46-.Ltmp31                #   Call between .Ltmp31 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin2          #     jumps to .Ltmp47
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp46-.Lfunc_begin2          # >> Call Site 6 <<
	.uleb128 .Lfunc_end6-.Ltmp46            #   Call between .Ltmp46 and .Lfunc_end6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_ # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_startproc
# %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
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	je	.LBB7_1
# %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	strlen
	leaq	(%rax,%rbx), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # TAILCALL
.LBB7_1:
	.cfi_def_cfa_offset 32
	movl	$.L.str.5, %edi
	callq	_ZSt19__throw_logic_errorPKc
.Lfunc_end7:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .Lfunc_end7-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB8_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB8_3
.LBB8_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB8_3:
	testq	%r14, %r14
	je	.LBB8_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB8_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB8_7
.LBB8_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB8_7:                                # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end8-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_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:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB9_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB9_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17prefix_sum_kernelPiS_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z26improved_prefix_sum_kernelPiS_i, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10map_kernelPiS_ii, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end9:
	.size	__hip_module_ctor, .Lfunc_end9-__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	.LBB10_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
.LBB10_2:
	retq
.Lfunc_end10:
	.size	__hip_module_dtor, .Lfunc_end10-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZN5utils6targetE,@object       # @_ZN5utils6targetE
	.bss
	.globl	_ZN5utils6targetE
	.p2align	2, 0x0
_ZN5utils6targetE:
	.long	0                               # 0x0
	.size	_ZN5utils6targetE, 4

	.type	_ZN5utils3lenE,@object          # @_ZN5utils3lenE
	.globl	_ZN5utils3lenE
	.p2align	2, 0x0
_ZN5utils3lenE:
	.long	0                               # 0x0
	.size	_ZN5utils3lenE, 4

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Your Input Target n : "
	.size	.L.str, 23

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"FrequencyPrefixSum of target "
	.size	.L.str.1, 30

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	" array is output to out.txt."
	.size	.L.str.2, 29

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Please compare the out.txt with the groundtruth answer_for_n_is_2.txt by command:"
	.size	.L.str.3, 82

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"\tdiff out.txt answer_for_n_is_2.txt"
	.size	.L.str.4, 36

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

	.type	_Z26improved_prefix_sum_kernelPiS_i,@object # @_Z26improved_prefix_sum_kernelPiS_i
	.globl	_Z26improved_prefix_sum_kernelPiS_i
	.p2align	3, 0x0
_Z26improved_prefix_sum_kernelPiS_i:
	.quad	_Z41__device_stub__improved_prefix_sum_kernelPiS_i
	.size	_Z26improved_prefix_sum_kernelPiS_i, 8

	.type	_Z10map_kernelPiS_ii,@object    # @_Z10map_kernelPiS_ii
	.globl	_Z10map_kernelPiS_ii
	.p2align	3, 0x0
_Z10map_kernelPiS_ii:
	.quad	_Z25__device_stub__map_kernelPiS_ii
	.size	_Z10map_kernelPiS_ii, 8

	.type	.L.str.5,@object                # @.str.5
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.5:
	.asciz	"basic_string: construction from null is not valid"
	.size	.L.str.5, 50

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z17prefix_sum_kernelPiS_i"
	.size	.L__unnamed_1, 27

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z26improved_prefix_sum_kernelPiS_i"
	.size	.L__unnamed_2, 36

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z10map_kernelPiS_ii"
	.size	.L__unnamed_3, 21

	.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 __gxx_personality_v0
	.addrsig_sym _Z32__device_stub__prefix_sum_kernelPiS_i
	.addrsig_sym _Z41__device_stub__improved_prefix_sum_kernelPiS_i
	.addrsig_sym _Z25__device_stub__map_kernelPiS_ii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZN5utils6targetE
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt3cin
	.addrsig_sym _Z17prefix_sum_kernelPiS_i
	.addrsig_sym _Z26improved_prefix_sum_kernelPiS_i
	.addrsig_sym _Z10map_kernelPiS_ii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z17prefix_sum_kernelPiS_i ; -- Begin function _Z17prefix_sum_kernelPiS_i
	.globl	_Z17prefix_sum_kernelPiS_i
	.p2align	8
	.type	_Z17prefix_sum_kernelPiS_i,@function
_Z17prefix_sum_kernelPiS_i:             ; @_Z17prefix_sum_kernelPiS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x24
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_u32_e64 s3, v1
	s_cbranch_execz .LBB0_4
; %bb.1:                                ; %.preheader.preheader
	s_load_b128 s[0:3], s[0:1], 0x0
	v_add_nc_u32_e32 v0, 1, v1
	s_mov_b32 s4, 0
	s_mov_b32 s5, 0
.LBB0_2:                                ; %.preheader
                                        ; =>This Inner Loop Header: Depth=1
	s_waitcnt lgkmcnt(0)
	s_load_b32 s6, s[2:3], 0x0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s5, s6, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_dual_mov_b32 v3, s5 :: v_dual_add_nc_u32 v0, -1, v0
	s_add_u32 s2, s2, 4
	s_addc_u32 s3, s3, 0
	v_cmp_eq_u32_e32 vcc_lo, 0, v0
	s_or_b32 s4, vcc_lo, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s4
	s_cbranch_execnz .LBB0_2
; %bb.3:
	s_or_b32 exec_lo, exec_lo, s4
	v_mov_b32_e32 v2, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_add_co_u32 v0, vcc_lo, s0, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[0:1], v3, off
.LBB0_4:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17prefix_sum_kernelPiS_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 4
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z17prefix_sum_kernelPiS_i, .Lfunc_end0-_Z17prefix_sum_kernelPiS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 196
; NumSgprs: 18
; NumVgprs: 4
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 4
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z26improved_prefix_sum_kernelPiS_i ; -- Begin function _Z26improved_prefix_sum_kernelPiS_i
	.globl	_Z26improved_prefix_sum_kernelPiS_i
	.p2align	8
	.type	_Z26improved_prefix_sum_kernelPiS_i,@function
_Z26improved_prefix_sum_kernelPiS_i:    ; @_Z26improved_prefix_sum_kernelPiS_i
; %bb.0:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b32 s2, s[0:1], 0x10
	v_lshlrev_b32_e32 v1, 3, v0
	v_lshlrev_b32_e32 v2, 1, v0
	s_mov_b32 s1, 1
	s_delay_alu instid0(VALU_DEP_1)
	v_or_b32_e32 v3, 1, v2
	s_waitcnt lgkmcnt(0)
	global_load_b64 v[4:5], v1, s[6:7]
	s_cmp_gt_i32 s2, 1
	s_cselect_b32 s3, -1, 0
	s_cmp_lt_i32 s2, 2
	s_waitcnt vmcnt(0)
	ds_store_b64 v1, v[4:5]
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc1 .LBB1_6
; %bb.1:                                ; %.lr.ph
	s_mov_b32 s0, s2
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_lshr_b32 s8, s0, 1
	s_mov_b32 s9, exec_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u32_e64 s8, v0
	s_cbranch_execz .LBB1_4
; %bb.3:                                ;   in Loop: Header=BB1_2 Depth=1
	v_mul_lo_u32 v4, s1, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v4, v4, 2, -4
	v_lshl_add_u32 v5, s1, 2, v4
	ds_load_b32 v4, v4
	ds_load_b32 v6, v5
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v4, v6, v4
	ds_store_b32 v5, v4
.LBB1_4:                                ;   in Loop: Header=BB1_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s9
	s_lshl_b32 s1, s1, 1
	s_cmp_lt_u32 s0, 4
	s_cbranch_scc1 .LBB1_6
; %bb.5:                                ;   in Loop: Header=BB1_2 Depth=1
	s_mov_b32 s0, s8
	s_branch .LBB1_2
.LBB1_6:                                ; %Flow68
	v_cmp_eq_u32_e64 s0, 0, v0
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s8, s0
	s_cbranch_execz .LBB1_8
; %bb.7:
	s_lshl_b32 s9, s2, 2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_add_i32 s9, s9, -4
	v_dual_mov_b32 v4, 0 :: v_dual_mov_b32 v5, s9
	ds_store_b32 v5, v4
.LBB1_8:
	s_or_b32 exec_lo, exec_lo, s8
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_mov_b32 s3, 1
	s_cbranch_vccnz .LBB1_12
.LBB1_9:                                ; %.lr.ph57
                                        ; =>This Inner Loop Header: Depth=1
	s_lshr_b32 s8, s1, 31
	s_waitcnt lgkmcnt(0)
	s_add_i32 s1, s1, s8
	s_mov_b32 s8, exec_lo
	s_ashr_i32 s1, s1, 1
	s_barrier
	buffer_gl0_inv
	v_cmpx_gt_u32_e64 s3, v0
	s_cbranch_execz .LBB1_11
; %bb.10:                               ;   in Loop: Header=BB1_9 Depth=1
	v_mul_lo_u32 v4, s1, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshl_add_u32 v4, v4, 2, -4
	v_lshl_add_u32 v5, s1, 2, v4
	ds_load_b32 v6, v4
	ds_load_b32 v7, v5
	s_waitcnt lgkmcnt(0)
	v_add_nc_u32_e32 v6, v7, v6
	ds_store_b32 v4, v7
	ds_store_b32 v5, v6
.LBB1_11:                               ;   in Loop: Header=BB1_9 Depth=1
	s_or_b32 exec_lo, exec_lo, s8
	s_lshl_b32 s3, s3, 1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_ge_i32 s3, s2
	s_cbranch_scc0 .LBB1_9
.LBB1_12:                               ; %._crit_edge58
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	ds_load_2addr_b32 v[0:1], v1 offset0:1 offset1:2
	v_lshlrev_b32_e32 v2, 2, v2
	s_waitcnt lgkmcnt(0)
	global_store_b64 v2, v[0:1], s[4:5]
	s_and_saveexec_b32 s1, s0
	s_cbranch_execz .LBB1_14
; %bb.13:
	s_ashr_i32 s3, s2, 31
	v_mov_b32_e32 v0, 0
	s_lshl_b64 s[0:1], s[2:3], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s2, s4, s0
	s_addc_u32 s3, s5, s1
	s_add_u32 s0, s6, s0
	s_addc_u32 s1, s7, s1
	s_clause 0x1
	global_load_b32 v1, v0, s[2:3] offset:-8
	global_load_b32 v2, v0, s[0:1] offset:-4
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v1, v2, v1
	global_store_b32 v0, v1, s[2:3] offset:-4
.LBB1_14:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z26improved_prefix_sum_kernelPiS_i
		.amdhsa_group_segment_fixed_size 8196
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 20
		.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 8
		.amdhsa_next_free_sgpr 10
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z26improved_prefix_sum_kernelPiS_i, .Lfunc_end1-_Z26improved_prefix_sum_kernelPiS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 552
; NumSgprs: 12
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 8196 bytes/workgroup (compile time only)
; SGPRBlocks: 1
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 12
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z10map_kernelPiS_ii    ; -- Begin function _Z10map_kernelPiS_ii
	.globl	_Z10map_kernelPiS_ii
	.p2align	8
	.type	_Z10map_kernelPiS_ii,@function
_Z10map_kernelPiS_ii:                   ; @_Z10map_kernelPiS_ii
; %bb.0:
	s_clause 0x1
	s_load_b32 s6, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x10
	s_add_u32 s4, s0, 24
	s_addc_u32 s5, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s6, 0xffff
	s_mov_b32 s6, exec_lo
	v_mad_u64_u32 v[1:2], null, s15, s8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_i32_e64 s2, v1
	s_cbranch_execz .LBB2_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b32 s9, s[4:5], 0x0
	s_load_b128 s[4:7], s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_mul_i32 s1, s9, s8
	s_mov_b32 s8, 0
.LBB2_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_lshlrev_b64 v[2:3], 2, v[1:2]
	v_add_nc_u32_e32 v1, s1, v1
	v_add_co_u32 v4, vcc_lo, s6, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v3, vcc_lo
	v_cmp_le_i32_e32 vcc_lo, s2, v1
	global_load_b32 v0, v[4:5], off
	s_or_b32 s8, vcc_lo, s8
	s_waitcnt vmcnt(0)
	v_cmp_eq_u32_e64 s0, s3, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v0, 0, 1, s0
	v_add_co_u32 v2, s0, s4, v2
	v_add_co_ci_u32_e64 v3, s0, s5, v3, s0
	global_store_b32 v[2:3], v0, off
	s_and_not1_b32 exec_lo, exec_lo, s8
	s_cbranch_execnz .LBB2_2
.LBB2_3:                                ; %Flow25
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10map_kernelPiS_ii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.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 6
		.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_end2:
	.size	_Z10map_kernelPiS_ii, .Lfunc_end2-_Z10map_kernelPiS_ii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 216
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17prefix_sum_kernelPiS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17prefix_sum_kernelPiS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     4
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
    .group_segment_fixed_size: 8196
    .kernarg_segment_align: 8
    .kernarg_segment_size: 20
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z26improved_prefix_sum_kernelPiS_i
    .private_segment_fixed_size: 0
    .sgpr_count:     12
    .sgpr_spill_count: 0
    .symbol:         _Z26improved_prefix_sum_kernelPiS_i.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .offset:         16
        .size:           4
        .value_kind:     by_value
      - .offset:         20
        .size:           4
        .value_kind:     by_value
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z10map_kernelPiS_ii
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z10map_kernelPiS_ii.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
