#include <stdio.h>
#include <sys/time.h>
#include <cuda.h>
#include <fstream>
#include <iostream>


#define N_ROWS 5
#define N_COLUMNS 6
#define INF 99999
#define K 60000000
#define SERIAL_DEPTH 10
#define GPU_DEPTH 2

#define at(table, i, j) ((table[1] & (1LL << ((i) * N_COLUMNS + j))) ? ( ((table[0] & (1LL << ((i) * N_COLUMNS + j)))!=0LL) + 1 ) : 0)

// error checking for CUDA calls: use this around ALL your calls!
#define GPU_CHECKERROR( err ) (gpuCheckError( err, __FILE__, __LINE__ ))
static void gpuCheckError( cudaError_t err,
                         const char *file,
                         int line ) {
   if (err != cudaSuccess) {
       printf( "%s in %s at line %d\n", cudaGetErrorString( err ),
              file, line );
       exit( EXIT_FAILURE );
   }
}

__host__ __device__ void set_at(long long int table[2], int i, int j, int x) {
    if(x==2)
        table[0] |= (1LL << (i * N_COLUMNS + j));
    table[1] |= (1LL << (i * N_COLUMNS + j));
}

int table_size = N_ROWS * N_COLUMNS;
long long int table[2] = {0LL, 0LL};

// Either 1 or 2
int current_player = 1;
int max_player = 1;
// Each player's score
int score1 = 0;
int score2 = 0;
// current column picked by current player
int current_move;
// current row picked by current player
int current_row;

/*
 Prints table and score
 */
void print_table(long long int t[2]) {
    
    printf("~* CONNECT 4 *~ \n \n");
    
    // Print table
    for (int i = 0; i < N_ROWS; i++) {
        printf("|");
        for (int j = 0; j < N_COLUMNS; j++) {
            if (at(t, i, j) == 0)
                printf(" . ");
            if (at(t, i, j) == 1)
                printf(" X ");
            if (at(t, i, j) == 2)
                printf(" 0 ");
            printf("|");
        }
        printf("\n");
    }
    
    // Print numbers
    printf("\n+ ");
    for (int j=0; j < N_COLUMNS; j++)
        printf("%d   ",j);
    printf("+ \n \n");
    
    //     Score
    printf("SCORE: \n Player 1 (X, Human) = %d \n Player 2 (0, Computer) = %d \n \n", score1, score2);
}

/*
 Checks if player won by making a sequence of 4 markers either
 horizontally, vertically or diagonally.
 */
__device__ __host__ int current_player_won(long long int table[2], int current_row, int current_move, int current_player){
    // Check for vertical sequence
    // Look at last marker placed and compare with the 3 markers below it
    if ((current_row < N_ROWS-3)
        && (at(table,current_row,current_move) == at(table,current_row + 1,current_move))
        && (at(table,current_row + 1,current_move) == at(table,current_row + 2,current_move))
        && (at(table,current_row+ 2,current_move) == at(table,current_row + 3,current_move)))
        return true;
    
    // Check for horizontal sequence
    int sequence_length = 1;
    int j = 1;
    while ((current_move - j >= 0) && (at(table,current_row,current_move - j) == current_player)){
        j++; sequence_length++;
    }
    j = 1;
    while ((current_move + j < N_COLUMNS) && (at(table,current_row,current_move + j) == current_player)){
        j++; sequence_length++;
    }
    if (sequence_length >= 4)
        return true;
    
    //Check for diagonal sequence
    sequence_length = 1;
    j = 1;
    while((current_move - j >= 0) && (current_row - j >= 0) && (at(table,current_row - j,current_move - j) == current_player)){
        j++; sequence_length++;
    }
    j = 1;
    while ((current_move + j < N_COLUMNS) && (current_row + j <= 5) && (at(table,current_row + j,current_move + j) == current_player)){
        j++; sequence_length++;
    }
    if (sequence_length >= 4)
        return true;
    
    //Check for inverted diagonal sequence
    sequence_length = 1;
    j = 1;
    while((current_move - j >= 0) && (current_row + j < N_ROWS) && (at(table,current_row + j,current_move - j) == current_player)){
        j++; sequence_length++;
    }
    j = 1;
    while ((current_move + j < N_COLUMNS) && (current_row - j >= 0) && (at(table,current_row - j,current_move + j) == current_player)){
        j++; sequence_length++;
    }
    if (sequence_length >= 4)
        return true;
    
    return false;
}


__device__ __host__ int column_is_full (long long int table[2], int column_j) {
    return (at(table, 0, column_j) != 0);
}

__device__ __host__ int table_is_full(long long int table[2]) {
    for (int j = 0; j < N_COLUMNS; j++){
        //If some column is not full, then table is not full
        if (at(table,0,j) == 0)
            return false;
    }
    return true;
}

/*
 Structures for maintaining the state of the recursion.
 */
typedef struct state
{
    long long int table[2]; //board state
    int current_move;
    int parent_index;
    int node_value;
    int child_count; // -1 means children havent been generated yet, non negative numbers mean how many children are left to be checked for minmax values
    int depth;
    
} state;


__device__ __host__ state new_state(long long int t[2], int current_move, int parent_index, int node_value, int child_count, int depth){
    state s;
    s.table[0] = t[0];
    s.table[1] = t[1];
    s.current_move = current_move;
    s.parent_index = parent_index;
    s.node_value = node_value;
    s.child_count = child_count;
    s.depth = depth;
    
    return s;
}

__device__ __host__ void print_state(state s){
    // print_table(s.table);
    printf("current move %d\n", s.current_move);
    printf("parent index %d\n", s.parent_index);
    printf("node value %d\n", s.node_value);
    printf("child count %d\n", s.child_count);
    printf("depth %d\n", s.depth);
}

typedef struct stack
{
    int last_i;
    state data[600];
} stack;

__device__ __host__ void stack_push(stack &s, state some_state){
    s.last_i = s.last_i + 1;
    s.data[s.last_i] = some_state;
}

__device__ __host__ int stack_is_empty(stack &s){
    return (s.last_i == -1);
}

__device__ __host__ state stack_pop(stack &s){
    state st = s.data[s.last_i];
    s.last_i--;
    return st;
}

__device__ __host__ state stack_peek(stack &s){
    // printf("last i: %d\n",s.last_i);
    return s.data[s.last_i];
}

__device__ __host__ stack new_stack(){
    stack s;
    s.last_i = -1;
    return s;
}

int k = -1;
// For storing the k nodes in SERIAL DEPTH 
long long int * kTables = new long long int [K * 2];
// For getting the k values back from the GPU
int * kValues = new int [K];

void add_table(long long int t[2]){
    k++;
    kTables[k*2] = t[0];
    kTables[k*2+1] = t[1];
}

int retrieve_value(){
    int value = kValues[k];
    k--;
    return value;
}

// Minmax that runs on the GPU
// Return value of the origin node
__device__ __host__ int d_minmax(long long int current_table[2], int origin_is_max){
    
    int value = INF;
    if (origin_is_max) value = -INF;
    
    state origin;
    origin = new_state(current_table, -1, -1, value, -1, 0);
    
    stack s = new_stack();
    
    stack_push(s, origin);
    
    // int best_move = -1;
    
    int final_value = -1;
    
    while(!stack_is_empty(s)){
        state current_state = stack_peek(s);
        int current_index = s.last_i;
        int current_depth = current_state.depth;
        int is_max = (current_depth % 2 == 0);
        if (!origin_is_max) is_max = !(is_max);
        int last_player = 1;
        if (is_max) last_player = 2;
        int current_move = current_state.current_move;
        int parent_index = current_state.parent_index;
        
        //  printf("current state:\n");
        //  print_state(current_state);
        
        int lose = 0, full_table = 0, all_children_accounted_for = 0;
        // If not the origin node, then test for win and full table situations
        if (current_move != -1){
            // retrieve row index of current state's move
            int row = 0;
            while (at(current_state.table,row, current_move) == 0)
                row++;
            
            //check if player wins in this move
            lose = current_player_won(current_state.table, row, current_move, last_player);
            
            //check if table gets full
            full_table = table_is_full(current_state.table);
        }
        
        all_children_accounted_for = current_state.child_count == 0;
        
        int at_max_depth = (current_depth == GPU_DEPTH);

        //if node is terminal (leaf) or all children have been computed
        if (lose || full_table || all_children_accounted_for || at_max_depth){//
            
            
            int value = 0;
            if (lose)
                value = -1;
            if (!is_max)
                value = -value;
            if (all_children_accounted_for)
                value = current_state.node_value;
            
            // If origin node, then end search
            if (current_move == -1){
                final_value = value;
                stack_pop(s);
                continue;
            }
            
            state parent_state = s.data[parent_index];
            int parent_value = parent_state.node_value;
            
            int parents_parent_index = s.data[parent_index].parent_index;
            
            //If current state is max, the parent state is min
            if(is_max){
                // if parent state has bigger value, give it the smaller value
                if (parent_value > value){
                    
                    s.data[parent_index].node_value = value;
                    // if(current_depth == 1)
                    //     best_move = current_move;
                    
                    if (parents_parent_index != -1){
                        int alpha = s.data[parents_parent_index].node_value;
                        int beta = value;
                        if (alpha >= beta){
                            s.last_i = parent_index;
                            s.data[parent_index].child_count = 0;
                            continue;
                        }
                    }
                    
                }
            }//otherwise, parent state is max
            else{
                if (parent_value < value){
                    
                    s.data[parent_index].node_value = value;
                    // if(current_depth == 1)
                    //     best_move = current_move;
                    
                    if (parents_parent_index != -1){
                        int beta = s.data[parents_parent_index].node_value;
                        int alpha = value;
                        if (alpha >= beta){
                            s.last_i = parent_index;
                            s.data[parent_index].child_count = 0;
                            continue;
                        }
                    }
                    
                }
            }
            
            s.data[parent_index].child_count--;
            stack_pop(s);
            continue;
        }
        
        // Generate children
        int child_count = 0;
        int child_value = -INF;
        if (is_max) child_value = INF;
        
        for(int j = 0; j < N_COLUMNS; j++ ){
            if (column_is_full(current_state.table, j)) continue;
            child_count++;
            
            long long int child_table[2];
            child_table[0] = current_state.table[0];
            child_table[1] = current_state.table[1];
            
            // Find row where we can play next
            int row = N_ROWS-1;
            while (at(child_table,row, j) != 0)
                row--;
            
            if (is_max)
                set_at(child_table, row, j, 1);
            else
                set_at(child_table, row, j, 2);
            
            state child;
            child = new_state(child_table, j, current_index, child_value, -1, current_depth+1);
            
            stack_push(s, child);
        }
        
        s.data[current_index].child_count = child_count;
    }
    
    // printf("best move %d\n", best_move);
    return final_value;
}

// Kernel function
// Receives all tables on the SERIAL DEPTH level of the tree and returns all the computed values
__global__ void minmax_gpu (long long int * tables, int * values, int origin_is_max, int k)
{
       int x = blockDim.x * blockIdx.x + threadIdx.x;
       if (x > k) return;
    
       long long int table[2];
       table[0] = tables[x*2];
       table[1] = tables[x*2+1];

       int value = d_minmax(table, origin_is_max);
       values[x] = value;
}

// CPU minmax. Called twice per turn, once to store all the nodes in the SERIAL DEPTH level of the tree
// and another one after the GPU part has returned with the computer values for those nodes
__host__ int h_minmax(long long int current_table[2], int origin_is_max, int first_pass){
    int breadth=0;
    
    int value = INF;
    if (origin_is_max) value = -INF;
    
    state origin;
    origin = new_state(current_table, -1, -1, value, -1, 0);
    
    stack s = new_stack();
    
    stack_push(s, origin);
    
    int best_move = -1;
    
    if (first_pass){
        k = -1;
    }
    
    while(!stack_is_empty(s)){
        state current_state = stack_peek(s);
        int current_index = s.last_i;
        int current_depth = current_state.depth;
        int is_max = (current_depth % 2 == 0);
        if (!origin_is_max) is_max = !(is_max);
        int last_player = 1;
        if (is_max) last_player = 2;
        int current_move = current_state.current_move;
        int parent_index = current_state.parent_index;
        
        //  printf("current state:\n");
        //  print_state(current_state);
        
        int lose = 0, full_table = 0, all_children_accounted_for = 0;
        // If not the origin node, then test for win and full table situations
        if (current_move != -1){
            // retrieve row index of current state's move
            int row = 0;
            while (at(current_state.table,row, current_move) == 0)
                row++;
            
            //check if player wins in this move
            lose = current_player_won(current_state.table, row, current_move, last_player);
            
            //check if table gets full
            full_table = table_is_full(current_state.table);
        }
        
        all_children_accounted_for = current_state.child_count == 0;
        
        int second_pass_leaf = (current_depth == SERIAL_DEPTH && !first_pass);
        
        //if node is terminal (leaf) or all children have been computed
        if (lose || full_table || all_children_accounted_for || second_pass_leaf){//
            
            // If origin node, then end search
            if (current_move == -1){
                stack_pop(s);
                continue;
            }
            
            int value = 0;
            if (lose){
                value = -1;
                if (!is_max)
                    value = -value;
            }
            else if (all_children_accounted_for)
                value = current_state.node_value;
            else if (second_pass_leaf){
                value = retrieve_value();
                               // printf("value %d\n", value);
            }
            state parent_state = s.data[parent_index];
            int parent_value = parent_state.node_value;
            
            //If current state is max, the parent state is min
            if(is_max){
                // if parent state has bigger value, give it the smaller value
                if (parent_value > value){
                    
                    s.data[parent_index].node_value = value;
                    if(current_depth == 1)
                        best_move = current_move;
                    
                }
            }//otherwise, parent state is max
            else{
                if (parent_value < value){
                    
                    s.data[parent_index].node_value = value;
                    if(current_depth == 1)
                        best_move = current_move;
                    
                }
            }
            
            s.data[parent_index].child_count--;
            stack_pop(s);
            continue;
        }
        
        
        if (current_depth == SERIAL_DEPTH && first_pass){
            add_table(current_state.table);
            breadth++;
            //            printf("breadth %d\n", breadth);
            stack_pop(s);
            s.data[parent_index].child_count--;
            continue;
        }
        
        // Generate children
        int child_count = 0;
        int child_value = -INF;
        if (is_max) child_value = INF;
        
        for(int j = 0; j < N_COLUMNS; j++ ){
            if (column_is_full(current_state.table, j)) continue;
            child_count++;
            
            long long int child_table[2];
            child_table[0] = current_state.table[0];
            child_table[1] = current_state.table[1];
            
            // Find row where we can play next
            int row = N_ROWS-1;
            while (at(child_table,row, j) != 0)
                row--;
            
            if (is_max)
                set_at(child_table, row, j, 1);
            else
                set_at(child_table, row, j, 2);
            
            state child;
            child = new_state(child_table, j, current_index, child_value, -1, current_depth+1);
            
            stack_push(s, child);
        }
        
        s.data[current_index].child_count = child_count;
    }
    
    // printf("best move %d\n", best_move);
    // printf("breadth0 %d\n", k);
    return best_move;
}

long long int *d_tables;
int *d_values;
// Main min max, encapsulates all the CPU and GPU dymanics
int minmax(long long int current_table[2], int origin_is_max){
    
    // Computer tables at SERIAL DEPTH level
    printf("First CPU pass \n");
    h_minmax(current_table, origin_is_max, 1);
    printf("Number of nodes found at SERIAL DEPTH level %d\n", k+1);
    
    int is_max = (SERIAL_DEPTH % 2 == 0);
    if (!origin_is_max) is_max = !(is_max);
    
    if (k > -1){
        // printf("Bytes sent to GPUK*2 * sizeof (long long int) %lu\n", (K*2 * sizeof (long long int)));
        printf("K*2 * sizeof (long long int) %lu\n", (K*2 * sizeof (long long int)));
        printf("k*2 * sizeof (long long int) %lu\n", (k*2 * sizeof (long long int)));

        GPU_CHECKERROR(
        cudaMemcpy ((void *) d_tables,
                    (void *) kTables,
                    (k+1)*2 * (sizeof(long long int)),
                    cudaMemcpyHostToDevice)
        );
    
        unsigned int threads_per_block = 512;
        unsigned int num_blocks = ceil ((k+1) / (1.0*threads_per_block) );
    
        // launch the kernel:
        printf("Launching Kernel \n");
        minmax_gpu<<<num_blocks, threads_per_block>>>
                                            (d_tables,
                                            d_values,is_max,k);
    
        // get back the move:
        GPU_CHECKERROR(
        cudaMemcpy ((void *) kValues,
                    (void *) d_values,
                    K*sizeof(int),
                    cudaMemcpyDeviceToHost)
        );
    
        // make sure the GPU is finished doing everything!
        GPU_CHECKERROR(
            cudaDeviceSynchronize()
        );

        printf( "Errors?: %s \n", cudaGetErrorString(cudaPeekAtLastError()));
   
    }
    
    printf("Second CPU pass \n");
    int move = h_minmax(current_table, origin_is_max, 0);
    printf("Best move computed: %d\n",move);
    // printf("k %d\n", k);
    
    return move;
}

void clear_table(){
    table[0]= 0LL;
    table[1]= 0LL;
}

/*
 Ask player which column to pick and change table accordingly
 */
void pick_column() {
    
    if (current_player == 1){
        current_move = -1;
        printf("Pick a column, then press enter, player %d:\n", current_player);
        scanf ("%d", &current_move);
        
        // while move is invalid, keep asking
        while(current_move < 0 || current_move > N_COLUMNS-1 || column_is_full(table, current_move)){
            printf("invalid move, pick another column:\n");
            scanf ("%d",&current_move);
        }
    }else{
        current_move = minmax(table,max_player==2);
    }
    
    // Find row where his move will be performed
    // It will be the first row with value equals 0
    int row = N_ROWS-1;
    while (at(table,row,current_move) != 0)
        row--;
    
    // Change table accordingly
    set_at(table, row, current_move, current_player);
    
    // Store row where player just placed his marker
    // Used to check if current player won the game
    current_row = row;
}

/*
 Switch current player
 */
void switch_player(){
    if (current_player == 1)
        current_player = 2;
    else
        current_player = 1;
}

/*
 Increase current player's score
 */
void update_score(){
    if (current_player == 1)
        score1++;
    else
        score2++;
}


int main (int argc, char *argv[])
{
    GPU_CHECKERROR(
        cudaMalloc ((void **) &d_tables, K * 2 * sizeof (long long int))
    );
    GPU_CHECKERROR(
        cudaMalloc ((void **) &d_values, K * sizeof (int))
    );
    
    // game loop
    while (true) {
        clear_table();
        print_table(table);
        // The player who starts is the max player
        max_player = current_player;
        
        // match loop
        while (true) {
            pick_column();
            print_table(table);
            
            if (current_player_won(table, current_row, current_move, current_player)){
                update_score();
                print_table(table);
                printf("Congratulations, Player %d! \n", current_player);
                // leave match
                break;
            }
            // If nobody wins and table is full, we come to a draw
            else if (table_is_full(table)){
                printf("Draw! \n");
                // leave match
                break;
            }
            
            switch_player();
        }
        
        printf("Do you wish to play again?(y/n) \n");
        char play_again;
        scanf (" %c",&play_again);
        if (!(play_again == 'y' || play_again == 'Y'))
            break;
        
    }
    
    cudaFree (d_tables);
    cudaFree (d_values);
    delete[] kValues;
    delete[] kTables;
    return 0;
    
}
	.file	"tmpxft_00330e89_00000000-6_c4.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3791:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3791:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"/home/ubuntu/Datasets/stackv2/train-structured/danilofaria/connect4minmaxCUDA/master/c4.cu"
.LC1:
	.string	"%s in %s at line %d\n"
	.text
	.type	_ZL13gpuCheckError9cudaErrorPKci.constprop.0, @function
_ZL13gpuCheckError9cudaErrorPKci.constprop.0:
.LFB4457:
	.cfi_startproc
	testl	%edi, %edi
	je	.L2
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	%esi, 12(%rsp)
	call	cudaGetErrorString@PLT
	movl	12(%rsp), %r8d
	movl	$2, %edi
	leaq	.LC0(%rip), %rcx
	movq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4457:
	.size	_ZL13gpuCheckError9cudaErrorPKci.constprop.0, .-_ZL13gpuCheckError9cudaErrorPKci.constprop.0
	.globl	_Z6set_atPxiii
	.type	_Z6set_atPxiii, @function
_Z6set_atPxiii:
.LFB3767:
	.cfi_startproc
	endbr64
	imull	$6, %esi, %esi
	movl	%ecx, %r8d
	movl	$1, %eax
	leal	(%rsi,%rdx), %ecx
	salq	%cl, %rax
	cmpl	$2, %r8d
	jne	.L9
	orq	%rax, (%rdi)
.L9:
	orq	%rax, 8(%rdi)
	ret
	.cfi_endproc
.LFE3767:
	.size	_Z6set_atPxiii, .-_Z6set_atPxiii
	.section	.rodata.str1.1
.LC2:
	.string	"~* CONNECT 4 *~ \n \n"
.LC3:
	.string	"|"
.LC4:
	.string	" . "
.LC5:
	.string	" X "
.LC6:
	.string	" 0 "
.LC7:
	.string	"\n"
.LC8:
	.string	"\n+ "
.LC9:
	.string	"%d   "
.LC10:
	.string	"+ \n \n"
.LC11:
	.string	"SCORE: \n Player 1 (X, Human) = %d \n Player 2 (0, Computer) = %d \n \n"
	.text
	.globl	_Z11print_tablePx
	.type	_Z11print_tablePx, @function
_Z11print_tablePx:
.LFB3768:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	movl	$2, %edi
	pushq	%r9
	.cfi_def_cfa_offset 64
	call	__printf_chk@PLT
.L19:
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	call	__printf_chk@PLT
	leaq	.LC4(%rip), %r15
.L18:
	movq	8(%rbx), %rax
	leal	0(%r13,%r12), %ebp
	btq	%rbp, %rax
	jnc	.L11
.L14:
	movq	(%rbx), %rax
	btq	%rbp, %rax
	jc	.L12
	jmp	.L26
.L11:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	btq	%rbp, %rax
	jnc	.L15
	jmp	.L14
.L26:
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	movl	$2, %edi
	call	__printf_chk@PLT
	movq	8(%rbx), %rax
	btq	%rbp, %rax
	jnc	.L15
	movq	(%rbx), %rax
	btq	%rbp, %rax
	jnc	.L15
.L12:
	leaq	.LC6(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movq	%r14, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%r13d
	call	__printf_chk@PLT
	cmpl	$6, %r13d
	jne	.L18
	leaq	.LC7(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	addl	$6, %r12d
	call	__printf_chk@PLT
	cmpl	$30, %r12d
	jne	.L19
	leaq	.LC8(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	leaq	.LC9(%rip), %rbp
.L20:
	movl	%ebx, %edx
	movq	%rbp, %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	incl	%ebx
	cmpl	$6, %ebx
	jne	.L20
	leaq	.LC10(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	score2(%rip), %ecx
	movl	score1(%rip), %edx
	xorl	%eax, %eax
	popq	%r8
	.cfi_def_cfa_offset 56
	leaq	.LC11(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 48
	movl	$2, %edi
	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
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE3768:
	.size	_Z11print_tablePx, .-_Z11print_tablePx
	.globl	_Z18current_player_wonPxiii
	.type	_Z18current_player_wonPxiii, @function
_Z18current_player_wonPxiii:
.LFB3769:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %rax
	movl	%ecx, %r8d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmpl	$1, %esi
	jg	.L28
	imull	$6, %esi, %r9d
	movq	8(%rdi), %rdi
	xorl	%r11d, %r11d
	leal	(%r9,%rdx), %ecx
	btq	%rcx, %rdi
	jnc	.L29
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %r11d
.L29:
	leal	6(%r9,%rdx), %ecx
	btq	%rcx, %rdi
	jnc	.L30
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	incq	%rcx
	movl	%ecx, %r10d
	cmpl	%ecx, %r11d
	jne	.L28
	jmp	.L31
.L30:
	testl	%r11d, %r11d
	je	.L60
.L28:
	imull	$6, %esi, %r10d
	movl	$1, %r9d
	addl	%edx, %r10d
	jmp	.L32
.L60:
	xorl	%r10d, %r10d
.L31:
	leal	12(%r9,%rdx), %ecx
	btq	%rcx, %rdi
	jnc	.L33
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	incq	%rcx
	movl	%ecx, %r11d
	cmpl	%ecx, %r10d
	jne	.L28
	jmp	.L34
.L33:
	testl	%r10d, %r10d
	jne	.L28
	xorl	%r11d, %r11d
.L34:
	leal	18(%r9,%rdx), %ecx
	xorl	%r9d, %r9d
	btq	%rcx, %rdi
	jnc	.L35
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %r9d
.L35:
	movl	$1, %ecx
	cmpl	%r9d, %r11d
	jne	.L28
	jmp	.L27
.L82:
	movq	8(%rax), %r11
	movl	%r10d, %ecx
	xorl	%edi, %edi
	subl	%r9d, %ecx
	btq	%rcx, %r11
	jnc	.L38
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %edi
.L38:
	cmpl	%r8d, %edi
	jne	.L63
	incl	%r9d
.L32:
	cmpl	%r9d, %edx
	jns	.L82
.L63:
	movl	$1, %edi
.L40:
	leal	(%rdx,%rdi), %ecx
	cmpl	$5, %ecx
	jg	.L41
	movq	8(%rax), %rbx
	leal	(%r10,%rdi), %ecx
	xorl	%r11d, %r11d
	btq	%rcx, %rbx
	jnc	.L42
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %r11d
.L42:
	cmpl	%r8d, %r11d
	jne	.L41
	incl	%edi
	jmp	.L40
.L41:
	leal	-1(%r9,%rdi), %edi
	movl	$1, %ecx
	cmpl	$3, %edi
	jg	.L27
	leal	-1(%rsi), %r9d
	movl	%edx, %r11d
	movl	%r9d, %edi
	subl	%esi, %r11d
.L46:
	leal	(%rdi,%r11), %ecx
	orl	%edi, %ecx
	js	.L44
	imull	$7, %edi, %ecx
	movq	8(%rax), %rbp
	xorl	%ebx, %ebx
	addl	%r11d, %ecx
	btq	%rcx, %rbp
	jnc	.L45
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %ebx
.L45:
	leal	-1(%rdi), %ecx
	cmpl	%r8d, %ebx
	jne	.L44
	movl	%ecx, %edi
	jmp	.L46
.L44:
	movl	%esi, %ebx
	subl	%edi, %ebx
	leal	1(%rsi), %edi
.L47:
	leal	(%rdi,%r11), %ecx
	cmpl	$5, %ecx
	jg	.L48
	cmpl	$5, %edi
	jg	.L48
	imull	$7, %edi, %ecx
	movq	8(%rax), %r14
	xorl	%ebp, %ebp
	addl	%r11d, %ecx
	btq	%rcx, %r14
	jnc	.L49
	movq	(%rax), %rbp
	sarq	%cl, %rbp
	movq	%rbp, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %ebp
.L49:
	incl	%edi
	cmpl	%r8d, %ebp
	jne	.L48
	incl	%ebx
	jmp	.L47
.L48:
	movl	$1, %ecx
	movl	$1, %edi
	cmpl	$3, %ebx
	jg	.L27
.L51:
	cmpl	%edi, %edx
	js	.L52
	leal	(%rsi,%rdi), %ecx
	cmpl	$4, %ecx
	jg	.L52
	movq	8(%rax), %rbx
	leal	(%rdi,%rdi,4), %ecx
	xorl	%r11d, %r11d
	addl	%r10d, %ecx
	btq	%rcx, %rbx
	jnc	.L53
	movq	(%rax), %rbx
	sarq	%cl, %rbx
	movq	%rbx, %rcx
	andl	$1, %ecx
	leal	1(%rcx), %r11d
.L53:
	cmpl	%r8d, %r11d
	jne	.L52
	incl	%edi
	jmp	.L51
.L52:
	addl	%edx, %esi
.L55:
	movl	%esi, %edx
	subl	%r9d, %edx
	cmpl	$5, %edx
	jg	.L56
	testl	%r9d, %r9d
	js	.L56
	movq	8(%rax), %r10
	leal	(%r9,%r9,4), %ecx
	xorl	%edx, %edx
	addl	%esi, %ecx
	btq	%rcx, %r10
	jnc	.L57
	movq	(%rax), %rdx
	sarq	%cl, %rdx
	andl	$1, %edx
	incl	%edx
.L57:
	decl	%r9d
	cmpl	%r8d, %edx
	jne	.L56
	incl	%edi
	jmp	.L55
.L56:
	xorl	%ecx, %ecx
	cmpl	$3, %edi
	setg	%cl
.L27:
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3769:
	.size	_Z18current_player_wonPxiii, .-_Z18current_player_wonPxiii
	.globl	_Z14column_is_fullPxi
	.type	_Z14column_is_fullPxi, @function
_Z14column_is_fullPxi:
.LFB3770:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rdx
	xorl	%eax, %eax
	movl	%esi, %ecx
	btq	%rsi, %rdx
	jnc	.L84
	movq	(%rdi), %rax
	sarq	%cl, %rax
	andl	$1, %eax
	incl	%eax
.L84:
	testl	%eax, %eax
	setne	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE3770:
	.size	_Z14column_is_fullPxi, .-_Z14column_is_fullPxi
	.globl	_Z13table_is_fullPx
	.type	_Z13table_is_fullPx, @function
_Z13table_is_fullPx:
.LFB3771:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rdx
	xorl	%eax, %eax
	testb	$1, %dl
	je	.L87
.L89:
	incl	%eax
	cmpl	$6, %eax
	je	.L93
	btq	%rax, %rdx
	jc	.L89
	xorl	%eax, %eax
	ret
.L93:
	movl	$1, %eax
	ret
.L87:
	ret
	.cfi_endproc
.LFE3771:
	.size	_Z13table_is_fullPx, .-_Z13table_is_fullPx
	.globl	_Z9new_statePxiiiii
	.type	_Z9new_statePxiiiii, @function
_Z9new_statePxiiiii:
.LFB3772:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	(%rsi), %rdi
	movq	8(%rsi), %rsi
	movl	%edx, 16(%rax)
	movl	8(%rsp), %edx
	movq	%rdi, (%rax)
	movq	%rsi, 8(%rax)
	movl	%ecx, 20(%rax)
	movl	%r8d, 24(%rax)
	movl	%r9d, 28(%rax)
	movl	%edx, 32(%rax)
	ret
	.cfi_endproc
.LFE3772:
	.size	_Z9new_statePxiiiii, .-_Z9new_statePxiiiii
	.section	.rodata.str1.1
.LC12:
	.string	"current move %d\n"
.LC13:
	.string	"parent index %d\n"
.LC14:
	.string	"node value %d\n"
.LC15:
	.string	"child count %d\n"
.LC16:
	.string	"depth %d\n"
	.text
	.globl	_Z11print_state5state
	.type	_Z11print_state5state, @function
_Z11print_state5state:
.LFB3773:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	32(%rsp), %edx
	leaq	.LC12(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	movl	36(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC13(%rip), %rsi
	call	__printf_chk@PLT
	movl	40(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC14(%rip), %rsi
	call	__printf_chk@PLT
	movl	44(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC15(%rip), %rsi
	call	__printf_chk@PLT
	movl	48(%rsp), %edx
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	.LC16(%rip), %rsi
	popq	%rcx
	.cfi_def_cfa_offset 8
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE3773:
	.size	_Z11print_state5state, .-_Z11print_state5state
	.globl	_Z10stack_pushR5stack5state
	.type	_Z10stack_pushR5stack5state, @function
_Z10stack_pushR5stack5state:
.LFB3774:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	$10, %ecx
	leaq	8(%rsp), %rsi
	incl	%eax
	movl	%eax, (%rdi)
	cltq
	imulq	$40, %rax, %rax
	leaq	8(%rdi,%rax), %rdi
	rep movsl
	ret
	.cfi_endproc
.LFE3774:
	.size	_Z10stack_pushR5stack5state, .-_Z10stack_pushR5stack5state
	.globl	_Z14stack_is_emptyR5stack
	.type	_Z14stack_is_emptyR5stack, @function
_Z14stack_is_emptyR5stack:
.LFB3775:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpl	$-1, (%rdi)
	sete	%al
	ret
	.cfi_endproc
.LFE3775:
	.size	_Z14stack_is_emptyR5stack, .-_Z14stack_is_emptyR5stack
	.globl	_Z9stack_popR5stack
	.type	_Z9stack_popR5stack, @function
_Z9stack_popR5stack:
.LFB3776:
	.cfi_startproc
	endbr64
	movslq	(%rsi), %rcx
	movq	%rsi, %rdx
	movq	%rdi, %rax
	movq	%rcx, %r8
	imulq	$40, %rcx, %rcx
	decl	%r8d
	leaq	8(%rsi,%rcx), %rsi
	movl	$10, %ecx
	rep movsl
	movl	%r8d, (%rdx)
	ret
	.cfi_endproc
.LFE3776:
	.size	_Z9stack_popR5stack, .-_Z9stack_popR5stack
	.globl	_Z10stack_peekR5stack
	.type	_Z10stack_peekR5stack, @function
_Z10stack_peekR5stack:
.LFB3777:
	.cfi_startproc
	endbr64
	movslq	(%rsi), %rdx
	movq	%rdi, %rax
	movl	$10, %ecx
	imulq	$40, %rdx, %rdx
	leaq	8(%rsi,%rdx), %rsi
	rep movsl
	ret
	.cfi_endproc
.LFE3777:
	.size	_Z10stack_peekR5stack, .-_Z10stack_peekR5stack
	.globl	_Z9new_stackv
	.type	_Z9new_stackv, @function
_Z9new_stackv:
.LFB3778:
	.cfi_startproc
	endbr64
	movl	$-1, (%rdi)
	movq	%rdi, %rax
	ret
	.cfi_endproc
.LFE3778:
	.size	_Z9new_stackv, .-_Z9new_stackv
	.globl	_Z9add_tablePx
	.type	_Z9add_tablePx, @function
_Z9add_tablePx:
.LFB3779:
	.cfi_startproc
	endbr64
	movl	k(%rip), %eax
	movq	(%rdi), %rcx
	movq	kTables(%rip), %rdx
	incl	%eax
	movl	%eax, k(%rip)
	addl	%eax, %eax
	cltq
	movq	%rcx, (%rdx,%rax,8)
	movq	8(%rdi), %rcx
	movq	%rcx, 8(%rdx,%rax,8)
	ret
	.cfi_endproc
.LFE3779:
	.size	_Z9add_tablePx, .-_Z9add_tablePx
	.globl	_Z14retrieve_valuev
	.type	_Z14retrieve_valuev, @function
_Z14retrieve_valuev:
.LFB3780:
	.cfi_startproc
	endbr64
	movslq	k(%rip), %rcx
	movq	kValues(%rip), %rdx
	movq	%rcx, %rax
	movl	(%rdx,%rcx,4), %edx
	decl	%eax
	movl	%eax, k(%rip)
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE3780:
	.size	_Z14retrieve_valuev, .-_Z14retrieve_valuev
	.globl	_Z8d_minmaxPxi
	.type	_Z8d_minmaxPxi, @function
_Z8d_minmaxPxi:
.LFB3781:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20536
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3704, %rsp
	.cfi_def_cfa_offset 24240
	movq	(%rdi), %rcx
	movq	8(%rdi), %rdx
	movq	%fs:40, %rax
	movq	%rax, 24168(%rsp)
	xorl	%eax, %eax
	cmpl	$1, %esi
	movl	%esi, %ebp
	movq	%rcx, 168(%rsp)
	sbbl	%eax, %eax
	xorl	%esi, %esi
	movq	%rdx, 176(%rsp)
	orl	$-1, %r13d
	andl	$199998, %eax
	movl	%esi, 160(%rsp)
	subl	$99999, %eax
	movq	$-1, 184(%rsp)
	movl	%eax, 192(%rsp)
	movl	$4294967295, %eax
	movq	%rax, 196(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, (%rsp)
.L106:
	movl	160(%rsp), %r14d
	cmpl	$-1, %r14d
	je	.L147
	movslq	%r14d, %r12
	leaq	80(%rsp), %rdi
	movl	$10, %ecx
	imulq	$40, %r12, %rax
	leaq	168(%rsp,%rax), %rsi
	rep movsl
	movl	112(%rsp), %r15d
	movl	%r15d, %ebx
	andl	$1, %ebx
	testl	%ebp, %ebp
	je	.L107
	xorl	$1, %ebx
.L107:
	movl	96(%rsp), %edx
	movl	100(%rsp), %r8d
	cmpl	$-1, %edx
	je	.L130
	movq	88(%rsp), %rcx
	xorl	%esi, %esi
.L109:
	imull	$6, %esi, %eax
	addl	%edx, %eax
	btq	%rax, %rcx
	jc	.L148
	incl	%esi
	jmp	.L109
.L148:
	movq	(%rsp), %rdi
	leal	1(%rbx), %ecx
	movl	%edx, 8(%rsp)
	movl	%r8d, 12(%rsp)
	call	_Z18current_player_wonPxiii
	movq	(%rsp), %rdi
	movl	%eax, %ecx
	call	_Z13table_is_fullPx
	movl	8(%rsp), %edx
	movl	12(%rsp), %r8d
	movl	%eax, %esi
	jmp	.L108
.L130:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
.L108:
	movl	108(%rsp), %eax
	testl	%eax, %eax
	sete	%r9b
	cmpl	$2, %r15d
	sete	%dil
	orl	%ecx, %esi
	orl	%edi, %r9d
	movzbl	%r9b, %r9d
	orl	%esi, %r9d
	je	.L111
	xorl	%r9d, %r9d
	testl	%ecx, %ecx
	setne	%r9b
	testl	%ebx, %ebx
	je	.L112
	negl	%r9d
.L112:
	testl	%eax, %eax
	jne	.L113
	movl	104(%rsp), %r9d
.L113:
	incl	%edx
	jne	.L114
	leaq	16(%rsp), %rdi
	leaq	160(%rsp), %rsi
	call	_Z9stack_popR5stack
	jmp	.L115
.L114:
	movslq	%r8d, %rcx
	imulq	$40, %rcx, %rdx
	movl	192(%rsp,%rdx), %esi
	movslq	188(%rsp,%rdx), %rax
	testl	%ebx, %ebx
	je	.L116
	cmpl	%esi, %r9d
	jge	.L117
	movl	%r9d, 192(%rsp,%rdx)
	cmpl	$-1, %eax
	je	.L117
	imulq	$40, %rax, %rax
	cmpl	192(%rsp,%rax), %r9d
	jg	.L117
	jmp	.L146
.L116:
	cmpl	%esi, %r9d
	jle	.L117
	movl	%r9d, 192(%rsp,%rdx)
	cmpl	$-1, %eax
	je	.L117
	imulq	$40, %rax, %rax
	cmpl	192(%rsp,%rax), %r9d
	jl	.L117
.L146:
	xorl	%eax, %eax
	movl	%r8d, 160(%rsp)
	movl	%eax, 196(%rsp,%rdx)
.L118:
	movl	%r13d, %r9d
	jmp	.L115
.L117:
	imulq	$40, %rcx, %rax
	leaq	16(%rsp), %rdi
	leaq	160(%rsp), %rsi
	decl	196(%rsp,%rax)
	call	_Z9stack_popR5stack
	jmp	.L118
.L115:
	movl	%r9d, %r13d
	jmp	.L106
.L111:
	cmpl	$1, %ebx
	sbbl	%r11d, %r11d
	xorl	%r10d, %r10d
	incl	%r15d
	andl	$-199998, %r11d
	addl	$99999, %r11d
.L126:
	movq	(%rsp), %rdi
	movl	%r10d, %esi
	call	_Z14column_is_fullPxi
	testl	%eax, %eax
	jne	.L121
	movq	80(%rsp), %rax
	incl	%r9d
	movl	$4, %esi
	movq	%rax, 64(%rsp)
	movq	88(%rsp), %rax
	movq	%rax, 72(%rsp)
.L123:
	imull	$6, %esi, %edx
	addl	%r10d, %edx
	btq	%rdx, %rax
	jnc	.L122
	decl	%esi
	jmp	.L123
.L122:
	testl	%ebx, %ebx
	je	.L124
	btsq	%rdx, %rax
	movq	%rax, 72(%rsp)
	jmp	.L125
.L124:
	leaq	64(%rsp), %rdi
	movl	$2, %ecx
	movl	%r10d, %edx
	call	_Z6set_atPxiii
.L125:
	movq	64(%rsp), %rax
	movl	%r10d, 136(%rsp)
	movl	$10, %ecx
	movl	%r14d, 140(%rsp)
	movq	%rax, 120(%rsp)
	movq	72(%rsp), %rax
	movl	%r11d, 144(%rsp)
	movq	%rax, 128(%rsp)
	leaq	160(%rsp), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 24280
	movl	$-1, 188(%rsp)
	movl	%r15d, 192(%rsp)
	leaq	160(%rsp), %rsi
	movq	%rsp, %rdi
	rep movsl
	movq	%rax, %rdi
	call	_Z10stack_pushR5stack5state
	addq	$40, %rsp
	.cfi_def_cfa_offset 24240
.L121:
	incl	%r10d
	cmpl	$6, %r10d
	jne	.L126
	imulq	$40, %r12, %r12
	movl	%r9d, 196(%rsp,%r12)
	jmp	.L106
.L147:
	movq	24168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L128
	call	__stack_chk_fail@PLT
.L128:
	addq	$24184, %rsp
	.cfi_def_cfa_offset 56
	movl	%r13d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3781:
	.size	_Z8d_minmaxPxi, .-_Z8d_minmaxPxi
	.globl	_Z8h_minmaxPxii
	.type	_Z8h_minmaxPxii, @function
_Z8h_minmaxPxii:
.LFB3782:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20536
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	.cfi_def_cfa_register 7
	subq	$3720, %rsp
	.cfi_def_cfa_offset 24256
	movq	(%rdi), %rcx
	movq	%fs:40, %rax
	movq	%rax, 24184(%rsp)
	xorl	%eax, %eax
	cmpl	$1, %esi
	movl	%edx, %r12d
	movq	8(%rdi), %rdx
	sbbl	%eax, %eax
	movl	%esi, %r14d
	xorl	%esi, %esi
	movq	%rcx, 184(%rsp)
	andl	$199998, %eax
	movl	%esi, 176(%rsp)
	subl	$99999, %eax
	movq	%rdx, 192(%rsp)
	movl	%eax, 208(%rsp)
	movl	$4294967295, %eax
	movq	$-1, 200(%rsp)
	movq	%rax, 212(%rsp)
	testl	%r12d, %r12d
	je	.L151
	movl	$-1, k(%rip)
.L151:
	leaq	96(%rsp), %rax
	movl	$-1, 16(%rsp)
	movq	%rax, 8(%rsp)
.L177:
	movl	176(%rsp), %r15d
	cmpl	$-1, %r15d
	je	.L206
	movslq	%r15d, %rax
	leaq	96(%rsp), %rdi
	movl	$10, %ecx
	movq	%rax, 24(%rsp)
	imulq	$40, %rax, %rax
	leaq	184(%rsp,%rax), %rsi
	rep movsl
	movl	128(%rsp), %r13d
	movl	%r13d, %ebx
	andl	$1, %ebx
	testl	%r14d, %r14d
	je	.L152
	xorl	$1, %ebx
.L152:
	movl	116(%rsp), %eax
	movl	112(%rsp), %ebp
	movl	%eax, 20(%rsp)
	cmpl	$-1, %ebp
	je	.L181
	movq	104(%rsp), %rdx
	xorl	%esi, %esi
.L154:
	imull	$6, %esi, %eax
	addl	%ebp, %eax
	btq	%rax, %rdx
	jc	.L207
	incl	%esi
	jmp	.L154
.L207:
	movq	8(%rsp), %rdi
	leal	1(%rbx), %ecx
	movl	%ebp, %edx
	call	_Z18current_player_wonPxiii
	movq	8(%rsp), %rdi
	movl	%eax, %ecx
	call	_Z13table_is_fullPx
	jmp	.L153
.L181:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.L153:
	cmpl	$10, %r13d
	movl	124(%rsp), %edi
	sete	%sil
	testl	%r12d, %r12d
	sete	%dl
	andl	%esi, %edx
	testl	%edi, %edi
	sete	%r9b
	orl	%ecx, %eax
	orl	%edx, %r9d
	movzbl	%r9b, %r9d
	orl	%eax, %r9d
	je	.L156
	cmpl	$-1, %ebp
	leaq	32(%rsp), %r8
	leaq	176(%rsp), %rsi
	jne	.L157
	movq	%r8, %rdi
	call	_Z9stack_popR5stack
	jmp	.L177
.L157:
	testl	%ecx, %ecx
	je	.L159
	movl	%ebx, %eax
	negl	%eax
	sbbl	%ecx, %ecx
	orl	$1, %ecx
	jmp	.L160
.L159:
	testl	%edi, %edi
	jne	.L161
	movl	120(%rsp), %ecx
	jmp	.L160
.L161:
	testb	%dl, %dl
	je	.L160
	call	_Z14retrieve_valuev
	movl	%eax, %ecx
.L160:
	movslq	20(%rsp), %rax
	imulq	$40, %rax, %rdx
	movl	208(%rsp,%rdx), %edi
	testl	%ebx, %ebx
	je	.L162
	cmpl	%edi, %ecx
	jl	.L205
.L166:
	movl	16(%rsp), %ebp
	jmp	.L164
.L162:
	cmpl	%edi, %ecx
	jle	.L166
.L205:
	decl	%r13d
	movl	%ecx, 208(%rsp,%rdx)
	jne	.L166
.L164:
	imulq	$40, %rax, %rax
	movq	%r8, %rdi
	decl	212(%rsp,%rax)
	call	_Z9stack_popR5stack
	movl	%ebp, 16(%rsp)
	jmp	.L177
.L156:
	testl	%r12d, %r12d
	je	.L168
	testb	%sil, %sil
	je	.L168
	movq	8(%rsp), %rdi
	leaq	176(%rsp), %rsi
	call	_Z9add_tablePx
	leaq	32(%rsp), %rdi
	call	_Z9stack_popR5stack
	movslq	20(%rsp), %rax
	imulq	$40, %rax, %rax
	decl	212(%rsp,%rax)
	jmp	.L177
.L168:
	cmpl	$1, %ebx
	sbbl	%r11d, %r11d
	xorl	%r10d, %r10d
	andl	$-199998, %r11d
	addl	$99999, %r11d
.L175:
	movq	8(%rsp), %rdi
	movl	%r10d, %esi
	call	_Z14column_is_fullPxi
	testl	%eax, %eax
	jne	.L170
	movq	96(%rsp), %rax
	incl	%r9d
	movl	$4, %esi
	movq	%rax, 80(%rsp)
	movq	104(%rsp), %rax
	movq	%rax, 88(%rsp)
.L172:
	imull	$6, %esi, %edx
	addl	%r10d, %edx
	btq	%rdx, %rax
	jnc	.L171
	decl	%esi
	jmp	.L172
.L171:
	testl	%ebx, %ebx
	je	.L173
	btsq	%rdx, %rax
	movq	%rax, 88(%rsp)
	jmp	.L174
.L173:
	leaq	80(%rsp), %rdi
	movl	$2, %ecx
	movl	%r10d, %edx
	call	_Z6set_atPxiii
.L174:
	movq	80(%rsp), %rax
	movl	%r10d, 152(%rsp)
	movl	$10, %ecx
	movl	%r15d, 156(%rsp)
	movq	%rax, 136(%rsp)
	movq	88(%rsp), %rax
	movl	%r11d, 160(%rsp)
	movq	%rax, 144(%rsp)
	leal	1(%r13), %eax
	movl	%eax, 168(%rsp)
	leaq	176(%rsp), %rax
	subq	$40, %rsp
	.cfi_def_cfa_offset 24296
	movl	$-1, 204(%rsp)
	movq	%rsp, %rdi
	leaq	176(%rsp), %rsi
	rep movsl
	movq	%rax, %rdi
	call	_Z10stack_pushR5stack5state
	addq	$40, %rsp
	.cfi_def_cfa_offset 24256
.L170:
	incl	%r10d
	cmpl	$6, %r10d
	jne	.L175
	imulq	$40, 24(%rsp), %rax
	movl	%r9d, 212(%rsp,%rax)
	jmp	.L177
.L206:
	movq	24184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L179
	call	__stack_chk_fail@PLT
.L179:
	movl	16(%rsp), %eax
	addq	$24200, %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
.LFE3782:
	.size	_Z8h_minmaxPxii, .-_Z8h_minmaxPxii
	.globl	_Z11clear_tablev
	.type	_Z11clear_tablev, @function
_Z11clear_tablev:
.LFB3784:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	movq	%rax, table(%rip)
	movq	%rax, 8+table(%rip)
	ret
	.cfi_endproc
.LFE3784:
	.size	_Z11clear_tablev, .-_Z11clear_tablev
	.globl	_Z13switch_playerv
	.type	_Z13switch_playerv, @function
_Z13switch_playerv:
.LFB3786:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpl	$1, current_player(%rip)
	sete	%al
	incl	%eax
	movl	%eax, current_player(%rip)
	ret
	.cfi_endproc
.LFE3786:
	.size	_Z13switch_playerv, .-_Z13switch_playerv
	.globl	_Z12update_scorev
	.type	_Z12update_scorev, @function
_Z12update_scorev:
.LFB3787:
	.cfi_startproc
	endbr64
	cmpl	$1, current_player(%rip)
	jne	.L213
	incl	score1(%rip)
	ret
.L213:
	incl	score2(%rip)
	ret
	.cfi_endproc
.LFE3787:
	.size	_Z12update_scorev, .-_Z12update_scorev
	.globl	_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii
	.type	_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii, @function
_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii:
.LFB3813:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	40(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L215
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z10minmax_gpuPxPiii(%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
.L215:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L217
	call	__stack_chk_fail@PLT
.L217:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3813:
	.size	_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii, .-_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii
	.globl	_Z10minmax_gpuPxPiii
	.type	_Z10minmax_gpuPxPiii, @function
_Z10minmax_gpuPxPiii:
.LFB3814:
	.cfi_startproc
	endbr64
	jmp	_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii
	.cfi_endproc
.LFE3814:
	.size	_Z10minmax_gpuPxPiii, .-_Z10minmax_gpuPxPiii
	.section	.rodata.str1.1
.LC17:
	.string	"First CPU pass \n"
.LC18:
	.string	"Number of nodes found at SERIAL DEPTH level %d\n"
.LC19:
	.string	"K*2 * sizeof (long long int) %lu\n"
.LC20:
	.string	"k*2 * sizeof (long long int) %lu\n"
.LC22:
	.string	"Launching Kernel \n"
.LC23:
	.string	"Errors?: %s \n"
.LC24:
	.string	"Second CPU pass \n"
.LC25:
	.string	"Best move computed: %d\n"
	.text
	.globl	_Z6minmaxPxi
	.type	_Z6minmaxPxi, @function
_Z6minmaxPxi:
.LFB3783:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%eax, %eax
	movq	%rdi, %rbp
	movl	$2, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%esi, %ebx
	leaq	.LC17(%rip), %rsi
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	call	__printf_chk@PLT
	movl	$1, %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	_Z8h_minmaxPxii
	movl	k(%rip), %eax
	movl	$2, %edi
	leaq	.LC18(%rip), %rsi
	leal	1(%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$0, k(%rip)
	js	.L221
	movl	$960000000, %edx
	leaq	.LC19(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	k(%rip), %eax
	movl	$2, %edi
	leaq	.LC20(%rip), %rsi
	leal	(%rax,%rax), %edx
	xorl	%eax, %eax
	movslq	%edx, %rdx
	salq	$3, %rdx
	call	__printf_chk@PLT
	movl	k(%rip), %eax
	movl	$1, %ecx
	movq	kTables(%rip), %rsi
	movq	d_tables(%rip), %rdi
	leal	2(%rax,%rax), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	call	cudaMemcpy@PLT
	movl	$578, %esi
	movl	%eax, %edi
	call	_ZL13gpuCheckError9cudaErrorPKci.constprop.0
	movl	k(%rip), %eax
	incl	%eax
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC21(%rip), %xmm0
	call	ceil@PLT
	leaq	.LC22(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	movsd	%xmm0, 8(%rsp)
	call	__printf_chk@PLT
	movl	$8388609, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movsd	8(%rsp), %xmm0
	salq	$9, %rdx
	movl	$1, %ecx
	cvttsd2siq	%xmm0, %rax
	movl	%eax, 24(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 28(%rsp)
	movq	24(%rsp), %rdi
	movl	32(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L222
	xorl	%edx, %edx
	movl	k(%rip), %ecx
	testl	%ebx, %ebx
	movq	d_values(%rip), %rsi
	movq	d_tables(%rip), %rdi
	setne	%dl
	call	_Z34__device_stub__Z10minmax_gpuPxPiiiPxPiii
.L222:
	movq	d_values(%rip), %rsi
	movl	$240000000, %edx
	movl	$2, %ecx
	movq	kValues(%rip), %rdi
	call	cudaMemcpy@PLT
	movl	$595, %esi
	movl	%eax, %edi
	call	_ZL13gpuCheckError9cudaErrorPKci.constprop.0
	call	cudaDeviceSynchronize@PLT
	movl	$603, %esi
	movl	%eax, %edi
	call	_ZL13gpuCheckError9cudaErrorPKci.constprop.0
	call	cudaPeekAtLastError@PLT
	movl	%eax, %edi
	call	cudaGetErrorString@PLT
	leaq	.LC23(%rip), %rsi
	movl	$2, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L221:
	leaq	.LC24(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	%ebx, %esi
	movq	%rbp, %rdi
	xorl	%edx, %edx
	call	_Z8h_minmaxPxii
	leaq	.LC25(%rip), %rsi
	movl	$2, %edi
	movl	%eax, %ebx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3783:
	.size	_Z6minmaxPxi, .-_Z6minmaxPxi
	.section	.rodata.str1.1
.LC26:
	.string	"Pick a column, then press enter, player %d:\n"
.LC27:
	.string	"%d"
.LC28:
	.string	"invalid move, pick another column:\n"
	.text
	.globl	_Z11pick_columnv
	.type	_Z11pick_columnv, @function
_Z11pick_columnv:
.LFB3785:
	.cfi_startproc
	endbr64
	cmpl	$1, current_player(%rip)
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	jne	.L225
	movl	$1, %edx
	leaq	.LC26(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	leaq	current_move(%rip), %rbp
	leaq	.LC27(%rip), %rbx
	movl	$-1, current_move(%rip)
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	leaq	table(%rip), %r12
.L228:
	movl	current_move(%rip), %esi
	cmpl	$5, %esi
	ja	.L226
	movq	%r12, %rdi
	call	_Z14column_is_fullPxi
	testl	%eax, %eax
	je	.L227
.L226:
	leaq	.LC28(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	jmp	.L228
.L225:
	xorl	%esi, %esi
	cmpl	$2, max_player(%rip)
	leaq	table(%rip), %rdi
	sete	%sil
	call	_Z6minmaxPxi
	movl	%eax, current_move(%rip)
.L227:
	movq	8+table(%rip), %rcx
	movl	current_move(%rip), %edx
	movl	$4, %r9d
.L230:
	imull	$6, %r9d, %eax
	addl	%edx, %eax
	btq	%rax, %rcx
	jc	.L229
	movl	current_player(%rip), %ecx
	movl	%r9d, %esi
	leaq	table(%rip), %rdi
	call	_Z6set_atPxiii
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	%r9d, current_row(%rip)
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L229:
	.cfi_restore_state
	decl	%r9d
	jmp	.L230
	.cfi_endproc
.LFE3785:
	.size	_Z11pick_columnv, .-_Z11pick_columnv
	.section	.rodata.str1.1
.LC29:
	.string	"Congratulations, Player %d! \n"
.LC30:
	.string	"Draw! \n"
.LC31:
	.string	"Do you wish to play again?(y/n) \n"
.LC32:
	.string	" %c"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3788:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	$960000000, %esi
	leaq	d_tables(%rip), %rdi
	leaq	table(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	cudaMalloc@PLT
	movl	$680, %esi
	movl	%eax, %edi
	call	_ZL13gpuCheckError9cudaErrorPKci.constprop.0
	movl	$240000000, %esi
	leaq	d_values(%rip), %rdi
	call	cudaMalloc@PLT
	movl	$683, %esi
	movl	%eax, %edi
	call	_ZL13gpuCheckError9cudaErrorPKci.constprop.0
.L242:
	call	_Z11clear_tablev
	movq	%rbx, %rdi
	call	_Z11print_tablePx
	movl	current_player(%rip), %eax
	movl	%eax, max_player(%rip)
.L240:
	call	_Z11pick_columnv
	movq	%rbx, %rdi
	call	_Z11print_tablePx
	movl	current_player(%rip), %ecx
	movl	current_move(%rip), %edx
	movq	%rbx, %rdi
	movl	current_row(%rip), %esi
	call	_Z18current_player_wonPxiii
	testl	%eax, %eax
	je	.L237
	call	_Z12update_scorev
	movq	%rbx, %rdi
	call	_Z11print_tablePx
	movl	current_player(%rip), %edx
	leaq	.LC29(%rip), %rsi
	xorl	%eax, %eax
	movl	$2, %edi
	call	__printf_chk@PLT
	jmp	.L238
.L237:
	movq	%rbx, %rdi
	call	_Z13table_is_fullPx
	testl	%eax, %eax
	je	.L239
	leaq	.LC30(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L238
.L239:
	call	_Z13switch_playerv
	jmp	.L240
.L238:
	leaq	.LC31(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	7(%rsp), %rsi
	leaq	.LC32(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc23_scanf@PLT
	movb	7(%rsp), %al
	andl	$-33, %eax
	cmpb	$89, %al
	je	.L242
	movq	d_tables(%rip), %rdi
	call	cudaFree@PLT
	movq	d_values(%rip), %rdi
	call	cudaFree@PLT
	movq	kValues(%rip), %rdi
	testq	%rdi, %rdi
	je	.L243
	call	_ZdaPv@PLT
.L243:
	movq	kTables(%rip), %rdi
	testq	%rdi, %rdi
	je	.L244
	call	_ZdaPv@PLT
.L244:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L245
	call	__stack_chk_fail@PLT
.L245:
	addq	$16, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3788:
	.size	main, .-main
	.section	.rodata.str1.1
.LC33:
	.string	"_Z10minmax_gpuPxPiii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3816:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC33(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z10minmax_gpuPxPiii(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE3816:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text.startup
	.type	_GLOBAL__sub_I__Z6set_atPxiii, @function
_GLOBAL__sub_I__Z6set_atPxiii:
.LFB4454:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$960000000, %edi
	call	_Znam@PLT
	movl	$240000000, %edi
	movq	%rax, kTables(%rip)
	call	_Znam@PLT
	movq	%rax, kValues(%rip)
	popq	%rdx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4454:
	.size	_GLOBAL__sub_I__Z6set_atPxiii, .-_GLOBAL__sub_I__Z6set_atPxiii
	.section	.init_array
	.align 8
	.quad	_GLOBAL__sub_I__Z6set_atPxiii
	.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	d_values
	.bss
	.align 8
	.type	d_values, @object
	.size	d_values, 8
d_values:
	.zero	8
	.globl	d_tables
	.align 8
	.type	d_tables, @object
	.size	d_tables, 8
d_tables:
	.zero	8
	.globl	kValues
	.align 8
	.type	kValues, @object
	.size	kValues, 8
kValues:
	.zero	8
	.globl	kTables
	.align 8
	.type	kTables, @object
	.size	kTables, 8
kTables:
	.zero	8
	.globl	k
	.data
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.long	-1
	.globl	current_row
	.bss
	.align 4
	.type	current_row, @object
	.size	current_row, 4
current_row:
	.zero	4
	.globl	current_move
	.align 4
	.type	current_move, @object
	.size	current_move, 4
current_move:
	.zero	4
	.globl	score2
	.align 4
	.type	score2, @object
	.size	score2, 4
score2:
	.zero	4
	.globl	score1
	.align 4
	.type	score1, @object
	.size	score1, 4
score1:
	.zero	4
	.globl	max_player
	.data
	.align 4
	.type	max_player, @object
	.size	max_player, 4
max_player:
	.long	1
	.globl	current_player
	.align 4
	.type	current_player, @object
	.size	current_player, 4
current_player:
	.long	1
	.globl	table
	.bss
	.align 16
	.type	table, @object
	.size	table, 16
table:
	.zero	16
	.globl	table_size
	.data
	.align 4
	.type	table_size, @object
	.size	table_size, 4
table_size:
	.long	30
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC21:
	.long	0
	.long	1063256064
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <sys/time.h>
#include <hip/hip_runtime.h>
#include <fstream>
#include <iostream>


#define N_ROWS 5
#define N_COLUMNS 6
#define INF 99999
#define K 60000000
#define SERIAL_DEPTH 10
#define GPU_DEPTH 2

#define at(table, i, j) ((table[1] & (1LL << ((i) * N_COLUMNS + j))) ? ( ((table[0] & (1LL << ((i) * N_COLUMNS + j)))!=0LL) + 1 ) : 0)

// error checking for CUDA calls: use this around ALL your calls!
#define GPU_CHECKERROR( err ) (gpuCheckError( err, __FILE__, __LINE__ ))
static void gpuCheckError( hipError_t err,
                         const char *file,
                         int line ) {
   if (err != hipSuccess) {
       printf( "%s in %s at line %d\n", hipGetErrorString( err ),
              file, line );
       exit( EXIT_FAILURE );
   }
}

__host__ __device__ void set_at(long long int table[2], int i, int j, int x) {
    if(x==2)
        table[0] |= (1LL << (i * N_COLUMNS + j));
    table[1] |= (1LL << (i * N_COLUMNS + j));
}

int table_size = N_ROWS * N_COLUMNS;
long long int table[2] = {0LL, 0LL};

// Either 1 or 2
int current_player = 1;
int max_player = 1;
// Each player's score
int score1 = 0;
int score2 = 0;
// current column picked by current player
int current_move;
// current row picked by current player
int current_row;

/*
 Prints table and score
 */
void print_table(long long int t[2]) {
    
    printf("~* CONNECT 4 *~ \n \n");
    
    // Print table
    for (int i = 0; i < N_ROWS; i++) {
        printf("|");
        for (int j = 0; j < N_COLUMNS; j++) {
            if (at(t, i, j) == 0)
                printf(" . ");
            if (at(t, i, j) == 1)
                printf(" X ");
            if (at(t, i, j) == 2)
                printf(" 0 ");
            printf("|");
        }
        printf("\n");
    }
    
    // Print numbers
    printf("\n+ ");
    for (int j=0; j < N_COLUMNS; j++)
        printf("%d   ",j);
    printf("+ \n \n");
    
    //     Score
    printf("SCORE: \n Player 1 (X, Human) = %d \n Player 2 (0, Computer) = %d \n \n", score1, score2);
}

/*
 Checks if player won by making a sequence of 4 markers either
 horizontally, vertically or diagonally.
 */
__device__ __host__ int current_player_won(long long int table[2], int current_row, int current_move, int current_player){
    // Check for vertical sequence
    // Look at last marker placed and compare with the 3 markers below it
    if ((current_row < N_ROWS-3)
        && (at(table,current_row,current_move) == at(table,current_row + 1,current_move))
        && (at(table,current_row + 1,current_move) == at(table,current_row + 2,current_move))
        && (at(table,current_row+ 2,current_move) == at(table,current_row + 3,current_move)))
        return true;
    
    // Check for horizontal sequence
    int sequence_length = 1;
    int j = 1;
    while ((current_move - j >= 0) && (at(table,current_row,current_move - j) == current_player)){
        j++; sequence_length++;
    }
    j = 1;
    while ((current_move + j < N_COLUMNS) && (at(table,current_row,current_move + j) == current_player)){
        j++; sequence_length++;
    }
    if (sequence_length >= 4)
        return true;
    
    //Check for diagonal sequence
    sequence_length = 1;
    j = 1;
    while((current_move - j >= 0) && (current_row - j >= 0) && (at(table,current_row - j,current_move - j) == current_player)){
        j++; sequence_length++;
    }
    j = 1;
    while ((current_move + j < N_COLUMNS) && (current_row + j <= 5) && (at(table,current_row + j,current_move + j) == current_player)){
        j++; sequence_length++;
    }
    if (sequence_length >= 4)
        return true;
    
    //Check for inverted diagonal sequence
    sequence_length = 1;
    j = 1;
    while((current_move - j >= 0) && (current_row + j < N_ROWS) && (at(table,current_row + j,current_move - j) == current_player)){
        j++; sequence_length++;
    }
    j = 1;
    while ((current_move + j < N_COLUMNS) && (current_row - j >= 0) && (at(table,current_row - j,current_move + j) == current_player)){
        j++; sequence_length++;
    }
    if (sequence_length >= 4)
        return true;
    
    return false;
}


__device__ __host__ int column_is_full (long long int table[2], int column_j) {
    return (at(table, 0, column_j) != 0);
}

__device__ __host__ int table_is_full(long long int table[2]) {
    for (int j = 0; j < N_COLUMNS; j++){
        //If some column is not full, then table is not full
        if (at(table,0,j) == 0)
            return false;
    }
    return true;
}

/*
 Structures for maintaining the state of the recursion.
 */
typedef struct state
{
    long long int table[2]; //board state
    int current_move;
    int parent_index;
    int node_value;
    int child_count; // -1 means children havent been generated yet, non negative numbers mean how many children are left to be checked for minmax values
    int depth;
    
} state;


__device__ __host__ state new_state(long long int t[2], int current_move, int parent_index, int node_value, int child_count, int depth){
    state s;
    s.table[0] = t[0];
    s.table[1] = t[1];
    s.current_move = current_move;
    s.parent_index = parent_index;
    s.node_value = node_value;
    s.child_count = child_count;
    s.depth = depth;
    
    return s;
}

__device__ __host__ void print_state(state s){
    // print_table(s.table);
    printf("current move %d\n", s.current_move);
    printf("parent index %d\n", s.parent_index);
    printf("node value %d\n", s.node_value);
    printf("child count %d\n", s.child_count);
    printf("depth %d\n", s.depth);
}

typedef struct stack
{
    int last_i;
    state data[600];
} stack;

__device__ __host__ void stack_push(stack &s, state some_state){
    s.last_i = s.last_i + 1;
    s.data[s.last_i] = some_state;
}

__device__ __host__ int stack_is_empty(stack &s){
    return (s.last_i == -1);
}

__device__ __host__ state stack_pop(stack &s){
    state st = s.data[s.last_i];
    s.last_i--;
    return st;
}

__device__ __host__ state stack_peek(stack &s){
    // printf("last i: %d\n",s.last_i);
    return s.data[s.last_i];
}

__device__ __host__ stack new_stack(){
    stack s;
    s.last_i = -1;
    return s;
}

int k = -1;
// For storing the k nodes in SERIAL DEPTH 
long long int * kTables = new long long int [K * 2];
// For getting the k values back from the GPU
int * kValues = new int [K];

void add_table(long long int t[2]){
    k++;
    kTables[k*2] = t[0];
    kTables[k*2+1] = t[1];
}

int retrieve_value(){
    int value = kValues[k];
    k--;
    return value;
}

// Minmax that runs on the GPU
// Return value of the origin node
__device__ __host__ int d_minmax(long long int current_table[2], int origin_is_max){
    
    int value = INF;
    if (origin_is_max) value = -INF;
    
    state origin;
    origin = new_state(current_table, -1, -1, value, -1, 0);
    
    stack s = new_stack();
    
    stack_push(s, origin);
    
    // int best_move = -1;
    
    int final_value = -1;
    
    while(!stack_is_empty(s)){
        state current_state = stack_peek(s);
        int current_index = s.last_i;
        int current_depth = current_state.depth;
        int is_max = (current_depth % 2 == 0);
        if (!origin_is_max) is_max = !(is_max);
        int last_player = 1;
        if (is_max) last_player = 2;
        int current_move = current_state.current_move;
        int parent_index = current_state.parent_index;
        
        //  printf("current state:\n");
        //  print_state(current_state);
        
        int lose = 0, full_table = 0, all_children_accounted_for = 0;
        // If not the origin node, then test for win and full table situations
        if (current_move != -1){
            // retrieve row index of current state's move
            int row = 0;
            while (at(current_state.table,row, current_move) == 0)
                row++;
            
            //check if player wins in this move
            lose = current_player_won(current_state.table, row, current_move, last_player);
            
            //check if table gets full
            full_table = table_is_full(current_state.table);
        }
        
        all_children_accounted_for = current_state.child_count == 0;
        
        int at_max_depth = (current_depth == GPU_DEPTH);

        //if node is terminal (leaf) or all children have been computed
        if (lose || full_table || all_children_accounted_for || at_max_depth){//
            
            
            int value = 0;
            if (lose)
                value = -1;
            if (!is_max)
                value = -value;
            if (all_children_accounted_for)
                value = current_state.node_value;
            
            // If origin node, then end search
            if (current_move == -1){
                final_value = value;
                stack_pop(s);
                continue;
            }
            
            state parent_state = s.data[parent_index];
            int parent_value = parent_state.node_value;
            
            int parents_parent_index = s.data[parent_index].parent_index;
            
            //If current state is max, the parent state is min
            if(is_max){
                // if parent state has bigger value, give it the smaller value
                if (parent_value > value){
                    
                    s.data[parent_index].node_value = value;
                    // if(current_depth == 1)
                    //     best_move = current_move;
                    
                    if (parents_parent_index != -1){
                        int alpha = s.data[parents_parent_index].node_value;
                        int beta = value;
                        if (alpha >= beta){
                            s.last_i = parent_index;
                            s.data[parent_index].child_count = 0;
                            continue;
                        }
                    }
                    
                }
            }//otherwise, parent state is max
            else{
                if (parent_value < value){
                    
                    s.data[parent_index].node_value = value;
                    // if(current_depth == 1)
                    //     best_move = current_move;
                    
                    if (parents_parent_index != -1){
                        int beta = s.data[parents_parent_index].node_value;
                        int alpha = value;
                        if (alpha >= beta){
                            s.last_i = parent_index;
                            s.data[parent_index].child_count = 0;
                            continue;
                        }
                    }
                    
                }
            }
            
            s.data[parent_index].child_count--;
            stack_pop(s);
            continue;
        }
        
        // Generate children
        int child_count = 0;
        int child_value = -INF;
        if (is_max) child_value = INF;
        
        for(int j = 0; j < N_COLUMNS; j++ ){
            if (column_is_full(current_state.table, j)) continue;
            child_count++;
            
            long long int child_table[2];
            child_table[0] = current_state.table[0];
            child_table[1] = current_state.table[1];
            
            // Find row where we can play next
            int row = N_ROWS-1;
            while (at(child_table,row, j) != 0)
                row--;
            
            if (is_max)
                set_at(child_table, row, j, 1);
            else
                set_at(child_table, row, j, 2);
            
            state child;
            child = new_state(child_table, j, current_index, child_value, -1, current_depth+1);
            
            stack_push(s, child);
        }
        
        s.data[current_index].child_count = child_count;
    }
    
    // printf("best move %d\n", best_move);
    return final_value;
}

// Kernel function
// Receives all tables on the SERIAL DEPTH level of the tree and returns all the computed values
__global__ void minmax_gpu (long long int * tables, int * values, int origin_is_max, int k)
{
       int x = blockDim.x * blockIdx.x + threadIdx.x;
       if (x > k) return;
    
       long long int table[2];
       table[0] = tables[x*2];
       table[1] = tables[x*2+1];

       int value = d_minmax(table, origin_is_max);
       values[x] = value;
}

// CPU minmax. Called twice per turn, once to store all the nodes in the SERIAL DEPTH level of the tree
// and another one after the GPU part has returned with the computer values for those nodes
__host__ int h_minmax(long long int current_table[2], int origin_is_max, int first_pass){
    int breadth=0;
    
    int value = INF;
    if (origin_is_max) value = -INF;
    
    state origin;
    origin = new_state(current_table, -1, -1, value, -1, 0);
    
    stack s = new_stack();
    
    stack_push(s, origin);
    
    int best_move = -1;
    
    if (first_pass){
        k = -1;
    }
    
    while(!stack_is_empty(s)){
        state current_state = stack_peek(s);
        int current_index = s.last_i;
        int current_depth = current_state.depth;
        int is_max = (current_depth % 2 == 0);
        if (!origin_is_max) is_max = !(is_max);
        int last_player = 1;
        if (is_max) last_player = 2;
        int current_move = current_state.current_move;
        int parent_index = current_state.parent_index;
        
        //  printf("current state:\n");
        //  print_state(current_state);
        
        int lose = 0, full_table = 0, all_children_accounted_for = 0;
        // If not the origin node, then test for win and full table situations
        if (current_move != -1){
            // retrieve row index of current state's move
            int row = 0;
            while (at(current_state.table,row, current_move) == 0)
                row++;
            
            //check if player wins in this move
            lose = current_player_won(current_state.table, row, current_move, last_player);
            
            //check if table gets full
            full_table = table_is_full(current_state.table);
        }
        
        all_children_accounted_for = current_state.child_count == 0;
        
        int second_pass_leaf = (current_depth == SERIAL_DEPTH && !first_pass);
        
        //if node is terminal (leaf) or all children have been computed
        if (lose || full_table || all_children_accounted_for || second_pass_leaf){//
            
            // If origin node, then end search
            if (current_move == -1){
                stack_pop(s);
                continue;
            }
            
            int value = 0;
            if (lose){
                value = -1;
                if (!is_max)
                    value = -value;
            }
            else if (all_children_accounted_for)
                value = current_state.node_value;
            else if (second_pass_leaf){
                value = retrieve_value();
                               // printf("value %d\n", value);
            }
            state parent_state = s.data[parent_index];
            int parent_value = parent_state.node_value;
            
            //If current state is max, the parent state is min
            if(is_max){
                // if parent state has bigger value, give it the smaller value
                if (parent_value > value){
                    
                    s.data[parent_index].node_value = value;
                    if(current_depth == 1)
                        best_move = current_move;
                    
                }
            }//otherwise, parent state is max
            else{
                if (parent_value < value){
                    
                    s.data[parent_index].node_value = value;
                    if(current_depth == 1)
                        best_move = current_move;
                    
                }
            }
            
            s.data[parent_index].child_count--;
            stack_pop(s);
            continue;
        }
        
        
        if (current_depth == SERIAL_DEPTH && first_pass){
            add_table(current_state.table);
            breadth++;
            //            printf("breadth %d\n", breadth);
            stack_pop(s);
            s.data[parent_index].child_count--;
            continue;
        }
        
        // Generate children
        int child_count = 0;
        int child_value = -INF;
        if (is_max) child_value = INF;
        
        for(int j = 0; j < N_COLUMNS; j++ ){
            if (column_is_full(current_state.table, j)) continue;
            child_count++;
            
            long long int child_table[2];
            child_table[0] = current_state.table[0];
            child_table[1] = current_state.table[1];
            
            // Find row where we can play next
            int row = N_ROWS-1;
            while (at(child_table,row, j) != 0)
                row--;
            
            if (is_max)
                set_at(child_table, row, j, 1);
            else
                set_at(child_table, row, j, 2);
            
            state child;
            child = new_state(child_table, j, current_index, child_value, -1, current_depth+1);
            
            stack_push(s, child);
        }
        
        s.data[current_index].child_count = child_count;
    }
    
    // printf("best move %d\n", best_move);
    // printf("breadth0 %d\n", k);
    return best_move;
}

long long int *d_tables;
int *d_values;
// Main min max, encapsulates all the CPU and GPU dymanics
int minmax(long long int current_table[2], int origin_is_max){
    
    // Computer tables at SERIAL DEPTH level
    printf("First CPU pass \n");
    h_minmax(current_table, origin_is_max, 1);
    printf("Number of nodes found at SERIAL DEPTH level %d\n", k+1);
    
    int is_max = (SERIAL_DEPTH % 2 == 0);
    if (!origin_is_max) is_max = !(is_max);
    
    if (k > -1){
        // printf("Bytes sent to GPUK*2 * sizeof (long long int) %lu\n", (K*2 * sizeof (long long int)));
        printf("K*2 * sizeof (long long int) %lu\n", (K*2 * sizeof (long long int)));
        printf("k*2 * sizeof (long long int) %lu\n", (k*2 * sizeof (long long int)));

        GPU_CHECKERROR(
        hipMemcpy ((void *) d_tables,
                    (void *) kTables,
                    (k+1)*2 * (sizeof(long long int)),
                    hipMemcpyHostToDevice)
        );
    
        unsigned int threads_per_block = 512;
        unsigned int num_blocks = ceil ((k+1) / (1.0*threads_per_block) );
    
        // launch the kernel:
        printf("Launching Kernel \n");
        minmax_gpu<<<num_blocks, threads_per_block>>>
                                            (d_tables,
                                            d_values,is_max,k);
    
        // get back the move:
        GPU_CHECKERROR(
        hipMemcpy ((void *) kValues,
                    (void *) d_values,
                    K*sizeof(int),
                    hipMemcpyDeviceToHost)
        );
    
        // make sure the GPU is finished doing everything!
        GPU_CHECKERROR(
            hipDeviceSynchronize()
        );

        printf( "Errors?: %s \n", hipGetErrorString(hipPeekAtLastError()));
   
    }
    
    printf("Second CPU pass \n");
    int move = h_minmax(current_table, origin_is_max, 0);
    printf("Best move computed: %d\n",move);
    // printf("k %d\n", k);
    
    return move;
}

void clear_table(){
    table[0]= 0LL;
    table[1]= 0LL;
}

/*
 Ask player which column to pick and change table accordingly
 */
void pick_column() {
    
    if (current_player == 1){
        current_move = -1;
        printf("Pick a column, then press enter, player %d:\n", current_player);
        scanf ("%d", &current_move);
        
        // while move is invalid, keep asking
        while(current_move < 0 || current_move > N_COLUMNS-1 || column_is_full(table, current_move)){
            printf("invalid move, pick another column:\n");
            scanf ("%d",&current_move);
        }
    }else{
        current_move = minmax(table,max_player==2);
    }
    
    // Find row where his move will be performed
    // It will be the first row with value equals 0
    int row = N_ROWS-1;
    while (at(table,row,current_move) != 0)
        row--;
    
    // Change table accordingly
    set_at(table, row, current_move, current_player);
    
    // Store row where player just placed his marker
    // Used to check if current player won the game
    current_row = row;
}

/*
 Switch current player
 */
void switch_player(){
    if (current_player == 1)
        current_player = 2;
    else
        current_player = 1;
}

/*
 Increase current player's score
 */
void update_score(){
    if (current_player == 1)
        score1++;
    else
        score2++;
}


int main (int argc, char *argv[])
{
    GPU_CHECKERROR(
        hipMalloc ((void **) &d_tables, K * 2 * sizeof (long long int))
    );
    GPU_CHECKERROR(
        hipMalloc ((void **) &d_values, K * sizeof (int))
    );
    
    // game loop
    while (true) {
        clear_table();
        print_table(table);
        // The player who starts is the max player
        max_player = current_player;
        
        // match loop
        while (true) {
            pick_column();
            print_table(table);
            
            if (current_player_won(table, current_row, current_move, current_player)){
                update_score();
                print_table(table);
                printf("Congratulations, Player %d! \n", current_player);
                // leave match
                break;
            }
            // If nobody wins and table is full, we come to a draw
            else if (table_is_full(table)){
                printf("Draw! \n");
                // leave match
                break;
            }
            
            switch_player();
        }
        
        printf("Do you wish to play again?(y/n) \n");
        char play_again;
        scanf (" %c",&play_again);
        if (!(play_again == 'y' || play_again == 'Y'))
            break;
        
    }
    
    hipFree (d_tables);
    hipFree (d_values);
    delete[] kValues;
    delete[] kTables;
    return 0;
    
}
	.text
	.file	"c4.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z6set_atPxiii                  # -- Begin function _Z6set_atPxiii
	.type	_Z6set_atPxiii,@function
_Z6set_atPxiii:                         # @_Z6set_atPxiii
	.cfi_startproc
# %bb.0:
	movl	%ecx, %eax
                                        # kill: def $edx killed $edx def $rdx
                                        # kill: def $esi killed $esi def $rsi
	leal	(%rsi,%rsi,2), %ecx
	leal	(%rdx,%rcx,2), %ecx
	movl	$1, %edx
                                        # kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rdx
	cmpl	$2, %eax
	jne	.LBB0_2
# %bb.1:
	orq	%rdx, (%rdi)
.LBB0_2:                                # %._crit_edge
	orq	%rdx, 8(%rdi)
	retq
.Lfunc_end0:
	.size	_Z6set_atPxiii, .Lfunc_end0-_Z6set_atPxiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11print_tablePx               # -- Begin function _Z11print_tablePx
	.type	_Z11print_tablePx,@function
_Z11print_tablePx:                      # @_Z11print_tablePx
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movl	$.Lstr, %edi
	callq	puts@PLT
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
.LBB1_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_2 Depth 2
	movl	$124, %edi
	callq	putchar@PLT
	xorl	%r12d, %r12d
.LBB1_2:                                #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	leal	(%r14,%r12), %ecx
	movl	$1, %r13d
	shlq	%cl, %r13
	btq	%rcx, %rax
	jb	.LBB1_4
# %bb.3:                                #   in Loop: Header=BB1_2 Depth=2
	movl	$.L.str.2, %edi
	xorl	%eax, %eax
	callq	printf
	testq	%r13, 8(%rbx)
	je	.LBB1_8
.LBB1_4:                                # %.thread47
                                        #   in Loop: Header=BB1_2 Depth=2
	testq	%r13, (%rbx)
	jne	.LBB1_6
# %bb.5:                                # %.critedge
                                        #   in Loop: Header=BB1_2 Depth=2
	movl	$.L.str.3, %edi
	xorl	%eax, %eax
	callq	printf
	testq	%r13, 8(%rbx)
	je	.LBB1_8
.LBB1_6:                                # %.critedge.thread52
                                        #   in Loop: Header=BB1_2 Depth=2
	testq	%r13, (%rbx)
	je	.LBB1_8
# %bb.7:                                #   in Loop: Header=BB1_2 Depth=2
	movl	$.L.str.4, %edi
	xorl	%eax, %eax
	callq	printf
.LBB1_8:                                # %.thread
                                        #   in Loop: Header=BB1_2 Depth=2
	movl	$124, %edi
	callq	putchar@PLT
	incq	%r12
	cmpq	$6, %r12
	jne	.LBB1_2
# %bb.9:                                #   in Loop: Header=BB1_1 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%r15
	addq	$6, %r14
	cmpq	$5, %r15
	jne	.LBB1_1
# %bb.10:
	movl	$.L.str.6, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%ebx, %ebx
.LBB1_11:                               # =>This Inner Loop Header: Depth=1
	movl	$.L.str.7, %edi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	printf
	incl	%ebx
	cmpl	$6, %ebx
	jne	.LBB1_11
# %bb.12:
	movl	$.Lstr.1, %edi
	callq	puts@PLT
	movl	score1(%rip), %esi
	movl	score2(%rip), %edx
	movl	$.L.str.9, %edi
	xorl	%eax, %eax
	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
	jmp	printf                          # TAILCALL
.Lfunc_end1:
	.size	_Z11print_tablePx, .Lfunc_end1-_Z11print_tablePx
	.cfi_endproc
                                        # -- End function
	.globl	_Z18current_player_wonPxiii     # -- Begin function _Z18current_player_wonPxiii
	.type	_Z18current_player_wonPxiii,@function
_Z18current_player_wonPxiii:            # @_Z18current_player_wonPxiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%ecx, %r9d
                                        # kill: def $edx killed $edx def $rdx
                                        # kill: def $esi killed $esi def $rsi
	cmpl	$1, %esi
	jg	.LBB2_14
# %bb.1:
	leal	(%rsi,%rsi), %eax
	leal	(%rax,%rax,2), %r8d
	addl	%edx, %r8d
	movl	$1, %ebx
	movl	%r8d, %ecx
	shlq	%cl, %rbx
	movq	8(%rdi), %rax
	movl	$1, %r10d
	leal	6(%r8), %ecx
                                        # kill: def $cl killed $cl killed $ecx
	shlq	%cl, %r10
	btq	%r8, %rax
	jae	.LBB2_7
# %bb.2:
	testq	%r10, %rax
	je	.LBB2_14
# %bb.3:                                # %.thread
	movq	(%rdi), %r11
	testq	%rbx, %r11
	setne	%cl
	testq	%r10, %r11
	sete	%bl
	cmpb	%cl, %bl
	je	.LBB2_14
# %bb.4:
	leal	12(%r8), %ecx
	movl	$1, %ebx
	shlq	%cl, %rbx
	movzbl	%cl, %ecx
	btq	%rcx, %rax
	jae	.LBB2_14
# %bb.5:                                # %.thread184
	testq	%r10, %r11
	setne	%cl
	testq	%rbx, %r11
	sete	%r10b
	cmpb	%cl, %r10b
	je	.LBB2_14
# %bb.6:
	andq	%rbx, %r11
	cmpq	$1, %r11
	movl	$2, %r10d
	sbbl	$0, %r10d
	jmp	.LBB2_10
.LBB2_7:                                # %.thread186
	testq	%r10, %rax
	jne	.LBB2_14
# %bb.8:                                # %.thread190
	leal	12(%r8), %ecx
	movzbl	%cl, %ecx
	btq	%rcx, %rax
	jb	.LBB2_14
# %bb.9:
	xorl	%r10d, %r10d
.LBB2_10:                               # %.thread192
	addb	$18, %r8b
	movl	$1, %r11d
	movl	%r8d, %ecx
	shlq	%cl, %r11
	movzbl	%r8b, %ecx
	btq	%rcx, %rax
	jae	.LBB2_11
# %bb.12:
	andq	(%rdi), %r11
	cmpq	$1, %r11
	movl	$2, %ecx
	sbbl	$0, %ecx
	jmp	.LBB2_13
.LBB2_11:
	xorl	%ecx, %ecx
.LBB2_13:
	movl	$1, %eax
	cmpl	%ecx, %r10d
	je	.LBB2_77
.LBB2_14:                               # %.thread.thread
	testl	%edx, %edx
	jle	.LBB2_15
# %bb.19:                               # %.lr.ph
	movq	8(%rdi), %rax
	leal	(%rsi,%rsi,2), %ecx
	leal	1(%rdx), %r8d
	leal	(%rdx,%rcx,2), %ecx
	decl	%ecx
	movl	$1, %r10d
.LBB2_20:                               # =>This Inner Loop Header: Depth=1
	movl	$1, %r11d
	shlq	%cl, %r11
	btq	%rcx, %rax
	jae	.LBB2_21
# %bb.22:                               #   in Loop: Header=BB2_20 Depth=1
	andq	(%rdi), %r11
	cmpq	$1, %r11
	movl	$2, %r11d
	sbbl	$0, %r11d
	jmp	.LBB2_23
.LBB2_21:                               #   in Loop: Header=BB2_20 Depth=1
	xorl	%r11d, %r11d
.LBB2_23:                               #   in Loop: Header=BB2_20 Depth=1
	cmpl	%r9d, %r11d
	jne	.LBB2_25
# %bb.24:                               #   in Loop: Header=BB2_20 Depth=1
	incq	%r10
	decl	%ecx
	cmpq	%r10, %r8
	jne	.LBB2_20
	jmp	.LBB2_26
.LBB2_15:
	movl	$1, %r8d
	jmp	.LBB2_16
.LBB2_25:                               # %..critedge_crit_edge
	movl	%r10d, %r8d
.LBB2_26:                               # %.critedge
	cmpl	$4, %edx
	jg	.LBB2_27
.LBB2_16:                               # %.lr.ph202
	movq	8(%rdi), %rax
	leal	(%rsi,%rsi,2), %ecx
	leal	(%rdx,%rcx,2), %ecx
	movslq	%ecx, %rcx
	movl	%r8d, %r11d
	subl	%edx, %r11d
	addl	$5, %r11d
	movl	$6, %ebx
	subl	%edx, %ebx
	incq	%rcx
	decq	%rbx
.LBB2_17:                               # =>This Inner Loop Header: Depth=1
	movl	$1, %r10d
	shlq	%cl, %r10
	btq	%rcx, %rax
	jae	.LBB2_18
# %bb.28:                               #   in Loop: Header=BB2_17 Depth=1
	andq	(%rdi), %r10
	cmpq	$1, %r10
	movl	$2, %ebp
	sbbl	$0, %ebp
	jmp	.LBB2_29
.LBB2_18:                               #   in Loop: Header=BB2_17 Depth=1
	xorl	%ebp, %ebp
.LBB2_29:                               #   in Loop: Header=BB2_17 Depth=1
	movb	$1, %r10b
	cmpl	%r9d, %ebp
	jne	.LBB2_32
# %bb.30:                               #   in Loop: Header=BB2_17 Depth=1
	incl	%r8d
	incq	%rcx
	decq	%rbx
	jne	.LBB2_17
# %bb.31:
	movl	%r11d, %r8d
	jmp	.LBB2_32
.LBB2_27:
	xorl	%r10d, %r10d
.LBB2_32:                               # %.critedge2
	movl	$1, %eax
	cmpl	$3, %r8d
	ja	.LBB2_77
# %bb.33:                               # %.preheader194
	movslq	%esi, %r8
	testl	%edx, %edx
	jle	.LBB2_34
# %bb.35:                               # %.lr.ph209
	leal	1(%rdx), %r11d
	leal	(%rsi,%rsi,2), %eax
	leal	(%rdx,%rax,2), %ecx
	addl	$-7, %ecx
	leaq	-1(%r8), %rbx
	movl	$1, %eax
.LBB2_36:                               # =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	js	.LBB2_42
# %bb.37:                               #   in Loop: Header=BB2_36 Depth=1
	movq	8(%rdi), %r15
	movl	$1, %r14d
	shlq	%cl, %r14
	btq	%rcx, %r15
	jae	.LBB2_38
# %bb.39:                               #   in Loop: Header=BB2_36 Depth=1
	andq	(%rdi), %r14
	cmpq	$1, %r14
	movl	$2, %ebp
	sbbl	$0, %ebp
	jmp	.LBB2_40
.LBB2_38:                               #   in Loop: Header=BB2_36 Depth=1
	xorl	%ebp, %ebp
.LBB2_40:                               #   in Loop: Header=BB2_36 Depth=1
	cmpl	%r9d, %ebp
	jne	.LBB2_42
# %bb.41:                               #   in Loop: Header=BB2_36 Depth=1
	incq	%rax
	addl	$-7, %ecx
	decq	%rbx
	cmpq	%rax, %r11
	jne	.LBB2_36
	jmp	.LBB2_43
.LBB2_42:                               # %..critedge4.loopexit_crit_edge
	movl	%eax, %r11d
	jmp	.LBB2_43
.LBB2_34:
	movl	$1, %r11d
.LBB2_43:                               # %.critedge4
	testb	%r10b, %r10b
	je	.LBB2_54
# %bb.44:                               # %.lr.ph217
	movl	%r11d, %eax
	subl	%edx, %eax
	addl	$5, %eax
	movl	$6, %ebx
	subl	%edx, %ebx
	movl	$6, %r14d
	subq	%r8, %r14
	leal	(%rsi,%rsi,2), %ecx
	leal	(%rdx,%rcx,2), %ecx
	addl	$7, %ecx
	movl	$1, %r15d
	movl	%r11d, %ebp
.LBB2_45:                               # =>This Inner Loop Header: Depth=1
	cmpq	%r14, %r15
	jge	.LBB2_46
# %bb.47:                               #   in Loop: Header=BB2_45 Depth=1
	movq	8(%rdi), %r13
	movl	$1, %r12d
	shlq	%cl, %r12
	btq	%rcx, %r13
	jae	.LBB2_48
# %bb.49:                               #   in Loop: Header=BB2_45 Depth=1
	andq	(%rdi), %r12
	cmpq	$1, %r12
	movl	$2, %r12d
	sbbl	$0, %r12d
	jmp	.LBB2_50
.LBB2_48:                               #   in Loop: Header=BB2_45 Depth=1
	xorl	%r12d, %r12d
.LBB2_50:                               #   in Loop: Header=BB2_45 Depth=1
	cmpl	%r9d, %r12d
	jne	.LBB2_53
# %bb.51:                               #   in Loop: Header=BB2_45 Depth=1
	incq	%r15
	incl	%ebp
	addl	$7, %ecx
	cmpq	%r15, %rbx
	jne	.LBB2_45
# %bb.52:
	movl	%eax, %r11d
	jmp	.LBB2_54
.LBB2_46:
	movl	%ebp, %r11d
	jmp	.LBB2_54
.LBB2_53:                               # %..critedge6.loopexit_crit_edge
	addl	%r15d, %r11d
	decl	%r11d
.LBB2_54:                               # %.critedge6
	movl	$1, %eax
	cmpl	$3, %r11d
	ja	.LBB2_77
# %bb.55:                               # %.preheader
	testl	%edx, %edx
	jle	.LBB2_56
# %bb.57:                               # %.lr.ph226
	leal	1(%rdx), %r11d
	leal	(%rsi,%rsi,2), %eax
	leal	(%rdx,%rax,2), %ecx
	addl	$5, %ecx
	movl	$1, %eax
.LBB2_58:                               # =>This Inner Loop Header: Depth=1
	leaq	(%r8,%rax), %rbx
	cmpq	$4, %rbx
	jg	.LBB2_64
# %bb.59:                               #   in Loop: Header=BB2_58 Depth=1
	movq	8(%rdi), %r14
	movl	$1, %ebx
	shlq	%cl, %rbx
	btq	%rcx, %r14
	jae	.LBB2_60
# %bb.61:                               #   in Loop: Header=BB2_58 Depth=1
	andq	(%rdi), %rbx
	cmpq	$1, %rbx
	movl	$2, %ebx
	sbbl	$0, %ebx
	jmp	.LBB2_62
.LBB2_60:                               #   in Loop: Header=BB2_58 Depth=1
	xorl	%ebx, %ebx
.LBB2_62:                               #   in Loop: Header=BB2_58 Depth=1
	cmpl	%r9d, %ebx
	jne	.LBB2_64
# %bb.63:                               #   in Loop: Header=BB2_58 Depth=1
	incq	%rax
	addl	$5, %ecx
	cmpq	%rax, %r11
	jne	.LBB2_58
	jmp	.LBB2_65
.LBB2_64:                               # %..critedge8.loopexit_crit_edge
	movl	%eax, %r11d
	jmp	.LBB2_65
.LBB2_56:
	movl	$1, %r11d
.LBB2_65:                               # %.critedge8
	testb	%r10b, %r10b
	je	.LBB2_76
# %bb.66:                               # %.lr.ph234
	movl	%r11d, %eax
	subl	%edx, %eax
	addl	$5, %eax
	movl	$6, %r10d
	subl	%edx, %r10d
	leal	(%rsi,%rsi,2), %ecx
	leal	(%rdx,%rcx,2), %ecx
	addl	$-5, %ecx
	movl	$1, %edx
	movl	%r11d, %esi
.LBB2_67:                               # =>This Inner Loop Header: Depth=1
	cmpq	%r8, %rdx
	jg	.LBB2_68
# %bb.69:                               #   in Loop: Header=BB2_67 Depth=1
	movq	8(%rdi), %r14
	movl	$1, %ebx
	shlq	%cl, %rbx
	btq	%rcx, %r14
	jae	.LBB2_70
# %bb.71:                               #   in Loop: Header=BB2_67 Depth=1
	andq	(%rdi), %rbx
	cmpq	$1, %rbx
	movl	$2, %ebx
	sbbl	$0, %ebx
	jmp	.LBB2_72
.LBB2_70:                               #   in Loop: Header=BB2_67 Depth=1
	xorl	%ebx, %ebx
.LBB2_72:                               #   in Loop: Header=BB2_67 Depth=1
	cmpl	%r9d, %ebx
	jne	.LBB2_75
# %bb.73:                               #   in Loop: Header=BB2_67 Depth=1
	incq	%rdx
	incl	%esi
	addl	$-5, %ecx
	cmpq	%rdx, %r10
	jne	.LBB2_67
# %bb.74:
	movl	%eax, %r11d
	jmp	.LBB2_76
.LBB2_68:
	movl	%esi, %r11d
	jmp	.LBB2_76
.LBB2_75:                               # %..critedge10.loopexit_crit_edge
	addl	%edx, %r11d
	decl	%r11d
.LBB2_76:                               # %.critedge10
	xorl	%eax, %eax
	cmpl	$4, %r11d
	setae	%al
.LBB2_77:
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z18current_player_wonPxiii, .Lfunc_end2-_Z18current_player_wonPxiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z14column_is_fullPxi           # -- Begin function _Z14column_is_fullPxi
	.type	_Z14column_is_fullPxi,@function
_Z14column_is_fullPxi:                  # @_Z14column_is_fullPxi
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
	movq	8(%rdi), %rcx
	xorl	%eax, %eax
	btq	%rsi, %rcx
	setb	%al
	retq
.Lfunc_end3:
	.size	_Z14column_is_fullPxi, .Lfunc_end3-_Z14column_is_fullPxi
	.cfi_endproc
                                        # -- End function
	.globl	_Z13table_is_fullPx             # -- Begin function _Z13table_is_fullPx
	.type	_Z13table_is_fullPx,@function
_Z13table_is_fullPx:                    # @_Z13table_is_fullPx
	.cfi_startproc
# %bb.0:
	movq	8(%rdi), %rdx
	xorl	%eax, %eax
	testb	$1, %dl
	je	.LBB4_5
# %bb.1:                                # %.lr.ph.preheader
	xorl	%eax, %eax
.LBB4_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%rax, %rcx
	cmpq	$5, %rax
	je	.LBB4_4
# %bb.3:                                #   in Loop: Header=BB4_2 Depth=1
	movq	%rdx, %rsi
	shrq	%cl, %rsi
	leaq	1(%rcx), %rax
	testb	$2, %sil
	jne	.LBB4_2
.LBB4_4:                                # %._crit_edge.loopexit
	xorl	%eax, %eax
	cmpq	$5, %rcx
	setae	%al
.LBB4_5:                                # %._crit_edge
	retq
.Lfunc_end4:
	.size	_Z13table_is_fullPx, .Lfunc_end4-_Z13table_is_fullPx
	.cfi_endproc
                                        # -- End function
	.globl	_Z9new_statePxiiiii             # -- Begin function _Z9new_statePxiiiii
	.type	_Z9new_statePxiiiii,@function
_Z9new_statePxiiiii:                    # @_Z9new_statePxiiiii
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rax
	movl	8(%rsp), %edi
	movq	(%rsi), %r10
	movq	%r10, (%rax)
	movq	8(%rsi), %rsi
	movq	%rsi, 8(%rax)
	movl	%edx, 16(%rax)
	movl	%ecx, 20(%rax)
	movl	%r8d, 24(%rax)
	movl	%r9d, 28(%rax)
	movl	%edi, 32(%rax)
	retq
.Lfunc_end5:
	.size	_Z9new_statePxiiiii, .Lfunc_end5-_Z9new_statePxiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z11print_state5state           # -- Begin function _Z11print_state5state
	.type	_Z11print_state5state,@function
_Z11print_state5state:                  # @_Z11print_state5state
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	32(%rsp), %esi
	movl	$.L.str.10, %edi
	xorl	%eax, %eax
	callq	printf
	movl	36(%rsp), %esi
	movl	$.L.str.11, %edi
	xorl	%eax, %eax
	callq	printf
	movl	40(%rsp), %esi
	movl	$.L.str.12, %edi
	xorl	%eax, %eax
	callq	printf
	movl	44(%rsp), %esi
	movl	$.L.str.13, %edi
	xorl	%eax, %eax
	callq	printf
	movl	48(%rsp), %esi
	movl	$.L.str.14, %edi
	xorl	%eax, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	jmp	printf                          # TAILCALL
.Lfunc_end6:
	.size	_Z11print_state5state, .Lfunc_end6-_Z11print_state5state
	.cfi_endproc
                                        # -- End function
	.globl	_Z10stack_pushR5stack5state     # -- Begin function _Z10stack_pushR5stack5state
	.type	_Z10stack_pushR5stack5state,@function
_Z10stack_pushR5stack5state:            # @_Z10stack_pushR5stack5state
	.cfi_startproc
# %bb.0:
	movslq	(%rdi), %rax
	incq	%rax
	movl	%eax, (%rdi)
	leaq	(%rax,%rax,4), %rax
	movq	40(%rsp), %rcx
	movq	%rcx, 40(%rdi,%rax,8)
	movaps	8(%rsp), %xmm0
	movaps	24(%rsp), %xmm1
	movups	%xmm1, 24(%rdi,%rax,8)
	movups	%xmm0, 8(%rdi,%rax,8)
	retq
.Lfunc_end7:
	.size	_Z10stack_pushR5stack5state, .Lfunc_end7-_Z10stack_pushR5stack5state
	.cfi_endproc
                                        # -- End function
	.globl	_Z14stack_is_emptyR5stack       # -- Begin function _Z14stack_is_emptyR5stack
	.type	_Z14stack_is_emptyR5stack,@function
_Z14stack_is_emptyR5stack:              # @_Z14stack_is_emptyR5stack
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	cmpl	$-1, (%rdi)
	sete	%al
	retq
.Lfunc_end8:
	.size	_Z14stack_is_emptyR5stack, .Lfunc_end8-_Z14stack_is_emptyR5stack
	.cfi_endproc
                                        # -- End function
	.globl	_Z9stack_popR5stack             # -- Begin function _Z9stack_popR5stack
	.type	_Z9stack_popR5stack,@function
_Z9stack_popR5stack:                    # @_Z9stack_popR5stack
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rax
	movslq	(%rsi), %rcx
	leaq	(%rcx,%rcx,4), %rdx
	movq	40(%rsi,%rdx,8), %rdi
	movq	%rdi, 32(%rax)
	movups	8(%rsi,%rdx,8), %xmm0
	movups	24(%rsi,%rdx,8), %xmm1
	movups	%xmm1, 16(%rax)
	movups	%xmm0, (%rax)
	decl	%ecx
	movl	%ecx, (%rsi)
	retq
.Lfunc_end9:
	.size	_Z9stack_popR5stack, .Lfunc_end9-_Z9stack_popR5stack
	.cfi_endproc
                                        # -- End function
	.globl	_Z10stack_peekR5stack           # -- Begin function _Z10stack_peekR5stack
	.type	_Z10stack_peekR5stack,@function
_Z10stack_peekR5stack:                  # @_Z10stack_peekR5stack
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rax
	movslq	(%rsi), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	movq	40(%rsi,%rcx,8), %rdx
	movq	%rdx, 32(%rdi)
	movups	8(%rsi,%rcx,8), %xmm0
	movups	24(%rsi,%rcx,8), %xmm1
	movups	%xmm1, 16(%rdi)
	movups	%xmm0, (%rdi)
	retq
.Lfunc_end10:
	.size	_Z10stack_peekR5stack, .Lfunc_end10-_Z10stack_peekR5stack
	.cfi_endproc
                                        # -- End function
	.globl	_Z9new_stackv                   # -- Begin function _Z9new_stackv
	.type	_Z9new_stackv,@function
_Z9new_stackv:                          # @_Z9new_stackv
	.cfi_startproc
# %bb.0:
	movq	%rdi, %rax
	movl	$-1, (%rdi)
	retq
.Lfunc_end11:
	.size	_Z9new_stackv, .Lfunc_end11-_Z9new_stackv
	.cfi_endproc
                                        # -- End function
	.globl	_Z9add_tablePx                  # -- Begin function _Z9add_tablePx
	.type	_Z9add_tablePx,@function
_Z9add_tablePx:                         # @_Z9add_tablePx
	.cfi_startproc
# %bb.0:
	movslq	k(%rip), %rax
	leaq	1(%rax), %rcx
	movl	%ecx, k(%rip)
	movq	(%rdi), %rdx
	movq	kTables(%rip), %rsi
	leaq	2(,%rax,2), %rax
	shlq	$4, %rcx
	movq	%rdx, (%rsi,%rcx)
	movq	8(%rdi), %rcx
	orl	$1, %eax
	cltq
	movq	%rcx, (%rsi,%rax,8)
	retq
.Lfunc_end12:
	.size	_Z9add_tablePx, .Lfunc_end12-_Z9add_tablePx
	.cfi_endproc
                                        # -- End function
	.globl	_Z14retrieve_valuev             # -- Begin function _Z14retrieve_valuev
	.type	_Z14retrieve_valuev,@function
_Z14retrieve_valuev:                    # @_Z14retrieve_valuev
	.cfi_startproc
# %bb.0:
	movq	kValues(%rip), %rax
	movslq	k(%rip), %rcx
	movl	(%rax,%rcx,4), %eax
	decl	%ecx
	movl	%ecx, k(%rip)
	retq
.Lfunc_end13:
	.size	_Z14retrieve_valuev, .Lfunc_end13-_Z14retrieve_valuev
	.cfi_endproc
                                        # -- End function
	.globl	_Z8d_minmaxPxi                  # -- Begin function _Z8d_minmaxPxi
	.type	_Z8d_minmaxPxi,@function
_Z8d_minmaxPxi:                         # @_Z8d_minmaxPxi
	.cfi_startproc
# %bb.0:                                # %.lr.ph192
	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	$24072, %rsp                    # imm = 0x5E08
	.cfi_def_cfa_offset 24128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, 12(%rsp)                  # 4-byte Spill
	testl	%esi, %esi
	movl	$-99999, %ecx                   # imm = 0xFFFE7961
	movl	$99999, %eax                    # imm = 0x1869F
	cmovnel	%ecx, %eax
	movups	(%rdi), %xmm0
	movl	$0, 64(%rsp)
	movups	%xmm0, 72(%rsp)
	movq	$-1, 88(%rsp)
	movl	%eax, 96(%rsp)
	movl	$4294967295, %eax               # imm = 0xFFFFFFFF
	movq	%rax, 100(%rsp)
	movl	$-1, 8(%rsp)                    # 4-byte Folded Spill
	xorl	%r13d, %r13d
.LBB14_1:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB14_3 Depth 2
                                        #     Child Loop BB14_7 Depth 2
                                        #     Child Loop BB14_28 Depth 2
                                        #       Child Loop BB14_30 Depth 3
	cmpl	$0, 12(%rsp)                    # 4-byte Folded Reload
	setne	%al
	movslq	%r13d, %rcx
	leaq	(%rcx,%rcx,4), %r12
	movups	72(%rsp,%r12,8), %xmm0
	movups	88(%rsp,%r12,8), %xmm1
	movaps	%xmm1, 32(%rsp)
	movq	104(%rsp,%r12,8), %r14
	movq	%r14, 48(%rsp)
	movaps	%xmm0, 16(%rsp)
	testb	$1, %r14b
	sete	%bpl
	xorb	%al, %bpl
	movslq	32(%rsp), %r15
	movl	36(%rsp), %ebx
	movl	$0, %ecx
	movl	$0, %eax
	cmpq	$-1, %r15
	je	.LBB14_11
# %bb.2:                                # %.preheader
                                        #   in Loop: Header=BB14_1 Depth=1
	movq	%r12, 56(%rsp)                  # 8-byte Spill
	movzbl	%bpl, %eax
	movl	$2, %ecx
	subl	%eax, %ecx
	movl	$-1, %esi
	movq	24(%rsp), %r12
	movq	%r15, %rax
.LBB14_3:                               #   Parent Loop BB14_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	incl	%esi
	btq	%rax, %r12
	leaq	6(%rax), %rax
	jae	.LBB14_3
# %bb.4:                                #   in Loop: Header=BB14_1 Depth=1
	leaq	16(%rsp), %rdi
	movl	%r15d, %edx
	callq	_Z18current_player_wonPxiii
	testb	$1, %r12b
	jne	.LBB14_6
# %bb.5:                                #   in Loop: Header=BB14_1 Depth=1
	xorl	%ecx, %ecx
	jmp	.LBB14_10
.LBB14_6:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB14_1 Depth=1
	xorl	%edx, %edx
.LBB14_7:                               # %.lr.ph
                                        #   Parent Loop BB14_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rdx, %rcx
	cmpq	$5, %rdx
	je	.LBB14_9
# %bb.8:                                #   in Loop: Header=BB14_7 Depth=2
	movq	%r12, %rsi
	shrq	%cl, %rsi
	leaq	1(%rcx), %rdx
	testb	$2, %sil
	jne	.LBB14_7
.LBB14_9:                               # %_Z13table_is_fullPx.exit.loopexit
                                        #   in Loop: Header=BB14_1 Depth=1
	cmpq	$5, %rcx
	setae	%cl
.LBB14_10:                              # %_Z13table_is_fullPx.exit
                                        #   in Loop: Header=BB14_1 Depth=1
	movzbl	%cl, %ecx
	movq	56(%rsp), %r12                  # 8-byte Reload
.LBB14_11:                              #   in Loop: Header=BB14_1 Depth=1
	movl	44(%rsp), %edx
	orl	%eax, %ecx
	jne	.LBB14_14
# %bb.12:                               #   in Loop: Header=BB14_1 Depth=1
	testl	%edx, %edx
	je	.LBB14_14
# %bb.13:                               #   in Loop: Header=BB14_1 Depth=1
	cmpl	$2, %r14d
	je	.LBB14_14
# %bb.27:                               #   in Loop: Header=BB14_1 Depth=1
	testb	%bpl, %bpl
	movl	$99999, %eax                    # imm = 0x1869F
	movl	$-99999, %ecx                   # imm = 0xFFFE7961
	cmovnel	%ecx, %eax
	movq	16(%rsp), %rdx
	movq	24(%rsp), %rsi
	incl	%r14d
	xorl	%edi, %edi
	movl	$24, %r8d
	xorl	%r9d, %r9d
.LBB14_28:                              #   Parent Loop BB14_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB14_30 Depth 3
	btq	%rdi, %rsi
	jb	.LBB14_32
# %bb.29:                               #   in Loop: Header=BB14_28 Depth=2
	movl	%r8d, %ecx
.LBB14_30:                              #   Parent Loop BB14_1 Depth=1
                                        #     Parent Loop BB14_28 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	$1, %r10d
	shlq	%cl, %r10
	movl	%ecx, %r11d
	addl	$-6, %r11d
	btq	%rcx, %rsi
	movl	%r11d, %ecx
	jb	.LBB14_30
# %bb.31:                               #   in Loop: Header=BB14_28 Depth=2
	incl	%r9d
	testb	%bpl, %bpl
	movl	$0, %ecx
	cmovneq	%r10, %rcx
	orq	%rdx, %rcx
	orq	%rsi, %r10
	movslq	64(%rsp), %r11
	incq	%r11
	movl	%r11d, 64(%rsp)
	leaq	(%r11,%r11,4), %r11
	movq	%rcx, 72(%rsp,%r11,8)
	movq	%r10, 80(%rsp,%r11,8)
	movl	%edi, 88(%rsp,%r11,8)
	movl	%r13d, 92(%rsp,%r11,8)
	movl	%eax, 96(%rsp,%r11,8)
	movl	$-1, 100(%rsp,%r11,8)
	movl	%r14d, 104(%rsp,%r11,8)
.LBB14_32:                              #   in Loop: Header=BB14_28 Depth=2
	incq	%rdi
	incl	%r8d
	cmpq	$6, %rdi
	jne	.LBB14_28
# %bb.33:                               #   in Loop: Header=BB14_1 Depth=1
	movl	%r9d, 100(%rsp,%r12,8)
	movl	64(%rsp), %ebx
	jmp	.LBB14_34
.LBB14_14:                              #   in Loop: Header=BB14_1 Depth=1
	movl	%eax, %ecx
	negl	%ecx
	testb	%bpl, %bpl
	cmovnel	%eax, %ecx
	testl	%edx, %edx
	jne	.LBB14_16
# %bb.15:                               #   in Loop: Header=BB14_1 Depth=1
	movl	40(%rsp), %ecx
.LBB14_16:                              #   in Loop: Header=BB14_1 Depth=1
	cmpl	$-1, %r15d
	je	.LBB14_17
# %bb.18:                               #   in Loop: Header=BB14_1 Depth=1
	movslq	%ebx, %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rsp,%rax,8), %rax
	addq	$72, %rax
	movl	24(%rax), %esi
	movslq	20(%rax), %rdx
	testb	%bpl, %bpl
	je	.LBB14_19
# %bb.23:                               #   in Loop: Header=BB14_1 Depth=1
	cmpl	%ecx, %esi
	jge	.LBB14_26
# %bb.24:                               #   in Loop: Header=BB14_1 Depth=1
	movl	%ecx, 24(%rax)
	cmpl	$-1, %edx
	je	.LBB14_26
# %bb.25:                               #   in Loop: Header=BB14_1 Depth=1
	leaq	(%rdx,%rdx,4), %rdx
	cmpl	96(%rsp,%rdx,8), %ecx
	jl	.LBB14_26
	jmp	.LBB14_22
.LBB14_17:                              #   in Loop: Header=BB14_1 Depth=1
	decl	%r13d
	movl	%r13d, 64(%rsp)
	movl	%r13d, %ebx
	movl	%ecx, 8(%rsp)                   # 4-byte Spill
	jmp	.LBB14_34
.LBB14_19:                              #   in Loop: Header=BB14_1 Depth=1
	cmpl	%ecx, %esi
	jle	.LBB14_26
# %bb.20:                               #   in Loop: Header=BB14_1 Depth=1
	movl	%ecx, 24(%rax)
	cmpl	$-1, %edx
	je	.LBB14_26
# %bb.21:                               #   in Loop: Header=BB14_1 Depth=1
	leaq	(%rdx,%rdx,4), %rdx
	cmpl	%ecx, 96(%rsp,%rdx,8)
	jge	.LBB14_22
.LBB14_26:                              # %.critedge
                                        #   in Loop: Header=BB14_1 Depth=1
	decl	28(%rax)
	decl	%r13d
	movl	%r13d, 64(%rsp)
	movl	%r13d, %ebx
.LBB14_34:                              #   in Loop: Header=BB14_1 Depth=1
	movl	%ebx, %r13d
	cmpl	$-1, %ebx
	jne	.LBB14_1
	jmp	.LBB14_35
.LBB14_22:                              #   in Loop: Header=BB14_1 Depth=1
	movl	%ebx, 64(%rsp)
	movl	$0, 28(%rax)
	jmp	.LBB14_34
.LBB14_35:                              # %._crit_edge
	movl	8(%rsp), %eax                   # 4-byte Reload
	addq	$24072, %rsp                    # imm = 0x5E08
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end14:
	.size	_Z8d_minmaxPxi, .Lfunc_end14-_Z8d_minmaxPxi
	.cfi_endproc
                                        # -- End function
	.globl	_Z25__device_stub__minmax_gpuPxPiii # -- Begin function _Z25__device_stub__minmax_gpuPxPiii
	.type	_Z25__device_stub__minmax_gpuPxPiii,@function
_Z25__device_stub__minmax_gpuPxPiii:    # @_Z25__device_stub__minmax_gpuPxPiii
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	12(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	8(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z10minmax_gpuPxPiii, %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_end15:
	.size	_Z25__device_stub__minmax_gpuPxPiii, .Lfunc_end15-_Z25__device_stub__minmax_gpuPxPiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z8h_minmaxPxii                 # -- Begin function _Z8h_minmaxPxii
	.type	_Z8h_minmaxPxii,@function
_Z8h_minmaxPxii:                        # @_Z8h_minmaxPxii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24120, %rsp                    # imm = 0x5E38
	.cfi_def_cfa_offset 24176
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, 36(%rsp)                  # 4-byte Spill
	testl	%esi, %esi
	movl	$-99999, %ecx                   # imm = 0xFFFE7961
	movl	$99999, %eax                    # imm = 0x1869F
	cmovnel	%ecx, %eax
	movups	(%rdi), %xmm0
	movl	$0, 112(%rsp)
	movups	%xmm0, 120(%rsp)
	movq	$-1, 136(%rsp)
	movl	%eax, 144(%rsp)
	movl	$4294967295, %eax               # imm = 0xFFFFFFFF
	movq	%rax, 148(%rsp)
	movl	%edx, 16(%rsp)                  # 4-byte Spill
	testl	%edx, %edx
	je	.LBB16_2
# %bb.1:
	movl	$-1, k(%rip)
.LBB16_2:                               # %.lr.ph179
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	sete	11(%rsp)                        # 1-byte Folded Spill
	movl	k(%rip), %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	movq	kTables(%rip), %rax
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	movl	$-1, 12(%rsp)                   # 4-byte Folded Spill
	xorl	%r14d, %r14d
	movq	kValues(%rip), %rax
	movq	%rax, 96(%rsp)                  # 8-byte Spill
.LBB16_3:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB16_5 Depth 2
                                        #     Child Loop BB16_9 Depth 2
                                        #     Child Loop BB16_33 Depth 2
                                        #       Child Loop BB16_35 Depth 3
	cmpl	$0, 36(%rsp)                    # 4-byte Folded Reload
	setne	%al
	movslq	%r14d, %rcx
	leaq	(%rcx,%rcx,4), %r13
	movups	120(%rsp,%r13,8), %xmm0
	movups	136(%rsp,%r13,8), %xmm1
	movaps	%xmm1, 64(%rsp)
	movq	152(%rsp,%r13,8), %rbx
	movq	%rbx, 80(%rsp)
	movaps	%xmm0, 48(%rsp)
	testb	$1, %bl
	sete	%bpl
	xorb	%al, %bpl
	movzbl	%bpl, %edi
	movslq	64(%rsp), %r12
	movslq	68(%rsp), %r8
	movl	$0, %eax
	movl	$0, %esi
	cmpq	$-1, %r12
	je	.LBB16_13
# %bb.4:                                # %.preheader
                                        #   in Loop: Header=BB16_3 Depth=1
	movq	%r8, 40(%rsp)                   # 8-byte Spill
	movl	$2, %ecx
	movl	%edi, 20(%rsp)                  # 4-byte Spill
	subl	%edi, %ecx
	movl	$-1, %esi
	movq	56(%rsp), %r15
	movq	%r12, %rax
.LBB16_5:                               #   Parent Loop BB16_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	incl	%esi
	btq	%rax, %r15
	leaq	6(%rax), %rax
	jae	.LBB16_5
# %bb.6:                                #   in Loop: Header=BB16_3 Depth=1
	leaq	48(%rsp), %rdi
	movl	%r12d, %edx
	callq	_Z18current_player_wonPxiii
	testb	$1, %r15b
	jne	.LBB16_8
# %bb.7:                                #   in Loop: Header=BB16_3 Depth=1
	xorl	%ecx, %ecx
	jmp	.LBB16_12
.LBB16_8:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB16_3 Depth=1
	xorl	%edx, %edx
.LBB16_9:                               # %.lr.ph
                                        #   Parent Loop BB16_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rdx, %rcx
	cmpq	$5, %rdx
	je	.LBB16_11
# %bb.10:                               #   in Loop: Header=BB16_9 Depth=2
	movq	%r15, %rsi
	shrq	%cl, %rsi
	leaq	1(%rcx), %rdx
	testb	$2, %sil
	jne	.LBB16_9
.LBB16_11:                              # %_Z13table_is_fullPx.exit.loopexit
                                        #   in Loop: Header=BB16_3 Depth=1
	cmpq	$5, %rcx
	setae	%cl
.LBB16_12:                              # %_Z13table_is_fullPx.exit
                                        #   in Loop: Header=BB16_3 Depth=1
	movq	40(%rsp), %r8                   # 8-byte Reload
	movl	20(%rsp), %edi                  # 4-byte Reload
	movzbl	%cl, %esi
.LBB16_13:                              #   in Loop: Header=BB16_3 Depth=1
	movl	76(%rsp), %edx
	cmpl	$10, %ebx
	sete	%cl
	andb	11(%rsp), %cl                   # 1-byte Folded Reload
	orl	%eax, %esi
	jne	.LBB16_16
# %bb.14:                               #   in Loop: Header=BB16_3 Depth=1
	testl	%edx, %edx
	je	.LBB16_16
# %bb.15:                               #   in Loop: Header=BB16_3 Depth=1
	testb	%cl, %cl
	jne	.LBB16_16
# %bb.29:                               #   in Loop: Header=BB16_3 Depth=1
	cmpl	$0, 16(%rsp)                    # 4-byte Folded Reload
	je	.LBB16_32
# %bb.30:                               #   in Loop: Header=BB16_3 Depth=1
	cmpl	$10, %ebx
	jne	.LBB16_32
# %bb.31:                               #   in Loop: Header=BB16_3 Depth=1
	movq	24(%rsp), %rdx                  # 8-byte Reload
	leal	2(,%rdx,2), %eax
	leal	3(,%rdx,2), %ecx
	incl	%edx
	movl	%edx, k(%rip)
	movq	48(%rsp), %rsi
	cltq
	movq	104(%rsp), %rdi                 # 8-byte Reload
	movq	%rsi, (%rdi,%rax,8)
	movq	56(%rsp), %rax
	movslq	%ecx, %rcx
	movq	%rax, (%rdi,%rcx,8)
	decl	%r14d
	movl	%r14d, 112(%rsp)
	leaq	(%r8,%r8,4), %rax
	decl	148(%rsp,%rax,8)
	movl	%edx, %eax
	movq	%rax, 24(%rsp)                  # 8-byte Spill
	jmp	.LBB16_39
.LBB16_16:                              #   in Loop: Header=BB16_3 Depth=1
	cmpl	$-1, %r12d
	je	.LBB16_17
# %bb.18:                               #   in Loop: Header=BB16_3 Depth=1
	testl	%eax, %eax
	je	.LBB16_20
# %bb.19:                               #   in Loop: Header=BB16_3 Depth=1
	decl	%edi
	orl	$1, %edi
.LBB16_24:                              #   in Loop: Header=BB16_3 Depth=1
	leaq	(%r8,%r8,4), %rax
	leaq	(%rsp,%rax,8), %rax
	addq	$120, %rax
	movl	24(%rax), %ecx
	testb	%bpl, %bpl
	je	.LBB16_25
# %bb.26:                               #   in Loop: Header=BB16_3 Depth=1
	cmpl	%edi, %ecx
	jl	.LBB16_27
	jmp	.LBB16_28
.LBB16_32:                              #   in Loop: Header=BB16_3 Depth=1
	testb	%bpl, %bpl
	movl	$99999, %eax                    # imm = 0x1869F
	movl	$-99999, %ecx                   # imm = 0xFFFE7961
	cmovnel	%ecx, %eax
	movq	48(%rsp), %rdx
	movq	56(%rsp), %rsi
	incl	%ebx
	xorl	%edi, %edi
	movl	$24, %r8d
	xorl	%r9d, %r9d
.LBB16_33:                              #   Parent Loop BB16_3 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB16_35 Depth 3
	btq	%rdi, %rsi
	jb	.LBB16_37
# %bb.34:                               #   in Loop: Header=BB16_33 Depth=2
	movl	%r8d, %ecx
.LBB16_35:                              #   Parent Loop BB16_3 Depth=1
                                        #     Parent Loop BB16_33 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	$1, %r10d
	shlq	%cl, %r10
	movl	%ecx, %r11d
	addl	$-6, %r11d
	btq	%rcx, %rsi
	movl	%r11d, %ecx
	jb	.LBB16_35
# %bb.36:                               #   in Loop: Header=BB16_33 Depth=2
	incl	%r9d
	testb	%bpl, %bpl
	movl	$0, %ecx
	cmovneq	%r10, %rcx
	orq	%rdx, %rcx
	orq	%rsi, %r10
	movslq	112(%rsp), %r11
	incq	%r11
	movl	%r11d, 112(%rsp)
	leaq	(%r11,%r11,4), %r11
	movq	%rcx, 120(%rsp,%r11,8)
	movq	%r10, 128(%rsp,%r11,8)
	movl	%edi, 136(%rsp,%r11,8)
	movl	%r14d, 140(%rsp,%r11,8)
	movl	%eax, 144(%rsp,%r11,8)
	movl	$-1, 148(%rsp,%r11,8)
	movl	%ebx, 152(%rsp,%r11,8)
.LBB16_37:                              #   in Loop: Header=BB16_33 Depth=2
	incq	%rdi
	incl	%r8d
	cmpq	$6, %rdi
	jne	.LBB16_33
# %bb.38:                               #   in Loop: Header=BB16_3 Depth=1
	movl	%r9d, 148(%rsp,%r13,8)
	movl	112(%rsp), %r14d
	jmp	.LBB16_39
.LBB16_25:                              #   in Loop: Header=BB16_3 Depth=1
	cmpl	%edi, %ecx
	jle	.LBB16_28
.LBB16_27:                              # %.sink.split
                                        #   in Loop: Header=BB16_3 Depth=1
	movl	%edi, 24(%rax)
	cmpl	$1, %ebx
	movl	12(%rsp), %ecx                  # 4-byte Reload
	cmovel	%r12d, %ecx
	movl	%ecx, 12(%rsp)                  # 4-byte Spill
.LBB16_28:                              #   in Loop: Header=BB16_3 Depth=1
	decl	28(%rax)
.LBB16_17:                              #   in Loop: Header=BB16_3 Depth=1
	decl	%r14d
	movl	%r14d, 112(%rsp)
.LBB16_39:                              #   in Loop: Header=BB16_3 Depth=1
	cmpl	$-1, %r14d
	jne	.LBB16_3
	jmp	.LBB16_40
.LBB16_20:                              #   in Loop: Header=BB16_3 Depth=1
	testl	%edx, %edx
	je	.LBB16_21
# %bb.22:                               #   in Loop: Header=BB16_3 Depth=1
	xorl	%edi, %edi
	testb	%cl, %cl
	je	.LBB16_24
# %bb.23:                               #   in Loop: Header=BB16_3 Depth=1
	movq	24(%rsp), %rdx                  # 8-byte Reload
	movslq	%edx, %rax
	movq	96(%rsp), %rcx                  # 8-byte Reload
	movl	(%rcx,%rax,4), %edi
	decl	%edx
	movq	%rdx, 24(%rsp)                  # 8-byte Spill
	movl	%edx, k(%rip)
	jmp	.LBB16_24
.LBB16_21:                              #   in Loop: Header=BB16_3 Depth=1
	movl	72(%rsp), %edi
	jmp	.LBB16_24
.LBB16_40:                              # %._crit_edge
	movl	12(%rsp), %eax                  # 4-byte Reload
	addq	$24120, %rsp                    # imm = 0x5E38
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end16:
	.size	_Z8h_minmaxPxii, .Lfunc_end16-_Z8h_minmaxPxii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z6minmaxPxi
.LCPI17_0:
	.quad	0x3f60000000000000              # double 0.001953125
	.text
	.globl	_Z6minmaxPxi
	.type	_Z6minmaxPxi,@function
_Z6minmaxPxi:                           # @_Z6minmaxPxi
	.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	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	$.Lstr.2, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_Z8h_minmaxPxii
	movl	k(%rip), %esi
	incl	%esi
	movl	$.L.str.17, %edi
	xorl	%eax, %eax
	callq	printf
	xorl	%ebp, %ebp
	testl	%ebx, %ebx
	setne	%r15b
	cmpl	$0, k(%rip)
	js	.LBB17_4
# %bb.1:
	movl	$.L.str.18, %edi
	movl	$960000000, %esi                # imm = 0x39387000
	xorl	%eax, %eax
	callq	printf
	movslq	k(%rip), %rsi
	shlq	$4, %rsi
	movl	$.L.str.19, %edi
	xorl	%eax, %eax
	callq	printf
	movq	d_tables(%rip), %rdi
	movq	kTables(%rip), %rsi
	movl	k(%rip), %eax
	leal	2(,%rax,2), %eax
	movslq	%eax, %rdx
	shlq	$3, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	%eax, %edi
	movl	$583, %esi                      # imm = 0x247
	callq	_ZL13gpuCheckError10hipError_tPKci
	movl	k(%rip), %eax
	incl	%eax
	cvtsi2sd	%eax, %xmm0
	mulsd	.LCPI17_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %r12
	movl	$.Lstr.3, %edi
	callq	puts@PLT
	movl	%r12d, %edi
	btsq	$32, %rdi
	movabsq	$4294967296, %rdx               # imm = 0x100000000
	orq	$512, %rdx                      # imm = 0x200
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB17_3
# %bb.2:
	movb	%r15b, %bpl
	movq	d_tables(%rip), %rdi
	movq	d_values(%rip), %rsi
	movl	k(%rip), %ecx
	movl	%ebp, %edx
	callq	_Z25__device_stub__minmax_gpuPxPiii
.LBB17_3:
	movq	kValues(%rip), %rdi
	movq	d_values(%rip), %rsi
	movl	$240000000, %edx                # imm = 0xE4E1C00
	movl	$2, %ecx
	callq	hipMemcpy
	movl	%eax, %edi
	movl	$600, %esi                      # imm = 0x258
	callq	_ZL13gpuCheckError10hipError_tPKci
	callq	hipDeviceSynchronize
	movl	%eax, %edi
	movl	$605, %esi                      # imm = 0x25D
	callq	_ZL13gpuCheckError10hipError_tPKci
	callq	hipPeekAtLastError
	movl	%eax, %edi
	callq	hipGetErrorString
	movl	$.L.str.22, %edi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	printf
.LBB17_4:
	movl	$.Lstr.4, %edi
	callq	puts@PLT
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_Z8h_minmaxPxii
	movl	%eax, %ebx
	movl	$.L.str.24, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	printf
	movl	%ebx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end17:
	.size	_Z6minmaxPxi, .Lfunc_end17-_Z6minmaxPxi
	.cfi_endproc
                                        # -- End function
	.type	_ZL13gpuCheckError10hipError_tPKci,@function # -- Begin function _ZL13gpuCheckError10hipError_tPKci
_ZL13gpuCheckError10hipError_tPKci:     # @_ZL13gpuCheckError10hipError_tPKci
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	jne	.LBB18_2
# %bb.1:
	retq
.LBB18_2:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movl	%esi, %ebx
	callq	hipGetErrorString
	movl	$.L.str.32, %edi
	movl	$.L.str.20, %edx
	movq	%rax, %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	printf
	movl	$1, %edi
	callq	exit
.Lfunc_end18:
	.size	_ZL13gpuCheckError10hipError_tPKci, .Lfunc_end18-_ZL13gpuCheckError10hipError_tPKci
	.cfi_endproc
                                        # -- End function
	.globl	_Z11clear_tablev                # -- Begin function _Z11clear_tablev
	.type	_Z11clear_tablev,@function
_Z11clear_tablev:                       # @_Z11clear_tablev
	.cfi_startproc
# %bb.0:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, table(%rip)
	retq
.Lfunc_end19:
	.size	_Z11clear_tablev, .Lfunc_end19-_Z11clear_tablev
	.cfi_endproc
                                        # -- End function
	.globl	_Z11pick_columnv                # -- Begin function _Z11pick_columnv
	.type	_Z11pick_columnv,@function
_Z11pick_columnv:                       # @_Z11pick_columnv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	cmpl	$1, current_player(%rip)
	jne	.LBB20_5
# %bb.1:
	movl	$-1, current_move(%rip)
	movl	$.L.str.25, %edi
	movl	$1, %esi
	xorl	%eax, %eax
	callq	printf
.LBB20_2:                               # =>This Inner Loop Header: Depth=1
	movl	$.L.str.26, %edi
	movl	$current_move, %esi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movl	current_move(%rip), %ecx
	cmpq	$5, %rcx
	ja	.LBB20_4
# %bb.3:                                #   in Loop: Header=BB20_2 Depth=1
	movq	table+8(%rip), %rax
	btq	%rcx, %rax
	jae	.LBB20_6
.LBB20_4:                               # %.critedge
                                        #   in Loop: Header=BB20_2 Depth=1
	movl	$.Lstr.5, %edi
	callq	puts@PLT
	jmp	.LBB20_2
.LBB20_5:
	xorl	%esi, %esi
	cmpl	$2, max_player(%rip)
	sete	%sil
	movl	$table, %edi
	callq	_Z6minmaxPxi
	movl	%eax, %ecx
	movl	%eax, current_move(%rip)
	movq	table+8(%rip), %rax
.LBB20_6:                               # %.loopexit
	addl	$24, %ecx
	movl	$5, %edx
.LBB20_7:                               # =>This Inner Loop Header: Depth=1
	movl	$1, %esi
	shlq	%cl, %rsi
	decl	%edx
	movl	%ecx, %edi
	addl	$-6, %edi
	btq	%rcx, %rax
	movl	%edi, %ecx
	jb	.LBB20_7
# %bb.8:
	cmpl	$2, current_player(%rip)
	jne	.LBB20_10
# %bb.9:
	orq	%rsi, table(%rip)
.LBB20_10:                              # %_Z6set_atPxiii.exit
	orq	%rax, %rsi
	movq	%rsi, table+8(%rip)
	movl	%edx, current_row(%rip)
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end20:
	.size	_Z11pick_columnv, .Lfunc_end20-_Z11pick_columnv
	.cfi_endproc
                                        # -- End function
	.globl	_Z13switch_playerv              # -- Begin function _Z13switch_playerv
	.type	_Z13switch_playerv,@function
_Z13switch_playerv:                     # @_Z13switch_playerv
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	cmpl	$1, current_player(%rip)
	sete	%al
	incl	%eax
	movl	%eax, current_player(%rip)
	retq
.Lfunc_end21:
	.size	_Z13switch_playerv, .Lfunc_end21-_Z13switch_playerv
	.cfi_endproc
                                        # -- End function
	.globl	_Z12update_scorev               # -- Begin function _Z12update_scorev
	.type	_Z12update_scorev,@function
_Z12update_scorev:                      # @_Z12update_scorev
	.cfi_startproc
# %bb.0:
	cmpl	$1, current_player(%rip)
	movl	$score1, %eax
	movl	$score2, %ecx
	cmoveq	%rax, %rcx
	incl	(%rcx)
	retq
.Lfunc_end22:
	.size	_Z12update_scorev, .Lfunc_end22-_Z12update_scorev
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI23_0:
	.zero	16
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	$d_tables, %edi
	movl	$960000000, %esi                # imm = 0x39387000
	callq	hipMalloc
	movl	%eax, %edi
	movl	$682, %esi                      # imm = 0x2AA
	callq	_ZL13gpuCheckError10hipError_tPKci
	movl	$d_values, %edi
	movl	$240000000, %esi                # imm = 0xE4E1C00
	callq	hipMalloc
	movl	%eax, %edi
	movl	$685, %esi                      # imm = 0x2AD
	callq	_ZL13gpuCheckError10hipError_tPKci
	movl	$score1, %r14d
	leaq	15(%rsp), %rbx
.LBB23_1:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB23_2 Depth 2
                                        #       Child Loop BB23_6 Depth 3
	xorps	%xmm0, %xmm0
	movaps	%xmm0, table(%rip)
	movl	$table, %edi
	callq	_Z11print_tablePx
	movl	current_player(%rip), %eax
	movl	%eax, max_player(%rip)
.LBB23_2:                               #   Parent Loop BB23_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB23_6 Depth 3
	callq	_Z11pick_columnv
	movl	$table, %edi
	callq	_Z11print_tablePx
	movl	current_row(%rip), %esi
	movl	current_move(%rip), %edx
	movl	current_player(%rip), %ebp
	movl	$table, %edi
	movl	%ebp, %ecx
	callq	_Z18current_player_wonPxiii
	testl	%eax, %eax
	jne	.LBB23_3
# %bb.4:                                # %.lr.ph13
                                        #   in Loop: Header=BB23_2 Depth=2
	movq	table+8(%rip), %rax
	testb	$1, %al
	je	.LBB23_16
# %bb.5:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB23_2 Depth=2
	movq	$-1, %rcx
.LBB23_6:                               # %.lr.ph
                                        #   Parent Loop BB23_1 Depth=1
                                        #     Parent Loop BB23_2 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	cmpq	$4, %rcx
	je	.LBB23_9
# %bb.7:                                #   in Loop: Header=BB23_6 Depth=3
	incq	%rcx
	movq	%rax, %rdx
	shrq	%cl, %rdx
	testb	$2, %dl
	jne	.LBB23_6
# %bb.8:                                # %_Z13table_is_fullPx.exit
                                        #   in Loop: Header=BB23_2 Depth=2
	cmpq	$5, %rcx
	jae	.LBB23_9
.LBB23_16:                              # %.critedge
                                        #   in Loop: Header=BB23_2 Depth=2
	xorl	%eax, %eax
	cmpl	$1, %ebp
	sete	%al
	incl	%eax
	movl	%eax, current_player(%rip)
	jmp	.LBB23_2
.LBB23_3:                               # %._crit_edge
                                        #   in Loop: Header=BB23_1 Depth=1
	cmpl	$1, %ebp
	movl	$score2, %eax
	cmoveq	%r14, %rax
	incl	(%rax)
	movl	$table, %edi
	callq	_Z11print_tablePx
	movl	current_player(%rip), %esi
	movl	$.L.str.28, %edi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB23_10
.LBB23_9:                               # %_Z13table_is_fullPx.exit.thread
                                        #   in Loop: Header=BB23_1 Depth=1
	movl	$.Lstr.6, %edi
	callq	puts@PLT
.LBB23_10:                              #   in Loop: Header=BB23_1 Depth=1
	movl	$.Lstr.7, %edi
	callq	puts@PLT
	movl	$.L.str.31, %edi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	__isoc23_scanf
	movb	15(%rsp), %al
	andb	$-33, %al
	cmpb	$89, %al
	je	.LBB23_1
# %bb.11:
	movq	d_tables(%rip), %rdi
	callq	hipFree
	movq	d_values(%rip), %rdi
	callq	hipFree
	movq	kValues(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB23_13
# %bb.12:
	callq	_ZdaPv
.LBB23_13:
	movq	kTables(%rip), %rdi
	testq	%rdi, %rdi
	je	.LBB23_15
# %bb.14:
	callq	_ZdaPv
.LBB23_15:
	xorl	%eax, %eax
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end23:
	.size	main, .Lfunc_end23-main
	.cfi_endproc
                                        # -- End function
	.section	.text.startup,"ax",@progbits
	.type	_GLOBAL__sub_I_c4.hip,@function # -- Begin function _GLOBAL__sub_I_c4.hip
_GLOBAL__sub_I_c4.hip:                  # @_GLOBAL__sub_I_c4.hip
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$960000000, %edi                # imm = 0x39387000
	callq	_Znam
	movq	%rax, kTables(%rip)
	movl	$240000000, %edi                # imm = 0xE4E1C00
	callq	_Znam
	movq	%rax, kValues(%rip)
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end24:
	.size	_GLOBAL__sub_I_c4.hip, .Lfunc_end24-_GLOBAL__sub_I_c4.hip
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB25_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB25_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z10minmax_gpuPxPiii, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end25:
	.size	__hip_module_ctor, .Lfunc_end25-__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	.LBB26_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
.LBB26_2:
	retq
.Lfunc_end26:
	.size	__hip_module_dtor, .Lfunc_end26-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	table_size,@object              # @table_size
	.data
	.globl	table_size
	.p2align	2, 0x0
table_size:
	.long	30                              # 0x1e
	.size	table_size, 4

	.type	table,@object                   # @table
	.bss
	.globl	table
	.p2align	4, 0x0
table:
	.zero	16
	.size	table, 16

	.type	current_player,@object          # @current_player
	.data
	.globl	current_player
	.p2align	2, 0x0
current_player:
	.long	1                               # 0x1
	.size	current_player, 4

	.type	max_player,@object              # @max_player
	.globl	max_player
	.p2align	2, 0x0
max_player:
	.long	1                               # 0x1
	.size	max_player, 4

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

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

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

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

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

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

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"\n+ "
	.size	.L.str.6, 4

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%d   "
	.size	.L.str.7, 6

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"SCORE: \n Player 1 (X, Human) = %d \n Player 2 (0, Computer) = %d \n \n"
	.size	.L.str.9, 68

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"current move %d\n"
	.size	.L.str.10, 17

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"parent index %d\n"
	.size	.L.str.11, 17

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"node value %d\n"
	.size	.L.str.12, 15

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"child count %d\n"
	.size	.L.str.13, 16

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"depth %d\n"
	.size	.L.str.14, 10

	.type	k,@object                       # @k
	.data
	.globl	k
	.p2align	2, 0x0
k:
	.long	4294967295                      # 0xffffffff
	.size	k, 4

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

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

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

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

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

	.type	.L.str.17,@object               # @.str.17
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.17:
	.asciz	"Number of nodes found at SERIAL DEPTH level %d\n"
	.size	.L.str.17, 48

	.type	.L.str.18,@object               # @.str.18
.L.str.18:
	.asciz	"K*2 * sizeof (long long int) %lu\n"
	.size	.L.str.18, 34

	.type	.L.str.19,@object               # @.str.19
.L.str.19:
	.asciz	"k*2 * sizeof (long long int) %lu\n"
	.size	.L.str.19, 34

	.type	.L.str.20,@object               # @.str.20
.L.str.20:
	.asciz	"/home/ubuntu/Datasets/stackv2/train-structured-repos-hip-sm89/danilofaria/connect4minmaxCUDA/master/c4.hip"
	.size	.L.str.20, 107

	.type	.L.str.22,@object               # @.str.22
.L.str.22:
	.asciz	"Errors?: %s \n"
	.size	.L.str.22, 14

	.type	.L.str.24,@object               # @.str.24
.L.str.24:
	.asciz	"Best move computed: %d\n"
	.size	.L.str.24, 24

	.type	.L.str.25,@object               # @.str.25
.L.str.25:
	.asciz	"Pick a column, then press enter, player %d:\n"
	.size	.L.str.25, 45

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

	.type	.L.str.28,@object               # @.str.28
.L.str.28:
	.asciz	"Congratulations, Player %d! \n"
	.size	.L.str.28, 30

	.type	.L.str.31,@object               # @.str.31
.L.str.31:
	.asciz	" %c"
	.size	.L.str.31, 4

	.type	.L.str.32,@object               # @.str.32
.L.str.32:
	.asciz	"%s in %s at line %d\n"
	.size	.L.str.32, 21

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z10minmax_gpuPxPiii"
	.size	.L__unnamed_1, 21

	.type	__hip_fatbin_wrapper,@object    # @__hip_fatbin_wrapper
	.section	.hipFatBinSegment,"a",@progbits
	.p2align	3, 0x0
__hip_fatbin_wrapper:
	.long	1212764230                      # 0x48495046
	.long	1                               # 0x1
	.quad	__hip_fatbin
	.quad	0
	.size	__hip_fatbin_wrapper, 24

	.type	__hip_gpubin_handle,@object     # @__hip_gpubin_handle
	.local	__hip_gpubin_handle
	.comm	__hip_gpubin_handle,8,8
	.section	.init_array,"aw",@init_array
	.p2align	3, 0x0
	.quad	_GLOBAL__sub_I_c4.hip
	.quad	__hip_module_ctor
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"~* CONNECT 4 *~ \n "
	.size	.Lstr, 19

	.type	.Lstr.1,@object                 # @str.1
.Lstr.1:
	.asciz	"+ \n "
	.size	.Lstr.1, 5

	.type	.Lstr.2,@object                 # @str.2
.Lstr.2:
	.asciz	"First CPU pass "
	.size	.Lstr.2, 16

	.type	.Lstr.3,@object                 # @str.3
.Lstr.3:
	.asciz	"Launching Kernel "
	.size	.Lstr.3, 18

	.type	.Lstr.4,@object                 # @str.4
.Lstr.4:
	.asciz	"Second CPU pass "
	.size	.Lstr.4, 17

	.type	.Lstr.5,@object                 # @str.5
.Lstr.5:
	.asciz	"invalid move, pick another column:"
	.size	.Lstr.5, 35

	.type	.Lstr.6,@object                 # @str.6
.Lstr.6:
	.asciz	"Draw! "
	.size	.Lstr.6, 7

	.type	.Lstr.7,@object                 # @str.7
.Lstr.7:
	.asciz	"Do you wish to play again?(y/n) "
	.size	.Lstr.7, 33

	.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 _Z25__device_stub__minmax_gpuPxPiii
	.addrsig_sym _GLOBAL__sub_I_c4.hip
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym table
	.addrsig_sym current_move
	.addrsig_sym _Z10minmax_gpuPxPiii
	.addrsig_sym d_tables
	.addrsig_sym d_values
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z10minmax_gpuPxPiii    ; -- Begin function _Z10minmax_gpuPxPiii
	.globl	_Z10minmax_gpuPxPiii
	.p2align	8
	.type	_Z10minmax_gpuPxPiii,@function
_Z10minmax_gpuPxPiii:                   ; @_Z10minmax_gpuPxPiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s4, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s4, s4, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[12:13], null, s15, s4, v[0:1]
	v_cmp_ge_i32_e32 vcc_lo, s3, v12
	s_and_saveexec_b32 s3, vcc_lo
	s_cbranch_execz .LBB0_123
; %bb.1:
	s_load_b128 s[4:7], s[0:1], 0x0
	v_dual_mov_b32 v3, -1 :: v_dual_lshlrev_b32 v0, 1, v12
	s_cmp_lg_u32 s2, 0
	s_mov_b32 s0, 0xfffe7961
	s_cselect_b32 s10, -1, 0
	s_delay_alu instid0(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	s_and_b32 s1, s10, exec_lo
	s_cselect_b32 s0, s0, 0x1869f
	v_mov_b32_e32 v14, 0
	v_add_nc_u32_e64 v15, 8, 40
	v_lshlrev_b64 v[0:1], 3, v[0:1]
	v_mov_b32_e32 v20, v3
	s_mov_b32 s9, 0
	s_mov_b32 s8, 8
	v_dual_mov_b32 v2, s0 :: v_dual_mov_b32 v21, 0xfffe7961
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	global_load_b128 v[4:7], v[0:1], off
	v_mov_b32_e32 v0, v3
	v_mov_b32_e32 v1, v3
	scratch_store_b128 off, v[0:3], off offset:32
	v_mov_b32_e32 v1, v14
	scratch_store_b32 off, v14, off offset:8
	s_waitcnt vmcnt(0)
	s_clause 0x1
	scratch_store_b128 off, v[4:7], off offset:16
	scratch_store_b32 off, v14, off offset:48
.LBB0_2:                                ; %.lr.ph303.i
                                        ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
                                        ;     Child Loop BB0_20 Depth 2
                                        ;     Child Loop BB0_31 Depth 2
                                        ;     Child Loop BB0_41 Depth 2
                                        ;     Child Loop BB0_56 Depth 2
                                        ;     Child Loop BB0_66 Depth 2
                                        ;     Child Loop BB0_83 Depth 2
                                        ;     Child Loop BB0_91 Depth 2
                                        ;       Child Loop BB0_93 Depth 3
	v_mad_u64_u32 v[8:9], null, v1, 40, s[8:9]
	s_delay_alu instid0(VALU_DEP_1)
	v_dual_mov_b32 v17, v14 :: v_dual_add_nc_u32 v0, 40, v8
	v_add_nc_u32_e32 v2, 24, v8
	s_clause 0x1
	scratch_load_b32 v0, v0, off
	scratch_load_b128 v[4:7], v2, off
	v_add_nc_u32_e32 v2, 8, v8
	scratch_load_b128 v[8:11], v2, off
	s_waitcnt vmcnt(2)
	v_and_b32_e32 v2, 1, v0
	s_waitcnt vmcnt(1)
	v_cmp_ne_u32_e32 vcc_lo, -1, v4
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_eq_u32_e64 s0, 0, v2
	v_mov_b32_e32 v2, v14
	s_xor_b32 s0, s10, s0
	s_and_saveexec_b32 s11, vcc_lo
	s_cbranch_execz .LBB0_89
; %bb.3:                                ; %.preheader.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v18, -1, v4
	v_dual_mov_b32 v26, v4 :: v_dual_add_nc_u32 v29, -7, v4
	v_add_nc_u32_e32 v19, 5, v4
	s_mov_b32 s3, 6
	s_mov_b32 s4, -5
	s_mov_b32 s2, 0
	s_mov_b32 s1, 0
.LBB0_4:                                ; %.preheader.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_dual_mov_b32 v28, v26 :: v_dual_mov_b32 v25, v29
	v_dual_mov_b32 v27, v18 :: v_dual_mov_b32 v22, v19
	s_add_i32 s5, s1, 1
	s_delay_alu instid0(VALU_DEP_2)
	v_lshlrev_b64 v[16:17], v28, 1
	v_mov_b32_e32 v2, s4
	v_dual_mov_b32 v24, s3 :: v_dual_mov_b32 v23, s5
	v_add_nc_u32_e32 v26, 6, v28
	v_add_nc_u32_e32 v29, 6, v25
	s_waitcnt vmcnt(0)
	v_and_b32_e32 v19, v17, v11
	v_dual_mov_b32 v13, s1 :: v_dual_and_b32 v18, v16, v10
	s_add_i32 s12, s3, 6
	s_add_i32 s13, s4, 6
	s_mov_b32 s3, s12
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_cmp_ne_u64_e64 s1, 0, v[18:19]
	v_add_nc_u32_e32 v18, 6, v27
	v_add_nc_u32_e32 v19, 6, v22
	s_mov_b32 s4, s13
	s_or_b32 s2, s1, s2
	s_mov_b32 s1, s5
	s_and_not1_b32 exec_lo, exec_lo, s2
	s_cbranch_execnz .LBB0_4
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
	v_cmp_lt_u32_e64 s4, 1, v13
	s_mov_b32 s5, exec_lo
                                        ; implicit-def: $sgpr2
	v_cmpx_gt_u32_e32 2, v13
	s_cbranch_execz .LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	v_lshlrev_b64 v[18:19], v26, 1
	v_and_b32_e32 v30, v17, v9
	v_and_b32_e32 v29, v16, v8
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_and_b32_e32 v17, v19, v9
	v_and_b32_e32 v16, v18, v8
	v_and_b32_e32 v19, v19, v11
	v_and_b32_e32 v18, v18, v10
	v_cmp_eq_u64_e64 s1, 0, v[29:30]
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_cmp_ne_u64_e64 s2, 0, v[16:17]
	v_cmp_ne_u64_e64 s3, 0, v[18:19]
	s_delay_alu instid0(VALU_DEP_2)
	s_xor_b32 s1, s1, s2
                                        ; implicit-def: $sgpr2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s3, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s12, s1, -1
	s_and_saveexec_b32 s13, s1
	s_cbranch_execz .LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v18, 12, v28
	v_cmp_eq_u64_e64 s1, 0, v[16:17]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[29:30], v18, 1
	v_and_b32_e32 v19, v30, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_and_b32_e32 v18, v29, v8
	v_and_b32_e32 v30, v30, v11
	v_and_b32_e32 v29, v29, v10
	v_cmp_ne_u64_e64 s2, 0, v[18:19]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s3, 0, v[29:30]
	s_xor_b32 s1, s1, s2
                                        ; implicit-def: $sgpr2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s3, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s14, s1, -1
	s_and_saveexec_b32 s15, s1
	s_cbranch_execz .LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v16, 18, v28
	v_cmp_eq_u64_e64 s1, 0, v[18:19]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[16:17], v16, 1
	v_and_b32_e32 v29, v17, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_and_b32_e32 v28, v16, v8
	v_and_b32_e32 v17, v17, v11
	v_and_b32_e32 v16, v16, v10
	v_cmp_ne_u64_e64 s2, 0, v[28:29]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_eq_u64_e64 s3, 0, v[16:17]
	s_xor_b32 s1, s1, s2
	s_mov_b32 s2, 1
	s_xor_b32 s1, s1, -1
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_or_b32 s1, s3, s1
	s_and_not1_b32 s3, s14, exec_lo
	s_and_b32 s1, s1, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s14, s3, s1
.LBB0_9:                                ; %Flow163
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s15
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s1, s12, exec_lo
	s_and_b32 s3, s14, exec_lo
	s_or_b32 s12, s1, s3
.LBB0_10:                               ; %Flow162
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s1, s4, exec_lo
	s_and_b32 s3, s12, exec_lo
	s_or_b32 s4, s1, s3
.LBB0_11:                               ; %Flow161
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	v_mov_b32_e32 v17, s2
	s_and_saveexec_b32 s5, s4
	s_cbranch_execz .LBB0_81
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=1
	v_cmp_lt_i32_e64 s2, 0, v4
	v_dual_mov_b32 v17, 1 :: v_dual_add_nc_u32 v16, 1, v4
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s4, s2
	s_cbranch_execz .LBB0_18
; %bb.13:                               ; %.lr.ph.i.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v18, 1, v4
	v_sub_nc_u32_e32 v19, 0, v4
	s_mov_b32 s13, 1
	s_mov_b32 s12, 0
                                        ; implicit-def: $sgpr14
.LBB0_14:                               ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_lshlrev_b64 v[28:29], v27, 1
	s_or_b32 s14, s14, exec_lo
	v_mov_b32_e32 v17, s13
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_and_b32_e32 v31, v29, v9
	v_and_b32_e32 v30, v28, v8
	v_and_b32_e32 v29, v29, v11
	v_and_b32_e32 v28, v28, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s1, 0, v[30:31]
	v_cmp_ne_u64_e64 s3, 0, v[28:29]
	s_delay_alu instid0(VALU_DEP_2)
	s_xor_b32 s1, s0, s1
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s3, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s1
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	s_add_i32 s13, s13, 1
	v_add_nc_u32_e32 v27, -1, v27
	v_add_nc_u32_e32 v17, s13, v19
	s_and_not1_b32 s14, s14, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_eq_u32_e64 s1, 1, v17
	v_mov_b32_e32 v17, v18
	s_and_b32 s1, s1, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s14, s14, s1
; %bb.16:                               ; %Flow154
                                        ;   in Loop: Header=BB0_14 Depth=2
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, exec_lo, s14
	s_or_b32 s12, s1, s12
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s12
	s_cbranch_execnz .LBB0_14
; %bb.17:                               ; %Flow155
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
.LBB0_18:                               ; %Flow156
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s4
	v_cmp_gt_i32_e64 s1, 5, v4
	s_and_saveexec_b32 s12, s1
	s_cbranch_execz .LBB0_28
; %bb.19:                               ; %.lr.ph191.i.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v18, 1, v4
	s_mov_b32 s13, 0
	s_mov_b32 s17, 0
                                        ; implicit-def: $sgpr14
                                        ; implicit-def: $sgpr16
                                        ; implicit-def: $sgpr15
.LBB0_20:                               ; %.lr.ph191.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add3_u32 v19, v26, s17, -5
	s_or_b32 s15, s15, exec_lo
	s_or_b32 s16, s16, exec_lo
	v_lshlrev_b64 v[27:28], v19, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_and_b32_e32 v30, v28, v9
	v_and_b32_e32 v29, v27, v8
	v_and_b32_e32 v28, v28, v11
	v_and_b32_e32 v27, v27, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s3, 0, v[29:30]
	v_cmp_ne_u64_e64 s4, 0, v[27:28]
	s_delay_alu instid0(VALU_DEP_2)
	s_xor_b32 s3, s0, s3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s3, s4, s3
                                        ; implicit-def: $sgpr4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_saveexec_b32 s18, s3
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=2
	s_add_i32 s4, s17, 1
	s_and_not1_b32 s16, s16, exec_lo
	v_add_nc_u32_e32 v19, s4, v18
	s_and_not1_b32 s15, s15, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_i32_e64 s3, 5, v19
	s_and_b32 s3, s3, exec_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 s16, s16, s3
; %bb.22:                               ; %Flow152
                                        ;   in Loop: Header=BB0_20 Depth=2
	s_or_b32 exec_lo, exec_lo, s18
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s3, exec_lo, s16
	v_mov_b32_e32 v27, s4
	s_or_b32 s13, s3, s13
	v_mov_b32_e32 v19, s17
	s_and_not1_b32 s3, s14, exec_lo
	s_and_b32 s14, s15, exec_lo
	s_mov_b32 s17, s4
	s_or_b32 s14, s3, s14
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB0_20
; %bb.23:                               ; %loop.exit.guard
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_xor_b32 s3, s14, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s3
	s_xor_b32 s3, exec_lo, s4
; %bb.24:                               ; %.critedge2.i.i.loopexitsplit
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v17, v17, v27
; %bb.25:                               ; %Flow149
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s3, s3
; %bb.26:                               ; %.lr.ph191.i.i..critedge2.i.i.loopexit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(VALU_DEP_1)
	v_add_nc_u32_e32 v17, v17, v19
; %bb.27:                               ; %Flow150
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s3
.LBB0_28:                               ; %Flow153
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s12
	v_cmp_gt_u32_e64 s3, 4, v17
	v_mov_b32_e32 v17, 1
	s_delay_alu instid0(VALU_DEP_2)
	s_and_saveexec_b32 s12, s3
	s_cbranch_execz .LBB0_80
; %bb.29:                               ; %.preheader183.i.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_mov_b32_e32 v17, 1
	s_and_saveexec_b32 s13, s2
	s_cbranch_execz .LBB0_39
; %bb.30:                               ; %.lr.ph198.i.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s14, 0
	s_mov_b32 s16, 0
                                        ; implicit-def: $sgpr15
                                        ; implicit-def: $sgpr17
                                        ; implicit-def: $sgpr18
.LBB0_31:                               ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	v_mov_b32_e32 v17, v23
	s_or_b32 s18, s18, exec_lo
	s_or_b32 s17, s17, exec_lo
	s_mov_b32 s19, exec_lo
                                        ; implicit-def: $sgpr4
	v_cmpx_ne_u32_e64 s16, v13
	s_cbranch_execz .LBB0_35
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=2
	v_lshlrev_b64 v[17:18], v25, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_and_b32_e32 v27, v18, v9
	v_and_b32_e32 v26, v17, v8
	v_and_b32_e32 v18, v18, v11
	v_and_b32_e32 v17, v17, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s3, 0, v[26:27]
	v_cmp_ne_u64_e64 s4, 0, v[17:18]
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	s_xor_b32 s20, s0, s3
	s_mov_b32 s3, -1
	s_and_b32 s22, s4, s20
	s_mov_b32 s20, 0
                                        ; implicit-def: $sgpr4
	s_and_saveexec_b32 s21, s22
; %bb.33:                               ;   in Loop: Header=BB0_31 Depth=2
	s_add_i32 s4, s16, 1
	v_add_nc_u32_e32 v25, -7, v25
	v_cmp_eq_u32_e64 s3, s4, v4
	s_mov_b32 s20, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	s_or_not1_b32 s3, s3, exec_lo
; %bb.34:                               ; %Flow145
                                        ;   in Loop: Header=BB0_31 Depth=2
	s_or_b32 exec_lo, exec_lo, s21
	v_mov_b32_e32 v17, v16
	s_and_not1_b32 s18, s18, exec_lo
	s_and_b32 s20, s20, exec_lo
	s_and_not1_b32 s17, s17, exec_lo
	s_and_b32 s3, s3, exec_lo
	s_or_b32 s18, s18, s20
	s_or_b32 s17, s17, s3
.LBB0_35:                               ; %Flow144
                                        ;   in Loop: Header=BB0_31 Depth=2
	s_or_b32 exec_lo, exec_lo, s19
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s3, exec_lo, s17
	v_mov_b32_e32 v18, s16
	s_or_b32 s14, s3, s14
	s_and_not1_b32 s3, s15, exec_lo
	s_and_b32 s15, s18, exec_lo
	s_mov_b32 s16, s4
	s_or_b32 s15, s3, s15
	s_and_not1_b32 exec_lo, exec_lo, s14
	s_cbranch_execnz .LBB0_31
; %bb.36:                               ; %loop.exit.guard102
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	s_xor_b32 s3, s15, -1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s4, s3
	s_xor_b32 s3, exec_lo, s4
; %bb.37:                               ; %..critedge4.i.i.loopexit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v17, 1, v18
; %bb.38:                               ; %Flow143
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s3
.LBB0_39:                               ; %Flow146
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s13
	s_and_saveexec_b32 s13, s1
	s_cbranch_execz .LBB0_53
; %bb.40:                               ; %.lr.ph206.i.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_mov_b32_e32 v18, v17
	s_mov_b32 s14, 0
	s_mov_b32 s20, 0
                                        ; implicit-def: $sgpr15
                                        ; implicit-def: $sgpr16
                                        ; implicit-def: $sgpr18
                                        ; implicit-def: $sgpr17
                                        ; implicit-def: $sgpr19
.LBB0_41:                               ; %.lr.ph206.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1)
	v_add_nc_u32_e32 v19, s20, v23
	s_and_not1_b32 s19, s19, exec_lo
	s_or_b32 s17, s17, exec_lo
	s_or_b32 s18, s18, exec_lo
	s_mov_b32 s21, exec_lo
                                        ; implicit-def: $sgpr4
	v_cmpx_gt_u32_e32 6, v19
	s_cbranch_execz .LBB0_45
; %bb.42:                               ;   in Loop: Header=BB0_41 Depth=2
	v_add_nc_u32_e32 v19, v16, v24
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[25:26], v19, 1
	v_and_b32_e32 v28, v26, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_and_b32_e32 v27, v25, v8
	v_and_b32_e32 v26, v26, v11
	v_and_b32_e32 v25, v25, v10
	v_cmp_ne_u64_e64 s3, 0, v[27:28]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s4, 0, v[25:26]
	s_xor_b32 s22, s0, s3
	s_mov_b32 s3, -1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s24, s4, s22
	s_mov_b32 s22, -1
                                        ; implicit-def: $sgpr4
	s_and_saveexec_b32 s23, s24
; %bb.43:                               ;   in Loop: Header=BB0_41 Depth=2
	s_add_i32 s4, s20, 1
	v_add_nc_u32_e32 v18, 1, v18
	v_add_nc_u32_e32 v19, s4, v16
	v_add_nc_u32_e32 v24, 7, v24
	s_xor_b32 s22, exec_lo, -1
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_i32_e64 s3, 5, v19
	s_or_not1_b32 s3, s3, exec_lo
; %bb.44:                               ; %Flow141
                                        ;   in Loop: Header=BB0_41 Depth=2
	s_or_b32 exec_lo, exec_lo, s23
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s19, s19, exec_lo
	s_and_b32 s22, s22, exec_lo
	s_and_not1_b32 s18, s18, exec_lo
	s_and_b32 s3, s3, exec_lo
	s_or_b32 s19, s19, s22
	s_and_not1_b32 s17, s17, exec_lo
	s_or_b32 s18, s18, s3
.LBB0_45:                               ; %Flow140
                                        ;   in Loop: Header=BB0_41 Depth=2
	s_or_b32 exec_lo, exec_lo, s21
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s3, exec_lo, s18
	v_mov_b32_e32 v25, s4
	s_or_b32 s14, s3, s14
	v_mov_b32_e32 v19, s20
	s_and_not1_b32 s3, s16, exec_lo
	s_and_b32 s16, s19, exec_lo
	s_and_not1_b32 s15, s15, exec_lo
	s_and_b32 s20, s17, exec_lo
	s_or_b32 s16, s3, s16
	s_or_b32 s15, s15, s20
	s_mov_b32 s20, s4
	s_and_not1_b32 exec_lo, exec_lo, s14
	s_cbranch_execnz .LBB0_41
; %bb.46:                               ; %loop.exit.guard103
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	s_xor_b32 s3, s15, -1
	s_xor_b32 s4, s16, -1
	s_and_saveexec_b32 s14, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s3, exec_lo, s14
	s_cbranch_execz .LBB0_50
; %bb.47:                               ; %loop.exit.guard104
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_saveexec_b32 s14, s4
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s4, exec_lo, s14
; %bb.48:                               ; %..critedge6.i.i.loopexitsplit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v18, v17, v25
; %bb.49:                               ; %Flow136
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
                                        ; implicit-def: $vgpr17
.LBB0_50:                               ; %Flow137
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s3, s3
; %bb.51:                               ; %.lr.ph206.i.i..critedge6.i.i.loopexit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v18, v17, v19
; %bb.52:                               ; %Flow138
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(VALU_DEP_1)
	v_mov_b32_e32 v17, v18
.LBB0_53:                               ; %Flow142
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_cmp_gt_u32_e64 s3, 4, v17
	v_mov_b32_e32 v17, 1
	s_and_saveexec_b32 s4, s3
	s_cbranch_execz .LBB0_79
; %bb.54:                               ; %.preheader.i.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_mov_b32_e32 v16, 1
	s_and_saveexec_b32 s13, s2
	s_cbranch_execz .LBB0_64
; %bb.55:                               ; %.lr.ph215.i.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v17, 1, v4
	s_mov_b32 s15, 1
	s_mov_b32 s14, 0
	s_mov_b32 s19, 0
                                        ; implicit-def: $sgpr16
                                        ; implicit-def: $sgpr18
                                        ; implicit-def: $sgpr17
.LBB0_56:                               ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v16, s19, v23
	s_or_b32 s17, s17, exec_lo
	s_or_b32 s18, s18, exec_lo
                                        ; implicit-def: $sgpr3
	v_cmp_gt_i32_e64 s2, 5, v16
                                        ; implicit-def: $vgpr16
	s_delay_alu instid0(VALU_DEP_1)
	s_and_saveexec_b32 s20, s2
	s_cbranch_execz .LBB0_60
; %bb.57:                               ;   in Loop: Header=BB0_56 Depth=2
	v_lshlrev_b64 v[18:19], v22, 1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_dual_mov_b32 v16, s15 :: v_dual_and_b32 v25, v19, v9
	v_and_b32_e32 v24, v18, v8
	v_and_b32_e32 v19, v19, v11
	v_and_b32_e32 v18, v18, v10
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s2, 0, v[24:25]
	v_cmp_ne_u64_e64 s3, 0, v[18:19]
	s_delay_alu instid0(VALU_DEP_2)
	s_xor_b32 s2, s0, s2
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s22, s3, s2
	s_mov_b32 s2, -1
                                        ; implicit-def: $sgpr3
	s_and_saveexec_b32 s21, s22
; %bb.58:                               ;   in Loop: Header=BB0_56 Depth=2
	s_add_i32 s3, s19, 1
	v_add_nc_u32_e32 v22, 5, v22
	v_cmp_eq_u32_e64 s2, s3, v4
	v_mov_b32_e32 v16, v17
	s_add_i32 s15, s15, 1
	s_delay_alu instid0(VALU_DEP_2)
	s_or_not1_b32 s2, s2, exec_lo
; %bb.59:                               ; %Flow132
                                        ;   in Loop: Header=BB0_56 Depth=2
	s_or_b32 exec_lo, exec_lo, s21
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s18, s18, exec_lo
	s_and_b32 s2, s2, exec_lo
	s_and_not1_b32 s17, s17, exec_lo
	s_or_b32 s18, s18, s2
.LBB0_60:                               ; %Flow131
                                        ;   in Loop: Header=BB0_56 Depth=2
	s_or_b32 exec_lo, exec_lo, s20
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s2, exec_lo, s18
	v_mov_b32_e32 v18, s19
	s_or_b32 s14, s2, s14
	s_and_not1_b32 s2, s16, exec_lo
	s_and_b32 s16, s17, exec_lo
	s_mov_b32 s19, s3
	s_or_b32 s16, s2, s16
	s_and_not1_b32 exec_lo, exec_lo, s14
	s_cbranch_execnz .LBB0_56
; %bb.61:                               ; %loop.exit.guard105
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	s_and_saveexec_b32 s2, s16
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s2, exec_lo, s2
; %bb.62:                               ; %..critedge8.i.i.loopexit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v16, 1, v18
; %bb.63:                               ; %Flow130
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
.LBB0_64:                               ; %Flow133
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s13
	s_and_saveexec_b32 s3, s1
	s_cbranch_execz .LBB0_78
; %bb.65:                               ; %.lr.ph223.i.preheader.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v17, v16, v13
	s_mov_b32 s13, 0
	s_mov_b32 s19, 0
                                        ; implicit-def: $sgpr14
                                        ; implicit-def: $sgpr15
                                        ; implicit-def: $sgpr17
                                        ; implicit-def: $sgpr16
                                        ; implicit-def: $sgpr18
.LBB0_66:                               ; %.lr.ph223.i.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_and_not1_b32 s18, s18, exec_lo
	s_or_b32 s16, s16, exec_lo
	s_or_b32 s17, s17, exec_lo
	s_mov_b32 s20, exec_lo
                                        ; implicit-def: $sgpr2
	v_cmpx_ne_u32_e64 s19, v13
	s_cbranch_execz .LBB0_70
; %bb.67:                               ;   in Loop: Header=BB0_66 Depth=2
	v_add_nc_u32_e32 v18, v4, v2
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[18:19], v18, 1
	v_and_b32_e32 v23, v19, v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_and_b32_e32 v22, v18, v8
	v_and_b32_e32 v19, v19, v11
	v_and_b32_e32 v18, v18, v10
	v_cmp_ne_u64_e64 s1, 0, v[22:23]
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_cmp_ne_u64_e64 s2, 0, v[18:19]
	s_xor_b32 s21, s0, s1
	s_mov_b32 s1, -1
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s23, s2, s21
	s_mov_b32 s21, -1
                                        ; implicit-def: $sgpr2
	s_and_saveexec_b32 s22, s23
; %bb.68:                               ;   in Loop: Header=BB0_66 Depth=2
	s_add_i32 s2, s19, 1
	v_add_nc_u32_e32 v2, -5, v2
	v_add3_u32 v18, v4, s2, 1
	s_xor_b32 s21, exec_lo, -1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_i32_e64 s1, 5, v18
	s_or_not1_b32 s1, s1, exec_lo
; %bb.69:                               ; %Flow128
                                        ;   in Loop: Header=BB0_66 Depth=2
	s_or_b32 exec_lo, exec_lo, s22
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 s18, s18, exec_lo
	s_and_b32 s21, s21, exec_lo
	s_and_not1_b32 s17, s17, exec_lo
	s_and_b32 s1, s1, exec_lo
	s_or_b32 s18, s18, s21
	s_and_not1_b32 s16, s16, exec_lo
	s_or_b32 s17, s17, s1
.LBB0_70:                               ; %Flow127
                                        ;   in Loop: Header=BB0_66 Depth=2
	s_or_b32 exec_lo, exec_lo, s20
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s1, exec_lo, s17
	v_dual_mov_b32 v19, s2 :: v_dual_mov_b32 v18, s19
	s_or_b32 s13, s1, s13
	s_and_not1_b32 s1, s15, exec_lo
	s_and_b32 s15, s18, exec_lo
	s_and_not1_b32 s14, s14, exec_lo
	s_and_b32 s19, s16, exec_lo
	s_or_b32 s15, s1, s15
	s_or_b32 s14, s14, s19
	s_mov_b32 s19, s2
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB0_66
; %bb.71:                               ; %loop.exit.guard106
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_xor_b32 s1, s14, -1
	s_xor_b32 s2, s15, -1
	s_and_saveexec_b32 s13, s1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s1, exec_lo, s13
	s_cbranch_execz .LBB0_77
; %bb.72:                               ; %loop.exit.guard107
                                        ;   in Loop: Header=BB0_2 Depth=1
                                        ; implicit-def: $vgpr17
	s_and_saveexec_b32 s13, s2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s2, exec_lo, s13
; %bb.73:                               ; %..critedge10.i.i.loopexitsplit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v17, v16, v19
                                        ; implicit-def: $vgpr16
; %bb.74:                               ; %Flow123
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s2, s2
; %bb.75:                               ; %..critedge10.i.i.loopexit_crit_edge
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v17, v16, v18
; %bb.76:                               ; %Flow124
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
.LBB0_77:                               ; %Flow125
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s1
	v_mov_b32_e32 v16, v17
.LBB0_78:                               ; %Flow129
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_lt_u32_e64 s1, 3, v16
	v_cndmask_b32_e64 v17, 0, 1, s1
.LBB0_79:                               ; %Flow135
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
.LBB0_80:                               ; %Flow148
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1)
	s_or_b32 exec_lo, exec_lo, s12
.LBB0_81:                               ; %Flow164
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	s_or_b32 exec_lo, exec_lo, s5
	v_and_b32_e32 v2, 1, v10
	s_mov_b32 s2, 0
	s_mov_b32 s12, exec_lo
	v_cmpx_eq_u32_e32 1, v2
	s_cbranch_execz .LBB0_88
; %bb.82:                               ; %.lr.ph.i.preheader
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b64 s[2:3], 0
	s_mov_b32 s13, 0
                                        ; implicit-def: $sgpr14
.LBB0_83:                               ; %.lr.ph.i
                                        ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	s_or_b32 s14, s14, exec_lo
	s_cmp_eq_u32 s2, 5
	s_cbranch_scc1 .LBB0_85
; %bb.84:                               ;   in Loop: Header=BB0_83 Depth=2
	s_add_u32 s4, s2, 1
	s_addc_u32 s5, s3, 0
	v_lshrrev_b64 v[18:19], s4, v[10:11]
	s_and_not1_b32 s3, s14, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v13, 1, v18
	v_cmp_eq_u64_e64 s1, 0, v[13:14]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s1, s1, exec_lo
	s_or_b32 s14, s3, s1
	s_branch .LBB0_86
.LBB0_85:                               ;   in Loop: Header=BB0_83 Depth=2
                                        ; implicit-def: $sgpr4_sgpr5
.LBB0_86:                               ; %Flow121
                                        ;   in Loop: Header=BB0_83 Depth=2
	v_mov_b32_e32 v2, s2
	s_and_b32 s1, exec_lo, s14
	s_mov_b64 s[2:3], s[4:5]
	s_or_b32 s13, s1, s13
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB0_83
; %bb.87:                               ; %_Z13table_is_fullPx.exit.loopexit.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	v_cmp_lt_u32_e64 s1, 4, v2
	s_delay_alu instid0(VALU_DEP_1)
	s_and_b32 s2, s1, exec_lo
.LBB0_88:                               ; %Flow122
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	v_cndmask_b32_e64 v2, 0, 1, s2
.LBB0_89:                               ; %Flow165
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s11
	s_delay_alu instid0(VALU_DEP_1)
	v_or_b32_e32 v2, v17, v2
	v_cmp_ne_u32_e64 s2, 0, v7
	v_cmp_ne_u32_e64 s3, 2, v0
	v_cmp_eq_u32_e64 s1, 0, v7
	s_xor_b32 s5, s0, -1
	v_cmp_eq_u32_e64 s4, 0, v2
	s_delay_alu instid0(VALU_DEP_3)
	s_and_b32 s2, s2, s3
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, s2, s4
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_saveexec_b32 s3, s2
	s_xor_b32 s3, exec_lo, s3
	s_cbranch_execz .LBB0_97
; %bb.90:                               ;   in Loop: Header=BB0_2 Depth=1
	v_cndmask_b32_e64 v2, 0x1869f, v21, s0
	v_dual_mov_b32 v6, 0 :: v_dual_add_nc_u32 v7, 1, v0
	s_mov_b32 s4, 0
	s_mov_b32 s11, 24
.LBB0_91:                               ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_93 Depth 3
	s_waitcnt vmcnt(0)
	v_lshrrev_b64 v[4:5], s4, v[10:11]
	s_mov_b32 s12, exec_lo
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_and_b32_e32 v13, 1, v4
	v_cmpx_eq_u64_e32 0, v[13:14]
	s_cbranch_execz .LBB0_95
; %bb.92:                               ; %.preheader.preheader
                                        ;   in Loop: Header=BB0_91 Depth=2
	s_mov_b32 s13, 0
	s_mov_b32 s14, s11
.LBB0_93:                               ; %.preheader
                                        ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_91 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	s_lshl_b64 s[16:17], 1, s14
	s_add_i32 s14, s14, -6
	v_and_b32_e32 v5, s17, v11
	v_and_b32_e32 v4, s16, v10
	v_cmp_eq_u64_e64 s2, 0, v[4:5]
	v_dual_mov_b32 v4, s16 :: v_dual_mov_b32 v5, s17
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_or_b32 s13, s2, s13
	s_and_not1_b32 exec_lo, exec_lo, s13
	s_cbranch_execnz .LBB0_93
; %bb.94:                               ;   in Loop: Header=BB0_91 Depth=2
	s_or_b32 exec_lo, exec_lo, s13
	scratch_load_b32 v13, off, off offset:8
	v_or_b32_e32 v16, v5, v9
	v_or_b32_e32 v18, v4, v10
	v_add_nc_u32_e32 v6, 1, v6
	v_or_b32_e32 v19, v5, v11
	s_delay_alu instid0(VALU_DEP_4)
	v_cndmask_b32_e64 v17, v9, v16, s0
	s_waitcnt vmcnt(0)
	v_mad_u64_u32 v[22:23], null, v13, 40, v[15:16]
	v_or_b32_e32 v23, v4, v8
	v_add_nc_u32_e32 v4, 1, v13
	v_mov_b32_e32 v0, s4
	s_delay_alu instid0(VALU_DEP_3)
	v_cndmask_b32_e64 v16, v8, v23, s0
	v_add_nc_u32_e32 v5, 8, v22
	v_add_nc_u32_e32 v13, 24, v22
	v_add_nc_u32_e32 v22, 40, v22
	scratch_store_b32 off, v4, off offset:8
	s_clause 0x2
	scratch_store_b128 v5, v[16:19], off
	scratch_store_b128 v13, v[0:3], off
	scratch_store_b32 v22, v7, off
.LBB0_95:                               ; %Flow
                                        ;   in Loop: Header=BB0_91 Depth=2
	s_or_b32 exec_lo, exec_lo, s12
	s_add_i32 s4, s4, 1
	s_add_i32 s11, s11, 1
	s_cmp_eq_u32 s4, 6
	s_cbranch_scc0 .LBB0_91
; %bb.96:                               ;   in Loop: Header=BB0_2 Depth=1
	v_mul_lo_u32 v0, v1, 40
	scratch_load_b32 v1, off, off offset:8
                                        ; implicit-def: $vgpr17
	v_add3_u32 v0, 8, 8, v0
	scratch_store_b32 v0, v6, off offset:28
                                        ; implicit-def: $vgpr4_vgpr5_vgpr6_vgpr7
.LBB0_97:                               ; %Flow120
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s2, s3
	s_cbranch_execz .LBB0_121
; %bb.98:                               ;   in Loop: Header=BB0_2 Depth=1
	v_sub_nc_u32_e32 v0, 0, v17
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e64 v0, v0, v17, s0
	v_cndmask_b32_e64 v2, v0, v6, s1
	s_and_saveexec_b32 s0, vcc_lo
	s_delay_alu instid0(SALU_CYCLE_1)
	s_xor_b32 s1, exec_lo, s0
	s_cbranch_execz .LBB0_118
; %bb.99:                               ;   in Loop: Header=BB0_2 Depth=1
	v_mul_lo_u32 v0, v5, 40
	s_mov_b32 s3, 0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)
	v_add3_u32 v0, 8, 8, v0
	scratch_load_b64 v[6:7], v0, off offset:20
	s_and_saveexec_b32 s0, s5
	s_xor_b32 s4, exec_lo, s0
	s_cbranch_execz .LBB0_107
; %bb.100:                              ;   in Loop: Header=BB0_2 Depth=1
	s_waitcnt vmcnt(0)
	v_cmp_le_i32_e32 vcc_lo, v7, v2
	s_mov_b32 s3, exec_lo
	v_cmpx_gt_i32_e64 v7, v2
	s_cbranch_execz .LBB0_106
; %bb.101:                              ;   in Loop: Header=BB0_2 Depth=1
	v_cmp_eq_u32_e64 s5, -1, v6
	s_mov_b32 s11, exec_lo
	scratch_store_b32 v0, v2, off offset:24
	v_cmpx_ne_u32_e32 -1, v6
	s_cbranch_execz .LBB0_105
; %bb.102:                              ;   in Loop: Header=BB0_2 Depth=1
	v_mul_lo_u32 v4, v6, 40
	s_mov_b32 s12, -1
	s_mov_b32 s13, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v4, 8, 8, v4
	scratch_load_b32 v4, v4, off offset:24
	s_waitcnt vmcnt(0)
	v_cmpx_ge_i32_e64 v4, v2
	s_cbranch_execz .LBB0_104
; %bb.103:                              ;   in Loop: Header=BB0_2 Depth=1
	s_xor_b32 s12, exec_lo, -1
	scratch_store_b32 off, v5, off offset:8
	scratch_store_b32 v0, v14, off offset:28
.LBB0_104:                              ; %Flow112
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s13
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, s5, exec_lo
	s_and_b32 s5, s12, exec_lo
	s_or_b32 s5, s0, s5
.LBB0_105:                              ; %Flow111
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s11
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, vcc_lo, exec_lo
	s_and_b32 s5, s5, exec_lo
	s_or_b32 vcc_lo, s0, s5
.LBB0_106:                              ; %Flow110
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s3
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s3, vcc_lo, exec_lo
                                        ; implicit-def: $vgpr6_vgpr7
                                        ; implicit-def: $vgpr2
.LBB0_107:                              ; %Flow109
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s4, s4
	s_cbranch_execz .LBB0_115
; %bb.108:                              ;   in Loop: Header=BB0_2 Depth=1
	s_waitcnt vmcnt(0)
	v_cmp_ge_i32_e32 vcc_lo, v7, v2
	s_mov_b32 s5, exec_lo
	v_cmpx_lt_i32_e64 v7, v2
	s_cbranch_execz .LBB0_114
; %bb.109:                              ;   in Loop: Header=BB0_2 Depth=1
	v_cmp_eq_u32_e64 s11, -1, v6
	s_mov_b32 s12, exec_lo
	scratch_store_b32 v0, v2, off offset:24
	v_cmpx_ne_u32_e32 -1, v6
	s_cbranch_execz .LBB0_113
; %bb.110:                              ;   in Loop: Header=BB0_2 Depth=1
	v_mul_lo_u32 v4, v6, 40
	s_mov_b32 s13, -1
	s_mov_b32 s14, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_add3_u32 v4, 8, 8, v4
	scratch_load_b32 v4, v4, off offset:24
	s_waitcnt vmcnt(0)
	v_cmpx_ge_i32_e64 v2, v4
	s_cbranch_execz .LBB0_112
; %bb.111:                              ;   in Loop: Header=BB0_2 Depth=1
	s_xor_b32 s13, exec_lo, -1
	scratch_store_b32 off, v5, off offset:8
	scratch_store_b32 v0, v14, off offset:28
.LBB0_112:                              ; %Flow116
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s14
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, s11, exec_lo
	s_and_b32 s11, s13, exec_lo
	s_or_b32 s11, s0, s11
.LBB0_113:                              ; %Flow115
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s12
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, vcc_lo, exec_lo
	s_and_b32 s11, s11, exec_lo
	s_or_b32 vcc_lo, s0, s11
.LBB0_114:                              ; %Flow114
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s5
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	s_and_not1_b32 s0, s3, exec_lo
	s_and_b32 s3, vcc_lo, exec_lo
	s_or_b32 s3, s0, s3
.LBB0_115:                              ; %Flow113
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s4
	s_and_saveexec_b32 s0, s3
	s_cbranch_execz .LBB0_117
; %bb.116:                              ; %.critedge.i
                                        ;   in Loop: Header=BB0_2 Depth=1
	scratch_load_b32 v2, v0, off offset:28
	s_waitcnt vmcnt(2)
	v_add_nc_u32_e32 v5, -1, v1
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v2, -1, v2
	scratch_store_b32 v0, v2, off offset:28
	scratch_store_b32 off, v5, off offset:8
.LBB0_117:                              ; %Flow117
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
                                        ; implicit-def: $vgpr2
.LBB0_118:                              ; %Flow118
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_saveexec_b32 s0, s1
	s_cbranch_execz .LBB0_120
; %bb.119:                              ;   in Loop: Header=BB0_2 Depth=1
	s_waitcnt vmcnt(0)
	v_dual_mov_b32 v20, v2 :: v_dual_add_nc_u32 v5, -1, v1
	scratch_store_b32 off, v5, off offset:8
.LBB0_120:                              ; %Flow119
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s0
	s_waitcnt vmcnt(0)
	v_mov_b32_e32 v1, v5
.LBB0_121:                              ;   in Loop: Header=BB0_2 Depth=1
	s_or_b32 exec_lo, exec_lo, s2
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)
	v_cmp_eq_u32_e32 vcc_lo, -1, v1
	s_or_b32 s9, vcc_lo, s9
	s_and_not1_b32 exec_lo, exec_lo, s9
	s_cbranch_execnz .LBB0_2
; %bb.122:                              ; %_Z8d_minmaxPxi.exit
	s_or_b32 exec_lo, exec_lo, s9
	v_ashrrev_i32_e32 v13, 31, v12
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[12:13]
	v_add_co_u32 v0, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	global_store_b32 v[0:1], v20, off
.LBB0_123:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z10minmax_gpuPxPiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 24016
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 1
		.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 32
		.amdhsa_next_free_sgpr 25
		.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	_Z10minmax_gpuPxPiii, .Lfunc_end0-_Z10minmax_gpuPxPiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 3760
; NumSgprs: 27
; NumVgprs: 32
; ScratchSize: 24016
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 3
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 27
; NumVGPRsForWavesPerEU: 32
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 1
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
