//  starter code taken from https://www.topcoder.com/community/competitive-programming/tutorials/assignment-problem-and-hungarian-algorithm/
//
//  edited by Joseph Greshik and Allee Zarrini

#include<iostream>
#include<stdio.h>
#include<string>
#include<fstream>
#include<cstring>

#define INF 100000000 //just infinity
#define THREADS_PER_BLOCK 32
#define BLOCK_SIZE(a) (a < 1) ? 1 : a


int *cost; //cost matrix
int *dcost;

int n, max_match;//n workers and n jobs
int bytes, blocks; //bytes dependent on n

int *lx, *ly; //labels of X and Y parts
int *dlx, *dly;

int *xy; //xy[x] - vertex that is matched with x,
int *yx; //yx[y] - vertex that is matched with y

bool *S, *T; //sets S and T in algorithm
bool *dS, *dT;

int *slack; //as in the algorithm description
int *dslack;
int *slackx; //slackx[y] such a vertex, that
int *dslackx;
// l(slackx[y]) + l(y) - w(slackx[y],y) = slack[y]

int *prev; //array for memorizing alternating paths

bool verbose=false;
bool maximum=false;

int maxi = 0;

__global__ void init_labels(int n, int* lx, int* ly, int *cost) 
{
	int x = blockIdx.x * blockDim.x + threadIdx.x;
	if (x >= n) return;

	lx[x] = 0;
	ly[x] = 0;
	for (int y = 0; y < n; y++) 
		lx[x] = max(lx[x], cost[x*n+y]);
}


//void init_labels_s()
//{
//    memset(lx, 0, sizeof(int)*n);
//    memset(ly, 0, sizeof(int)*n);
//    for (int x = 0; x < n; x++)
//        for (int y = 0; y < n; y++)
//            lx[x] = std::max(lx[x], cost[x][y]);
//}

__global__ void add_to_tree(int x, 
							int prevx, 
							int n, 
							int* lx, 
							int* ly, 
							int* cost, 
							int* slack, 
							int* slackx)
    //x - current vertex,prevx - vertex from X before x in the alternating path,
    //so we add edges (prevx, xy[x]), (xy[x], x)
{
    int y = blockIdx.x * blockDim.x + threadIdx.x;
	if (y >= n) return;

    //update slacks, because we add new vertex to S
    
    if (lx[x] + ly[y] - cost[x*n+y] < slack[y])
    {
        slack[y] = lx[x] + ly[y] - cost[x*n+y];
        slackx[y] = x;
    }
}

//void add_to_tree(int x, int prevx)
//    //x - current vertex,prevx - vertex from X before x in the alternating path,
//    //so we add edges (prevx, xy[x]), (xy[x], x)
//{
//    S[x] = true; //add x to S
//    prev[x] = prevx; //we need this when augmenting
//    for (int y = 0; y < n; y++) //update slacks, because we add new vertex to S
//        if (lx[x] + ly[y] - cost[x*n+y] < slack[y])
//        {
//            slack[y] = lx[x] + ly[y] - cost[x*n+y];
//            slackx[y] = x;
//        }
//}

__global__ void update_labels(int n, 
							  bool* T, 
							  bool* S, 
							  int* lx, 
							  int* ly, 
							  int* slack)
{
	int x = blockIdx.x * blockDim.x + threadIdx.x;
	if (x >= n) return;

	__shared__ int delta;
	delta = 100000000;

	//calculate delta using slack
    if (!T[x])
        atomicMin(&delta, slack[x]);
    
	//update X labels
    __syncthreads();

	if (S[x]) lx[x] -= delta;
	if (T[x]) ly[x] += delta;
	else
    	slack[x] -= delta;
	
}

//void update_labels()
//{
//    int x, delta = INF; //init delta as infinity
//    for (x = 0; x < n; x++) //calculate delta using slack
//        if (!T[x])
//            delta = std::min(delta, slack[x]);
//    for (x = 0; x < n; x++) //update X labels
//    {
//		if (S[x]) lx[x] -= delta;
//        if (T[x]) ly[x] += delta;
//        else
//            slack[x] -= delta;
//	}
//}

void augment() //Main function of the algorithm
{
    if (max_match == n) return; //check wether matching is already perfect
    int x, y, root; //just counters and root vertex
    int *q, wr = 0, rd = 0; //q - queue for bfs, wr,rd - write and read
    q = new int[n];
    //pos in queue
    memset(S, false, sizeof(bool)*n); //init set S
    memset(T, false, sizeof(bool)*n); //init set T
    memset(prev, -1, sizeof(int)*n); //init set prev - for the alternating tree
    for (x = 0; x < n; x++) //finding root of the tree
        if (xy[x] == -1)
        {
            q[wr++] = root = x;
            prev[x] = -2;
            S[x] = true;
            break;
        }
    for (y = 0; y < n; y++) //initializing slack array
    {
        slack[y] = lx[root] + ly[y] - cost[root*n+y];
        slackx[y] = root;
    }

	cudaMemcpy(dslack, slack, bytes, cudaMemcpyHostToDevice);
	cudaMemcpy(dslackx, slackx, bytes, cudaMemcpyHostToDevice);
    //second part of augment() function
    while (true) //main cycle
    {
        while (rd < wr) //building tree with bfs cycle
        {
            x = q[rd++]; //current vertex from X part
            for (y = 0; y < n; y++) //iterate through all edges in equality graph
                if (cost[x*n+y] == lx[x] + ly[y] && !T[y])
                {
                    if (yx[y] == -1) break; //an exposed vertex in Y found, so
                    //augmenting path exists!
                    T[y] = true; //else just add y to T,
                    q[wr++] = yx[y]; //add vertex yx[y], which is matched
                    //with y, to the queue
        			
					S[yx[y]] = true; //add x to S
    				prev[yx[y]] = x; //we need this when augmenting
					
					//add_to_tree(yx[y], x);
					add_to_tree<<<blocks, THREADS_PER_BLOCK>>>(yx[y], x, n, dlx, dly, dcost, dslack, dslackx); //add edges (x,y) and (y,yx[y]) to the tree
					
					
				}
            if (y < n) break; //augmenting path found!
        }
        if (y < n) break; //augmenting path found!
		
		cudaMemcpy(dT, T, sizeof(bool)*n, cudaMemcpyHostToDevice);
		cudaMemcpy(dS, S, sizeof(bool)*n, cudaMemcpyHostToDevice);
		cudaMemcpy(dslack, slack, bytes, cudaMemcpyHostToDevice);
	  	
		//update_labels();
		update_labels<<<blocks, THREADS_PER_BLOCK>>>(n,  dT, dS, dlx, dly, dslack); //augmenting path not found, so improve labeling
        
        cudaMemcpy(lx, dlx, bytes, cudaMemcpyDeviceToHost);
		cudaMemcpy(ly, dly, bytes, cudaMemcpyDeviceToHost);
		cudaMemcpy(slack, dslack, bytes, cudaMemcpyDeviceToHost);
		cudaMemcpy(slackx, dslackx, bytes, cudaMemcpyDeviceToHost);

		wr = rd = 0;
        for (y = 0; y < n; y++)
            //in this cycle we add edges that were added to the equality graph as a
            //result of improving the labeling, we add edge (slackx[y], y) to the tree if
            //and only if !T[y] && slack[y] == 0, also with this edge we add another one
            //(y, yx[y]) or augment the matching, if y was exposed
            if (!T[y] && slack[y] == 0)
            {
                if (yx[y] == -1) //exposed vertex in Y found - augmenting path exists!
                {
                    x = slackx[y];
                    break;
                }
                else
                {
                    T[y] = true; //else just add y to T,
                    if (!S[yx[y]])
                    {
                        q[wr++] = yx[y]; //add vertex yx[y], which is matched with
                        //y, to the queue
                    
					S[yx[y]] = true; //add x to S
    				prev[yx[y]] = slackx[y]; //we need this when augmenting
					
					//add_to_tree(yx[y],slackx[y]);
                    add_to_tree<<<blocks, THREADS_PER_BLOCK>>>(yx[y], slackx[y], n, dlx, dly, dcost, dslack, dslackx); //add edges (x,y) and (y,yx[y]) to the tree
                        //yx[y]) to the tree
					cudaMemcpy(slack, dslack, bytes, cudaMemcpyDeviceToHost);
					cudaMemcpy(slackx, dslackx, bytes, cudaMemcpyDeviceToHost);

					}
                }
            }
        if (y < n) break; //augmenting path found!
    }
    if (y < n) //we found augmenting path!
    {
        max_match++; //increment matching
        //in this cycle we inverse edges along augmenting path
        for (int cx = x, cy = y, ty; cx != -2; cx = prev[cx], cy = ty)
        {
            ty = xy[cx];
            yx[cy] = cx;
            xy[cx] = cy;
        }
        augment(); //recall function, go to step 1 of the algorithm
    }
}//end of augment() function

int hungarian()
{
	int ret = 0;
	max_match = 0;
	
	memset(xy, -1, bytes);
	memset(yx, -1, bytes);
	
	init_labels<<<blocks, THREADS_PER_BLOCK>>>(n, dlx, dly, dcost);
	
	cudaMemcpy(lx, dlx, bytes, cudaMemcpyDeviceToHost);
	cudaMemcpy(ly, dly, bytes, cudaMemcpyDeviceToHost);

	augment(); //steps 1-3

    for (int x = 0; x < n; x++) {//forming answer there
        if (maximum) ret += cost[x*n+xy[x]];
        else ret += maxi-cost[x*n+xy[x]];
    }
    return ret;
}

void output_assignment()
{
    std::cout<<std::endl;
    for (int x = 0; x < n; x++){ //forming answer there
        if (maximum) std::cout<<cost[x*n+xy[x]]<<"\t";
        else std::cout<<maxi-cost[x*n+xy[x]]<<"\t";
    }
    std::cout<<std::endl<<std::endl;
    std::cout<<"Optimal assignment: "<<std::endl;
    for (int x = 0; x < n; x++){ 
        std::cout<<x+1<<" => "<<xy[x]+1;
        if(x!=n-1) std::cout<<", ";
    }
    std::cout<<std::endl;
}

void read_in_cost_matrix(char* filename)
{
    std::ifstream fin (filename);
    fin>>n;

	bytes = sizeof(int)*n;
	blocks = BLOCK_SIZE(bytes / THREADS_PER_BLOCK); 

    cost = new int[n*n];
	cudaMalloc(&dcost, bytes*n);

    lx = new int[n]; ly = new int[n];
    cudaMalloc(&dlx, bytes); cudaMalloc(&dly, bytes);

	xy = new int[n];
	yx = new int[n];

    S = new bool[n]; T = new bool[n];
	cudaMalloc(&dS, sizeof(bool)*n); cudaMalloc(&dT, sizeof(bool)*n);

    slack = new int[n];
	cudaMalloc(&dslack, bytes);
    slackx = new int[n];
	cudaMalloc(&dslackx, bytes);

	prev = new int[n];

    if (verbose) std::cout<<n<<std::endl;
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            fin>>cost[i*n+j];
            if (verbose&&maximum)   std::cout<<cost[i*n+j]<<"\t";
        }
        if (verbose&&maximum) std::cout<<std::endl;
    }
    //* NEW MIN FUNCTION
    if(!maximum){
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                if (cost[i*n+j]>maxi) maxi = cost[i*n+j];
            }
        }
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                if(verbose) std::cout<<cost[i*n+j]<<"\t";
                cost[i*n+j] = maxi - cost[i*n+j];
            }
            if(verbose) std::cout<<std::endl;
        }
    }
    fin.close();

	cudaMemcpy(dcost, cost, bytes*n, cudaMemcpyHostToDevice);

    // std::cout<<"Finished reading input" << std::endl;
}

int main(int argc, char*argv[])
{
    if (argc != 4) {
        std::cerr << "Arguments must be presented as follows." << std::endl;
        std::cerr << "./hungarian_parallel ./matrix/<matrix-file-name> <max/min> <0/1>" << std::endl;
        exit(1);
    }
    //    static const int arr[] = {7,4,2,8,2,3,4,7,1}; 
    verbose=atoi(argv[3]);
    if (std::string(argv[2])=="max") maximum=true;

    clock_t start, end;

    //  start = clock();
    read_in_cost_matrix(argv[1]);
    //  end = clock();
    //  double time_io = double(end - start) / double(CLOCKS_PER_SEC);
    //  std::cout << "File IO: " << time_io << "s" << std::endl;

    start = clock();
    int x=hungarian();    
    end = clock();
    double time_algo = double(end - start) / double(CLOCKS_PER_SEC);

    if (verbose) output_assignment();

    std::cout<<n<<"\t\t"<<x<<"\t\t"<<time_algo<<std::endl;
    // std::cout<<"Algorithm execution: " << time_algo<<"s"<<std::endl;
}

	.file	"tmpxft_0022e369_00000000-6_hungarian_parallel.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3773:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3773:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\t"
.LC1:
	.string	"Optimal assignment: "
.LC2:
	.string	" => "
.LC3:
	.string	", "
	.text
	.globl	_Z17output_assignmentv
	.type	_Z17output_assignmentv, @function
_Z17output_assignmentv:
.LFB3768:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	_ZSt4cout(%rip), %rbx
	movq	%rbx, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L3:
	movl	n(%rip), %eax
	cmpl	%r12d, %eax
	jle	.L13
	movq	xy(%rip), %rdx
	imull	%r12d, %eax
	addl	(%rdx,%r12,4), %eax
	movq	cost(%rip), %rdx
	cltq
	cmpb	$0, maximum(%rip)
	movl	(%rdx,%rax,4), %eax
	movl	%eax, %esi
	jne	.L11
	movl	maxi(%rip), %esi
	subl	%eax, %esi
.L11:
	movq	%rbx, %rdi
	incq	%r12
	call	_ZNSolsEi@PLT
	movq	%rbp, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L3
.L13:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r12
	call	_ZNSolsEPFRSoS_E@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	leaq	.LC1(%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@PLT
.L7:
	cmpl	n(%rip), %ebp
	jge	.L14
	leal	1(%rbp), %esi
	movq	%rbx, %rdi
	call	_ZNSolsEi@PLT
	movq	%r12, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	xy(%rip), %rax
	movl	(%rax,%rbp,4), %esi
	incl	%esi
	call	_ZNSolsEi@PLT
	movl	n(%rip), %eax
	decl	%eax
	cmpl	%eax, %ebp
	je	.L8
	leaq	.LC3(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L8:
	incq	%rbp
	jmp	.L7
.L14:
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_ZNSolsEPFRSoS_E@PLT
	.cfi_endproc
.LFE3768:
	.size	_Z17output_assignmentv, .-_Z17output_assignmentv
	.globl	_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_
	.type	_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_, @function
_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_:
.LFB3795:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 28(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%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	.L15
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z11init_labelsiPiS_S_(%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
.L15:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3795:
	.size	_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_, .-_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_
	.globl	_Z11init_labelsiPiS_S_
	.type	_Z11init_labelsiPiS_S_, @function
_Z11init_labelsiPiS_S_:
.LFB3796:
	.cfi_startproc
	endbr64
	jmp	_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_
	.cfi_endproc
.LFE3796:
	.size	_Z11init_labelsiPiS_S_, .-_Z11init_labelsiPiS_S_
	.globl	_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_
	.type	_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_, @function
_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_:
.LFB3797:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	88(%rsp), %rdi
	movl	%esi, 56(%rsp)
	leaq	100(%rsp), %rsi
	movq	%rax, 16(%rsp)
	movq	232(%rsp), %rax
	movl	%edx, 52(%rsp)
	leaq	72(%rsp), %rdx
	movq	%rcx, 40(%rsp)
	leaq	80(%rsp), %rcx
	movq	%r8, 32(%rsp)
	movq	%r9, 24(%rsp)
	movq	%rax, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 96(%rsp)
	movq	%rax, 136(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 184(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L20
	pushq	80(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z11add_to_treeiiiPiS_S_S_S_(%rip), %rdi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 240
	movq	116(%rsp), %rcx
	movl	124(%rsp), %r8d
	movq	104(%rsp), %rsi
	movl	112(%rsp), %edx
	leaq	152(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L20:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3797:
	.size	_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_, .-_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_
	.globl	_Z11add_to_treeiiiPiS_S_S_S_
	.type	_Z11add_to_treeiiiPiS_S_S_S_, @function
_Z11add_to_treeiiiPiS_S_S_S_:
.LFB3798:
	.cfi_startproc
	endbr64
	jmp	_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_
	.cfi_endproc
.LFE3798:
	.size	_Z11add_to_treeiiiPiS_S_S_S_, .-_Z11add_to_treeiiiPiS_S_S_S_
	.globl	_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_
	.type	_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_, @function
_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_:
.LFB3799:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movl	%edi, 44(%rsp)
	leaq	72(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movq	%rcx, 16(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 8(%rsp)
	movq	%r9, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%rsp, %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L25
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z13update_labelsiPbS_PiS0_S0_(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L25:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3799:
	.size	_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_, .-_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_
	.globl	_Z13update_labelsiPbS_PiS0_S0_
	.type	_Z13update_labelsiPbS_PiS0_S0_, @function
_Z13update_labelsiPbS_PiS0_S0_:
.LFB3800:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_
	.cfi_endproc
.LFE3800:
	.size	_Z13update_labelsiPbS_PiS0_S0_, .-_Z13update_labelsiPbS_PiS0_S0_
	.globl	_Z7augmentv
	.type	_Z7augmentv, @function
_Z7augmentv:
.LFB3766:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rdi
	cmpl	%edi, max_match(%rip)
	jne	.L65
	ret
.L65:
	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	$72, %rsp
	.cfi_def_cfa_offset 128
.L63:
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L32
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	n(%rip), %rcx
	movq	S(%rip), %rdi
	movq	%rax, %r12
	xorl	%eax, %eax
	rep stosb
	movslq	n(%rip), %rcx
	movq	T(%rip), %rdi
	rep stosb
	movb	$-1, %al
	movslq	n(%rip), %rcx
	movq	prev(%rip), %rdi
	salq	$2, %rcx
	rep stosb
	xorl	%eax, %eax
	movl	n(%rip), %edx
	movq	xy(%rip), %rcx
	jmp	.L33
.L32:
	call	__cxa_throw_bad_array_new_length@PLT
.L59:
	movq	%rsi, %rax
.L33:
	movl	%eax, %ebx
	cmpl	%eax, %edx
	jle	.L66
	cmpl	$-1, (%rcx,%rax,4)
	leaq	1(%rax), %rsi
	jne	.L59
	movq	prev(%rip), %rdx
	movl	%eax, (%r12)
	movl	%eax, %r14d
	movl	$1, %r8d
	movl	$-2, (%rdx,%rax,4)
	movq	S(%rip), %rdx
	movb	$1, (%rdx,%rax)
	jmp	.L34
.L66:
	xorl	%r8d, %r8d
.L34:
	movq	lx(%rip), %rcx
	movq	ly(%rip), %rdi
	xorl	%eax, %eax
	movslq	%r14d, %rbp
	movq	cost(%rip), %r10
	movq	slack(%rip), %rsi
	movq	slackx(%rip), %r11
.L36:
	movl	n(%rip), %edx
	cmpl	%eax, %edx
	jle	.L67
	imull	%r14d, %edx
	movl	(%rdi,%rax,4), %r9d
	addl	(%rcx,%rbp,4), %r9d
	addl	%eax, %edx
	movslq	%edx, %rdx
	subl	(%r10,%rdx,4), %r9d
	movl	%r9d, (%rsi,%rax,4)
	movl	%r14d, (%r11,%rax,4)
	incq	%rax
	jmp	.L36
.L67:
	movslq	bytes(%rip), %rdx
	movq	dslack(%rip), %rdi
	movl	%eax, 8(%rsp)
	xorl	%r15d, %r15d
	movl	$1, %ecx
	movl	%r8d, 20(%rsp)
	movabsq	$4294967328, %r13
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$1, %ecx
	movq	slackx(%rip), %rsi
	movq	dslackx(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	8(%rsp), %r9d
	movslq	20(%rsp), %r8
.L38:
	cmpl	%r15d, %r8d
	jle	.L44
	movslq	%r15d, %rax
	xorl	%ebp, %ebp
	movslq	(%r12,%rax,4), %rax
	movq	%rax, %rbx
	salq	$2, %rax
	movq	%rax, 8(%rsp)
.L39:
	movl	n(%rip), %ecx
	movl	%ebp, %r9d
	cmpl	%ebp, %ecx
	jle	.L60
	movl	%ecx, %eax
	movq	lx(%rip), %rsi
	movq	ly(%rip), %rdx
	leaq	0(,%rbp,4), %r11
	imull	%ebx, %eax
	movq	8(%rsp), %rdi
	movl	(%rdx,%rbp,4), %edx
	addl	(%rsi,%rdi), %edx
	movq	cost(%rip), %rsi
	addl	%ebp, %eax
	cltq
	cmpl	%edx, (%rsi,%rax,4)
	jne	.L40
	movq	T(%rip), %rsi
	addq	%rbp, %rsi
	cmpb	$0, (%rsi)
	jne	.L40
	movq	%r11, %rax
	addq	yx(%rip), %rax
	movq	%r11, 24(%rsp)
	movl	(%rax), %edx
	cmpl	$-1, %edx
	je	.L41
	movb	$1, (%rsi)
	leal	1(%r8), %esi
	xorl	%r9d, %r9d
	movl	$1, %ecx
	movl	%edx, (%r12,%r8,4)
	movq	S(%rip), %rdx
	xorl	%r8d, %r8d
	movslq	(%rax), %rax
	movl	%esi, 20(%rsp)
	movb	$1, (%rdx,%rax)
	movq	prev(%rip), %rdx
	movl	%ebx, (%rdx,%rax,4)
	movl	blocks(%rip), %eax
	movq	%r13, %rdx
	movq	%r13, 52(%rsp)
	movl	%eax, 40(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 44(%rsp)
	movq	40(%rsp), %rdi
	movl	48(%rsp), %esi
	movl	$1, 60(%rsp)
	call	__cudaPushCallConfiguration@PLT
	movq	24(%rsp), %r11
	testl	%eax, %eax
	jne	.L42
	movq	yx(%rip), %rax
	movq	dlx(%rip), %rcx
	movl	%ebx, %esi
	movq	dcost(%rip), %r9
	movq	dly(%rip), %r8
	movl	(%rax,%r11), %edi
	movl	n(%rip), %edx
	pushq	dslackx(%rip)
	.cfi_def_cfa_offset 136
	pushq	dslack(%rip)
	.cfi_def_cfa_offset 144
	call	_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_
	popq	%rcx
	.cfi_def_cfa_offset 136
	popq	%rsi
	.cfi_def_cfa_offset 128
.L42:
	movslq	20(%rsp), %r8
.L40:
	incq	%rbp
	jmp	.L39
.L41:
	cmpl	%r9d, %ecx
	jg	.L44
.L60:
	incl	%r15d
	jmp	.L38
.L44:
	movslq	n(%rip), %rdx
	cmpl	%r9d, %edx
	jg	.L46
	movq	T(%rip), %rsi
	movq	dT(%rip), %rdi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movslq	n(%rip), %rdx
	movl	$1, %ecx
	movq	S(%rip), %rsi
	movq	dS(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$1, %ecx
	movq	slack(%rip), %rsi
	movq	dslack(%rip), %rdi
	call	cudaMemcpy@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r13, %rdx
	movl	blocks(%rip), %eax
	movl	$1, %ecx
	movq	%r13, 52(%rsp)
	movl	$1, 60(%rsp)
	movl	%eax, 40(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 44(%rsp)
	movq	40(%rsp), %rdi
	movl	48(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L47
	movq	dslack(%rip), %r9
	movq	dly(%rip), %r8
	movq	dlx(%rip), %rcx
	movq	dS(%rip), %rdx
	movq	dT(%rip), %rsi
	movl	n(%rip), %edi
	call	_Z44__device_stub__Z13update_labelsiPbS_PiS0_S0_iPbS_PiS0_S0_
.L47:
	movslq	bytes(%rip), %rdx
	movq	dlx(%rip), %rsi
	movl	$2, %ecx
	xorl	%r15d, %r15d
	movq	lx(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	movq	dly(%rip), %rsi
	movq	ly(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	movq	dslack(%rip), %rsi
	movq	slack(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	movq	dslackx(%rip), %rsi
	movq	slackx(%rip), %rdi
	call	cudaMemcpy@PLT
	xorl	%r8d, %r8d
.L48:
	cmpl	%r15d, n(%rip)
	movl	%r15d, %r9d
	jle	.L68
	movq	T(%rip), %rdx
	addq	%r15, %rdx
	cmpb	$0, (%rdx)
	jne	.L51
	movq	slack(%rip), %rax
	leaq	0(,%r15,4), %rbp
	cmpl	$0, (%rax,%r15,4)
	jne	.L51
	movq	yx(%rip), %rcx
	addq	%rbp, %rcx
	movl	(%rcx), %eax
	cmpl	$-1, %eax
	jne	.L52
	movq	slackx(%rip), %rax
	cmpl	%r9d, n(%rip)
	movl	(%rax,%rbp), %ebx
	jg	.L46
	jmp	.L30
.L52:
	movb	$1, (%rdx)
	movq	S(%rip), %rdx
	movslq	%eax, %rsi
	cmpb	$0, (%rdx,%rsi)
	jne	.L51
	movl	%eax, (%r12,%r8,4)
	movslq	(%rcx), %rax
	leal	1(%r8), %esi
	xorl	%r9d, %r9d
	movl	%esi, 8(%rsp)
	xorl	%r8d, %r8d
	movb	$1, (%rdx,%rax)
	movq	slackx(%rip), %rdx
	movl	(%rdx,%rbp), %ecx
	movq	prev(%rip), %rdx
	movl	%ecx, (%rdx,%rax,4)
	movl	blocks(%rip), %eax
	movq	%r13, %rdx
	movl	$1, %ecx
	movq	%r13, 52(%rsp)
	movl	%eax, 40(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 44(%rsp)
	movq	40(%rsp), %rdi
	movl	48(%rsp), %esi
	movl	$1, 60(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L53
	movq	slackx(%rip), %rax
	movl	n(%rip), %edx
	movq	dcost(%rip), %r9
	movq	dly(%rip), %r8
	movl	(%rax,%rbp), %esi
	movq	yx(%rip), %rax
	movq	dlx(%rip), %rcx
	movl	(%rax,%rbp), %edi
	pushq	dslackx(%rip)
	.cfi_def_cfa_offset 136
	pushq	dslack(%rip)
	.cfi_def_cfa_offset 144
	call	_Z42__device_stub__Z11add_to_treeiiiPiS_S_S_S_iiiPiS_S_S_S_
	popq	%rax
	.cfi_def_cfa_offset 136
	popq	%rdx
	.cfi_def_cfa_offset 128
.L53:
	movslq	bytes(%rip), %rdx
	movq	dslack(%rip), %rsi
	movl	$2, %ecx
	movq	slack(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	movq	dslackx(%rip), %rsi
	movq	slackx(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	8(%rsp), %r8
.L51:
	incq	%r15
	jmp	.L48
.L68:
	xorl	%r15d, %r15d
	jmp	.L38
.L46:
	incl	max_match(%rip)
	movq	xy(%rip), %rcx
	movq	yx(%rip), %rsi
	movq	prev(%rip), %rdi
.L56:
	cmpl	$-2, %ebx
	jne	.L57
	movslq	n(%rip), %rdi
	cmpl	%edi, max_match(%rip)
	jne	.L63
	jmp	.L30
.L57:
	movslq	%ebx, %rax
	movslq	%r9d, %r10
	leaq	(%rcx,%rax,4), %rdx
	movl	(%rdx), %r8d
	movl	%ebx, (%rsi,%r10,4)
	movl	%r9d, (%rdx)
	movl	(%rdi,%rax,4), %ebx
	movl	%r8d, %r9d
	jmp	.L56
.L30:
	addq	$72, %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
.LFE3766:
	.size	_Z7augmentv, .-_Z7augmentv
	.globl	_Z9hungarianv
	.type	_Z9hungarianv, @function
_Z9hungarianv:
.LFB3767:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	xorl	%eax, %eax
	movl	$134217729, %edx
	xorl	%r9d, %r9d
	salq	$5, %rdx
	xorl	%r8d, %r8d
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movslq	bytes(%rip), %rcx
	movl	%eax, max_match(%rip)
	movb	$-1, %al
	movq	xy(%rip), %rdi
	movq	%rdx, 20(%rsp)
	movl	$1, 28(%rsp)
	rep stosb
	movslq	bytes(%rip), %rcx
	movq	yx(%rip), %rdi
	rep stosb
	movl	$1, %ecx
	movl	blocks(%rip), %eax
	movl	%eax, 8(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 12(%rsp)
	movq	8(%rsp), %rdi
	movl	16(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L70
	movq	dcost(%rip), %rcx
	movq	dly(%rip), %rdx
	movq	dlx(%rip), %rsi
	movl	n(%rip), %edi
	call	_Z36__device_stub__Z11init_labelsiPiS_S_iPiS_S_
.L70:
	movslq	bytes(%rip), %rdx
	movq	dlx(%rip), %rsi
	movl	$2, %ecx
	movq	lx(%rip), %rdi
	call	cudaMemcpy@PLT
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	movq	ly(%rip), %rdi
	movq	dly(%rip), %rsi
	call	cudaMemcpy@PLT
	call	_Z7augmentv
	movl	n(%rip), %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movb	maximum(%rip), %r8b
	movl	maxi(%rip), %r9d
	xorl	%eax, %eax
	movq	cost(%rip), %r10
	movq	xy(%rip), %r11
.L71:
	cmpl	%edx, %edi
	jle	.L76
	movl	(%r11,%rdx,4), %esi
	addl	%ecx, %esi
	movslq	%esi, %rsi
	movl	(%r10,%rsi,4), %esi
	testb	%r8b, %r8b
	je	.L72
	addl	%esi, %eax
	jmp	.L73
.L72:
	movl	%r9d, %ebx
	subl	%esi, %ebx
	addl	%ebx, %eax
.L73:
	incq	%rdx
	addl	%edi, %ecx
	jmp	.L71
.L76:
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3767:
	.size	_Z9hungarianv, .-_Z9hungarianv
	.section	.rodata.str1.1
.LC4:
	.string	"_Z13update_labelsiPbS_PiS0_S0_"
.LC5:
	.string	"_Z11add_to_treeiiiPiS_S_S_S_"
.LC6:
	.string	"_Z11init_labelsiPiS_S_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3802:
	.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	.LC4(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z13update_labelsiPbS_PiS0_S0_(%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	.LC5(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11add_to_treeiiiPiS_S_S_S_(%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	.LC6(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z11init_labelsiPiS_S_(%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
.LFE3802:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.text
	.globl	_Z19read_in_cost_matrixPc
	.type	_Z19read_in_cost_matrixPc, @function
_Z19read_in_cost_matrixPc:
.LFB3769:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3769
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rdi, %rsi
	movl	$8, %edx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$536, %rsp
	.cfi_def_cfa_offset 576
	movq	%fs:40, %rax
	movq	%rax, 520(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	n(%rip), %rsi
	movq	%rbx, %rdi
.LEHB1:
	call	_ZNSirsERi@PLT
	movl	n(%rip), %edi
	movl	$1, %edx
	leal	0(,%rdi,4), %eax
	movl	%eax, bytes(%rip)
	cmpl	$31, %eax
	jle	.L80
	sarl	$5, %eax
	movl	%eax, %edx
.L80:
	imull	%edi, %edi
	movl	%edx, blocks(%rip)
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	_Znam@PLT
	movl	bytes(%rip), %esi
	imull	n(%rip), %esi
	leaq	dcost(%rip), %rdi
	movq	%rax, cost(%rip)
	movslq	%esi, %rsi
	call	cudaMalloc@PLT
	movslq	n(%rip), %rdi
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L81
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	n(%rip), %rdi
	movq	%rax, lx(%rip)
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jnb	.L134
	jmp	.L145
.L81:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L134:
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	bytes(%rip), %rsi
	leaq	dlx(%rip), %rdi
	movq	%rax, ly(%rip)
	call	cudaMalloc@PLT
	jmp	.L146
.L145:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L146:
	movslq	bytes(%rip), %rsi
	leaq	dly(%rip), %rdi
	call	cudaMalloc@PLT
	movslq	n(%rip), %rdi
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L87
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	n(%rip), %rdi
	movq	%rax, xy(%rip)
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jnb	.L136
	jmp	.L147
.L87:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L136:
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	n(%rip), %rdi
	movq	%rax, yx(%rip)
	call	_Znam@PLT
	jmp	.L148
.L147:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L148:
	movslq	n(%rip), %rdi
	movq	%rax, S(%rip)
	call	_Znam@PLT
	movslq	n(%rip), %rsi
	leaq	dS(%rip), %rdi
	movq	%rax, T(%rip)
	call	cudaMalloc@PLT
	movslq	n(%rip), %rsi
	leaq	dT(%rip), %rdi
	call	cudaMalloc@PLT
	movslq	n(%rip), %rdi
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L93
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	bytes(%rip), %rsi
	leaq	dslack(%rip), %rdi
	movq	%rax, slack(%rip)
	call	cudaMalloc@PLT
	jmp	.L149
.L93:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L149:
	movslq	n(%rip), %rdi
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L96
	salq	$2, %rdi
	call	_Znam@PLT
	movslq	bytes(%rip), %rsi
	leaq	dslackx(%rip), %rdi
	movq	%rax, slackx(%rip)
	call	cudaMalloc@PLT
	jmp	.L150
.L96:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L150:
	movslq	n(%rip), %rdi
	movabsq	$2305843009213693950, %rax
	cmpq	%rdi, %rax
	jb	.L99
	salq	$2, %rdi
	call	_Znam@PLT
	cmpb	$0, verbose(%rip)
	movq	%rax, prev(%rip)
	movl	n(%rip), %esi
	je	.L102
	jmp	.L151
.L99:
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	call	__cxa_throw_bad_array_new_length@PLT
.L151:
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L102:
	xorl	%ebp, %ebp
	leaq	_ZSt4cout(%rip), %r13
.L103:
	movl	n(%rip), %eax
	cmpl	%ebp, %eax
	jle	.L152
	xorl	%r12d, %r12d
.L107:
	movl	n(%rip), %eax
	cmpl	%r12d, %eax
	jle	.L153
	imull	%ebp, %eax
	movq	cost(%rip), %rdx
	movq	%rsp, %rdi
	addl	%r12d, %eax
	cltq
	leaq	(%rdx,%rax,4), %rsi
	call	_ZNSirsERi@PLT
	cmpb	$0, verbose(%rip)
	movl	n(%rip), %eax
	je	.L104
	cmpb	$0, maximum(%rip)
	je	.L104
	imull	%ebp, %eax
	movq	cost(%rip), %rdx
	movq	%r13, %rdi
	addl	%r12d, %eax
	cltq
	movl	(%rdx,%rax,4), %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC0(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L104:
	incl	%r12d
	jmp	.L107
.L153:
	cmpb	$0, verbose(%rip)
	je	.L106
	cmpb	$0, maximum(%rip)
	je	.L106
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L106:
	incl	%ebp
	jmp	.L103
.L152:
	cmpb	$0, maximum(%rip)
	je	.L108
.L118:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	jmp	.L154
.L108:
	movslq	%eax, %rsi
	movq	cost(%rip), %rdi
	xorl	%ecx, %ecx
	salq	$2, %rsi
.L110:
	cmpl	%ecx, %eax
	jle	.L155
	xorl	%edx, %edx
.L112:
	movl	(%rdi,%rdx,4), %r8d
	cmpl	maxi(%rip), %r8d
	jle	.L111
	movl	%r8d, maxi(%rip)
.L111:
	incq	%rdx
	cmpl	%edx, %eax
	jg	.L112
	incl	%ecx
	addq	%rsi, %rdi
	jmp	.L110
.L155:
	xorl	%ebp, %ebp
	leaq	_ZSt4cout(%rip), %r13
.L113:
	cmpl	%ebp, n(%rip)
	jle	.L118
	xorl	%r12d, %r12d
.L117:
	movl	n(%rip), %eax
	movb	verbose(%rip), %dl
	cmpl	%r12d, %eax
	jle	.L156
	imull	%ebp, %eax
	movq	cost(%rip), %rcx
	addl	%r12d, %eax
	cltq
	movl	(%rcx,%rax,4), %esi
	testb	%dl, %dl
	je	.L114
	movq	%r13, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC0(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
.L114:
	movl	n(%rip), %eax
	movq	cost(%rip), %rdx
	imull	%ebp, %eax
	addl	%r12d, %eax
	incl	%r12d
	cltq
	leaq	(%rdx,%rax,4), %rdx
	movl	maxi(%rip), %eax
	subl	(%rdx), %eax
	movl	%eax, (%rdx)
	jmp	.L117
.L156:
	testb	%dl, %dl
	je	.L116
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
.L116:
	incl	%ebp
	jmp	.L113
.L154:
	movl	bytes(%rip), %edx
	imull	n(%rip), %edx
	movl	$1, %ecx
	movq	cost(%rip), %rsi
	movq	dcost(%rip), %rdi
	movslq	%edx, %rdx
	call	cudaMemcpy@PLT
.LEHE1:
	movq	%rsp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	je	.L121
	jmp	.L142
.L126:
	endbr64
	movq	%rax, %rbp
.L119:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	520(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	movq	%rbp, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L142:
	call	__stack_chk_fail@PLT
.L121:
	addq	$536, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3769:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3769:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3769-.LLSDACSB3769
.LLSDACSB3769:
	.uleb128 .LEHB0-.LFB3769
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3769
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L126-.LFB3769
	.uleb128 0
	.uleb128 .LEHB2-.LFB3769
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3769:
	.text
	.size	_Z19read_in_cost_matrixPc, .-_Z19read_in_cost_matrixPc
	.section	.rodata.str1.1
.LC7:
	.string	"Arguments must be presented as follows."
.LC8:
	.string	"./hungarian_parallel ./matrix/<matrix-file-name> <max/min> <0/1>"
.LC9:
	.string	"basic_string: construction from null is not valid"
.LC10:
	.string	"max"
.LC12:
	.string	"\t\t"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB3770:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	cmpl	$4, %edi
	je	.L158
	leaq	_ZSt4cerr(%rip), %rbx
	leaq	.LC7(%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@PLT
	leaq	.LC8(%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@PLT
	movl	$1, %edi
	call	exit@PLT
.L158:
	movq	24(%rsi), %rdi
	movq	%rsi, %rbx
	leaq	8(%rsp), %r12
	call	atoi@PLT
	movq	16(%rbx), %rbp
	testl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	setne	verbose(%rip)
	testq	%rbp, %rbp
	jne	.L159
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L171
	leaq	.LC9(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L159:
	movq	%rbp, %rdi
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r13
	cmpq	$15, %rax
	jbe	.L161
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, 8(%rsp)
	movq	(%rsp), %rax
	movq	%rax, 24(%rsp)
.L161:
	movq	8(%rsp), %rdi
	movq	%r13, %rdx
	movq	%rbp, %rsi
	xorl	%ebp, %ebp
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	8(%rsp), %rdx
	movq	%rax, 16(%rsp)
	movb	$0, (%rdx,%rax)
	cmpq	$3, 16(%rsp)
	jne	.L162
	movq	8(%rsp), %rdi
	movl	$3, %edx
	leaq	.LC10(%rip), %rsi
	call	memcmp@PLT
	testl	%eax, %eax
	sete	%bpl
.L162:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	testb	%bpl, %bpl
	je	.L163
	movb	$1, maximum(%rip)
.L163:
	movq	8(%rbx), %rdi
	call	_Z19read_in_cost_matrixPc
	call	clock@PLT
	movq	%rax, %rbx
	call	_Z9hungarianv
	movl	%eax, %r12d
	call	clock@PLT
	subq	%rbx, %rax
	cmpb	$0, verbose(%rip)
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC11(%rip), %xmm0
	movq	%xmm0, %rbx
	je	.L164
	call	_Z17output_assignmentv
.L164:
	movl	n(%rip), %esi
	leaq	_ZSt4cout(%rip), %rdi
	leaq	.LC12(%rip), %rbp
	call	_ZNSolsEi@PLT
	movq	%rbp, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	%r12d, %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rbp, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rbx, %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L165
.L171:
	call	__stack_chk_fail@PLT
.L165:
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3770:
	.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	maxi
	.bss
	.align 4
	.type	maxi, @object
	.size	maxi, 4
maxi:
	.zero	4
	.globl	maximum
	.type	maximum, @object
	.size	maximum, 1
maximum:
	.zero	1
	.globl	verbose
	.type	verbose, @object
	.size	verbose, 1
verbose:
	.zero	1
	.globl	prev
	.align 8
	.type	prev, @object
	.size	prev, 8
prev:
	.zero	8
	.globl	dslackx
	.align 8
	.type	dslackx, @object
	.size	dslackx, 8
dslackx:
	.zero	8
	.globl	slackx
	.align 8
	.type	slackx, @object
	.size	slackx, 8
slackx:
	.zero	8
	.globl	dslack
	.align 8
	.type	dslack, @object
	.size	dslack, 8
dslack:
	.zero	8
	.globl	slack
	.align 8
	.type	slack, @object
	.size	slack, 8
slack:
	.zero	8
	.globl	dT
	.align 8
	.type	dT, @object
	.size	dT, 8
dT:
	.zero	8
	.globl	dS
	.align 8
	.type	dS, @object
	.size	dS, 8
dS:
	.zero	8
	.globl	T
	.align 8
	.type	T, @object
	.size	T, 8
T:
	.zero	8
	.globl	S
	.align 8
	.type	S, @object
	.size	S, 8
S:
	.zero	8
	.globl	yx
	.align 8
	.type	yx, @object
	.size	yx, 8
yx:
	.zero	8
	.globl	xy
	.align 8
	.type	xy, @object
	.size	xy, 8
xy:
	.zero	8
	.globl	dly
	.align 8
	.type	dly, @object
	.size	dly, 8
dly:
	.zero	8
	.globl	dlx
	.align 8
	.type	dlx, @object
	.size	dlx, 8
dlx:
	.zero	8
	.globl	ly
	.align 8
	.type	ly, @object
	.size	ly, 8
ly:
	.zero	8
	.globl	lx
	.align 8
	.type	lx, @object
	.size	lx, 8
lx:
	.zero	8
	.globl	blocks
	.align 4
	.type	blocks, @object
	.size	blocks, 4
blocks:
	.zero	4
	.globl	bytes
	.align 4
	.type	bytes, @object
	.size	bytes, 4
bytes:
	.zero	4
	.globl	max_match
	.align 4
	.type	max_match, @object
	.size	max_match, 4
max_match:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	dcost
	.align 8
	.type	dcost, @object
	.size	dcost, 8
dcost:
	.zero	8
	.globl	cost
	.align 8
	.type	cost, @object
	.size	cost, 8
cost:
	.zero	8
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC11:
	.long	0
	.long	1093567616
	.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:

//  starter code taken from https://www.topcoder.com/community/competitive-programming/tutorials/assignment-problem-and-hungarian-algorithm/
//
//  edited by Joseph Greshik and Allee Zarrini


#include <hip/hip_runtime.h>
#include<iostream>
#include<stdio.h>
#include<string>
#include<fstream>
#include<cstring>

#define INF 100000000 //just infinity
#define THREADS_PER_BLOCK 32
#define BLOCK_SIZE(a) (a < 1) ? 1 : a


int *cost; //cost matrix
int *dcost;

int n, max_match;//n workers and n jobs
int bytes, blocks; //bytes dependent on n

int *lx, *ly; //labels of X and Y parts
int *dlx, *dly;

int *xy; //xy[x] - vertex that is matched with x,
int *yx; //yx[y] - vertex that is matched with y

bool *S, *T; //sets S and T in algorithm
bool *dS, *dT;

int *slack; //as in the algorithm description
int *dslack;
int *slackx; //slackx[y] such a vertex, that
int *dslackx;
// l(slackx[y]) + l(y) - w(slackx[y],y) = slack[y]

int *prev; //array for memorizing alternating paths

bool verbose=false;
bool maximum=false;

int maxi = 0;

__global__ void init_labels(int n, int* lx, int* ly, int *cost) 
{
	int x = blockIdx.x * blockDim.x + threadIdx.x;
	if (x >= n) return;

	lx[x] = 0;
	ly[x] = 0;
	for (int y = 0; y < n; y++) 
		lx[x] = max(lx[x], cost[x*n+y]);
}


//void init_labels_s()
//{
//    memset(lx, 0, sizeof(int)*n);
//    memset(ly, 0, sizeof(int)*n);
//    for (int x = 0; x < n; x++)
//        for (int y = 0; y < n; y++)
//            lx[x] = std::max(lx[x], cost[x][y]);
//}

__global__ void add_to_tree(int x, 
							int prevx, 
							int n, 
							int* lx, 
							int* ly, 
							int* cost, 
							int* slack, 
							int* slackx)
    //x - current vertex,prevx - vertex from X before x in the alternating path,
    //so we add edges (prevx, xy[x]), (xy[x], x)
{
    int y = blockIdx.x * blockDim.x + threadIdx.x;
	if (y >= n) return;

    //update slacks, because we add new vertex to S
    
    if (lx[x] + ly[y] - cost[x*n+y] < slack[y])
    {
        slack[y] = lx[x] + ly[y] - cost[x*n+y];
        slackx[y] = x;
    }
}

//void add_to_tree(int x, int prevx)
//    //x - current vertex,prevx - vertex from X before x in the alternating path,
//    //so we add edges (prevx, xy[x]), (xy[x], x)
//{
//    S[x] = true; //add x to S
//    prev[x] = prevx; //we need this when augmenting
//    for (int y = 0; y < n; y++) //update slacks, because we add new vertex to S
//        if (lx[x] + ly[y] - cost[x*n+y] < slack[y])
//        {
//            slack[y] = lx[x] + ly[y] - cost[x*n+y];
//            slackx[y] = x;
//        }
//}

__global__ void update_labels(int n, 
							  bool* T, 
							  bool* S, 
							  int* lx, 
							  int* ly, 
							  int* slack)
{
	int x = blockIdx.x * blockDim.x + threadIdx.x;
	if (x >= n) return;

	__shared__ int delta;
	delta = 100000000;

	//calculate delta using slack
    if (!T[x])
        atomicMin(&delta, slack[x]);
    
	//update X labels
    __syncthreads();

	if (S[x]) lx[x] -= delta;
	if (T[x]) ly[x] += delta;
	else
    	slack[x] -= delta;
	
}

//void update_labels()
//{
//    int x, delta = INF; //init delta as infinity
//    for (x = 0; x < n; x++) //calculate delta using slack
//        if (!T[x])
//            delta = std::min(delta, slack[x]);
//    for (x = 0; x < n; x++) //update X labels
//    {
//		if (S[x]) lx[x] -= delta;
//        if (T[x]) ly[x] += delta;
//        else
//            slack[x] -= delta;
//	}
//}

void augment() //Main function of the algorithm
{
    if (max_match == n) return; //check wether matching is already perfect
    int x, y, root; //just counters and root vertex
    int *q, wr = 0, rd = 0; //q - queue for bfs, wr,rd - write and read
    q = new int[n];
    //pos in queue
    memset(S, false, sizeof(bool)*n); //init set S
    memset(T, false, sizeof(bool)*n); //init set T
    memset(prev, -1, sizeof(int)*n); //init set prev - for the alternating tree
    for (x = 0; x < n; x++) //finding root of the tree
        if (xy[x] == -1)
        {
            q[wr++] = root = x;
            prev[x] = -2;
            S[x] = true;
            break;
        }
    for (y = 0; y < n; y++) //initializing slack array
    {
        slack[y] = lx[root] + ly[y] - cost[root*n+y];
        slackx[y] = root;
    }

	hipMemcpy(dslack, slack, bytes, hipMemcpyHostToDevice);
	hipMemcpy(dslackx, slackx, bytes, hipMemcpyHostToDevice);
    //second part of augment() function
    while (true) //main cycle
    {
        while (rd < wr) //building tree with bfs cycle
        {
            x = q[rd++]; //current vertex from X part
            for (y = 0; y < n; y++) //iterate through all edges in equality graph
                if (cost[x*n+y] == lx[x] + ly[y] && !T[y])
                {
                    if (yx[y] == -1) break; //an exposed vertex in Y found, so
                    //augmenting path exists!
                    T[y] = true; //else just add y to T,
                    q[wr++] = yx[y]; //add vertex yx[y], which is matched
                    //with y, to the queue
        			
					S[yx[y]] = true; //add x to S
    				prev[yx[y]] = x; //we need this when augmenting
					
					//add_to_tree(yx[y], x);
					add_to_tree<<<blocks, THREADS_PER_BLOCK>>>(yx[y], x, n, dlx, dly, dcost, dslack, dslackx); //add edges (x,y) and (y,yx[y]) to the tree
					
					
				}
            if (y < n) break; //augmenting path found!
        }
        if (y < n) break; //augmenting path found!
		
		hipMemcpy(dT, T, sizeof(bool)*n, hipMemcpyHostToDevice);
		hipMemcpy(dS, S, sizeof(bool)*n, hipMemcpyHostToDevice);
		hipMemcpy(dslack, slack, bytes, hipMemcpyHostToDevice);
	  	
		//update_labels();
		update_labels<<<blocks, THREADS_PER_BLOCK>>>(n,  dT, dS, dlx, dly, dslack); //augmenting path not found, so improve labeling
        
        hipMemcpy(lx, dlx, bytes, hipMemcpyDeviceToHost);
		hipMemcpy(ly, dly, bytes, hipMemcpyDeviceToHost);
		hipMemcpy(slack, dslack, bytes, hipMemcpyDeviceToHost);
		hipMemcpy(slackx, dslackx, bytes, hipMemcpyDeviceToHost);

		wr = rd = 0;
        for (y = 0; y < n; y++)
            //in this cycle we add edges that were added to the equality graph as a
            //result of improving the labeling, we add edge (slackx[y], y) to the tree if
            //and only if !T[y] && slack[y] == 0, also with this edge we add another one
            //(y, yx[y]) or augment the matching, if y was exposed
            if (!T[y] && slack[y] == 0)
            {
                if (yx[y] == -1) //exposed vertex in Y found - augmenting path exists!
                {
                    x = slackx[y];
                    break;
                }
                else
                {
                    T[y] = true; //else just add y to T,
                    if (!S[yx[y]])
                    {
                        q[wr++] = yx[y]; //add vertex yx[y], which is matched with
                        //y, to the queue
                    
					S[yx[y]] = true; //add x to S
    				prev[yx[y]] = slackx[y]; //we need this when augmenting
					
					//add_to_tree(yx[y],slackx[y]);
                    add_to_tree<<<blocks, THREADS_PER_BLOCK>>>(yx[y], slackx[y], n, dlx, dly, dcost, dslack, dslackx); //add edges (x,y) and (y,yx[y]) to the tree
                        //yx[y]) to the tree
					hipMemcpy(slack, dslack, bytes, hipMemcpyDeviceToHost);
					hipMemcpy(slackx, dslackx, bytes, hipMemcpyDeviceToHost);

					}
                }
            }
        if (y < n) break; //augmenting path found!
    }
    if (y < n) //we found augmenting path!
    {
        max_match++; //increment matching
        //in this cycle we inverse edges along augmenting path
        for (int cx = x, cy = y, ty; cx != -2; cx = prev[cx], cy = ty)
        {
            ty = xy[cx];
            yx[cy] = cx;
            xy[cx] = cy;
        }
        augment(); //recall function, go to step 1 of the algorithm
    }
}//end of augment() function

int hungarian()
{
	int ret = 0;
	max_match = 0;
	
	memset(xy, -1, bytes);
	memset(yx, -1, bytes);
	
	init_labels<<<blocks, THREADS_PER_BLOCK>>>(n, dlx, dly, dcost);
	
	hipMemcpy(lx, dlx, bytes, hipMemcpyDeviceToHost);
	hipMemcpy(ly, dly, bytes, hipMemcpyDeviceToHost);

	augment(); //steps 1-3

    for (int x = 0; x < n; x++) {//forming answer there
        if (maximum) ret += cost[x*n+xy[x]];
        else ret += maxi-cost[x*n+xy[x]];
    }
    return ret;
}

void output_assignment()
{
    std::cout<<std::endl;
    for (int x = 0; x < n; x++){ //forming answer there
        if (maximum) std::cout<<cost[x*n+xy[x]]<<"\t";
        else std::cout<<maxi-cost[x*n+xy[x]]<<"\t";
    }
    std::cout<<std::endl<<std::endl;
    std::cout<<"Optimal assignment: "<<std::endl;
    for (int x = 0; x < n; x++){ 
        std::cout<<x+1<<" => "<<xy[x]+1;
        if(x!=n-1) std::cout<<", ";
    }
    std::cout<<std::endl;
}

void read_in_cost_matrix(char* filename)
{
    std::ifstream fin (filename);
    fin>>n;

	bytes = sizeof(int)*n;
	blocks = BLOCK_SIZE(bytes / THREADS_PER_BLOCK); 

    cost = new int[n*n];
	hipMalloc(&dcost, bytes*n);

    lx = new int[n]; ly = new int[n];
    hipMalloc(&dlx, bytes); hipMalloc(&dly, bytes);

	xy = new int[n];
	yx = new int[n];

    S = new bool[n]; T = new bool[n];
	hipMalloc(&dS, sizeof(bool)*n); hipMalloc(&dT, sizeof(bool)*n);

    slack = new int[n];
	hipMalloc(&dslack, bytes);
    slackx = new int[n];
	hipMalloc(&dslackx, bytes);

	prev = new int[n];

    if (verbose) std::cout<<n<<std::endl;
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            fin>>cost[i*n+j];
            if (verbose&&maximum)   std::cout<<cost[i*n+j]<<"\t";
        }
        if (verbose&&maximum) std::cout<<std::endl;
    }
    //* NEW MIN FUNCTION
    if(!maximum){
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                if (cost[i*n+j]>maxi) maxi = cost[i*n+j];
            }
        }
        for(int i=0;i<n;++i){
            for(int j=0;j<n;++j){
                if(verbose) std::cout<<cost[i*n+j]<<"\t";
                cost[i*n+j] = maxi - cost[i*n+j];
            }
            if(verbose) std::cout<<std::endl;
        }
    }
    fin.close();

	hipMemcpy(dcost, cost, bytes*n, hipMemcpyHostToDevice);

    // std::cout<<"Finished reading input" << std::endl;
}

int main(int argc, char*argv[])
{
    if (argc != 4) {
        std::cerr << "Arguments must be presented as follows." << std::endl;
        std::cerr << "./hungarian_parallel ./matrix/<matrix-file-name> <max/min> <0/1>" << std::endl;
        exit(1);
    }
    //    static const int arr[] = {7,4,2,8,2,3,4,7,1}; 
    verbose=atoi(argv[3]);
    if (std::string(argv[2])=="max") maximum=true;

    clock_t start, end;

    //  start = clock();
    read_in_cost_matrix(argv[1]);
    //  end = clock();
    //  double time_io = double(end - start) / double(CLOCKS_PER_SEC);
    //  std::cout << "File IO: " << time_io << "s" << std::endl;

    start = clock();
    int x=hungarian();    
    end = clock();
    double time_algo = double(end - start) / double(CLOCKS_PER_SEC);

    if (verbose) output_assignment();

    std::cout<<n<<"\t\t"<<x<<"\t\t"<<time_algo<<std::endl;
    // std::cout<<"Algorithm execution: " << time_algo<<"s"<<std::endl;
}

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

                                        # End of file scope inline assembly
	.globl	_Z26__device_stub__init_labelsiPiS_S_ # -- Begin function _Z26__device_stub__init_labelsiPiS_S_
	.type	_Z26__device_stub__init_labelsiPiS_S_,@function
_Z26__device_stub__init_labelsiPiS_S_:  # @_Z26__device_stub__init_labelsiPiS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$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	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	40(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	32(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	24(%rsp), %rdx
	movq	%rcx, (%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	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11init_labelsiPiS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z26__device_stub__init_labelsiPiS_S_, .Lfunc_end0-_Z26__device_stub__init_labelsiPiS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z26__device_stub__add_to_treeiiiPiS_S_S_S_ # -- Begin function _Z26__device_stub__add_to_treeiiiPiS_S_S_S_
	.type	_Z26__device_stub__add_to_treeiiiPiS_S_S_S_,@function
_Z26__device_stub__add_to_treeiiiPiS_S_S_S_: # @_Z26__device_stub__add_to_treeiiiPiS_S_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	20(%rsp), %rax
	movl	%edi, (%rax)
	leaq	16(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	56(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	48(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	40(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	216(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z11add_to_treeiiiPiS_S_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z26__device_stub__add_to_treeiiiPiS_S_S_S_, .Lfunc_end1-_Z26__device_stub__add_to_treeiiiPiS_S_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z28__device_stub__update_labelsiPbS_PiS0_S0_ # -- Begin function _Z28__device_stub__update_labelsiPbS_PiS0_S0_
	.type	_Z28__device_stub__update_labelsiPbS_PiS0_S0_,@function
_Z28__device_stub__update_labelsiPbS_PiS0_S0_: # @_Z28__device_stub__update_labelsiPbS_PiS0_S0_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z13update_labelsiPbS_PiS0_S0_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z28__device_stub__update_labelsiPbS_PiS0_S0_, .Lfunc_end2-_Z28__device_stub__update_labelsiPbS_PiS0_S0_
	.cfi_endproc
                                        # -- End function
	.globl	_Z7augmentv                     # -- Begin function _Z7augmentv
	.type	_Z7augmentv,@function
_Z7augmentv:                            # @_Z7augmentv
	.cfi_startproc
# %bb.0:
	movl	n(%rip), %edx
	cmpl	%edx, max_match(%rip)
	je	.LBB3_48
# %bb.1:                                # %.lr.ph166.preheader
	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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
.LBB3_4:                                # %.lr.ph166
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_7 Depth 2
                                        #     Child Loop BB3_14 Depth 2
                                        #     Child Loop BB3_16 Depth 2
                                        #       Child Loop BB3_20 Depth 3
                                        #         Child Loop BB3_23 Depth 4
                                        #       Child Loop BB3_34 Depth 3
                                        #     Child Loop BB3_41 Depth 2
	movslq	%edx, %r14
	leaq	(,%r14,4), %rdi
	testl	%r14d, %r14d
	movq	$-1, %rax
	cmovsq	%rax, %rdi
	callq	_Znam
	movq	%rax, %rbx
	movq	S(%rip), %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	memset@PLT
	movq	T(%rip), %rdi
	movslq	n(%rip), %rdx
	xorl	%esi, %esi
	callq	memset@PLT
	movq	prev(%rip), %rdi
	movslq	n(%rip), %rdx
	shlq	$2, %rdx
	movl	$255, %esi
	callq	memset@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.LBB3_5
# %bb.6:                                # %.lr.ph
                                        #   in Loop: Header=BB3_4 Depth=1
	movq	xy(%rip), %rcx
	xorl	%r14d, %r14d
.LBB3_7:                                #   Parent Loop BB3_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	$-1, (%rcx,%r14,4)
	je	.LBB3_8
# %bb.9:                                #   in Loop: Header=BB3_7 Depth=2
	incq	%r14
	cmpq	%r14, %rax
	jne	.LBB3_7
# %bb.10:                               # %.loopexit125.loopexit
                                        #   in Loop: Header=BB3_4 Depth=1
	xorl	%r15d, %r15d
	movl	%eax, %r14d
	jmp	.LBB3_11
.LBB3_5:                                # %.loopexit125.thread
                                        #   in Loop: Header=BB3_4 Depth=1
	xorl	%r15d, %r15d
	movq	slack(%rip), %rsi
	xorl	%r14d, %r14d
	jmp	.LBB3_12
.LBB3_8:                                #   in Loop: Header=BB3_4 Depth=1
	movl	%r14d, (%rbx)
	movq	prev(%rip), %rax
	movl	$-2, (%rax,%r14,4)
	movq	S(%rip), %rax
	movb	$1, (%rax,%r14)
	movl	n(%rip), %eax
	movl	$1, %r15d
.LBB3_11:                               # %.loopexit125
                                        #   in Loop: Header=BB3_4 Depth=1
	movq	slack(%rip), %rsi
	testl	%eax, %eax
	jle	.LBB3_12
# %bb.13:                               # %.lr.ph140
                                        #   in Loop: Header=BB3_4 Depth=1
	movq	lx(%rip), %rcx
	movl	%r14d, %edx
	movq	ly(%rip), %rdi
	movq	cost(%rip), %r8
	movq	slackx(%rip), %r9
	xorl	%r13d, %r13d
.LBB3_14:                               #   Parent Loop BB3_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%rdi,%r13,4), %r10d
	addl	(%rcx,%rdx,4), %r10d
	imull	%r14d, %eax
	cltq
	addq	%r13, %rax
	subl	(%r8,%rax,4), %r10d
	movl	%r10d, (%rsi,%r13,4)
	movl	%r14d, (%r9,%r13,4)
	incq	%r13
	movslq	n(%rip), %rax
	cmpq	%rax, %r13
	jl	.LBB3_14
	jmp	.LBB3_15
.LBB3_12:                               #   in Loop: Header=BB3_4 Depth=1
	xorl	%r13d, %r13d
.LBB3_15:                               # %._crit_edge
                                        #   in Loop: Header=BB3_4 Depth=1
	movq	dslack(%rip), %rdi
	movslq	bytes(%rip), %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	dslackx(%rip), %rdi
	movq	slackx(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	n(%rip), %edx
.LBB3_16:                               # %.loopexit122
                                        #   Parent Loop BB3_4 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB3_20 Depth 3
                                        #         Child Loop BB3_23 Depth 4
                                        #       Child Loop BB3_34 Depth 3
	testl	%r15d, %r15d
	jle	.LBB3_29
# %bb.17:                               # %.lr.ph151.preheader
                                        #   in Loop: Header=BB3_16 Depth=2
	movl	%edx, %eax
	xorl	%ebp, %ebp
.LBB3_20:                               # %.lr.ph151
                                        #   Parent Loop BB3_4 Depth=1
                                        #     Parent Loop BB3_16 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB3_23 Depth 4
	movl	(%rbx,%rbp,4), %r14d
	testl	%eax, %eax
	jle	.LBB3_21
# %bb.22:                               # %.lr.ph145
                                        #   in Loop: Header=BB3_20 Depth=3
	movslq	%r14d, %r12
	xorl	%r13d, %r13d
.LBB3_23:                               #   Parent Loop BB3_4 Depth=1
                                        #     Parent Loop BB3_16 Depth=2
                                        #       Parent Loop BB3_20 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movq	cost(%rip), %rcx
	imull	%r14d, %eax
	cltq
	addq	%r13, %rax
	movq	lx(%rip), %rsi
	movq	ly(%rip), %rdi
	movl	(%rdi,%r13,4), %edi
	addl	(%rsi,%r12,4), %edi
	cmpl	%edi, (%rcx,%rax,4)
	jne	.LBB3_28
# %bb.24:                               #   in Loop: Header=BB3_23 Depth=4
	movq	T(%rip), %rcx
	cmpb	$0, (%rcx,%r13)
	jne	.LBB3_28
# %bb.25:                               #   in Loop: Header=BB3_23 Depth=4
	movq	yx(%rip), %rax
	movslq	(%rax,%r13,4), %rax
	cmpq	$-1, %rax
	je	.LBB3_29
# %bb.26:                               #   in Loop: Header=BB3_23 Depth=4
	movb	$1, %dl
	movb	%dl, (%rcx,%r13)
	movslq	%r15d, %rcx
	incl	%r15d
	movl	%eax, (%rbx,%rcx,4)
	movq	S(%rip), %rcx
	movb	%dl, (%rcx,%rax)
	movq	prev(%rip), %rcx
	movl	%r14d, (%rcx,%rax,4)
	movl	blocks(%rip), %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	leaq	32(%rax), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	movl	n(%rip), %edx
	testl	%eax, %eax
	jne	.LBB3_28
# %bb.27:                               #   in Loop: Header=BB3_23 Depth=4
	movq	yx(%rip), %rax
	movl	(%rax,%r13,4), %edi
	movq	dlx(%rip), %rcx
	movq	dly(%rip), %r8
	movq	dcost(%rip), %r9
	movl	%r14d, %esi
	pushq	dslackx(%rip)
	.cfi_adjust_cfa_offset 8
	pushq	dslack(%rip)
	.cfi_adjust_cfa_offset 8
	callq	_Z26__device_stub__add_to_treeiiiPiS_S_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
	movl	n(%rip), %edx
.LBB3_28:                               #   in Loop: Header=BB3_23 Depth=4
	incq	%r13
	movslq	%edx, %rcx
	movl	%edx, %eax
	cmpq	%rcx, %r13
	jl	.LBB3_23
# %bb.18:                               # %.loopexit.loopexit
                                        #   in Loop: Header=BB3_20 Depth=3
	movl	%edx, %eax
	jmp	.LBB3_19
.LBB3_21:                               #   in Loop: Header=BB3_20 Depth=3
	xorl	%r13d, %r13d
.LBB3_19:                               # %.loopexit
                                        #   in Loop: Header=BB3_20 Depth=3
	incq	%rbp
	movslq	%r15d, %rcx
	cmpq	%rcx, %rbp
	jl	.LBB3_20
.LBB3_29:                               # %.thread
                                        #   in Loop: Header=BB3_16 Depth=2
	cmpl	%edx, %r13d
	jl	.LBB3_38
# %bb.30:                               #   in Loop: Header=BB3_16 Depth=2
	movq	dT(%rip), %rdi
	movq	T(%rip), %rsi
	movslq	%edx, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	dS(%rip), %rdi
	movq	S(%rip), %rsi
	movslq	n(%rip), %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	dslack(%rip), %rdi
	movq	slack(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	blocks(%rip), %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	leaq	32(%rax), %r12
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_32
# %bb.31:                               #   in Loop: Header=BB3_16 Depth=2
	movl	n(%rip), %edi
	movq	dT(%rip), %rsi
	movq	dS(%rip), %rdx
	movq	dlx(%rip), %rcx
	movq	dly(%rip), %r8
	movq	dslack(%rip), %r9
	callq	_Z28__device_stub__update_labelsiPbS_PiS0_S0_
.LBB3_32:                               #   in Loop: Header=BB3_16 Depth=2
	movq	lx(%rip), %rdi
	movq	dlx(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	ly(%rip), %rdi
	movq	dly(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	slack(%rip), %rdi
	movq	dslack(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	slackx(%rip), %rdi
	movq	dslackx(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	n(%rip), %edx
	xorl	%r15d, %r15d
	movl	$0, %r13d
	testl	%edx, %edx
	jle	.LBB3_16
# %bb.33:                               # %.lr.ph157.preheader
                                        #   in Loop: Header=BB3_16 Depth=2
	xorl	%r13d, %r13d
	movq	T(%rip), %rax
	xorl	%r15d, %r15d
.LBB3_34:                               # %.lr.ph157
                                        #   Parent Loop BB3_4 Depth=1
                                        #     Parent Loop BB3_16 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpb	$0, (%rax,%r13)
	jne	.LBB3_46
# %bb.35:                               #   in Loop: Header=BB3_34 Depth=3
	movq	slack(%rip), %rcx
	cmpl	$0, (%rcx,%r13,4)
	jne	.LBB3_46
# %bb.36:                               #   in Loop: Header=BB3_34 Depth=3
	movq	yx(%rip), %rcx
	movslq	(%rcx,%r13,4), %rcx
	cmpq	$-1, %rcx
	je	.LBB3_37
# %bb.42:                               #   in Loop: Header=BB3_34 Depth=3
	movb	$1, (%rax,%r13)
	movq	S(%rip), %rsi
	cmpb	$0, (%rsi,%rcx)
	jne	.LBB3_46
# %bb.43:                               #   in Loop: Header=BB3_34 Depth=3
	movslq	%r15d, %rax
	movl	%ecx, (%rbx,%rax,4)
	movb	$1, (%rsi,%rcx)
	movq	slackx(%rip), %rax
	movl	(%rax,%r13,4), %eax
	movq	prev(%rip), %rdx
	movl	%eax, (%rdx,%rcx,4)
	movl	blocks(%rip), %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	movl	$1, %esi
	movq	%r12, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_45
# %bb.44:                               #   in Loop: Header=BB3_34 Depth=3
	movq	yx(%rip), %rax
	movl	(%rax,%r13,4), %edi
	movq	slackx(%rip), %rax
	movl	(%rax,%r13,4), %esi
	movl	n(%rip), %edx
	movq	dlx(%rip), %rcx
	movq	dly(%rip), %r8
	movq	dcost(%rip), %r9
	pushq	dslackx(%rip)
	.cfi_adjust_cfa_offset 8
	pushq	dslack(%rip)
	.cfi_adjust_cfa_offset 8
	callq	_Z26__device_stub__add_to_treeiiiPiS_S_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB3_45:                               #   in Loop: Header=BB3_34 Depth=3
	incl	%r15d
	movq	slack(%rip), %rdi
	movq	dslack(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	slackx(%rip), %rdi
	movq	dslackx(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	T(%rip), %rax
	movl	n(%rip), %edx
.LBB3_46:                               #   in Loop: Header=BB3_34 Depth=3
	incq	%r13
	movslq	%edx, %rcx
	cmpq	%rcx, %r13
	jl	.LBB3_34
	jmp	.LBB3_16
.LBB3_37:                               # %.thread120
                                        #   in Loop: Header=BB3_4 Depth=1
	movq	slackx(%rip), %rax
	movl	(%rax,%r13,4), %r14d
.LBB3_38:                               # %.loopexit124
                                        #   in Loop: Header=BB3_4 Depth=1
	cmpl	%edx, %r13d
	jge	.LBB3_47
# %bb.39:                               #   in Loop: Header=BB3_4 Depth=1
	movl	max_match(%rip), %eax
	incl	%eax
	movl	%eax, max_match(%rip)
	cmpl	$-2, %r14d
	je	.LBB3_3
# %bb.40:                               # %.lr.ph164
                                        #   in Loop: Header=BB3_4 Depth=1
	movq	xy(%rip), %rax
	movq	yx(%rip), %rcx
	movq	prev(%rip), %rdx
.LBB3_41:                               #   Parent Loop BB3_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movslq	%r14d, %rsi
	movslq	%r13d, %rdi
	movl	(%rax,%rsi,4), %r8d
	movl	%esi, (%rcx,%rdi,4)
	movl	%edi, (%rax,%rsi,4)
	movl	(%rdx,%rsi,4), %r14d
	movl	%r8d, %r13d
	cmpl	$-2, %r14d
	jne	.LBB3_41
# %bb.2:                                # %tailrecurse.loopexit.loopexit
                                        #   in Loop: Header=BB3_4 Depth=1
	movl	max_match(%rip), %eax
	movl	n(%rip), %edx
.LBB3_3:                                # %tailrecurse.loopexit
                                        #   in Loop: Header=BB3_4 Depth=1
	cmpl	%edx, %eax
	jne	.LBB3_4
.LBB3_47:
	addq	$8, %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
	.cfi_restore %rbx
	.cfi_restore %r12
	.cfi_restore %r13
	.cfi_restore %r14
	.cfi_restore %r15
	.cfi_restore %rbp
.LBB3_48:                               # %._crit_edge167
	retq
.Lfunc_end3:
	.size	_Z7augmentv, .Lfunc_end3-_Z7augmentv
	.cfi_endproc
                                        # -- End function
	.globl	_Z9hungarianv                   # -- Begin function _Z9hungarianv
	.type	_Z9hungarianv,@function
_Z9hungarianv:                          # @_Z9hungarianv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	$0, max_match(%rip)
	movq	xy(%rip), %rdi
	movslq	bytes(%rip), %rdx
	movl	$255, %esi
	callq	memset@PLT
	movq	yx(%rip), %rdi
	movslq	bytes(%rip), %rdx
	movl	$255, %esi
	callq	memset@PLT
	movl	blocks(%rip), %edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$32, %rdx
	xorl	%ebx, %ebx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB4_2
# %bb.1:
	movl	n(%rip), %edi
	movq	dlx(%rip), %rsi
	movq	dly(%rip), %rdx
	movq	dcost(%rip), %rcx
	callq	_Z26__device_stub__init_labelsiPiS_S_
.LBB4_2:
	movq	lx(%rip), %rdi
	movq	dlx(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movq	ly(%rip), %rdi
	movq	dly(%rip), %rsi
	movslq	bytes(%rip), %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	callq	_Z7augmentv
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.LBB4_5
# %bb.3:                                # %.lr.ph
	movb	maximum(%rip), %cl
	movq	cost(%rip), %rdx
	movq	xy(%rip), %rsi
	movl	maxi(%rip), %edi
	leaq	(,%rax,4), %r8
	xorl	%r9d, %r9d
	xorl	%ebx, %ebx
.LBB4_4:                                # =>This Inner Loop Header: Depth=1
	movslq	(%rsi,%r9,4), %r10
	movl	(%rdx,%r10,4), %r10d
	movl	%edi, %r11d
	subl	%r10d, %r11d
	testb	%cl, %cl
	cmovnel	%r10d, %r11d
	addl	%r11d, %ebx
	incq	%r9
	addq	%r8, %rdx
	cmpq	%r9, %rax
	jne	.LBB4_4
.LBB4_5:                                # %._crit_edge
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z9hungarianv, .Lfunc_end4-_Z9hungarianv
	.cfi_endproc
                                        # -- End function
	.globl	_Z17output_assignmentv          # -- Begin function _Z17output_assignmentv
	.type	_Z17output_assignmentv,@function
_Z17output_assignmentv:                 # @_Z17output_assignmentv
	.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	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %r14d
	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	n(%rip), %eax
	testl	%eax, %eax
	jle	.LBB5_4
# %bb.1:                                # %.lr.ph.preheader
	xorl	%ebx, %ebx
.LBB5_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	cmpb	$0, maximum(%rip)
	je	.LBB5_10
# %bb.3:                                #   in Loop: Header=BB5_2 Depth=1
	movq	cost(%rip), %rcx
	imull	%ebx, %eax
	movq	xy(%rip), %rdx
	movslq	(%rdx,%rbx,4), %rdx
	cltq
	addq	%rdx, %rax
	movl	(%rcx,%rax,4), %esi
	jmp	.LBB5_11
.LBB5_10:                               #   in Loop: Header=BB5_2 Depth=1
	movl	maxi(%rip), %esi
	movq	cost(%rip), %rcx
	imull	%ebx, %eax
	movq	xy(%rip), %rdx
	movslq	(%rdx,%rbx,4), %rdx
	cltq
	addq	%rdx, %rax
	subl	(%rcx,%rax,4), %esi
.LBB5_11:                               #   in Loop: Header=BB5_2 Depth=1
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%rbx
	movslq	n(%rip), %rax
	cmpq	%rax, %rbx
	jl	.LBB5_2
.LBB5_4:                                # %._crit_edge
	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
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.1, %esi
	movl	$20, %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
	cmpl	$0, n(%rip)
	jle	.LBB5_9
# %bb.5:                                # %.lr.ph17.preheader
	xorl	%ebx, %ebx
.LBB5_6:                                # %.lr.ph17
                                        # =>This Inner Loop Header: Depth=1
	movq	%rbx, %r15
	incq	%rbx
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.2, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	xy(%rip), %rax
	movl	(%rax,%r15,4), %esi
	incl	%esi
	movq	%r14, %rdi
	callq	_ZNSolsEi
	movl	n(%rip), %eax
	leal	-1(%rax), %ecx
	cmpq	%rcx, %r15
	je	.LBB5_8
# %bb.7:                                #   in Loop: Header=BB5_6 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.3, %esi
	movl	$2, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	n(%rip), %eax
.LBB5_8:                                #   in Loop: Header=BB5_6 Depth=1
	cltq
	cmpq	%rax, %rbx
	jl	.LBB5_6
.LBB5_9:                                # %._crit_edge18
	movq	_ZSt4cout(%rip), %rax
	movl	$_ZSt4cout, %ecx
	movq	-24(%rax), %rdi
	addq	%rcx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end5:
	.size	_Z17output_assignmentv, .Lfunc_end5-_Z17output_assignmentv
	.cfi_endproc
                                        # -- End function
	.globl	_Z19read_in_cost_matrixPc       # -- Begin function _Z19read_in_cost_matrixPc
	.type	_Z19read_in_cost_matrixPc,@function
_Z19read_in_cost_matrixPc:              # @_Z19read_in_cost_matrixPc
.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	$520, %rsp                      # imm = 0x208
	.cfi_def_cfa_offset 576
	.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	%rdi, %rsi
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp0:
	movl	$n, %esi
	movq	%rbx, %rdi
	callq	_ZNSirsERi
.Ltmp1:
# %bb.1:
	movl	n(%rip), %ebx
	leal	(,%rbx,4), %ebp
	movl	%ebp, bytes(%rip)
	leal	31(,%rbx,4), %eax
	testl	%ebp, %ebp
	cmovnsl	%ebp, %eax
	sarl	$5, %eax
	cmpl	$32, %ebp
	movl	$1, %ecx
	cmovgel	%eax, %ecx
	movl	%ecx, blocks(%rip)
	movl	%ebx, %edi
	imull	%edi, %edi
	shlq	$2, %rdi
.Ltmp2:
	callq	_Znam
.Ltmp3:
# %bb.2:
	movq	%rax, cost(%rip)
	imull	%ebx, %ebp
	movslq	%ebp, %rsi
.Ltmp4:
	movl	$dcost, %edi
	callq	hipMalloc
.Ltmp5:
# %bb.3:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
	movslq	n(%rip), %rax
	leaq	(,%rax,4), %rcx
	testq	%rax, %rax
	movq	$-1, %rbx
	cmovnsq	%rcx, %rbx
.Ltmp6:
	movq	%rbx, %rdi
	callq	_Znam
.Ltmp7:
# %bb.4:
	movq	%rax, lx(%rip)
.Ltmp8:
	movq	%rbx, %rdi
	callq	_Znam
.Ltmp9:
# %bb.5:
	movq	%rax, ly(%rip)
	movslq	bytes(%rip), %rsi
.Ltmp10:
	movl	$dlx, %edi
	callq	hipMalloc
.Ltmp11:
# %bb.6:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit54
	movslq	bytes(%rip), %rsi
.Ltmp12:
	movl	$dly, %edi
	callq	hipMalloc
.Ltmp13:
# %bb.7:                                # %_ZL9hipMallocIiE10hipError_tPPT_m.exit55
	movslq	n(%rip), %rbx
	leaq	(,%rbx,4), %rax
	testq	%rbx, %rbx
	movq	$-1, %r14
	cmovnsq	%rax, %r14
.Ltmp14:
	movq	%r14, %rdi
	callq	_Znam
.Ltmp15:
# %bb.8:
	movq	%rax, xy(%rip)
.Ltmp16:
	movq	%r14, %rdi
	callq	_Znam
.Ltmp17:
# %bb.9:
	movq	%rax, yx(%rip)
.Ltmp18:
	movq	%rbx, %rdi
	callq	_Znam
.Ltmp19:
# %bb.10:
	movq	%rax, S(%rip)
.Ltmp20:
	movq	%rbx, %rdi
	callq	_Znam
.Ltmp21:
# %bb.11:
	movq	%rax, T(%rip)
.Ltmp22:
	movl	$dS, %edi
	movq	%rbx, %rsi
	callq	hipMalloc
.Ltmp23:
# %bb.12:                               # %_ZL9hipMallocIbE10hipError_tPPT_m.exit
	movslq	n(%rip), %rsi
.Ltmp24:
	movl	$dT, %edi
	callq	hipMalloc
.Ltmp25:
# %bb.13:                               # %_ZL9hipMallocIbE10hipError_tPPT_m.exit56
	movslq	n(%rip), %rax
	leaq	(,%rax,4), %rcx
	testq	%rax, %rax
	movq	$-1, %rdi
	cmovnsq	%rcx, %rdi
.Ltmp26:
	callq	_Znam
.Ltmp27:
# %bb.14:
	movq	%rax, slack(%rip)
	movslq	bytes(%rip), %rsi
.Ltmp28:
	movl	$dslack, %edi
	callq	hipMalloc
.Ltmp29:
# %bb.15:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit57
	movslq	n(%rip), %rax
	leaq	(,%rax,4), %rcx
	testq	%rax, %rax
	movq	$-1, %rdi
	cmovnsq	%rcx, %rdi
.Ltmp30:
	callq	_Znam
.Ltmp31:
# %bb.16:
	movq	%rax, slackx(%rip)
	movslq	bytes(%rip), %rsi
.Ltmp32:
	movl	$dslackx, %edi
	callq	hipMalloc
.Ltmp33:
# %bb.17:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit58
	movslq	n(%rip), %rbx
	leaq	(,%rbx,4), %rax
	testq	%rbx, %rbx
	movq	$-1, %rdi
	cmovnsq	%rax, %rdi
.Ltmp34:
	callq	_Znam
.Ltmp35:
# %bb.18:
	movq	%rax, prev(%rip)
	cmpb	$0, verbose(%rip)
	je	.LBB6_24
# %bb.19:
.Ltmp36:
	movl	$_ZSt4cout, %edi
	movl	%ebx, %esi
	callq	_ZNSolsEi
.Ltmp37:
# %bb.20:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp38:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp39:
# %bb.21:                               # %.noexc
.Ltmp40:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp41:
# %bb.22:                               # %.noexc62
.Ltmp42:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp43:
# %bb.23:                               # %.noexc62._ZNSolsEPFRSoS_E.exit_crit_edge
	movl	n(%rip), %ebx
.LBB6_24:                               # %_ZNSolsEPFRSoS_E.exit
	testl	%ebx, %ebx
	jle	.LBB6_41
# %bb.25:                               # %.preheader75.preheader
	xorl	%r15d, %r15d
	movq	%rsp, %r14
	movl	$_ZSt4cout, %r12d
.LBB6_26:                               # %.preheader75
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_28 Depth 2
	testl	%ebx, %ebx
	jle	.LBB6_34
# %bb.27:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB6_26 Depth=1
	movslq	%r15d, %r13
	xorl	%ebp, %ebp
.LBB6_28:                               # %.lr.ph
                                        #   Parent Loop BB6_26 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	imull	%r15d, %ebx
	movslq	%ebx, %rsi
	addq	%rbp, %rsi
	shlq	$2, %rsi
	addq	cost(%rip), %rsi
.Ltmp44:
	movq	%r14, %rdi
	callq	_ZNSirsERi
.Ltmp45:
# %bb.29:                               #   in Loop: Header=BB6_28 Depth=2
	cmpb	$0, verbose(%rip)
	je	.LBB6_33
# %bb.30:                               #   in Loop: Header=BB6_28 Depth=2
	cmpb	$0, maximum(%rip)
	je	.LBB6_33
# %bb.31:                               #   in Loop: Header=BB6_28 Depth=2
	movq	cost(%rip), %rax
	movslq	n(%rip), %rcx
	imulq	%r13, %rcx
	addq	%rbp, %rcx
	movl	(%rax,%rcx,4), %esi
.Ltmp46:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp47:
# %bb.32:                               #   in Loop: Header=BB6_28 Depth=2
.Ltmp48:
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp49:
.LBB6_33:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
                                        #   in Loop: Header=BB6_28 Depth=2
	movl	n(%rip), %ebx
	incq	%rbp
	cmpl	%ebx, %ebp
	jl	.LBB6_28
.LBB6_34:                               # %._crit_edge
                                        #   in Loop: Header=BB6_26 Depth=1
	cmpb	$0, verbose(%rip)
	je	.LBB6_40
# %bb.35:                               # %._crit_edge
                                        #   in Loop: Header=BB6_26 Depth=1
	cmpb	$0, maximum(%rip)
	je	.LBB6_40
# %bb.36:                               #   in Loop: Header=BB6_26 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
.Ltmp51:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp52:
# %bb.37:                               # %.noexc64
                                        #   in Loop: Header=BB6_26 Depth=1
.Ltmp53:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp54:
# %bb.38:                               # %.noexc65
                                        #   in Loop: Header=BB6_26 Depth=1
.Ltmp55:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp56:
# %bb.39:                               # %.noexc65._ZNSolsEPFRSoS_E.exit59_crit_edge
                                        #   in Loop: Header=BB6_26 Depth=1
	movl	n(%rip), %ebx
.LBB6_40:                               # %_ZNSolsEPFRSoS_E.exit59
                                        #   in Loop: Header=BB6_26 Depth=1
	incl	%r15d
	cmpl	%ebx, %r15d
	jl	.LBB6_26
.LBB6_41:                               # %._crit_edge80
	cmpb	$0, maximum(%rip)
	je	.LBB6_42
.LBB6_64:                               # %.loopexit
.Ltmp70:
	movq	%rsp, %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp71:
# %bb.65:
	movq	dcost(%rip), %rdi
	movq	cost(%rip), %rsi
	movslq	bytes(%rip), %rax
	movslq	n(%rip), %rdx
	imulq	%rax, %rdx
.Ltmp72:
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp73:
# %bb.66:
	movq	%rsp, %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	addq	$520, %rsp                      # imm = 0x208
	.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
.LBB6_42:                               # %.preheader74
	.cfi_def_cfa_offset 576
	testl	%ebx, %ebx
	jle	.LBB6_64
# %bb.43:                               # %.preheader73.lr.ph
	movl	maxi(%rip), %edx
	movq	cost(%rip), %rax
	movl	%ebx, %ecx
	xorl	%esi, %esi
	xorl	%edi, %edi
.LBB6_44:                               # %.lr.ph82
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_45 Depth 2
	movl	%esi, %r8d
	leaq	(%rax,%r8,4), %r8
	xorl	%r9d, %r9d
.LBB6_45:                               #   Parent Loop BB6_44 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	(%r8,%r9,4), %r10d
	cmpl	%edx, %r10d
	jle	.LBB6_47
# %bb.46:                               #   in Loop: Header=BB6_45 Depth=2
	movl	%r10d, maxi(%rip)
	movl	%r10d, %edx
.LBB6_47:                               #   in Loop: Header=BB6_45 Depth=2
	incq	%r9
	cmpq	%r9, %rcx
	jne	.LBB6_45
# %bb.48:                               # %._crit_edge83
                                        #   in Loop: Header=BB6_44 Depth=1
	incq	%rdi
	addl	%ebx, %esi
	cmpq	%rcx, %rdi
	jne	.LBB6_44
# %bb.49:                               # %.preheader72
	testl	%ebx, %ebx
	jle	.LBB6_64
# %bb.50:                               # %.preheader.preheader
	xorl	%r14d, %r14d
	movl	$_ZSt4cout, %r15d
.LBB6_51:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB6_53 Depth 2
	testl	%ebx, %ebx
	jle	.LBB6_58
# %bb.52:                               # %.lr.ph92.preheader
                                        #   in Loop: Header=BB6_51 Depth=1
	xorl	%r12d, %r12d
.LBB6_53:                               # %.lr.ph92
                                        #   Parent Loop BB6_51 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpb	$0, verbose(%rip)
	movq	cost(%rip), %rax
	je	.LBB6_57
# %bb.54:                               #   in Loop: Header=BB6_53 Depth=2
	imull	%r14d, %ebx
	addl	%r12d, %ebx
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %esi
.Ltmp58:
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
.Ltmp59:
# %bb.55:                               #   in Loop: Header=BB6_53 Depth=2
.Ltmp60:
	movl	$.L.str, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp61:
# %bb.56:                               # %._ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit60_crit_edge
                                        #   in Loop: Header=BB6_53 Depth=2
	movq	cost(%rip), %rax
	movl	n(%rip), %ebx
.LBB6_57:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit60
                                        #   in Loop: Header=BB6_53 Depth=2
	movl	maxi(%rip), %ecx
	imull	%r14d, %ebx
	movslq	%ebx, %rdx
	addq	%r12, %rdx
	subl	(%rax,%rdx,4), %ecx
	movl	%ecx, (%rax,%rdx,4)
	movl	n(%rip), %ebx
	incq	%r12
	cmpl	%ebx, %r12d
	jl	.LBB6_53
.LBB6_58:                               # %._crit_edge93
                                        #   in Loop: Header=BB6_51 Depth=1
	cmpb	$0, verbose(%rip)
	je	.LBB6_63
# %bb.59:                               #   in Loop: Header=BB6_51 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp63:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp64:
# %bb.60:                               # %.noexc68
                                        #   in Loop: Header=BB6_51 Depth=1
.Ltmp65:
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
.Ltmp66:
# %bb.61:                               # %.noexc69
                                        #   in Loop: Header=BB6_51 Depth=1
.Ltmp67:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp68:
# %bb.62:                               # %.noexc69._ZNSolsEPFRSoS_E.exit61_crit_edge
                                        #   in Loop: Header=BB6_51 Depth=1
	movl	n(%rip), %ebx
.LBB6_63:                               # %_ZNSolsEPFRSoS_E.exit61
                                        #   in Loop: Header=BB6_51 Depth=1
	incl	%r14d
	cmpl	%ebx, %r14d
	jl	.LBB6_51
	jmp	.LBB6_64
.LBB6_72:
.Ltmp69:
	jmp	.LBB6_70
.LBB6_69:
.Ltmp74:
	jmp	.LBB6_70
.LBB6_68:
.Ltmp57:
	jmp	.LBB6_70
.LBB6_71:
.Ltmp62:
	jmp	.LBB6_70
.LBB6_67:
.Ltmp50:
.LBB6_70:
	movq	%rax, %rbx
	movq	%rsp, %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end6:
	.size	_Z19read_in_cost_matrixPc, .Lfunc_end6-_Z19read_in_cost_matrixPc
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table6:
.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 .Ltmp43-.Ltmp0                 #   Call between .Ltmp0 and .Ltmp43
	.uleb128 .Ltmp74-.Lfunc_begin0          #     jumps to .Ltmp74
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp44-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp49-.Ltmp44                #   Call between .Ltmp44 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin0          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp56-.Ltmp51                #   Call between .Ltmp51 and .Ltmp56
	.uleb128 .Ltmp57-.Lfunc_begin0          #     jumps to .Ltmp57
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp70-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp73-.Ltmp70                #   Call between .Ltmp70 and .Ltmp73
	.uleb128 .Ltmp74-.Lfunc_begin0          #     jumps to .Ltmp74
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp58-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp61-.Ltmp58                #   Call between .Ltmp58 and .Ltmp61
	.uleb128 .Ltmp62-.Lfunc_begin0          #     jumps to .Ltmp62
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp63-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp68-.Ltmp63                #   Call between .Ltmp63 and .Ltmp68
	.uleb128 .Ltmp69-.Lfunc_begin0          #     jumps to .Ltmp69
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp68-.Lfunc_begin0          # >> Call Site 8 <<
	.uleb128 .Lfunc_end6-.Ltmp68            #   Call between .Ltmp68 and .Lfunc_end6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI7_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.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	%rbx
	.cfi_def_cfa_offset 40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	cmpl	$4, %edi
	jne	.LBB7_11
# %bb.1:
	movq	%rsi, %rbx
	movq	24(%rsi), %rdi
	callq	atoi
	testl	%eax, %eax
	setne	verbose(%rip)
	movq	16(%rbx), %rsi
	leaq	24(%rsp), %r14
	leaq	15(%rsp), %rdx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	movq	(%r14), %rdi
	cmpq	$3, 8(%r14)
	jne	.LBB7_2
# %bb.3:
	movzwl	(%rdi), %eax
	xorl	$24941, %eax                    # imm = 0x616D
	movzbl	2(%rdi), %ecx
	xorl	$120, %ecx
	orw	%ax, %cx
	sete	%bpl
	jmp	.LBB7_4
.LBB7_2:
	xorl	%ebp, %ebp
.LBB7_4:                                # %_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_.exit
	leaq	40(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB7_6
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB7_6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	testb	%bpl, %bpl
	je	.LBB7_8
# %bb.7:
	movb	$1, maximum(%rip)
.LBB7_8:
	movq	8(%rbx), %rdi
	callq	_Z19read_in_cost_matrixPc
	callq	clock
	movq	%rax, %r14
	callq	_Z9hungarianv
	movl	%eax, %ebx
	callq	clock
	movq	%rax, %r15
	cmpb	$0, verbose(%rip)
	je	.LBB7_10
# %bb.9:
	callq	_Z17output_assignmentv
.LBB7_10:
	subq	%r14, %r15
	cvtsi2sd	%r15, %xmm0
	divsd	.LCPI7_0(%rip), %xmm0
	movsd	%xmm0, 16(%rsp)                 # 8-byte Spill
	movl	n(%rip), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r14
	movl	$.L.str.7, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movl	$.L.str.7, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rbx, %rdi
	movsd	16(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB7_11:
	.cfi_def_cfa_offset 96
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.4, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$_ZSt4cerr, %edi
	movl	$.L.str.5, %esi
	callq	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
	movq	%rax, %rdi
	callq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
	movl	$1, %edi
	callq	exit
.Lfunc_end7:
	.size	main, .Lfunc_end7-main
	.cfi_endproc
                                        # -- 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	.LBB8_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
.LBB8_1:
	.cfi_def_cfa_offset 32
	movl	$.L.str.8, %edi
	callq	_ZSt19__throw_logic_errorPKc
.Lfunc_end8:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .Lfunc_end8-_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	.LBB9_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	.LBB9_3
.LBB9_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB9_3:
	testq	%r14, %r14
	je	.LBB9_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB9_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB9_7
.LBB9_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB9_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_end9:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end9-_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	.LBB10_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB10_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z11init_labelsiPiS_S_, %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	$_Z11add_to_treeiiiPiS_S_S_S_, %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	$_Z13update_labelsiPbS_PiS0_S0_, %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_end10:
	.size	__hip_module_ctor, .Lfunc_end10-__hip_module_ctor
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_dtor
	.type	__hip_module_dtor,@function
__hip_module_dtor:                      # @__hip_module_dtor
	.cfi_startproc
# %bb.0:
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB11_2
# %bb.1:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__hipUnregisterFatBinary
	movq	$0, __hip_gpubin_handle(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
.LBB11_2:
	retq
.Lfunc_end11:
	.size	__hip_module_dtor, .Lfunc_end11-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	cost,@object                    # @cost
	.bss
	.globl	cost
	.p2align	3, 0x0
cost:
	.quad	0
	.size	cost, 8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	.type	verbose,@object                 # @verbose
	.globl	verbose
verbose:
	.byte	0                               # 0x0
	.size	verbose, 1

	.type	maximum,@object                 # @maximum
	.globl	maximum
maximum:
	.byte	0                               # 0x0
	.size	maximum, 1

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"\t"
	.size	.L.str, 2

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"Optimal assignment: "
	.size	.L.str.1, 21

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	" => "
	.size	.L.str.2, 5

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"Arguments must be presented as follows."
	.size	.L.str.4, 40

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"./hungarian_parallel ./matrix/<matrix-file-name> <max/min> <0/1>"
	.size	.L.str.5, 65

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"max"
	.size	.L.str.6, 4

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"\t\t"
	.size	.L.str.7, 3

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"basic_string: construction from null is not valid"
	.size	.L.str.8, 50

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z11init_labelsiPiS_S_"
	.size	.L__unnamed_1, 23

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z11add_to_treeiiiPiS_S_S_S_"
	.size	.L__unnamed_2, 29

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z13update_labelsiPbS_PiS0_S0_"
	.size	.L__unnamed_3, 31

	.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 _Z26__device_stub__init_labelsiPiS_S_
	.addrsig_sym _Z26__device_stub__add_to_treeiiiPiS_S_S_S_
	.addrsig_sym _Z28__device_stub__update_labelsiPbS_PiS0_S0_
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym dcost
	.addrsig_sym n
	.addrsig_sym dlx
	.addrsig_sym dly
	.addrsig_sym dS
	.addrsig_sym dT
	.addrsig_sym dslack
	.addrsig_sym dslackx
	.addrsig_sym _Z11init_labelsiPiS_S_
	.addrsig_sym _Z11add_to_treeiiiPiS_S_S_S_
	.addrsig_sym _Z13update_labelsiPbS_PiS0_S0_
	.addrsig_sym _ZSt4cout
	.addrsig_sym _ZSt4cerr
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z11init_labelsiPiS_S_  ; -- Begin function _Z11init_labelsiPiS_S_
	.globl	_Z11init_labelsiPiS_S_
	.p2align	8
	.type	_Z11init_labelsiPiS_S_,@function
_Z11init_labelsiPiS_S_:                 ; @_Z11init_labelsiPiS_S_
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x2c
	s_load_b32 s2, s[0:1], 0x0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[2:3], null, s15, s3, v[0:1]
	s_mov_b32 s3, exec_lo
	v_cmpx_gt_i32_e64 s2, v2
	s_cbranch_execz .LBB0_4
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x8
	v_ashrrev_i32_e32 v3, 31, v2
	v_mov_b32_e32 v5, 0
	s_cmp_lt_i32 s2, 1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[3:4], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s4, v3
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v4, vcc_lo
	v_add_co_u32 v3, vcc_lo, s6, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v4, vcc_lo
	global_store_b32 v[0:1], v5, off
	global_store_b32 v[3:4], v5, off
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph
	global_load_b32 v4, v[0:1], off
	s_load_b64 s[0:1], s[0:1], 0x18
	v_mul_lo_u32 v2, v2, s2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
.LBB0_3:                                ; =>This Inner Loop Header: Depth=1
	global_load_b32 v5, v[2:3], off
	v_add_co_u32 v2, vcc_lo, v2, 4
	v_add_co_ci_u32_e32 v3, vcc_lo, 0, v3, vcc_lo
	s_add_i32 s2, s2, -1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_lg_u32 s2, 0
	s_waitcnt vmcnt(0)
	v_max_i32_e32 v4, v4, v5
	global_store_b32 v[0:1], v4, off
	s_cbranch_scc1 .LBB0_3
.LBB0_4:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11init_labelsiPiS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.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_end0:
	.size	_Z11init_labelsiPiS_S_, .Lfunc_end0-_Z11init_labelsiPiS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 268
; 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
	.protected	_Z11add_to_treeiiiPiS_S_S_S_ ; -- Begin function _Z11add_to_treeiiiPiS_S_S_S_
	.globl	_Z11add_to_treeiiiPiS_S_S_S_
	.p2align	8
	.type	_Z11add_to_treeiiiPiS_S_S_S_,@function
_Z11add_to_treeiiiPiS_S_S_S_:           ; @_Z11add_to_treeiiiPiS_S_S_S_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x44
	s_load_b32 s3, s[0:1], 0x8
	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_i32_e64 s3, v1
	s_cbranch_execz .LBB1_3
; %bb.1:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x0
	s_load_b256 s[4:11], s[0:1], 0x10
	v_ashrrev_i32_e32 v2, 31, v1
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_2)
	v_mad_u64_u32 v[3:4], null, s3, s2, v[1:2]
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_ashr_i32 s3, s2, 31
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[2:3], 2, v[3:4]
	v_add_co_u32 v4, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(SKIP_1) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v1, vcc_lo
	s_lshl_b64 s[6:7], s[2:3], 2
	v_add_co_u32 v2, vcc_lo, s8, v2
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v3, vcc_lo
	s_add_u32 s4, s4, s6
	s_addc_u32 s5, s5, s7
	global_load_b32 v4, v[4:5], off
	global_load_b32 v5, v[2:3], off
	v_add_co_u32 v2, vcc_lo, s10, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s11, v1, vcc_lo
	s_load_b32 s3, s[4:5], 0x0
	global_load_b32 v6, v[2:3], off
	s_waitcnt vmcnt(2) lgkmcnt(0)
	v_add_nc_u32_e32 v4, s3, v4
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_sub_nc_u32_e32 v4, v4, v5
	s_waitcnt vmcnt(0)
	v_cmp_lt_i32_e32 vcc_lo, v4, v6
	s_and_b32 exec_lo, exec_lo, vcc_lo
	s_cbranch_execz .LBB1_3
; %bb.2:
	s_load_b64 s[0:1], s[0:1], 0x30
	v_mov_b32_e32 v5, s2
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b32 v[2:3], v4, off
	global_store_b32 v[0:1], v5, off
.LBB1_3:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z11add_to_treeiiiPiS_S_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 312
		.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 7
		.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_end1:
	.size	_Z11add_to_treeiiiPiS_S_S_S_, .Lfunc_end1-_Z11add_to_treeiiiPiS_S_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 308
; NumSgprs: 18
; NumVgprs: 7
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 7
; 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	_Z13update_labelsiPbS_PiS0_S0_ ; -- Begin function _Z13update_labelsiPbS_PiS0_S0_
	.globl	_Z13update_labelsiPbS_PiS0_S0_
	.p2align	8
	.type	_Z13update_labelsiPbS_PiS0_S0_,@function
_Z13update_labelsiPbS_PiS0_S0_:         ; @_Z13update_labelsiPbS_PiS0_S0_
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b32 s3, s[0:1], 0x0
	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[4:5], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v4
	s_cbranch_execz .LBB2_12
; %bb.1:
	s_load_b256 s[4:11], s[0:1], 0x8
	v_ashrrev_i32_e32 v5, 31, v4
	s_load_b64 s[0:1], s[0:1], 0x28
	v_dual_mov_b32 v7, 0x5f5e100 :: v_dual_mov_b32 v8, 0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_2)
	v_lshlrev_b64 v[0:1], 2, v[4:5]
	ds_store_b32 v8, v7
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s4, v4
	v_add_co_ci_u32_e32 v3, vcc_lo, s5, v5, vcc_lo
	global_load_u8 v6, v[2:3], off
	s_waitcnt vmcnt(0)
	v_cmpx_eq_u16_e32 0, v6
	s_cbranch_execz .LBB2_6
; %bb.2:
	v_add_co_u32 v6, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v7, vcc_lo, s1, v1, vcc_lo
	s_mov_b32 s4, exec_lo
	s_brev_b32 s3, -2
	global_load_b32 v6, v[6:7], off
.LBB2_3:                                ; %ComputeLoop
                                        ; =>This Inner Loop Header: Depth=1
	s_ctz_i32_b32 s5, s4
	s_waitcnt vmcnt(0)
	v_readlane_b32 s12, v6, s5
	s_lshl_b32 s5, 1, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_and_not1_b32 s4, s4, s5
	s_min_i32 s3, s3, s12
	s_cmp_lg_u32 s4, 0
	s_cbranch_scc1 .LBB2_3
; %bb.4:                                ; %ComputeEnd
	v_mbcnt_lo_u32_b32 v6, exec_lo, 0
	s_mov_b32 s4, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_eq_u32_e32 0, v6
	s_xor_b32 s4, exec_lo, s4
	s_cbranch_execz .LBB2_6
; %bb.5:
	v_dual_mov_b32 v6, 0 :: v_dual_mov_b32 v7, s3
	ds_min_i32 v6, v7
.LBB2_6:                                ; %Flow41
	s_or_b32 exec_lo, exec_lo, s2
	v_add_co_u32 v4, vcc_lo, s6, v4
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	s_waitcnt lgkmcnt(0)
	s_barrier
	buffer_gl0_inv
	global_load_u8 v4, v[4:5], off
	s_mov_b32 s2, exec_lo
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u16_e32 0, v4
	s_cbranch_execz .LBB2_8
; %bb.7:
	v_add_co_u32 v4, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s9, v1, vcc_lo
	v_mov_b32_e32 v7, 0
	global_load_b32 v6, v[4:5], off
	ds_load_b32 v7, v7
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_sub_nc_u32_e32 v6, v6, v7
	global_store_b32 v[4:5], v6, off
.LBB2_8:
	s_or_b32 exec_lo, exec_lo, s2
	global_load_u8 v3, v[2:3], off
	v_mov_b32_e32 v2, 0
	s_mov_b32 s2, exec_lo
	ds_load_b32 v2, v2
	s_waitcnt vmcnt(0)
	v_cmpx_ne_u16_e32 0, v3
	s_xor_b32 s2, exec_lo, s2
	s_cbranch_execz .LBB2_10
; %bb.9:
	v_add_co_u32 v0, vcc_lo, s10, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s11, v1, vcc_lo
	global_load_b32 v3, v[0:1], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_add_nc_u32_e32 v2, v3, v2
	global_store_b32 v[0:1], v2, off
                                        ; implicit-def: $vgpr0_vgpr1
                                        ; implicit-def: $vgpr2
.LBB2_10:                               ; %Flow
	s_and_not1_saveexec_b32 s2, s2
	s_cbranch_execz .LBB2_12
; %bb.11:
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_load_b32 v3, v[0:1], off
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_sub_nc_u32_e32 v2, v3, v2
	global_store_b32 v[0:1], v2, off
.LBB2_12:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z13update_labelsiPbS_PiS0_S0_
		.amdhsa_group_segment_fixed_size 4
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 9
		.amdhsa_next_free_sgpr 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	_Z13update_labelsiPbS_PiS0_S0_, .Lfunc_end2-_Z13update_labelsiPbS_PiS0_S0_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 504
; NumSgprs: 18
; NumVgprs: 9
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 4 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 9
; 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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11init_labelsiPiS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11init_labelsiPiS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .offset:         8
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         48
        .size:           8
        .value_kind:     global_buffer
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         60
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         64
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         68
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         70
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         72
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         74
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         76
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         78
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         112
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         120
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 312
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z11add_to_treeiiiPiS_S_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z11add_to_treeiiiPiS_S_S_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     7
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         32
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         40
        .size:           8
        .value_kind:     global_buffer
      - .offset:         48
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         52
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         56
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         60
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         62
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         64
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         66
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         68
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         70
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         96
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         104
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         112
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 4
    .kernarg_segment_align: 8
    .kernarg_segment_size: 304
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z13update_labelsiPbS_PiS0_S0_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z13update_labelsiPbS_PiS0_S0_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     9
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
