/**
 * CUDA implementation of a fully-connected feed forward neural network
 *
 * Authors: Jevgenija Aksjonova (jevaks@kth.se)
 *          Beatrice Ionascu (bionascu@kth.se)
 *
 * Last changed: 04/30/2017
 */

#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define TOL 0.00000001
#define BATCH_SIZE 100
#define TRAIN_SET_SIZE 60000
#define TEST_SET_SIZE 10000
#define FUNCTION_TYPE 1 // 0 - tanh, 1 - relu


/* Read labels data */
void read_labels(const char filename[], int *array, int data_size) {
    memset(array, 0, sizeof(int) * data_size);
    FILE *file = fopen(filename, "r");
    if (file) {
        size_t i;
        /* Read each line from the file. */
        for (i = 0; i < data_size && !feof(file); i++) {
            fscanf(file, "%d", array + i);
        }
        assert(i == data_size);
        fclose(file);
    } else {
        perror(filename);
    }
}


/* Read image data */
void read_images(const char *filename, double *array, int data_size, int batch_size, int batch_ind) {
    FILE *file = fopen(filename, "r");
    if (file) {
        size_t i, j;
        char buffer[data_size * 4], *ptr;
        /* Read each line from the file. */
        for (i = 0; fgets(buffer, sizeof buffer, file); ++i) {
            /* Only parse data from desired batch. */
            if (i >= batch_ind * batch_size && i < (batch_ind + 1) * batch_size ) {
                /* Parse the comma-separated values from each line into 'array'. */
                for (j = 0, ptr = buffer; j < data_size; j++, ptr++) {
                    array[(i - batch_ind * batch_size) * data_size + j] = strtol(ptr, &ptr, 10) / 256.0;
                }
            }
        }
        fclose(file);
    } else {
        perror(filename);
    }
}

/* Compute local number of parameters (includes weights and biases) */
int param_size(int *layer_size, int num_layers) {
    int size = 0;
    size_t i;
    for (i = 1; i < num_layers; i++) {
        size = size + layer_size[i] * (layer_size[i-1] +1);
    }
    return size;
}


/* Compute total amount of data (includes the input data features and the layer outputs) */
int data_size(int *layer_size, int num_layers) {
    int size = 0;
    size_t i;
    for (i = 0; i < num_layers; i++) {
        size += layer_size[i];
    }
    return size;
}


/* Compute local starting index of the parameters corresponding to layer */
int param_ind(int layer, int *layer_size) {
    int ind = 0;
    size_t i;
    for (i = 1; i < layer; i++) {
        ind += layer_size[i] * (layer_size[i - 1] + 1);
    }
    return ind;
}


/* Compute local starting index of the data corresponding to layer */
int data_ind(int layer, int *layer_size) {
    int ind = 0;
    size_t i;
    for (i = 0; i < layer; i++) {
        ind += layer_size[i];
    }
    return ind;
}


/* Forward pass */
__global__
void forward(double *input, int inputSize, double *output, int outputSize, double *param, int fun) {

    size_t i, j;
    double l_output;
    i = blockIdx.x * blockDim.x + threadIdx.x;

    if (i < outputSize ) {

        /* Initialize output with the bias term */
        l_output = param[i];
        for (j = 0; j < inputSize; j++) {
            // Add weighted inputs
            l_output += param[(j+1)*outputSize + i] * input[j];
        }
        /* Activation */
        if (fun > 0) {
            if (FUNCTION_TYPE == 0) {
                l_output = tanh(l_output);
            }
            else if (FUNCTION_TYPE == 1) { // relu function
                if (l_output <= 0) {
                    l_output = 0.0;
                }
            }
        }
        output[i] = l_output;
    }
}


/* Backward pass (backpropagate gradients from current_layer to prev_layer) */
__global__
void backward_part1(double *current_layer, int layer_size, double *prev_layer, int prev_layer_size,
              double *param, double *grad_param, int layer,double lambda) {
    
    size_t i, j;
    double l_current_layer;
    i = blockIdx.x * blockDim.x + threadIdx.x;

    if (i < layer_size) {
        l_current_layer = current_layer[i];
        // Update parameters
        grad_param[i] += l_current_layer;
        for (j = 0; j < prev_layer_size; j++) {
            grad_param[(j+1) * layer_size + i ] += l_current_layer * prev_layer[j] + 
                        2.0 * lambda * param[(j+1) * layer_size + i]; // regularization
        }
    }
}

__global__
void backward_part2(double *current_layer, int layer_size, double *prev_layer, int prev_layer_size,
              double *param, double *grad_param, int layer,double lambda) {

    size_t i, k;
    double l_prev_layer;
    i = blockIdx.x * blockDim.x + threadIdx.x;

    if (i < prev_layer_size ) {
        l_prev_layer = prev_layer[i];
        // backprapogate partial derivatives
        if (FUNCTION_TYPE == 0) {
            double localGrad = (1-pow(l_prev_layer,2)); // tanh derivative
            l_prev_layer = 0.0; 
            for (k = 0; k < layer_size; k++) {
                l_prev_layer += current_layer[k] * param[(i+1) * layer_size + k];
            }
            l_prev_layer *= localGrad;
        } else if (FUNCTION_TYPE == 1) {
            if (l_prev_layer >0.0) {
                l_prev_layer = 0.0;
                for (k = 0; k < layer_size; k++) {
                    l_prev_layer += current_layer[k] * param[(i+1) * layer_size + k];
                }
            } else {
                l_prev_layer = 0.0;
            }
        }
        prev_layer[i] = l_prev_layer;
    }
}

__global__
void update_param(double *param, double *grad_param, int num_param, double learning_rate, int batch_size) {
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < num_param) {
        param[i] = param[i] - learning_rate * grad_param[i] / (float)batch_size;
    }
}

/* Train the network */
void train(const char filename[], int* label, double *d_param, double *d_grad_param, int *layer_size, int num_layers,
           int epochs, double lambda, double learning_rate) {

    size_t img, ep = 0;
    int i, layer, batch_index;
    int input_pointer, output_pointer, param_pointer;
    double sum, global_loss = 1;
    int image_size = layer_size[0];
    int num_param = param_size(layer_size, num_layers);

    /* Allocate image data array */
    double *images;
    images = (double *) malloc(BATCH_SIZE * image_size * sizeof(double));

    /* Allocate data array */
    double *d_data ;
    cudaMalloc( (void**)&d_data, data_size(layer_size, num_layers) * sizeof(double));

    /* Loop over epochs (one epoch = loop over all images) */
    while (ep++ < epochs && global_loss > TOL) {
        /* Loop over batches */
        for (batch_index = 0; batch_index < TRAIN_SET_SIZE / BATCH_SIZE; batch_index++) {
            /* Initialize loss */
            global_loss = 0.0;

            /* Reset gradients to 0 */
            cudaMemset(d_grad_param, 0.0, num_param * sizeof(double));

            /* Load images in batch */
            read_images(filename, images, image_size, BATCH_SIZE, batch_index);

            /* Loop over images in batch */
            for (img = 0; img < BATCH_SIZE; img++) {

                /* Copy one image to the 1st layer of the data */
                cudaMemcpy(d_data, images + img * image_size, image_size * sizeof(double), cudaMemcpyHostToDevice );

                /* Forward pass */
                for (layer = 1; layer < num_layers; layer++) {
                    input_pointer = data_ind(layer - 1, layer_size);
                    output_pointer = data_ind(layer, layer_size);
                    param_pointer = param_ind(layer, layer_size);
                    dim3 dimBlock( 128,1,1 );
                    dim3 dimGrid(ceil((float)layer_size[layer]/128.0),1,1);
                    forward<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer - 1], d_data + output_pointer, layer_size[layer],
                            d_param + param_pointer, num_layers - layer - 1);
                }

                double *probs;
                probs = (double * ) malloc(layer_size[num_layers - 1]* sizeof(double));
                int probs_pointer = data_ind(num_layers - 1, layer_size);
                cudaMemcpy(probs, d_data + probs_pointer, layer_size[num_layers - 1] * sizeof(double), cudaMemcpyDeviceToHost);

                /* Softmax */
                sum = 0.0;
                for ( i = 0; i < layer_size[num_layers - 1]; i++) {
                    sum += exp(probs[i]);
                }
                for ( i = 0; i < layer_size[num_layers - 1]; i++) {
                    probs[i] = exp(probs[i]) / sum;
                }

                /* Loss computation */
                /* Compute the cross-entropy loss by adding the log probabilities assigned to the correct classes */
                global_loss += -log(probs[label[batch_index * BATCH_SIZE + img]]);

                /* Gradient computation for the last (score) layer */
                probs[label[batch_index * BATCH_SIZE + img]] -= 1.0;

                cudaMemcpy(d_data+probs_pointer, probs, layer_size[num_layers - 1]*sizeof(double), cudaMemcpyHostToDevice);

                /* Backpropagation */
                for (layer = num_layers - 1; layer > 0; layer--) {
                    input_pointer = data_ind(layer, layer_size);
                    output_pointer = data_ind(layer - 1, layer_size);
                    param_pointer = param_ind(layer, layer_size);
                    dim3 dimBlock( 128, 1, 1 );
                    dim3 dimGrid( ceil((float)layer_size[layer]/128.0), 1, 1 );
                    backward_part1<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer], d_data + output_pointer, layer_size[layer - 1],
                             d_param + param_pointer, d_grad_param + param_pointer, layer, lambda);
                    if (layer > 1) {
                        dim3 dimBlock( 128, 1, 1 );
                        dim3 dimGrid( ceil((float)layer_size[layer - 1]/128.0), 1, 1 );
                        backward_part2<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer], d_data + output_pointer, layer_size[layer - 1],
                             d_param + param_pointer, d_grad_param + param_pointer, layer, lambda);
                    }
                }
            }

            /* Update parameters using gradient averaged over batch)*/
            dim3 dimBlock(512, 1, 1 );
            dim3 dimGrid( ceil((float)num_param/512.0), 1 ,1 );
            update_param<<<dimGrid, dimBlock>>>(d_param, d_grad_param, num_param, learning_rate, BATCH_SIZE);

            /* Compute global loss averaged over batch */
            global_loss /= BATCH_SIZE;
            if (batch_index % 100 == 0) {
                printf("Ep: %zu/%d\t batch:%d \t train loss: %f\n", ep, epochs, batch_index, global_loss);
            }
        }
    }
    cudaFree(d_data);
    free(images);
}


/* Test the network */
void test(const char filename[], int* label, double *d_param, int *layer_size, int num_layers) {
    int it, layer, i;
    int input_pointer, output_pointer, param_pointer, probs_pointer, predicted_class;
    double sum, predicted_class_score, global_loss = 0.0;
    int image_size = layer_size[0];
    int acc = 0;

    /* Allocate image data array */
    double *images;
    images  = (double *) malloc(image_size* sizeof(double));

    /* Allocate data array */
    double *d_data ;
    cudaMalloc( (void**)&d_data, data_size(layer_size,num_layers)*sizeof(double));

    /* Loop over batches */
    for (it = 0; it < TEST_SET_SIZE; it++) {

        /* Load image data */
        read_images(filename, images, image_size, 1, it);

        /* Copy one image to the 1st layer of the data */
        cudaMemcpy(d_data, images, image_size * sizeof(double),cudaMemcpyHostToDevice);

        /* Forward pass */
        for (layer = 1; layer < num_layers; layer++) {
            input_pointer = data_ind(layer - 1, layer_size);
            output_pointer = data_ind(layer, layer_size);
            param_pointer = param_ind(layer, layer_size);
            dim3 dimBlock( 128, 1, 1 );
            dim3 dimGrid( ceil((float)layer_size[layer]/128.0), 1, 1 );
            forward<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer - 1], d_data + output_pointer, layer_size[layer],
                    d_param + param_pointer, num_layers - layer - 1);
        }

        /* Softmax and Predict class */
        double *probs;
        probs = (double * ) malloc(layer_size[num_layers - 1] * sizeof(double));
        probs_pointer = data_ind(num_layers - 1, layer_size);
        cudaMemcpy(probs, d_data+probs_pointer, layer_size[num_layers - 1]*sizeof(double), cudaMemcpyDeviceToHost);
        
        sum = 0.0;
        for (i = 0; i < layer_size[num_layers - 1]; i++) {
            sum += exp(probs[i]);
        }
        predicted_class_score = -1.0;
        predicted_class = -1;
        for (i = 0; i < layer_size[num_layers - 1]; i++) {
            /* Compute normalized probability of the correct class */
            probs[i] = exp(probs[i])/sum;
            /* Argmax */
            if (probs[i] > predicted_class_score) {
                predicted_class_score = probs[i];
                predicted_class = i;
            }
        }

        /* Compute accuracy */
        if (predicted_class == label[it]) {
            acc++;
        }

        /* Compute the cross-entropy loss by adding the log probabilities assigned to the correct classes */
        global_loss += -log(probs[label[it]]);

        if ((it+1) % 1000 == 0) {
            printf("Test set size: %d\tloss: %f\taccuracy:%f\n",
                   it + 1, global_loss / (it + 1), (float) acc / (float) (it + 1));
        }

    }
    cudaFree(d_data);
    free(images);
}



int main(int argc, char **argv) {

    /* local variables */
    int epochs, W = 28, H = 28;
    const char train_images_filename[] = "./mnist_data/train_images.csv";
    const char train_labels_filename[] = "./mnist_data/train_labels.csv";
    const char test_images_filename[] = "./mnist_data/test_images.csv";
    const char test_labels_filename[] = "./mnist_data/test_labels.csv";

    /* Read number of epochs from command line */
    if (argc < 2) {
        printf("Number of epochs is not given \n");
        exit(1);
    }
    epochs = atoi(argv[1]);

    /* Set neural network parameters */
    double lambda = 0.0005, learning_rate = 0.01;
    int num_layers = 4;
    int layer_size[4] = {W*H,300,100,10};
    int p_size = param_size(layer_size, num_layers) * sizeof(double);
    double *h_param, *d_param;
    double *h_grad_param, *d_grad_param;
    int *train_label, *test_label;

    /* Allocate memory and read training labels */
    train_label = (int *) malloc(TRAIN_SET_SIZE * sizeof(int));
    read_labels(train_labels_filename, train_label, TRAIN_SET_SIZE);

    /* Allocate memory for parameters */
    h_param = (double *) malloc(p_size);
    h_grad_param = (double *) malloc(p_size);
    cudaMalloc( (void**)&d_param, p_size);
    cudaMalloc( (void**)&d_grad_param, p_size);

    srandom(1);
    /* Initialize parameters using "xavier" initialization */
    int layer, i, j;
    for (layer = 1; layer < num_layers; layer++) {
        double a = sqrt(3.0/(float)layer_size[layer-1]); // uniform interval limit
        int param_pointer = param_ind(layer, layer_size);
        for (i = 0; i < layer_size[layer]; i++) {
            h_param[param_pointer + i] = 0.0; // bias
        }
        for (j = 1; j < layer_size[layer - 1] +1; j++) {
            for (i = 0; i < layer_size[layer]; i++) {
                h_param[param_pointer + j * layer_size[layer] + i] = 2.0 * a * (double) random() / RAND_MAX - a;
            }
        }
    }

    /* Initialize gradients with 0 */
    memset(h_grad_param, 0, p_size);

    cudaMemcpy( d_param, h_param, p_size, cudaMemcpyHostToDevice );
    cudaMemcpy( d_grad_param, h_grad_param, p_size, cudaMemcpyHostToDevice );

    /* Train network */
    train(train_images_filename, train_label, d_param, d_grad_param, layer_size, num_layers, epochs, lambda, learning_rate);

    /* Deallocate arrays */
    free(h_grad_param);
    cudaFree(d_grad_param);
    free(train_label);

    /* Allocate memory and read testing labels */
    test_label = (int *) malloc(TEST_SET_SIZE * sizeof(int));
    read_labels(test_labels_filename, test_label, TEST_SET_SIZE);

    /* Test network */
    test(test_images_filename, test_label, d_param, layer_size, num_layers);

    /* Deallocate arrays */
    free(h_param);
    cudaFree(d_param);
    free(test_label);

    return 0;
}

	.file	"tmpxft_0024661a_00000000-6_cuda.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2038:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2038:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"r"
.LC1:
	.string	"%d"
	.text
	.globl	_Z11read_labelsPKcPii
	.type	_Z11read_labelsPKcPii, @function
_Z11read_labelsPKcPii:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	0(,%r13,4), %rcx
	movq	%rdi, %r12
	movq	%rsi, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	leaq	.LC0(%rip), %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	rep stosb
	movq	%r12, %rdi
	call	fopen@PLT
	testq	%rax, %rax
	je	.L3
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
.L5:
	cmpq	%r13, %r12
	jnb	.L4
	movq	%rbx, %rdi
	call	feof@PLT
	testl	%eax, %eax
	jne	.L4
	leaq	0(%rbp,%r12,4), %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	incq	%r12
	call	__isoc23_fscanf@PLT
	jmp	.L5
.L4:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	fclose@PLT
.L3:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 40
	movq	%r12, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	jmp	perror@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z11read_labelsPKcPii, .-_Z11read_labelsPKcPii
	.globl	_Z11read_imagesPKcPdiii
	.type	_Z11read_imagesPKcPdiii, @function
_Z11read_imagesPKcPdiii:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	movl	%r8d, %r15d
	pushq	%r14
	.cfi_offset 14, -32
	movslq	%edx, %r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%ecx, %ebx
	subq	$88, %rsp
	movq	%rsi, -112(%rbp)
	leaq	.LC0(%rip), %rsi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rdi, -80(%rbp)
	call	fopen@PLT
	movq	-80(%rbp), %rdi
	testq	%rax, %rax
	movq	%rax, -72(%rbp)
	je	.L9
	leal	0(,%r14,4), %eax
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rcx
	movl	%eax, -84(%rbp)
	cltq
	leaq	15(%rax), %rdx
	movq	%rax, -80(%rbp)
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L10:
	cmpq	%rcx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L12
	orq	$0, -8(%rsp,%rax)
.L12:
	imull	%ebx, %r15d
	movq	%rsp, -96(%rbp)
	xorl	%r13d, %r13d
	movl	%r15d, %r8d
	movslq	%r15d, %r15
	movq	%r15, %r12
	addl	%r8d, %ebx
	imulq	%r14, %r12
	movslq	%ebx, %rbx
	negq	%r12
.L13:
	movq	-72(%rbp), %rcx
	movl	-84(%rbp), %edx
	movq	-80(%rbp), %rsi
	movq	-96(%rbp), %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L25
	cmpq	%r15, %r13
	jnb	.L14
.L15:
	incq	%r13
	addq	%r14, %r12
	jmp	.L13
.L14:
	cmpq	%rbx, %r13
	jnb	.L15
	movq	-112(%rbp), %rax
	movq	-96(%rbp), %rdi
	xorl	%ecx, %ecx
	leaq	(%rax,%r12,8), %r9
.L16:
	movq	%rdi, -64(%rbp)
	cmpq	%r14, %rcx
	jnb	.L15
	leaq	-64(%rbp), %rsi
	movl	$10, %edx
	movq	%r9, -128(%rbp)
	movq	%rcx, -120(%rbp)
	call	__isoc23_strtol@PLT
	movq	-120(%rbp), %rcx
	movq	-128(%rbp), %r9
	cvtsi2sdq	%rax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	movq	-64(%rbp), %rax
	leaq	1(%rax), %rdi
	movsd	%xmm0, (%r9,%rcx,8)
	incq	%rcx
	jmp	.L16
.L25:
	movq	-72(%rbp), %rdi
	call	fclose@PLT
	movq	-104(%rbp), %rsp
	jmp	.L8
.L9:
	call	perror@PLT
.L8:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z11read_imagesPKcPdiii, .-_Z11read_imagesPKcPdiii
	.globl	_Z10param_sizePii
	.type	_Z10param_sizePii, @function
_Z10param_sizePii:
.LFB2029:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	xorl	%ecx, %ecx
	movslq	%esi, %rsi
.L27:
	cmpq	%rsi, %rax
	jnb	.L29
	movl	-4(%rdi,%rax,4), %edx
	incl	%edx
	imull	(%rdi,%rax,4), %edx
	incq	%rax
	addl	%edx, %ecx
	jmp	.L27
.L29:
	movl	%ecx, %eax
	ret
	.cfi_endproc
.LFE2029:
	.size	_Z10param_sizePii, .-_Z10param_sizePii
	.globl	_Z9data_sizePii
	.type	_Z9data_sizePii, @function
_Z9data_sizePii:
.LFB2030:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	xorl	%edx, %edx
	movslq	%esi, %rsi
.L31:
	cmpq	%rsi, %rax
	jnb	.L33
	addl	(%rdi,%rax,4), %edx
	incq	%rax
	jmp	.L31
.L33:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z9data_sizePii, .-_Z9data_sizePii
	.globl	_Z9param_indiPi
	.type	_Z9param_indiPi, @function
_Z9param_indiPi:
.LFB2031:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	xorl	%ecx, %ecx
	movslq	%edi, %rdi
.L35:
	cmpq	%rdi, %rax
	jnb	.L37
	movl	-4(%rsi,%rax,4), %edx
	incl	%edx
	imull	(%rsi,%rax,4), %edx
	incq	%rax
	addl	%edx, %ecx
	jmp	.L35
.L37:
	movl	%ecx, %eax
	ret
	.cfi_endproc
.LFE2031:
	.size	_Z9param_indiPi, .-_Z9param_indiPi
	.globl	_Z8data_indiPi
	.type	_Z8data_indiPi, @function
_Z8data_indiPi:
.LFB2032:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	xorl	%edx, %edx
	movslq	%edi, %rdi
.L39:
	cmpq	%rdi, %rax
	jnb	.L41
	addl	(%rsi,%rax,4), %edx
	incq	%rax
	jmp	.L39
.L41:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z8data_indiPi, .-_Z8data_indiPi
	.globl	_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i
	.type	_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i, @function
_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$184, %rsp
	.cfi_def_cfa_offset 192
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movl	%esi, 36(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 32(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 160(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L42
	pushq	64(%rsp)
	.cfi_def_cfa_offset 200
	leaq	_Z7forwardPdiS_iS_i(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 208
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 200
	popq	%rdx
	.cfi_def_cfa_offset 192
.L42:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	addq	$184, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i, .-_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i
	.globl	_Z7forwardPdiS_iS_i
	.type	_Z7forwardPdiS_iS_i, @function
_Z7forwardPdiS_iS_i:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i
	.cfi_endproc
.LFE2061:
	.size	_Z7forwardPdiS_iS_i, .-_Z7forwardPdiS_iS_i
	.section	.rodata.str1.1
.LC6:
	.string	"Test set size: %d\tloss: %f\taccuracy:%f\n"
	.text
	.globl	_Z4testPKcPiPdS1_i
	.type	_Z4testPKcPiPdS1_i, @function
_Z4testPKcPiPdS1_i:
.LFB2034:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rcx, %rbx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdx, 88(%rsp)
	movq	%rdi, 72(%rsp)
	movq	%rsi, 80(%rsp)
	movl	%r8d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movslq	(%rcx), %rax
	movl	%eax, 52(%rsp)
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, 40(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %esi
	movq	%rbx, %rdi
	movq	%rax, 32(%rsp)
	call	_Z9data_sizePii
	leaq	104(%rsp), %rdi
	movslq	%eax, %rsi
	salq	$3, %rsi
	call	cudaMalloc@PLT
	movslq	12(%rsp), %rax
	movq	$0x000000000, 24(%rsp)
	leaq	-4(%rbx,%rax,4), %r14
	xorl	%eax, %eax
	movl	%eax, 48(%rsp)
	movl	12(%rsp), %eax
	decl	%eax
	movl	%eax, 56(%rsp)
.L59:
	movl	52(%rsp), %edx
	movq	32(%rsp), %rsi
	movl	%r15d, %r8d
	movl	$1, %ecx
	movq	72(%rsp), %rdi
	movl	%r15d, 60(%rsp)
	movl	$1, %ebp
	call	_Z11read_imagesPKcPdiii
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	movl	$1, %ecx
	movq	104(%rsp), %rdi
	call	cudaMemcpy@PLT
.L48:
	movl	%ebp, 16(%rsp)
	cmpl	%ebp, 12(%rsp)
	jle	.L65
	movq	%rbx, %rsi
	leal	-1(%rbp), %edi
	call	_Z8data_indiPi
	movl	16(%rsp), %edi
	movslq	%eax, %r12
	call	_Z8data_indiPi
	movl	16(%rsp), %edi
	movslq	%eax, %r13
	call	_Z9param_indiPi
	cvtsi2ssl	(%rbx,%rbp,4), %xmm0
	movl	$1, 120(%rsp)
	movl	%eax, 64(%rsp)
	movl	$33554433, %eax
	salq	$7, %rax
	movq	%rax, 112(%rsp)
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	ceil@PLT
	movl	$33554433, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttsd2siq	%xmm0, %rax
	salq	$7, %rdx
	movl	$1, %ecx
	movl	%eax, 124(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 128(%rsp)
	movq	124(%rsp), %rdi
	movl	132(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L49
	movq	104(%rsp), %rax
	movl	56(%rsp), %r9d
	movslq	64(%rsp), %r8
	movl	(%rbx,%rbp,4), %ecx
	leaq	(%rax,%r13,8), %rdx
	leaq	(%rax,%r12,8), %rdi
	movl	16(%rsp), %eax
	movl	-4(%rbx,%rbp,4), %esi
	subl	%eax, %r9d
	movq	88(%rsp), %rax
	leaq	(%rax,%r8,8), %r8
	call	_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i
.L49:
	incq	%rbp
	jmp	.L48
.L65:
	movslq	(%r14), %rdi
	xorl	%r12d, %r12d
	salq	$3, %rdi
	call	malloc@PLT
	movl	56(%rsp), %edi
	movq	%rbx, %rsi
	movq	%rax, %rbp
	call	_Z8data_indiPi
	movq	104(%rsp), %rcx
	movslq	(%r14), %rdx
	movq	%rbp, %rdi
	cltq
	leaq	(%rcx,%rax,8), %rsi
	salq	$3, %rdx
	movl	$2, %ecx
	call	cudaMemcpy@PLT
	movq	$0x000000000, 16(%rsp)
.L51:
	cmpl	%r12d, (%r14)
	jle	.L66
	movsd	0(%rbp,%r12,8), %xmm0
	incq	%r12
	call	exp@PLT
	addsd	16(%rsp), %xmm0
	movsd	%xmm0, 16(%rsp)
	jmp	.L51
.L66:
	movsd	.LC4(%rip), %xmm1
	xorl	%r12d, %r12d
	orl	$-1, %r13d
.L53:
	cmpl	%r12d, (%r14)
	jle	.L67
	movsd	0(%rbp,%r12,8), %xmm0
	movsd	%xmm1, 64(%rsp)
	call	exp@PLT
	movsd	64(%rsp), %xmm1
	divsd	16(%rsp), %xmm0
	movsd	%xmm0, 0(%rbp,%r12,8)
	comisd	%xmm1, %xmm0
	maxsd	%xmm1, %xmm0
	cmova	%r12d, %r13d
	movaps	%xmm0, %xmm1
	incq	%r12
	jmp	.L53
.L67:
	movq	80(%rsp), %rax
	movslq	(%rax,%r15,4), %rax
	cmpl	%r13d, %eax
	jne	.L57
	incl	48(%rsp)
.L57:
	movsd	0(%rbp,%rax,8), %xmm0
	call	log@PLT
	movl	60(%rsp), %ecx
	movl	$1000, %esi
	movsd	24(%rsp), %xmm3
	incl	%ecx
	subsd	%xmm0, %xmm3
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movsd	%xmm3, 24(%rsp)
	testl	%edx, %edx
	jne	.L58
	cvtsi2ssl	%ecx, %xmm0
	movl	%ecx, %edx
	leaq	.LC6(%rip), %rsi
	movb	$2, %al
	cvtsi2ssl	48(%rsp), %xmm1
	movl	$2, %edi
	cvtsi2sdl	%ecx, %xmm2
	divss	%xmm0, %xmm1
	movaps	%xmm3, %xmm0
	divsd	%xmm2, %xmm0
	cvtss2sd	%xmm1, %xmm1
	call	__printf_chk@PLT
.L58:
	incq	%r15
	cmpq	$10000, %r15
	jne	.L59
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L60
	call	__stack_chk_fail@PLT
.L60:
	movq	32(%rsp), %rdi
	addq	$152, %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
	jmp	free@PLT
	.cfi_endproc
.LFE2034:
	.size	_Z4testPKcPiPdS1_i, .-_Z4testPKcPiPdS1_i
	.globl	_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id
	.type	_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id, @function
_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id:
.LFB2062:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movl	%esi, 36(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 32(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movq	%r9, 8(%rsp)
	movsd	%xmm0, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 168(%rsp)
	movq	%rsp, %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L68
	pushq	64(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z14backward_part1PdiS_iS_S_id(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 224
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L68:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L70
	call	__stack_chk_fail@PLT
.L70:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id, .-_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id
	.globl	_Z14backward_part1PdiS_iS_S_id
	.type	_Z14backward_part1PdiS_iS_S_id, @function
_Z14backward_part1PdiS_iS_S_id:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id
	.cfi_endproc
.LFE2063:
	.size	_Z14backward_part1PdiS_iS_S_id, .-_Z14backward_part1PdiS_iS_S_id
	.globl	_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id
	.type	_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id, @function
_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id:
.LFB2064:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	72(%rsp), %rdi
	movl	%esi, 36(%rsp)
	leaq	84(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	56(%rsp), %rdx
	movl	%ecx, 32(%rsp)
	leaq	64(%rsp), %rcx
	movq	%r8, 16(%rsp)
	movq	%r9, 8(%rsp)
	movsd	%xmm0, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 80(%rsp)
	movq	%rax, 120(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 168(%rsp)
	movq	%rsp, %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 72(%rsp)
	movq	%rax, 84(%rsp)
	movl	$1, 92(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L73
	pushq	64(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z14backward_part2PdiS_iS_S_id(%rip), %rdi
	pushq	64(%rsp)
	.cfi_def_cfa_offset 224
	movq	100(%rsp), %rcx
	movl	108(%rsp), %r8d
	movq	88(%rsp), %rsi
	movl	96(%rsp), %edx
	leaq	136(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L73:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L75
	call	__stack_chk_fail@PLT
.L75:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id, .-_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id
	.globl	_Z14backward_part2PdiS_iS_S_id
	.type	_Z14backward_part2PdiS_iS_S_id, @function
_Z14backward_part2PdiS_iS_S_id:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id
	.cfi_endproc
.LFE2065:
	.size	_Z14backward_part2PdiS_iS_S_id, .-_Z14backward_part2PdiS_iS_S_id
	.globl	_Z37__device_stub__Z12update_paramPdS_idiPdS_idi
	.type	_Z37__device_stub__Z12update_paramPdS_idiPdS_idi, @function
_Z37__device_stub__Z12update_paramPdS_idiPdS_idi:
.LFB2066:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movl	%edx, 12(%rsp)
	leaq	32(%rsp), %rdx
	movl	%ecx, 8(%rsp)
	leaq	40(%rsp), %rcx
	movsd	%xmm0, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 112(%rsp)
	movq	%rsp, %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L78
	pushq	40(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z12update_paramPdS_idi(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 176
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L78:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L80
	call	__stack_chk_fail@PLT
.L80:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z37__device_stub__Z12update_paramPdS_idiPdS_idi, .-_Z37__device_stub__Z12update_paramPdS_idiPdS_idi
	.globl	_Z12update_paramPdS_idi
	.type	_Z12update_paramPdS_idi, @function
_Z12update_paramPdS_idi:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z37__device_stub__Z12update_paramPdS_idiPdS_idi
	.cfi_endproc
.LFE2067:
	.size	_Z12update_paramPdS_idi, .-_Z12update_paramPdS_idi
	.section	.rodata.str1.1
.LC10:
	.string	"Ep: %zu/%d\t batch:%d \t train loss: %f\n"
	.text
	.globl	_Z5trainPKcPiPdS2_S1_iidd
	.type	_Z5trainPKcPiPdS2_S1_iidd, @function
_Z5trainPKcPiPdS2_S1_iidd:
.LFB2033:
	.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
	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	%r8, %rbx
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movl	304(%rsp), %eax
	movq	%rdx, 32(%rsp)
	movq	%rcx, 40(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%rdi, 144(%rsp)
	movq	%r8, %rdi
	movq	%rsi, 152(%rsp)
	movl	%r9d, %esi
	movl	%eax, 124(%rsp)
	movsd	%xmm0, 128(%rsp)
	movsd	%xmm1, 160(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	movl	(%r8), %eax
	movl	%eax, 72(%rsp)
	call	_Z10param_sizePii
	imull	$100, 72(%rsp), %edi
	movl	%eax, 76(%rsp)
	movslq	%edi, %rdi
	salq	$3, %rdi
	call	malloc@PLT
	movl	12(%rsp), %esi
	movq	%rbx, %rdi
	movq	%rax, 80(%rsp)
	call	_Z9data_sizePii
	leaq	176(%rsp), %rdi
	movslq	%eax, %rsi
	salq	$3, %rsi
	call	cudaMalloc@PLT
	movslq	76(%rsp), %rax
	movq	%r12, 48(%rsp)
	movsd	.LC7(%rip), %xmm0
	salq	$3, %rax
	movq	%rax, 136(%rsp)
	movslq	72(%rsp), %rax
	salq	$3, %rax
	movq	%rax, 88(%rsp)
	movslq	12(%rsp), %rax
	leaq	-4(%rbx,%rax,4), %rax
	movq	%rax, 16(%rsp)
	movslq	124(%rsp), %rax
	movq	%rax, 168(%rsp)
.L84:
	movq	48(%rsp), %rax
	movq	168(%rsp), %rdx
	incq	48(%rsp)
	cmpq	%rdx, %rax
	jnb	.L101
	comisd	.LC11(%rip), %xmm0
	jbe	.L101
	xorl	%ebp, %ebp
	movq	%rbp, 24(%rsp)
.L100:
	movl	24(%rsp), %eax
	movq	136(%rsp), %rdx
	xorl	%esi, %esi
	movq	40(%rsp), %rdi
	movl	%eax, 120(%rsp)
	call	cudaMemset@PLT
	movl	24(%rsp), %r8d
	movl	72(%rsp), %edx
	movl	$100, %ecx
	movq	80(%rsp), %rsi
	movq	144(%rsp), %rdi
	call	_Z11read_imagesPKcPdiii
	movq	80(%rsp), %rax
	movq	152(%rsp), %rcx
	xorl	%r11d, %r11d
	movq	$0x000000000, 64(%rsp)
	movq	%rax, 104(%rsp)
	imulq	$400, 24(%rsp), %rax
	movq	%r11, 96(%rsp)
	addq	%rcx, %rax
	movq	%rax, 112(%rsp)
.L97:
	movq	88(%rsp), %rdx
	movq	104(%rsp), %rsi
	movl	$1, %ecx
	movl	$1, %r15d
	movq	176(%rsp), %rdi
	call	cudaMemcpy@PLT
.L85:
	movl	%r15d, %r14d
	cmpl	%r15d, 12(%rsp)
	jle	.L111
	movq	%rbx, %rsi
	leal	-1(%r15), %edi
	call	_Z8data_indiPi
	movl	%r14d, %edi
	movslq	%eax, %r12
	call	_Z8data_indiPi
	movl	%r14d, %edi
	movslq	%eax, %r13
	call	_Z9param_indiPi
	cvtsi2ssl	(%rbx,%r15,4), %xmm0
	movl	$1, 216(%rsp)
	movslq	%eax, %rbp
	movl	$33554433, %eax
	salq	$7, %rax
	movq	%rax, 208(%rsp)
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	ceil@PLT
	movl	$33554433, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttsd2siq	%xmm0, %rax
	salq	$7, %rdx
	movl	$1, %ecx
	movl	%eax, 220(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 224(%rsp)
	movq	220(%rsp), %rdi
	movl	228(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L86
	movq	176(%rsp), %rax
	movl	12(%rsp), %ecx
	movl	-4(%rbx,%r15,4), %esi
	leaq	(%rax,%r13,8), %rdx
	leaq	(%rax,%r12,8), %rdi
	movq	32(%rsp), %rax
	leal	-1(%rcx), %r9d
	movl	(%rbx,%r15,4), %ecx
	subl	%r14d, %r9d
	leaq	(%rax,%rbp,8), %r8
	call	_Z33__device_stub__Z7forwardPdiS_iS_iPdiS_iS_i
.L86:
	incq	%r15
	jmp	.L85
.L111:
	movq	16(%rsp), %rax
	xorl	%r14d, %r14d
	movslq	(%rax), %rdi
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rbx, %rsi
	movl	$2, %ecx
	movq	%rax, %r13
	movl	12(%rsp), %eax
	leal	-1(%rax), %ebp
	movl	%ebp, %edi
	call	_Z8data_indiPi
	movq	176(%rsp), %rsi
	movq	%r13, %rdi
	movslq	%eax, %r12
	movq	16(%rsp), %rax
	salq	$3, %r12
	movslq	(%rax), %rdx
	addq	%r12, %rsi
	salq	$3, %rdx
	call	cudaMemcpy@PLT
	movq	$0x000000000, 56(%rsp)
.L88:
	movq	16(%rsp), %rax
	cmpl	%r14d, (%rax)
	jle	.L112
	movsd	0(%r13,%r14,8), %xmm0
	incq	%r14
	call	exp@PLT
	addsd	56(%rsp), %xmm0
	movsd	%xmm0, 56(%rsp)
	jmp	.L88
.L112:
	xorl	%r14d, %r14d
.L90:
	movq	16(%rsp), %rax
	cmpl	%r14d, (%rax)
	jle	.L113
	movsd	0(%r13,%r14,8), %xmm0
	call	exp@PLT
	divsd	56(%rsp), %xmm0
	movsd	%xmm0, 0(%r13,%r14,8)
	incq	%r14
	jmp	.L90
.L113:
	movq	112(%rsp), %rax
	movslq	(%rax), %rax
	leaq	0(%r13,%rax,8), %r15
	movq	(%r15), %r14
	movq	%r14, %xmm0
	call	log@PLT
	movsd	64(%rsp), %xmm2
	movq	16(%rsp), %rax
	movq	%r13, %rsi
	movq	176(%rsp), %rdi
	movl	$1, %ecx
	subsd	%xmm0, %xmm2
	movq	%r14, %xmm0
	movslq	(%rax), %rdx
	subsd	.LC7(%rip), %xmm0
	addq	%r12, %rdi
	salq	$3, %rdx
	movsd	%xmm0, (%r15)
	movslq	%ebp, %r15
	movsd	%xmm2, 64(%rsp)
	call	cudaMemcpy@PLT
.L92:
	movl	%r15d, 56(%rsp)
	movl	%r15d, %r14d
	testl	%r15d, %r15d
	jle	.L114
	movq	%rbx, %rsi
	movl	%r14d, %edi
	call	_Z8data_indiPi
	leal	-1(%r15), %edi
	movslq	%eax, %r12
	call	_Z8data_indiPi
	movl	%r14d, %edi
	movslq	%eax, %r13
	call	_Z9param_indiPi
	cvtsi2ssl	(%rbx,%r15,4), %xmm0
	movl	$1, 192(%rsp)
	movslq	%eax, %rbp
	movl	$33554433, %eax
	salq	$7, %rax
	movq	%rax, 184(%rsp)
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	ceil@PLT
	movl	$33554433, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttsd2siq	%xmm0, %rax
	salq	$7, %rdx
	movl	$1, %ecx
	movl	%eax, 196(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 200(%rsp)
	movq	196(%rsp), %rdi
	movl	204(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L93
	movslq	%r13d, %rsi
	movslq	%r12d, %rdi
	movl	-4(%rbx,%r15,4), %ecx
	movslq	%ebp, %rax
	movq	176(%rsp), %r8
	salq	$3, %rax
	leaq	(%r8,%rsi,8), %rdx
	leaq	(%r8,%rdi,8), %rdi
	movl	(%rbx,%r15,4), %esi
	pushq	%r8
	.cfi_def_cfa_offset 312
	pushq	%r15
	.cfi_def_cfa_offset 320
	movq	56(%rsp), %r10
	movsd	144(%rsp), %xmm0
	movq	48(%rsp), %r11
	leaq	(%r10,%rax), %r9
	leaq	(%r11,%rax), %r8
	call	_Z44__device_stub__Z14backward_part1PdiS_iS_S_idPdiS_iS_S_id
	popq	%r9
	.cfi_def_cfa_offset 312
	popq	%r10
	.cfi_def_cfa_offset 304
.L93:
	cmpl	$1, 56(%rsp)
	je	.L94
	cvtsi2ssl	-4(%rbx,%r15,4), %xmm0
	movl	$33554433, %eax
	movl	$1, 216(%rsp)
	salq	$7, %rax
	movq	%rax, 208(%rsp)
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC5(%rip), %xmm0
	call	ceil@PLT
	movl	$33554433, %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	cvttsd2siq	%xmm0, %rax
	salq	$7, %rdx
	movl	$1, %ecx
	movl	%eax, 220(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 224(%rsp)
	movq	220(%rsp), %rdi
	movl	228(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L94
	movq	176(%rsp), %rax
	movl	-4(%rbx,%r15,4), %ecx
	salq	$3, %rbp
	movl	(%rbx,%r15,4), %esi
	leaq	(%rax,%r13,8), %rdx
	leaq	(%rax,%r12,8), %rdi
	pushq	%rax
	.cfi_def_cfa_offset 312
	pushq	%r14
	.cfi_def_cfa_offset 320
	movq	56(%rsp), %rax
	movsd	144(%rsp), %xmm0
	leaq	(%rax,%rbp), %r9
	movq	48(%rsp), %rax
	leaq	(%rax,%rbp), %r8
	call	_Z44__device_stub__Z14backward_part2PdiS_iS_S_idPdiS_iS_S_id
	popq	%rdx
	.cfi_def_cfa_offset 312
	popq	%rcx
	.cfi_def_cfa_offset 304
.L94:
	decq	%r15
	jmp	.L92
.L114:
	incq	96(%rsp)
	movq	88(%rsp), %rcx
	addq	$4, 112(%rsp)
	addq	%rcx, 104(%rsp)
	cmpq	$100, 96(%rsp)
	jne	.L97
	cvtsi2ssl	76(%rsp), %xmm0
	movl	$8388609, %ebp
	movl	$1, 216(%rsp)
	salq	$9, %rbp
	movq	%rbp, 208(%rsp)
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LC8(%rip), %xmm0
	call	ceil@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%rbp, %rdx
	cvttsd2siq	%xmm0, %rax
	movl	$1, %ecx
	movl	%eax, 220(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 224(%rsp)
	movq	220(%rsp), %rdi
	movl	228(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L98
	movl	76(%rsp), %edx
	movq	40(%rsp), %rsi
	movl	$100, %ecx
	movsd	160(%rsp), %xmm0
	movq	32(%rsp), %rdi
	call	_Z37__device_stub__Z12update_paramPdS_idiPdS_idi
.L98:
	movl	120(%rsp), %eax
	movl	$100, %ecx
	movsd	64(%rsp), %xmm0
	divsd	.LC9(%rip), %xmm0
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L99
	movl	120(%rsp), %r8d
	movl	124(%rsp), %ecx
	movl	$2, %edi
	movb	$1, %al
	movq	48(%rsp), %rdx
	leaq	.LC10(%rip), %rsi
	movsd	%xmm0, 56(%rsp)
	call	__printf_chk@PLT
	movsd	56(%rsp), %xmm0
.L99:
	incq	24(%rsp)
	cmpq	$600, 24(%rsp)
	jne	.L100
	jmp	.L84
.L101:
	movq	176(%rsp), %rdi
	call	cudaFree@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	je	.L102
	call	__stack_chk_fail@PLT
.L102:
	movq	80(%rsp), %rdi
	addq	$248, %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
	jmp	free@PLT
	.cfi_endproc
.LFE2033:
	.size	_Z5trainPKcPiPdS2_S1_iidd, .-_Z5trainPKcPiPdS2_S1_iidd
	.section	.rodata.str1.1
.LC12:
	.string	"Number of epochs is not given \n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB2035:
	.cfi_startproc
	endbr64
	movabsq	$7021802515871326564, %rdx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movabsq	$7020383252735680882, %rcx
	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
	movabsq	$33340917070128487, %rbx
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	movabsq	$6878249427562999598, %rax
	movq	%rdx, 164(%rsp)
	decl	%edi
	movq	%rdx, 194(%rsp)
	movabsq	$33340917070130277, %rdx
	movq	%rdx, 208(%rsp)
	movabsq	$8315180033856790884, %rdx
	movq	%rdx, 106(%rsp)
	movq	%rdx, 135(%rsp)
	movabsq	$33340917070130277, %rdx
	movq	%rcx, 170(%rsp)
	movabsq	$7020383252837000564, %rcx
	movq	%rax, 156(%rsp)
	movq	%rax, 186(%rsp)
	movabsq	$7089066445587964274, %rax
	movq	%rax, 200(%rsp)
	movabsq	$6878249427562999598, %rax
	movq	%rbx, 178(%rsp)
	movabsq	$33340917070128487, %rbx
	movq	%rax, 98(%rsp)
	movq	%rax, 127(%rsp)
	movabsq	$7089066445689283956, %rax
	movq	%rcx, 111(%rsp)
	movq	%rbx, 119(%rsp)
	movq	%rax, 140(%rsp)
	movq	%rdx, 148(%rsp)
	jg	.L116
	movl	$2, %edi
	leaq	.LC12(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$1, %edi
	call	exit@PLT
.L116:
	movq	8(%rsi), %rdi
	leaq	80(%rsp), %r12
	movl	$1, %r13d
	call	atoi@PLT
	movl	$4, %esi
	movq	%r12, %rdi
	movl	%eax, %r14d
	movabsq	$1288490189584, %rax
	movq	%rax, 80(%rsp)
	movabsq	$42949673060, %rax
	movq	%rax, 88(%rsp)
	call	_Z10param_sizePii
	movl	$240000, %edi
	movl	%eax, %ebx
	call	malloc@PLT
	sall	$3, %ebx
	movl	$60000, %edx
	leaq	186(%rsp), %rdi
	movq	%rax, %rsi
	movq	%rax, 16(%rsp)
	call	_Z11read_labelsPKcPii
	movslq	%ebx, %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	8(%rsp), %rsi
	leaq	64(%rsp), %rdi
	movq	%rax, 24(%rsp)
	call	cudaMalloc@PLT
	movq	8(%rsp), %rsi
	leaq	72(%rsp), %rdi
	call	cudaMalloc@PLT
	movl	$1, %edi
	call	srandom@PLT
.L123:
	movl	-4(%r12,%r13,4), %r15d
	movsd	.LC13(%rip), %xmm1
	cvtsi2ssl	%r15d, %xmm0
	cvtss2sd	%xmm0, %xmm0
	divsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	call	sqrt@PLT
	movq	%r12, %rsi
	movl	%r13d, %edi
	movsd	%xmm0, 32(%rsp)
	call	_Z9param_indiPi
	movl	(%r12,%r13,4), %esi
	movslq	%eax, %rdx
	leaq	0(%rbp,%rdx,8), %rcx
	xorl	%edx, %edx
.L117:
	cmpl	%edx, %esi
	jle	.L127
	movq	$0x000000000, (%rcx,%rdx,8)
	incq	%rdx
	jmp	.L117
.L127:
	leal	(%rax,%rsi), %edx
	movl	$1, %edi
.L119:
	cmpl	%edi, %r15d
	jl	.L121
	movslq	%edx, %rax
	xorl	%ebx, %ebx
	leaq	0(%rbp,%rax,8), %r8
.L122:
	cmpl	%ebx, %esi
	jle	.L128
	movl	%edx, 60(%rsp)
	movq	%r8, 48(%rsp)
	movl	%edi, 56(%rsp)
	movl	%esi, 44(%rsp)
	call	random@PLT
	movsd	32(%rsp), %xmm1
	movq	48(%rsp), %r8
	cvtsi2sdq	%rax, %xmm0
	movl	60(%rsp), %edx
	movl	56(%rsp), %edi
	addsd	%xmm1, %xmm1
	movl	44(%rsp), %esi
	mulsd	%xmm1, %xmm0
	divsd	.LC14(%rip), %xmm0
	subsd	32(%rsp), %xmm0
	movsd	%xmm0, (%r8,%rbx,8)
	incq	%rbx
	jmp	.L122
.L128:
	incl	%edi
	addl	%esi, %edx
	jmp	.L119
.L121:
	incq	%r13
	cmpq	$4, %r13
	jne	.L123
	movq	8(%rsp), %rcx
	movq	24(%rsp), %rdi
	xorl	%esi, %esi
	movq	%rcx, %rdx
	call	__memset_chk@PLT
	movq	8(%rsp), %rdx
	movq	64(%rsp), %rdi
	movq	%rbp, %rsi
	movl	$1, %ecx
	call	cudaMemcpy@PLT
	movq	8(%rsp), %rdx
	movq	24(%rsp), %rsi
	movl	$1, %ecx
	movq	72(%rsp), %rdi
	call	cudaMemcpy@PLT
	leaq	156(%rsp), %rdi
	movq	%r12, %r8
	movsd	.LC15(%rip), %xmm1
	pushq	%rax
	.cfi_def_cfa_offset 296
	movsd	.LC16(%rip), %xmm0
	movl	$4, %r9d
	pushq	%r14
	.cfi_def_cfa_offset 304
	movq	32(%rsp), %rsi
	movq	88(%rsp), %rcx
	movq	80(%rsp), %rdx
	call	_Z5trainPKcPiPdS2_S1_iidd
	movq	40(%rsp), %rdi
	call	free@PLT
	popq	%rdx
	.cfi_def_cfa_offset 296
	popq	%rcx
	.cfi_def_cfa_offset 288
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movl	$40000, %edi
	call	malloc@PLT
	leaq	127(%rsp), %rdi
	movl	$10000, %edx
	movq	%rax, %rsi
	movq	%rax, %rbx
	call	_Z11read_labelsPKcPii
	movq	64(%rsp), %rdx
	movq	%r12, %rcx
	movq	%rbx, %rsi
	movl	$4, %r8d
	leaq	98(%rsp), %rdi
	call	_Z4testPKcPiPdS1_i
	movq	%rbp, %rdi
	call	free@PLT
	movq	64(%rsp), %rdi
	call	cudaFree@PLT
	movq	%rbx, %rdi
	call	free@PLT
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	je	.L124
	call	__stack_chk_fail@PLT
.L124:
	addq	$232, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2035:
	.size	main, .-main
	.section	.rodata.str1.1
.LC17:
	.string	"_Z12update_paramPdS_idi"
.LC18:
	.string	"_Z14backward_part2PdiS_iS_S_id"
.LC19:
	.string	"_Z14backward_part1PdiS_iS_S_id"
.LC20:
	.string	"_Z7forwardPdiS_iS_i"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2069:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC17(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z12update_paramPdS_idi(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC18(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14backward_part2PdiS_iS_S_id(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC19(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14backward_part1PdiS_iS_S_id(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC20(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z7forwardPdiS_iS_i(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2069:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1064304640
	.align 8
.LC4:
	.long	0
	.long	-1074790400
	.align 8
.LC5:
	.long	0
	.long	1065353216
	.align 8
.LC7:
	.long	0
	.long	1072693248
	.align 8
.LC8:
	.long	0
	.long	1063256064
	.align 8
.LC9:
	.long	0
	.long	1079574528
	.align 8
.LC11:
	.long	-500134854
	.long	1044740494
	.align 8
.LC13:
	.long	0
	.long	1074266112
	.align 8
.LC14:
	.long	-4194304
	.long	1105199103
	.align 8
.LC15:
	.long	1202590843
	.long	1065646817
	.align 8
.LC16:
	.long	-755914244
	.long	1061184077
	.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:

/**
 * CUDA implementation of a fully-connected feed forward neural network
 *
 * Authors: Jevgenija Aksjonova (jevaks@kth.se)
 *          Beatrice Ionascu (bionascu@kth.se)
 *
 * Last changed: 04/30/2017
 */


#include <hip/hip_runtime.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define TOL 0.00000001
#define BATCH_SIZE 100
#define TRAIN_SET_SIZE 60000
#define TEST_SET_SIZE 10000
#define FUNCTION_TYPE 1 // 0 - tanh, 1 - relu


/* Read labels data */
void read_labels(const char filename[], int *array, int data_size) {
    memset(array, 0, sizeof(int) * data_size);
    FILE *file = fopen(filename, "r");
    if (file) {
        size_t i;
        /* Read each line from the file. */
        for (i = 0; i < data_size && !feof(file); i++) {
            fscanf(file, "%d", array + i);
        }
        assert(i == data_size);
        fclose(file);
    } else {
        perror(filename);
    }
}


/* Read image data */
void read_images(const char *filename, double *array, int data_size, int batch_size, int batch_ind) {
    FILE *file = fopen(filename, "r");
    if (file) {
        size_t i, j;
        char buffer[data_size * 4], *ptr;
        /* Read each line from the file. */
        for (i = 0; fgets(buffer, sizeof buffer, file); ++i) {
            /* Only parse data from desired batch. */
            if (i >= batch_ind * batch_size && i < (batch_ind + 1) * batch_size ) {
                /* Parse the comma-separated values from each line into 'array'. */
                for (j = 0, ptr = buffer; j < data_size; j++, ptr++) {
                    array[(i - batch_ind * batch_size) * data_size + j] = strtol(ptr, &ptr, 10) / 256.0;
                }
            }
        }
        fclose(file);
    } else {
        perror(filename);
    }
}

/* Compute local number of parameters (includes weights and biases) */
int param_size(int *layer_size, int num_layers) {
    int size = 0;
    size_t i;
    for (i = 1; i < num_layers; i++) {
        size = size + layer_size[i] * (layer_size[i-1] +1);
    }
    return size;
}


/* Compute total amount of data (includes the input data features and the layer outputs) */
int data_size(int *layer_size, int num_layers) {
    int size = 0;
    size_t i;
    for (i = 0; i < num_layers; i++) {
        size += layer_size[i];
    }
    return size;
}


/* Compute local starting index of the parameters corresponding to layer */
int param_ind(int layer, int *layer_size) {
    int ind = 0;
    size_t i;
    for (i = 1; i < layer; i++) {
        ind += layer_size[i] * (layer_size[i - 1] + 1);
    }
    return ind;
}


/* Compute local starting index of the data corresponding to layer */
int data_ind(int layer, int *layer_size) {
    int ind = 0;
    size_t i;
    for (i = 0; i < layer; i++) {
        ind += layer_size[i];
    }
    return ind;
}


/* Forward pass */
__global__
void forward(double *input, int inputSize, double *output, int outputSize, double *param, int fun) {

    size_t i, j;
    double l_output;
    i = blockIdx.x * blockDim.x + threadIdx.x;

    if (i < outputSize ) {

        /* Initialize output with the bias term */
        l_output = param[i];
        for (j = 0; j < inputSize; j++) {
            // Add weighted inputs
            l_output += param[(j+1)*outputSize + i] * input[j];
        }
        /* Activation */
        if (fun > 0) {
            if (FUNCTION_TYPE == 0) {
                l_output = tanh(l_output);
            }
            else if (FUNCTION_TYPE == 1) { // relu function
                if (l_output <= 0) {
                    l_output = 0.0;
                }
            }
        }
        output[i] = l_output;
    }
}


/* Backward pass (backpropagate gradients from current_layer to prev_layer) */
__global__
void backward_part1(double *current_layer, int layer_size, double *prev_layer, int prev_layer_size,
              double *param, double *grad_param, int layer,double lambda) {
    
    size_t i, j;
    double l_current_layer;
    i = blockIdx.x * blockDim.x + threadIdx.x;

    if (i < layer_size) {
        l_current_layer = current_layer[i];
        // Update parameters
        grad_param[i] += l_current_layer;
        for (j = 0; j < prev_layer_size; j++) {
            grad_param[(j+1) * layer_size + i ] += l_current_layer * prev_layer[j] + 
                        2.0 * lambda * param[(j+1) * layer_size + i]; // regularization
        }
    }
}

__global__
void backward_part2(double *current_layer, int layer_size, double *prev_layer, int prev_layer_size,
              double *param, double *grad_param, int layer,double lambda) {

    size_t i, k;
    double l_prev_layer;
    i = blockIdx.x * blockDim.x + threadIdx.x;

    if (i < prev_layer_size ) {
        l_prev_layer = prev_layer[i];
        // backprapogate partial derivatives
        if (FUNCTION_TYPE == 0) {
            double localGrad = (1-pow(l_prev_layer,2)); // tanh derivative
            l_prev_layer = 0.0; 
            for (k = 0; k < layer_size; k++) {
                l_prev_layer += current_layer[k] * param[(i+1) * layer_size + k];
            }
            l_prev_layer *= localGrad;
        } else if (FUNCTION_TYPE == 1) {
            if (l_prev_layer >0.0) {
                l_prev_layer = 0.0;
                for (k = 0; k < layer_size; k++) {
                    l_prev_layer += current_layer[k] * param[(i+1) * layer_size + k];
                }
            } else {
                l_prev_layer = 0.0;
            }
        }
        prev_layer[i] = l_prev_layer;
    }
}

__global__
void update_param(double *param, double *grad_param, int num_param, double learning_rate, int batch_size) {
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < num_param) {
        param[i] = param[i] - learning_rate * grad_param[i] / (float)batch_size;
    }
}

/* Train the network */
void train(const char filename[], int* label, double *d_param, double *d_grad_param, int *layer_size, int num_layers,
           int epochs, double lambda, double learning_rate) {

    size_t img, ep = 0;
    int i, layer, batch_index;
    int input_pointer, output_pointer, param_pointer;
    double sum, global_loss = 1;
    int image_size = layer_size[0];
    int num_param = param_size(layer_size, num_layers);

    /* Allocate image data array */
    double *images;
    images = (double *) malloc(BATCH_SIZE * image_size * sizeof(double));

    /* Allocate data array */
    double *d_data ;
    hipMalloc( (void**)&d_data, data_size(layer_size, num_layers) * sizeof(double));

    /* Loop over epochs (one epoch = loop over all images) */
    while (ep++ < epochs && global_loss > TOL) {
        /* Loop over batches */
        for (batch_index = 0; batch_index < TRAIN_SET_SIZE / BATCH_SIZE; batch_index++) {
            /* Initialize loss */
            global_loss = 0.0;

            /* Reset gradients to 0 */
            hipMemset(d_grad_param, 0.0, num_param * sizeof(double));

            /* Load images in batch */
            read_images(filename, images, image_size, BATCH_SIZE, batch_index);

            /* Loop over images in batch */
            for (img = 0; img < BATCH_SIZE; img++) {

                /* Copy one image to the 1st layer of the data */
                hipMemcpy(d_data, images + img * image_size, image_size * sizeof(double), hipMemcpyHostToDevice );

                /* Forward pass */
                for (layer = 1; layer < num_layers; layer++) {
                    input_pointer = data_ind(layer - 1, layer_size);
                    output_pointer = data_ind(layer, layer_size);
                    param_pointer = param_ind(layer, layer_size);
                    dim3 dimBlock( 128,1,1 );
                    dim3 dimGrid(ceil((float)layer_size[layer]/128.0),1,1);
                    forward<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer - 1], d_data + output_pointer, layer_size[layer],
                            d_param + param_pointer, num_layers - layer - 1);
                }

                double *probs;
                probs = (double * ) malloc(layer_size[num_layers - 1]* sizeof(double));
                int probs_pointer = data_ind(num_layers - 1, layer_size);
                hipMemcpy(probs, d_data + probs_pointer, layer_size[num_layers - 1] * sizeof(double), hipMemcpyDeviceToHost);

                /* Softmax */
                sum = 0.0;
                for ( i = 0; i < layer_size[num_layers - 1]; i++) {
                    sum += exp(probs[i]);
                }
                for ( i = 0; i < layer_size[num_layers - 1]; i++) {
                    probs[i] = exp(probs[i]) / sum;
                }

                /* Loss computation */
                /* Compute the cross-entropy loss by adding the log probabilities assigned to the correct classes */
                global_loss += -log(probs[label[batch_index * BATCH_SIZE + img]]);

                /* Gradient computation for the last (score) layer */
                probs[label[batch_index * BATCH_SIZE + img]] -= 1.0;

                hipMemcpy(d_data+probs_pointer, probs, layer_size[num_layers - 1]*sizeof(double), hipMemcpyHostToDevice);

                /* Backpropagation */
                for (layer = num_layers - 1; layer > 0; layer--) {
                    input_pointer = data_ind(layer, layer_size);
                    output_pointer = data_ind(layer - 1, layer_size);
                    param_pointer = param_ind(layer, layer_size);
                    dim3 dimBlock( 128, 1, 1 );
                    dim3 dimGrid( ceil((float)layer_size[layer]/128.0), 1, 1 );
                    backward_part1<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer], d_data + output_pointer, layer_size[layer - 1],
                             d_param + param_pointer, d_grad_param + param_pointer, layer, lambda);
                    if (layer > 1) {
                        dim3 dimBlock( 128, 1, 1 );
                        dim3 dimGrid( ceil((float)layer_size[layer - 1]/128.0), 1, 1 );
                        backward_part2<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer], d_data + output_pointer, layer_size[layer - 1],
                             d_param + param_pointer, d_grad_param + param_pointer, layer, lambda);
                    }
                }
            }

            /* Update parameters using gradient averaged over batch)*/
            dim3 dimBlock(512, 1, 1 );
            dim3 dimGrid( ceil((float)num_param/512.0), 1 ,1 );
            update_param<<<dimGrid, dimBlock>>>(d_param, d_grad_param, num_param, learning_rate, BATCH_SIZE);

            /* Compute global loss averaged over batch */
            global_loss /= BATCH_SIZE;
            if (batch_index % 100 == 0) {
                printf("Ep: %zu/%d\t batch:%d \t train loss: %f\n", ep, epochs, batch_index, global_loss);
            }
        }
    }
    hipFree(d_data);
    free(images);
}


/* Test the network */
void test(const char filename[], int* label, double *d_param, int *layer_size, int num_layers) {
    int it, layer, i;
    int input_pointer, output_pointer, param_pointer, probs_pointer, predicted_class;
    double sum, predicted_class_score, global_loss = 0.0;
    int image_size = layer_size[0];
    int acc = 0;

    /* Allocate image data array */
    double *images;
    images  = (double *) malloc(image_size* sizeof(double));

    /* Allocate data array */
    double *d_data ;
    hipMalloc( (void**)&d_data, data_size(layer_size,num_layers)*sizeof(double));

    /* Loop over batches */
    for (it = 0; it < TEST_SET_SIZE; it++) {

        /* Load image data */
        read_images(filename, images, image_size, 1, it);

        /* Copy one image to the 1st layer of the data */
        hipMemcpy(d_data, images, image_size * sizeof(double),hipMemcpyHostToDevice);

        /* Forward pass */
        for (layer = 1; layer < num_layers; layer++) {
            input_pointer = data_ind(layer - 1, layer_size);
            output_pointer = data_ind(layer, layer_size);
            param_pointer = param_ind(layer, layer_size);
            dim3 dimBlock( 128, 1, 1 );
            dim3 dimGrid( ceil((float)layer_size[layer]/128.0), 1, 1 );
            forward<<<dimGrid, dimBlock>>>(d_data + input_pointer, layer_size[layer - 1], d_data + output_pointer, layer_size[layer],
                    d_param + param_pointer, num_layers - layer - 1);
        }

        /* Softmax and Predict class */
        double *probs;
        probs = (double * ) malloc(layer_size[num_layers - 1] * sizeof(double));
        probs_pointer = data_ind(num_layers - 1, layer_size);
        hipMemcpy(probs, d_data+probs_pointer, layer_size[num_layers - 1]*sizeof(double), hipMemcpyDeviceToHost);
        
        sum = 0.0;
        for (i = 0; i < layer_size[num_layers - 1]; i++) {
            sum += exp(probs[i]);
        }
        predicted_class_score = -1.0;
        predicted_class = -1;
        for (i = 0; i < layer_size[num_layers - 1]; i++) {
            /* Compute normalized probability of the correct class */
            probs[i] = exp(probs[i])/sum;
            /* Argmax */
            if (probs[i] > predicted_class_score) {
                predicted_class_score = probs[i];
                predicted_class = i;
            }
        }

        /* Compute accuracy */
        if (predicted_class == label[it]) {
            acc++;
        }

        /* Compute the cross-entropy loss by adding the log probabilities assigned to the correct classes */
        global_loss += -log(probs[label[it]]);

        if ((it+1) % 1000 == 0) {
            printf("Test set size: %d\tloss: %f\taccuracy:%f\n",
                   it + 1, global_loss / (it + 1), (float) acc / (float) (it + 1));
        }

    }
    hipFree(d_data);
    free(images);
}



int main(int argc, char **argv) {

    /* local variables */
    int epochs, W = 28, H = 28;
    const char train_images_filename[] = "./mnist_data/train_images.csv";
    const char train_labels_filename[] = "./mnist_data/train_labels.csv";
    const char test_images_filename[] = "./mnist_data/test_images.csv";
    const char test_labels_filename[] = "./mnist_data/test_labels.csv";

    /* Read number of epochs from command line */
    if (argc < 2) {
        printf("Number of epochs is not given \n");
        exit(1);
    }
    epochs = atoi(argv[1]);

    /* Set neural network parameters */
    double lambda = 0.0005, learning_rate = 0.01;
    int num_layers = 4;
    int layer_size[4] = {W*H,300,100,10};
    int p_size = param_size(layer_size, num_layers) * sizeof(double);
    double *h_param, *d_param;
    double *h_grad_param, *d_grad_param;
    int *train_label, *test_label;

    /* Allocate memory and read training labels */
    train_label = (int *) malloc(TRAIN_SET_SIZE * sizeof(int));
    read_labels(train_labels_filename, train_label, TRAIN_SET_SIZE);

    /* Allocate memory for parameters */
    h_param = (double *) malloc(p_size);
    h_grad_param = (double *) malloc(p_size);
    hipMalloc( (void**)&d_param, p_size);
    hipMalloc( (void**)&d_grad_param, p_size);

    srandom(1);
    /* Initialize parameters using "xavier" initialization */
    int layer, i, j;
    for (layer = 1; layer < num_layers; layer++) {
        double a = sqrt(3.0/(float)layer_size[layer-1]); // uniform interval limit
        int param_pointer = param_ind(layer, layer_size);
        for (i = 0; i < layer_size[layer]; i++) {
            h_param[param_pointer + i] = 0.0; // bias
        }
        for (j = 1; j < layer_size[layer - 1] +1; j++) {
            for (i = 0; i < layer_size[layer]; i++) {
                h_param[param_pointer + j * layer_size[layer] + i] = 2.0 * a * (double) random() / RAND_MAX - a;
            }
        }
    }

    /* Initialize gradients with 0 */
    memset(h_grad_param, 0, p_size);

    hipMemcpy( d_param, h_param, p_size, hipMemcpyHostToDevice );
    hipMemcpy( d_grad_param, h_grad_param, p_size, hipMemcpyHostToDevice );

    /* Train network */
    train(train_images_filename, train_label, d_param, d_grad_param, layer_size, num_layers, epochs, lambda, learning_rate);

    /* Deallocate arrays */
    free(h_grad_param);
    hipFree(d_grad_param);
    free(train_label);

    /* Allocate memory and read testing labels */
    test_label = (int *) malloc(TEST_SET_SIZE * sizeof(int));
    read_labels(test_labels_filename, test_label, TEST_SET_SIZE);

    /* Test network */
    test(test_images_filename, test_label, d_param, layer_size, num_layers);

    /* Deallocate arrays */
    free(h_param);
    hipFree(d_param);
    free(test_label);

    return 0;
}

	.text
	.file	"cuda.hip"
	.globl	_Z11read_labelsPKcPii           # -- Begin function _Z11read_labelsPKcPii
	.type	_Z11read_labelsPKcPii,@function
_Z11read_labelsPKcPii:                  # @_Z11read_labelsPKcPii
	.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	%edx, %ebp
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movslq	%edx, %r12
	leaq	(,%r12,4), %rdx
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	memset@PLT
	movl	$.L.str, %esi
	movq	%r15, %rdi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_5
# %bb.1:                                # %.preheader
	movq	%rax, %r14
	testl	%ebp, %ebp
	je	.LBB0_4
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	feof
	testl	%eax, %eax
	jne	.LBB0_4
# %bb.3:                                #   in Loop: Header=BB0_2 Depth=1
	movl	$.L.str.1, %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	__isoc23_fscanf
	addq	$4, %rbx
	decq	%r12
	jne	.LBB0_2
.LBB0_4:                                # %.critedge
	movq	%r14, %rdi
	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
	jmp	fclose                          # TAILCALL
.LBB0_5:
	.cfi_def_cfa_offset 48
	movq	%r15, %rdi
	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
	jmp	perror                          # TAILCALL
.Lfunc_end0:
	.size	_Z11read_labelsPKcPii, .Lfunc_end0-_Z11read_labelsPKcPii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z11read_imagesPKcPdiii
.LCPI1_0:
	.quad	0x3f70000000000000              # double 0.00390625
	.text
	.globl	_Z11read_imagesPKcPdiii
	.type	_Z11read_imagesPKcPdiii,@function
_Z11read_imagesPKcPdiii:                # @_Z11read_imagesPKcPdiii
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movl	%ecx, -48(%rbp)                 # 4-byte Spill
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	$.L.str, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB1_10
# %bb.1:
	movq	%rax, %r13
	movq	%rsp, -80(%rbp)                 # 8-byte Spill
	movq	%r15, -72(%rbp)                 # 8-byte Spill
	leal	(,%r15,4), %esi
	movq	%rsp, %rdi
	leaq	15(%rsi), %rax
	andq	$-16, %rax
	subq	%rax, %rdi
	movq	%rdi, %rsp
	movq	%rdi, -56(%rbp)                 # 8-byte Spill
	movq	%rsi, -112(%rbp)                # 8-byte Spill
                                        # kill: def $esi killed $esi killed $rsi
	movq	%r13, %rdx
	callq	fgets
	testq	%rax, %rax
	je	.LBB1_9
# %bb.2:                                # %.lr.ph33
	movl	%ebx, %eax
	movl	-48(%rbp), %edx                 # 4-byte Reload
	imull	%edx, %eax
	movslq	%eax, %rcx
	incl	%ebx
	imull	%edx, %ebx
	movslq	%ebx, %rax
	movq	%rax, -88(%rbp)                 # 8-byte Spill
	movslq	-72(%rbp), %r12                 # 4-byte Folded Reload
	movq	%r12, %rax
	movq	%rcx, -48(%rbp)                 # 8-byte Spill
	imulq	%rcx, %rax
	shlq	$3, %rax
	subq	%rax, %r14
	leaq	(,%r12,8), %rax
	movq	%rax, -96(%rbp)                 # 8-byte Spill
	xorl	%r15d, %r15d
	leaq	-64(%rbp), %rbx
	movq	%r13, -104(%rbp)                # 8-byte Spill
.LBB1_3:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_7 Depth 2
	cmpq	-48(%rbp), %r15                 # 8-byte Folded Reload
	jb	.LBB1_8
# %bb.4:                                #   in Loop: Header=BB1_3 Depth=1
	cmpq	-88(%rbp), %r15                 # 8-byte Folded Reload
	jae	.LBB1_8
# %bb.5:                                # %.preheader
                                        #   in Loop: Header=BB1_3 Depth=1
	movq	-56(%rbp), %rax                 # 8-byte Reload
	movq	%rax, -64(%rbp)
	cmpl	$0, -72(%rbp)                   # 4-byte Folded Reload
	je	.LBB1_8
# %bb.6:                                # %.lr.ph
                                        #   in Loop: Header=BB1_3 Depth=1
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rdi                 # 8-byte Reload
.LBB1_7:                                #   Parent Loop BB1_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rsi
	movl	$10, %edx
	callq	__isoc23_strtol
	movsd	.LCPI1_0(%rip), %xmm1           # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, (%r14,%r13,8)
	incq	%r13
	movq	-64(%rbp), %rdi
	incq	%rdi
	movq	%rdi, -64(%rbp)
	cmpq	%r13, %r12
	jne	.LBB1_7
.LBB1_8:                                # %.loopexit
                                        #   in Loop: Header=BB1_3 Depth=1
	incq	%r15
	movq	-56(%rbp), %rdi                 # 8-byte Reload
	movq	-112(%rbp), %rsi                # 8-byte Reload
                                        # kill: def $esi killed $esi killed $rsi
	movq	-104(%rbp), %r13                # 8-byte Reload
	movq	%r13, %rdx
	callq	fgets
	addq	-96(%rbp), %r14                 # 8-byte Folded Reload
	testq	%rax, %rax
	jne	.LBB1_3
.LBB1_9:                                # %._crit_edge
	movq	%r13, %rdi
	callq	fclose
	movq	-80(%rbp), %rsp                 # 8-byte Reload
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB1_10:
	.cfi_def_cfa %rbp, 16
	movq	%r12, %rdi
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	jmp	perror                          # TAILCALL
.Lfunc_end1:
	.size	_Z11read_imagesPKcPdiii, .Lfunc_end1-_Z11read_imagesPKcPdiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z10param_sizePii               # -- Begin function _Z10param_sizePii
	.type	_Z10param_sizePii,@function
_Z10param_sizePii:                      # @_Z10param_sizePii
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	cmpl	$2, %esi
	jb	.LBB2_3
# %bb.1:                                # %.lr.ph.preheader
	movslq	%esi, %rcx
	xorl	%eax, %eax
	movl	$1, %edx
.LBB2_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	-4(%rdi,%rdx,4), %esi
	incl	%esi
	imull	(%rdi,%rdx,4), %esi
	addl	%esi, %eax
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB2_2
.LBB2_3:                                # %._crit_edge
	retq
.Lfunc_end2:
	.size	_Z10param_sizePii, .Lfunc_end2-_Z10param_sizePii
	.cfi_endproc
                                        # -- End function
	.globl	_Z9data_sizePii                 # -- Begin function _Z9data_sizePii
	.type	_Z9data_sizePii,@function
_Z9data_sizePii:                        # @_Z9data_sizePii
	.cfi_startproc
# %bb.0:
	testl	%esi, %esi
	je	.LBB3_1
# %bb.2:                                # %.lr.ph.preheader
	movslq	%esi, %rcx
	xorl	%edx, %edx
	xorl	%eax, %eax
.LBB3_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addl	(%rdi,%rdx,4), %eax
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB3_3
# %bb.4:                                # %._crit_edge
	retq
.LBB3_1:
	xorl	%eax, %eax
	retq
.Lfunc_end3:
	.size	_Z9data_sizePii, .Lfunc_end3-_Z9data_sizePii
	.cfi_endproc
                                        # -- End function
	.globl	_Z9param_indiPi                 # -- Begin function _Z9param_indiPi
	.type	_Z9param_indiPi,@function
_Z9param_indiPi:                        # @_Z9param_indiPi
	.cfi_startproc
# %bb.0:
	xorl	%eax, %eax
	cmpl	$2, %edi
	jb	.LBB4_3
# %bb.1:                                # %.lr.ph.preheader
	movslq	%edi, %rcx
	xorl	%eax, %eax
	movl	$1, %edx
.LBB4_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	-4(%rsi,%rdx,4), %edi
	incl	%edi
	imull	(%rsi,%rdx,4), %edi
	addl	%edi, %eax
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB4_2
.LBB4_3:                                # %._crit_edge
	retq
.Lfunc_end4:
	.size	_Z9param_indiPi, .Lfunc_end4-_Z9param_indiPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z8data_indiPi                  # -- Begin function _Z8data_indiPi
	.type	_Z8data_indiPi,@function
_Z8data_indiPi:                         # @_Z8data_indiPi
	.cfi_startproc
# %bb.0:
	testl	%edi, %edi
	je	.LBB5_1
# %bb.2:                                # %.lr.ph.preheader
	movslq	%edi, %rcx
	xorl	%edx, %edx
	xorl	%eax, %eax
.LBB5_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addl	(%rsi,%rdx,4), %eax
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	.LBB5_3
# %bb.4:                                # %._crit_edge
	retq
.LBB5_1:
	xorl	%eax, %eax
	retq
.Lfunc_end5:
	.size	_Z8data_indiPi, .Lfunc_end5-_Z8data_indiPi
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__forwardPdiS_iS_i # -- Begin function _Z22__device_stub__forwardPdiS_iS_i
	.type	_Z22__device_stub__forwardPdiS_iS_i,@function
_Z22__device_stub__forwardPdiS_iS_i:    # @_Z22__device_stub__forwardPdiS_iS_i
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$144, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	20(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7forwardPdiS_iS_i, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$160, %rsp
	.cfi_adjust_cfa_offset -160
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z22__device_stub__forwardPdiS_iS_i, .Lfunc_end6-_Z22__device_stub__forwardPdiS_iS_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__backward_part1PdiS_iS_S_id # -- Begin function _Z29__device_stub__backward_part1PdiS_iS_S_id
	.type	_Z29__device_stub__backward_part1PdiS_iS_S_id,@function
_Z29__device_stub__backward_part1PdiS_iS_S_id: # @_Z29__device_stub__backward_part1PdiS_iS_S_id
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	movq	%rsp, %rdx
	movl	%ecx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	32(%rsp), %r8
	movq	%r9, (%r8)
	leaq	24(%rsp), %r9
	movsd	%xmm0, (%r9)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	movq	%r9, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z14backward_part1PdiS_iS_S_id, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end7:
	.size	_Z29__device_stub__backward_part1PdiS_iS_S_id, .Lfunc_end7-_Z29__device_stub__backward_part1PdiS_iS_S_id
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__backward_part2PdiS_iS_S_id # -- Begin function _Z29__device_stub__backward_part2PdiS_iS_S_id
	.type	_Z29__device_stub__backward_part2PdiS_iS_S_id,@function
_Z29__device_stub__backward_part2PdiS_iS_S_id: # @_Z29__device_stub__backward_part2PdiS_iS_S_id
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	4(%rsp), %rdi
	movl	%esi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	movq	%rsp, %rdx
	movl	%ecx, (%rdx)
	leaq	40(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	32(%rsp), %r8
	movq	%r9, (%r8)
	leaq	24(%rsp), %r9
	movsd	%xmm0, (%r9)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	movq	%r9, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z14backward_part2PdiS_iS_S_id, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	_Z29__device_stub__backward_part2PdiS_iS_S_id, .Lfunc_end8-_Z29__device_stub__backward_part2PdiS_iS_S_id
	.cfi_endproc
                                        # -- End function
	.globl	_Z27__device_stub__update_paramPdS_idi # -- Begin function _Z27__device_stub__update_paramPdS_idi
	.type	_Z27__device_stub__update_paramPdS_idi,@function
_Z27__device_stub__update_paramPdS_idi: # @_Z27__device_stub__update_paramPdS_idi
	.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	$128, %rsp
	.cfi_def_cfa_offset 176
	.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	4(%rsp), %rsi
	movl	%edx, (%rsi)
	leaq	24(%rsp), %rdx
	movsd	%xmm0, (%rdx)
	movq	%rsp, %r8
	movl	%ecx, (%r8)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%r8, 32(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z12update_paramPdS_idi, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$144, %rsp
	.cfi_adjust_cfa_offset -144
	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_end9:
	.size	_Z27__device_stub__update_paramPdS_idi, .Lfunc_end9-_Z27__device_stub__update_paramPdS_idi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z5trainPKcPiPdS2_S1_iidd
.LCPI10_0:
	.quad	0x3f60000000000000              # double 0.001953125
.LCPI10_1:
	.quad	0x3f80000000000000              # double 0.0078125
.LCPI10_2:
	.quad	0xbff0000000000000              # double -1
.LCPI10_3:
	.quad	0x4059000000000000              # double 100
.LCPI10_4:
	.quad	0x3e45798ee2308c3a              # double 1.0E-8
	.text
	.globl	_Z5trainPKcPiPdS2_S1_iidd
	.type	_Z5trainPKcPiPdS2_S1_iidd,@function
_Z5trainPKcPiPdS2_S1_iidd:              # @_Z5trainPKcPiPdS2_S1_iidd
	.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	$232, %rsp
	.cfi_def_cfa_offset 288
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movsd	%xmm1, 120(%rsp)                # 8-byte Spill
	movsd	%xmm0, 104(%rsp)                # 8-byte Spill
                                        # kill: def $r9d killed $r9d def $r9
	movq	%r8, %r14
	movq	%rcx, 64(%rsp)                  # 8-byte Spill
	movq	%rdx, 72(%rsp)                  # 8-byte Spill
	movq	%rsi, 152(%rsp)                 # 8-byte Spill
	movq	%rdi, 144(%rsp)                 # 8-byte Spill
	movslq	(%r8), %rax
	movq	%rax, 56(%rsp)                  # 8-byte Spill
	movq	%r9, 40(%rsp)                   # 8-byte Spill
	movslq	%r9d, %rbx
	xorl	%edx, %edx
	cmpl	$2, %ebx
	jb	.LBB10_3
# %bb.1:                                # %.lr.ph.i.preheader
	xorl	%edx, %edx
	movl	$1, %eax
.LBB10_2:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movl	-4(%r14,%rax,4), %ecx
	incl	%ecx
	imull	(%r14,%rax,4), %ecx
	addl	%ecx, %edx
	incq	%rax
	cmpq	%rax, %rbx
	jne	.LBB10_2
.LBB10_3:                               # %_Z10param_sizePii.exit
	movl	%edx, 52(%rsp)                  # 4-byte Spill
	imulq	$800, 56(%rsp), %rdi            # 8-byte Folded Reload
                                        # imm = 0x320
	callq	malloc
	movq	%rax, 80(%rsp)                  # 8-byte Spill
	xorl	%esi, %esi
	cmpl	$0, 40(%rsp)                    # 4-byte Folded Reload
	je	.LBB10_4
# %bb.5:                                # %.lr.ph.i174.preheader
	xorl	%eax, %eax
.LBB10_6:                               # %.lr.ph.i174
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%r14,%rax,4), %rcx
	movslq	%esi, %rsi
	addq	%rcx, %rsi
	incq	%rax
	cmpq	%rax, %rbx
	jne	.LBB10_6
# %bb.7:                                # %_Z9data_sizePii.exit.loopexit
	movq	%rbx, %r15
	shlq	$3, %rsi
	jmp	.LBB10_8
.LBB10_4:
	movq	%rbx, %r15
.LBB10_8:                               # %_Z9data_sizePii.exit
	leaq	24(%rsp), %rdi
	callq	hipMalloc
	cmpl	$0, 288(%rsp)
	je	.LBB10_59
# %bb.9:                                # %.preheader238.lr.ph
	movslq	288(%rsp), %rax
	movq	%rax, 112(%rsp)                 # 8-byte Spill
	movslq	52(%rsp), %rax                  # 4-byte Folded Reload
	leaq	(,%rax,8), %rcx
	movq	%rcx, 136(%rsp)                 # 8-byte Spill
	movq	56(%rsp), %rcx                  # 8-byte Reload
	leaq	(,%rcx,8), %rcx
	movq	%rcx, 192(%rsp)                 # 8-byte Spill
	movq	40(%rsp), %rbx                  # 8-byte Reload
	leal	-1(%rbx), %ecx
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	movslq	%ecx, %rax
	movq	%rax, 184(%rsp)                 # 8-byte Spill
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI10_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rax
	movl	%eax, %eax
	btsq	$32, %rax
	movq	%rax, 128(%rsp)                 # 8-byte Spill
	leaq	-1(%r15), %rax
	movq	%rax, 168(%rsp)                 # 8-byte Spill
	movl	%ebx, %eax
	movq	%rax, 224(%rsp)                 # 8-byte Spill
	addq	$-2, %r15
	movq	%r15, 176(%rsp)                 # 8-byte Spill
	movl	$1, %eax
.LBB10_12:                              # %.preheader238
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_13 Depth 2
                                        #       Child Loop BB10_14 Depth 3
                                        #         Child Loop BB10_16 Depth 4
                                        #           Child Loop BB10_18 Depth 5
                                        #           Child Loop BB10_20 Depth 5
                                        #           Child Loop BB10_23 Depth 5
                                        #         Child Loop BB10_30 Depth 4
                                        #         Child Loop BB10_33 Depth 4
                                        #         Child Loop BB10_36 Depth 4
                                        #         Child Loop BB10_39 Depth 4
                                        #           Child Loop BB10_40 Depth 5
                                        #           Child Loop BB10_44 Depth 5
                                        #           Child Loop BB10_46 Depth 5
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	xorl	%ebx, %ebx
.LBB10_13:                              #   Parent Loop BB10_12 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB10_14 Depth 3
                                        #         Child Loop BB10_16 Depth 4
                                        #           Child Loop BB10_18 Depth 5
                                        #           Child Loop BB10_20 Depth 5
                                        #           Child Loop BB10_23 Depth 5
                                        #         Child Loop BB10_30 Depth 4
                                        #         Child Loop BB10_33 Depth 4
                                        #         Child Loop BB10_36 Depth 4
                                        #         Child Loop BB10_39 Depth 4
                                        #           Child Loop BB10_40 Depth 5
                                        #           Child Loop BB10_44 Depth 5
                                        #           Child Loop BB10_46 Depth 5
	movq	64(%rsp), %rdi                  # 8-byte Reload
	xorl	%esi, %esi
	movq	136(%rsp), %rdx                 # 8-byte Reload
	callq	hipMemset
	movq	144(%rsp), %rdi                 # 8-byte Reload
	movq	80(%rsp), %rsi                  # 8-byte Reload
	movq	56(%rsp), %rdx                  # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	movl	$100, %ecx
	movl	%ebx, %r8d
	callq	_Z11read_imagesPKcPdiii
	movq	%rbx, 160(%rsp)                 # 8-byte Spill
	imulq	$400, %rbx, %rax                # imm = 0x190
	addq	152(%rsp), %rax                 # 8-byte Folded Reload
	movq	%rax, 200(%rsp)                 # 8-byte Spill
	xorpd	%xmm0, %xmm0
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	xorl	%eax, %eax
.LBB10_14:                              #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB10_16 Depth 4
                                        #           Child Loop BB10_18 Depth 5
                                        #           Child Loop BB10_20 Depth 5
                                        #           Child Loop BB10_23 Depth 5
                                        #         Child Loop BB10_30 Depth 4
                                        #         Child Loop BB10_33 Depth 4
                                        #         Child Loop BB10_36 Depth 4
                                        #         Child Loop BB10_39 Depth 4
                                        #           Child Loop BB10_40 Depth 5
                                        #           Child Loop BB10_44 Depth 5
                                        #           Child Loop BB10_46 Depth 5
	movq	24(%rsp), %rdi
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	imulq	56(%rsp), %rax                  # 8-byte Folded Reload
	movq	80(%rsp), %rcx                  # 8-byte Reload
	leaq	(%rcx,%rax,8), %rsi
	movq	192(%rsp), %rdx                 # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	cmpl	$2, 40(%rsp)                    # 4-byte Folded Reload
	jl	.LBB10_27
# %bb.15:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB10_14 Depth=3
	movl	$1, %ebx
	xorl	%r15d, %r15d
.LBB10_16:                              # %.lr.ph
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        # =>      This Loop Header: Depth=4
                                        #           Child Loop BB10_18 Depth 5
                                        #           Child Loop BB10_20 Depth 5
                                        #           Child Loop BB10_23 Depth 5
	xorl	%r12d, %r12d
	movl	$0, %ebp
	cmpq	$1, %rbx
	je	.LBB10_19
# %bb.17:                               # %.lr.ph.i177.preheader
                                        #   in Loop: Header=BB10_16 Depth=4
	xorl	%eax, %eax
	xorl	%ebp, %ebp
.LBB10_18:                              # %.lr.ph.i177
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        #         Parent Loop BB10_16 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	addl	(%r14,%rax), %ebp
	addq	$4, %rax
	cmpq	%rax, %r15
	jne	.LBB10_18
.LBB10_19:                              # %_Z8data_indiPi.exit
                                        #   in Loop: Header=BB10_16 Depth=4
	xorl	%eax, %eax
.LBB10_20:                              # %.lr.ph.i183
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        #         Parent Loop BB10_16 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movslq	(%r14,%rax,4), %rcx
	movslq	%r12d, %r12
	addq	%rcx, %r12
	incq	%rax
	cmpq	%rax, %rbx
	jne	.LBB10_20
# %bb.21:                               # %_Z8data_indiPi.exit188
                                        #   in Loop: Header=BB10_16 Depth=4
	xorl	%r13d, %r13d
	cmpq	$2, %rbx
	jb	.LBB10_24
# %bb.22:                               # %.lr.ph.i190.preheader
                                        #   in Loop: Header=BB10_16 Depth=4
	xorl	%eax, %eax
	xorl	%r13d, %r13d
.LBB10_23:                              # %.lr.ph.i190
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        #         Parent Loop BB10_16 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movl	(%r14,%rax), %ecx
	incl	%ecx
	imull	4(%r14,%rax), %ecx
	addl	%ecx, %r13d
	addq	$4, %rax
	cmpq	%rax, %r15
	jne	.LBB10_23
.LBB10_24:                              # %_Z9param_indiPi.exit
                                        #   in Loop: Header=BB10_16 Depth=4
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%r14,%rbx,4), %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI10_1(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rax
	movl	%eax, %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	leaq	128(%rax), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_26
# %bb.25:                               #   in Loop: Header=BB10_16 Depth=4
	movq	24(%rsp), %rax
	movslq	%ebp, %rcx
	leaq	(%rax,%rcx,8), %rdi
	leaq	(%rax,%r12,8), %rdx
	movl	-4(%r14,%rbx,4), %esi
	movl	(%r14,%rbx,4), %ecx
	movslq	%r13d, %rax
	movq	72(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%rax,8), %r8
	movl	%ebx, %r9d
	notl	%r9d
	addl	40(%rsp), %r9d                  # 4-byte Folded Reload
	callq	_Z22__device_stub__forwardPdiS_iS_i
.LBB10_26:                              #   in Loop: Header=BB10_16 Depth=4
	incq	%rbx
	addq	$4, %r15
	cmpq	224(%rsp), %rbx                 # 8-byte Folded Reload
	jne	.LBB10_16
.LBB10_27:                              # %._crit_edge
                                        #   in Loop: Header=BB10_14 Depth=3
	movq	184(%rsp), %r12                 # 8-byte Reload
	movslq	(%r14,%r12,4), %r15
	shlq	$3, %r15
	movq	%r15, %rdi
	callq	malloc
	movq	%rax, %rbp
	testl	%r12d, %r12d
	je	.LBB10_28
# %bb.29:                               # %.lr.ph.i195.preheader
                                        #   in Loop: Header=BB10_14 Depth=3
	xorl	%ecx, %ecx
	xorl	%eax, %eax
.LBB10_30:                              # %.lr.ph.i195
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	addl	(%r14,%rcx,4), %eax
	incq	%rcx
	cmpq	%rcx, %r12
	jne	.LBB10_30
	jmp	.LBB10_31
.LBB10_28:                              #   in Loop: Header=BB10_14 Depth=3
	xorl	%eax, %eax
.LBB10_31:                              # %_Z8data_indiPi.exit200
                                        #   in Loop: Header=BB10_14 Depth=3
	movslq	%eax, %r13
	shlq	$3, %r13
	movq	24(%rsp), %rsi
	addq	%r13, %rsi
	movq	%rbp, %rdi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	cmpl	$0, (%r14,%r12,4)
	movq	96(%rsp), %r15                  # 8-byte Reload
	jle	.LBB10_37
# %bb.32:                               # %.lr.ph251.preheader
                                        #   in Loop: Header=BB10_14 Depth=3
	xorpd	%xmm1, %xmm1
	xorl	%ebx, %ebx
.LBB10_33:                              # %.lr.ph251
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	movsd	(%rbp,%rbx,8), %xmm0            # xmm0 = mem[0],zero
	callq	exp
	movsd	16(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	addsd	%xmm0, %xmm1
	incq	%rbx
	movslq	(%r14,%r12,4), %rax
	cmpq	%rax, %rbx
	jl	.LBB10_33
# %bb.34:                               # %.preheader
                                        #   in Loop: Header=BB10_14 Depth=3
	testl	%eax, %eax
	jle	.LBB10_37
# %bb.35:                               # %.lr.ph254.preheader
                                        #   in Loop: Header=BB10_14 Depth=3
	xorl	%ebx, %ebx
.LBB10_36:                              # %.lr.ph254
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	movsd	(%rbp,%rbx,8), %xmm0            # xmm0 = mem[0],zero
	callq	exp
	movsd	16(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbp,%rbx,8)
	incq	%rbx
	movslq	(%r14,%r12,4), %rax
	cmpq	%rax, %rbx
	jl	.LBB10_36
.LBB10_37:                              # %._crit_edge255
                                        #   in Loop: Header=BB10_14 Depth=3
	movq	200(%rsp), %rbx                 # 8-byte Reload
	movslq	(%rbx,%r15,4), %rax
	movsd	(%rbp,%rax,8), %xmm0            # xmm0 = mem[0],zero
	callq	log
	movsd	%xmm0, 208(%rsp)                # 8-byte Spill
	movslq	(%rbx,%r15,4), %rax
	movsd	(%rbp,%rax,8), %xmm0            # xmm0 = mem[0],zero
	addsd	.LCPI10_2(%rip), %xmm0
	movsd	%xmm0, (%rbp,%rax,8)
	addq	24(%rsp), %r13
	movslq	(%r14,%r12,4), %rdx
	shlq	$3, %rdx
	movq	%r13, %rdi
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	cmpl	$2, 40(%rsp)                    # 4-byte Folded Reload
	jl	.LBB10_53
# %bb.38:                               # %.lr.ph260.preheader
                                        #   in Loop: Header=BB10_14 Depth=3
	movq	176(%rsp), %r15                 # 8-byte Reload
	movq	168(%rsp), %rax                 # 8-byte Reload
	movq	%rax, 16(%rsp)                  # 8-byte Spill
.LBB10_39:                              # %.lr.ph260
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        # =>      This Loop Header: Depth=4
                                        #           Child Loop BB10_40 Depth 5
                                        #           Child Loop BB10_44 Depth 5
                                        #           Child Loop BB10_46 Depth 5
	movq	16(%rsp), %rbp                  # 8-byte Reload
	xorl	%eax, %eax
	xorl	%r12d, %r12d
.LBB10_40:                              # %.lr.ph.i202
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        #         Parent Loop BB10_39 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movslq	(%r14,%rax,4), %rcx
	movslq	%r12d, %r12
	addq	%rcx, %r12
	incq	%rax
	cmpq	%rax, %rbp
	jne	.LBB10_40
# %bb.41:                               # %_Z8data_indiPi.exit207
                                        #   in Loop: Header=BB10_39 Depth=4
	movq	%rbp, %rax
	decq	%rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB10_42
# %bb.43:                               # %.lr.ph.i209.preheader
                                        #   in Loop: Header=BB10_39 Depth=4
	xorl	%eax, %eax
	xorl	%ebx, %ebx
.LBB10_44:                              # %.lr.ph.i209
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        #         Parent Loop BB10_39 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	addl	(%r14,%rax,4), %ebx
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB10_44
# %bb.45:                               # %.lr.ph.i216.preheader
                                        #   in Loop: Header=BB10_39 Depth=4
	xorl	%eax, %eax
	xorl	%r13d, %r13d
.LBB10_46:                              # %.lr.ph.i216
                                        #   Parent Loop BB10_12 Depth=1
                                        #     Parent Loop BB10_13 Depth=2
                                        #       Parent Loop BB10_14 Depth=3
                                        #         Parent Loop BB10_39 Depth=4
                                        # =>        This Inner Loop Header: Depth=5
	movl	(%r14,%rax,4), %ecx
	incl	%ecx
	imull	4(%r14,%rax,4), %ecx
	addl	%ecx, %r13d
	incq	%rax
	cmpq	%rax, %r15
	jne	.LBB10_46
	jmp	.LBB10_47
.LBB10_42:                              #   in Loop: Header=BB10_39 Depth=4
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
.LBB10_47:                              # %_Z9param_indiPi.exit220
                                        #   in Loop: Header=BB10_39 Depth=4
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%r14,%rbp,4), %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI10_1(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rax
	movl	%eax, %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	leaq	128(%rax), %rdx
	movl	$1, %esi
	movq	%rdx, 216(%rsp)                 # 8-byte Spill
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_49
# %bb.48:                               #   in Loop: Header=BB10_39 Depth=4
	movq	24(%rsp), %rax
	leaq	(%rax,%r12,8), %rdi
	movl	(%r14,%rbp,4), %esi
	movslq	%ebx, %rcx
	leaq	(%rax,%rcx,8), %rdx
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	(%r14,%rax,4), %ecx
	movslq	%r13d, %rax
	movq	72(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%rax,8), %r8
	movq	64(%rsp), %r9                   # 8-byte Reload
	leaq	(%r9,%rax,8), %r9
	movl	%ebp, (%rsp)
	movsd	104(%rsp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_Z29__device_stub__backward_part1PdiS_iS_S_id
.LBB10_49:                              #   in Loop: Header=BB10_39 Depth=4
	cmpq	$1, %rbp
	je	.LBB10_53
# %bb.50:                               #   in Loop: Header=BB10_39 Depth=4
	movq	16(%rsp), %rax                  # 8-byte Reload
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%r14,%rax,4), %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI10_1(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rax
	movl	%eax, %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	movl	$1, %esi
	movq	216(%rsp), %rdx                 # 8-byte Reload
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_52
# %bb.51:                               #   in Loop: Header=BB10_39 Depth=4
	movq	24(%rsp), %rax
	movslq	%r12d, %rcx
	leaq	(%rax,%rcx,8), %rdi
	movl	(%r14,%rbp,4), %esi
	movslq	%ebx, %rcx
	leaq	(%rax,%rcx,8), %rdx
	movq	16(%rsp), %rax                  # 8-byte Reload
	movl	(%r14,%rax,4), %ecx
	movslq	%r13d, %rax
	movq	72(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%rax,8), %r8
	movq	64(%rsp), %r9                   # 8-byte Reload
	leaq	(%r9,%rax,8), %r9
	movl	%ebp, (%rsp)
	movsd	104(%rsp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	callq	_Z29__device_stub__backward_part2PdiS_iS_S_id
.LBB10_52:                              #   in Loop: Header=BB10_39 Depth=4
	decq	%r15
	cmpq	$1, %rbp
	jg	.LBB10_39
.LBB10_53:                              # %._crit_edge261
                                        #   in Loop: Header=BB10_14 Depth=3
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	subsd	208(%rsp), %xmm0                # 8-byte Folded Reload
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	movq	96(%rsp), %rax                  # 8-byte Reload
	incq	%rax
	cmpq	$100, %rax
	jne	.LBB10_14
# %bb.54:                               #   in Loop: Header=BB10_13 Depth=2
	movabsq	$4294967296, %rax               # imm = 0x100000000
	leaq	512(%rax), %rdx
	movq	128(%rsp), %rdi                 # 8-byte Reload
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_56
# %bb.55:                               #   in Loop: Header=BB10_13 Depth=2
	movq	72(%rsp), %rdi                  # 8-byte Reload
	movq	64(%rsp), %rsi                  # 8-byte Reload
	movl	52(%rsp), %edx                  # 4-byte Reload
	movsd	120(%rsp), %xmm0                # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movl	$100, %ecx
	callq	_Z27__device_stub__update_paramPdS_idi
.LBB10_56:                              #   in Loop: Header=BB10_13 Depth=2
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	.LCPI10_3(%rip), %xmm0
	movq	160(%rsp), %rbx                 # 8-byte Reload
	imull	$-1030792151, %ebx, %eax        # imm = 0xC28F5C29
	rorl	$2, %eax
	cmpl	$42949672, %eax                 # imm = 0x28F5C28
	ja	.LBB10_58
# %bb.57:                               #   in Loop: Header=BB10_13 Depth=2
	movl	$.L.str.2, %edi
	movq	88(%rsp), %rsi                  # 8-byte Reload
	movl	288(%rsp), %edx
	movl	%ebx, %ecx
	movsd	%xmm0, 32(%rsp)                 # 8-byte Spill
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	movsd	32(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
.LBB10_58:                              #   in Loop: Header=BB10_13 Depth=2
	incq	%rbx
	cmpq	$600, %rbx                      # imm = 0x258
	jne	.LBB10_13
# %bb.10:                               # %.loopexit
                                        #   in Loop: Header=BB10_12 Depth=1
	movq	88(%rsp), %rax                  # 8-byte Reload
	cmpq	112(%rsp), %rax                 # 8-byte Folded Reload
	jae	.LBB10_59
# %bb.11:                               # %.loopexit
                                        #   in Loop: Header=BB10_12 Depth=1
	incq	%rax
	ucomisd	.LCPI10_4(%rip), %xmm0
	ja	.LBB10_12
.LBB10_59:                              # %._crit_edge287
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	80(%rsp), %rdi                  # 8-byte Reload
	callq	free
	addq	$232, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end10:
	.size	_Z5trainPKcPiPdS2_S1_iidd, .Lfunc_end10-_Z5trainPKcPiPdS2_S1_iidd
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z4testPKcPiPdS1_i
.LCPI11_0:
	.quad	0x3f80000000000000              # double 0.0078125
.LCPI11_1:
	.quad	0xbff0000000000000              # double -1
	.text
	.globl	_Z4testPKcPiPdS1_i
	.type	_Z4testPKcPiPdS1_i,@function
_Z4testPKcPiPdS1_i:                     # @_Z4testPKcPiPdS1_i
	.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	$120, %rsp
	.cfi_def_cfa_offset 176
	.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	%r8d, %ebx
	movq	%rcx, %r14
	movq	%rdx, 96(%rsp)                  # 8-byte Spill
	movq	%rsi, 88(%rsp)                  # 8-byte Spill
	movq	%rdi, 80(%rsp)                  # 8-byte Spill
	movslq	(%rcx), %rax
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	leaq	(,%rax,8), %rdi
	movq	%rdi, 64(%rsp)                  # 8-byte Spill
	callq	malloc
	movq	%rax, 32(%rsp)                  # 8-byte Spill
	xorl	%esi, %esi
	testl	%ebx, %ebx
	je	.LBB11_4
# %bb.1:                                # %.lr.ph.i.preheader
	movslq	%ebx, %rax
	xorl	%ecx, %ecx
.LBB11_2:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movslq	(%r14,%rcx,4), %rdx
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	incq	%rcx
	cmpq	%rcx, %rax
	jne	.LBB11_2
# %bb.3:                                # %_Z9data_sizePii.exit.loopexit
	shlq	$3, %rsi
.LBB11_4:                               # %_Z9data_sizePii.exit
	movq	%rsp, %rdi
	callq	hipMalloc
	leal	-1(%rbx), %eax
	movslq	%eax, %r12
	movl	%ebx, %eax
	movq	%rax, 104(%rsp)                 # 8-byte Spill
	xorl	%r13d, %r13d
	xorpd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)                  # 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rbx, 48(%rsp)                  # 8-byte Spill
	movq	%r12, 56(%rsp)                  # 8-byte Spill
.LBB11_5:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB11_7 Depth 2
                                        #       Child Loop BB11_9 Depth 3
                                        #       Child Loop BB11_11 Depth 3
                                        #       Child Loop BB11_14 Depth 3
                                        #     Child Loop BB11_21 Depth 2
                                        #     Child Loop BB11_32 Depth 2
                                        #     Child Loop BB11_26 Depth 2
	movl	%r15d, 28(%rsp)                 # 4-byte Spill
	movq	80(%rsp), %rdi                  # 8-byte Reload
	movq	32(%rsp), %r15                  # 8-byte Reload
	movq	%r15, %rsi
	movq	72(%rsp), %rdx                  # 8-byte Reload
                                        # kill: def $edx killed $edx killed $rdx
	movl	$1, %ecx
	movq	%r13, 40(%rsp)                  # 8-byte Spill
	movl	%r13d, %r8d
	callq	_Z11read_imagesPKcPdiii
	movq	(%rsp), %rdi
	movq	%r15, %rsi
	movq	64(%rsp), %rdx                  # 8-byte Reload
	movl	$1, %ecx
	callq	hipMemcpy
	cmpl	$2, %ebx
	jl	.LBB11_18
# %bb.6:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB11_5 Depth=1
	movl	$1, %r13d
	xorl	%ebp, %ebp
.LBB11_7:                               # %.lr.ph
                                        #   Parent Loop BB11_5 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB11_9 Depth 3
                                        #       Child Loop BB11_11 Depth 3
                                        #       Child Loop BB11_14 Depth 3
	xorl	%r15d, %r15d
	movl	$0, %r12d
	cmpq	$1, %r13
	je	.LBB11_10
# %bb.8:                                # %.lr.ph.i97.preheader
                                        #   in Loop: Header=BB11_7 Depth=2
	xorl	%eax, %eax
	xorl	%r12d, %r12d
.LBB11_9:                               # %.lr.ph.i97
                                        #   Parent Loop BB11_5 Depth=1
                                        #     Parent Loop BB11_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	addl	(%r14,%rax), %r12d
	addq	$4, %rax
	cmpq	%rax, %rbp
	jne	.LBB11_9
.LBB11_10:                              # %_Z8data_indiPi.exit
                                        #   in Loop: Header=BB11_7 Depth=2
	xorl	%eax, %eax
.LBB11_11:                              # %.lr.ph.i103
                                        #   Parent Loop BB11_5 Depth=1
                                        #     Parent Loop BB11_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movslq	(%r14,%rax,4), %rcx
	movslq	%r15d, %r15
	addq	%rcx, %r15
	incq	%rax
	cmpq	%rax, %r13
	jne	.LBB11_11
# %bb.12:                               # %_Z8data_indiPi.exit108
                                        #   in Loop: Header=BB11_7 Depth=2
	xorl	%ebx, %ebx
	cmpq	$2, %r13
	jb	.LBB11_15
# %bb.13:                               # %.lr.ph.i109.preheader
                                        #   in Loop: Header=BB11_7 Depth=2
	xorl	%eax, %eax
	xorl	%ebx, %ebx
.LBB11_14:                              # %.lr.ph.i109
                                        #   Parent Loop BB11_5 Depth=1
                                        #     Parent Loop BB11_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	(%r14,%rax), %ecx
	incl	%ecx
	imull	4(%r14,%rax), %ecx
	addl	%ecx, %ebx
	addq	$4, %rax
	cmpq	%rax, %rbp
	jne	.LBB11_14
.LBB11_15:                              # %_Z9param_indiPi.exit
                                        #   in Loop: Header=BB11_7 Depth=2
	xorps	%xmm0, %xmm0
	cvtsi2ssl	(%r14,%r13,4), %xmm0
	cvtss2sd	%xmm0, %xmm0
	mulsd	.LCPI11_0(%rip), %xmm0
	callq	ceil@PLT
	cvttsd2si	%xmm0, %rax
	movl	%eax, %edi
	movabsq	$4294967296, %rax               # imm = 0x100000000
	orq	%rax, %rdi
	leaq	128(%rax), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_17
# %bb.16:                               #   in Loop: Header=BB11_7 Depth=2
	movq	(%rsp), %rax
	movslq	%r12d, %rcx
	leaq	(%rax,%rcx,8), %rdi
	leaq	(%rax,%r15,8), %rdx
	movl	-4(%r14,%r13,4), %esi
	movl	(%r14,%r13,4), %ecx
	movslq	%ebx, %rax
	movq	96(%rsp), %r8                   # 8-byte Reload
	leaq	(%r8,%rax,8), %r8
	movl	%r13d, %r9d
	notl	%r9d
	addl	48(%rsp), %r9d                  # 4-byte Folded Reload
	callq	_Z22__device_stub__forwardPdiS_iS_i
.LBB11_17:                              #   in Loop: Header=BB11_7 Depth=2
	incq	%r13
	addq	$4, %rbp
	cmpq	104(%rsp), %r13                 # 8-byte Folded Reload
	jne	.LBB11_7
.LBB11_18:                              # %._crit_edge
                                        #   in Loop: Header=BB11_5 Depth=1
	movq	56(%rsp), %r12                  # 8-byte Reload
	movslq	(%r14,%r12,4), %r13
	shlq	$3, %r13
	movq	%r13, %rdi
	callq	malloc
	movq	%rax, %rbp
	testl	%r12d, %r12d
	je	.LBB11_19
# %bb.20:                               # %.lr.ph.i112.preheader
                                        #   in Loop: Header=BB11_5 Depth=1
	xorl	%ecx, %ecx
	xorl	%eax, %eax
.LBB11_21:                              # %.lr.ph.i112
                                        #   Parent Loop BB11_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	addl	(%r14,%rcx,4), %eax
	incq	%rcx
	cmpq	%rcx, %r12
	jne	.LBB11_21
	jmp	.LBB11_22
.LBB11_19:                              #   in Loop: Header=BB11_5 Depth=1
	xorl	%eax, %eax
.LBB11_22:                              # %_Z8data_indiPi.exit117
                                        #   in Loop: Header=BB11_5 Depth=1
	movslq	%eax, %rsi
	shlq	$3, %rsi
	addq	(%rsp), %rsi
	movq	%rbp, %rdi
	movq	%r13, %rdx
	movl	$2, %ecx
	callq	hipMemcpy
	movl	$-1, %r15d
	cmpl	$0, (%r14,%r12,4)
	jle	.LBB11_23
# %bb.31:                               # %.lr.ph127.preheader
                                        #   in Loop: Header=BB11_5 Depth=1
	xorps	%xmm1, %xmm1
	xorl	%ebx, %ebx
	movq	40(%rsp), %r13                  # 8-byte Reload
.LBB11_32:                              # %.lr.ph127
                                        #   Parent Loop BB11_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	movsd	(%rbp,%rbx,8), %xmm0            # xmm0 = mem[0],zero
	callq	exp
	movsd	16(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	addsd	%xmm0, %xmm1
	incq	%rbx
	movslq	(%r14,%r12,4), %rax
	cmpq	%rax, %rbx
	jl	.LBB11_32
# %bb.24:                               # %.preheader
                                        #   in Loop: Header=BB11_5 Depth=1
	testl	%eax, %eax
	jle	.LBB11_27
# %bb.25:                               # %.lr.ph131.preheader
                                        #   in Loop: Header=BB11_5 Depth=1
	movl	$-1, %r15d
	xorl	%ebx, %ebx
	movsd	.LCPI11_1(%rip), %xmm0          # xmm0 = mem[0],zero
.LBB11_26:                              # %.lr.ph131
                                        #   Parent Loop BB11_5 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm0, 112(%rsp)                # 8-byte Spill
	movsd	%xmm1, 16(%rsp)                 # 8-byte Spill
	movsd	(%rbp,%rbx,8), %xmm0            # xmm0 = mem[0],zero
	callq	exp
	movsd	16(%rsp), %xmm1                 # 8-byte Reload
                                        # xmm1 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbp,%rbx,8)
	movsd	112(%rsp), %xmm2                # 8-byte Reload
                                        # xmm2 = mem[0],zero
	ucomisd	%xmm2, %xmm0
	maxsd	%xmm2, %xmm0
	cmoval	%ebx, %r15d
	incq	%rbx
	movslq	(%r14,%r12,4), %rax
	cmpq	%rax, %rbx
	jl	.LBB11_26
	jmp	.LBB11_27
.LBB11_23:                              #   in Loop: Header=BB11_5 Depth=1
	movq	40(%rsp), %r13                  # 8-byte Reload
.LBB11_27:                              # %._crit_edge132
                                        #   in Loop: Header=BB11_5 Depth=1
	movq	88(%rsp), %rax                  # 8-byte Reload
	movslq	(%rax,%r13,4), %rax
	xorl	%ecx, %ecx
	cmpl	%eax, %r15d
	sete	%cl
	movl	28(%rsp), %r15d                 # 4-byte Reload
	addl	%ecx, %r15d
	movsd	(%rbp,%rax,8), %xmm0            # xmm0 = mem[0],zero
	callq	log
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	subsd	%xmm0, %xmm1
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	incq	%r13
	imull	$652835029, %r13d, %eax         # imm = 0x26E978D5
	rorl	$3, %eax
	cmpl	$4294967, %eax                  # imm = 0x418937
	ja	.LBB11_29
# %bb.28:                               #   in Loop: Header=BB11_5 Depth=1
	xorps	%xmm1, %xmm1
	cvtsi2sd	%r13d, %xmm1
	xorps	%xmm2, %xmm2
	cvtsi2ss	%r15d, %xmm2
	cvtsi2ss	%r13d, %xmm3
	movsd	8(%rsp), %xmm0                  # 8-byte Reload
                                        # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	divss	%xmm3, %xmm2
	xorps	%xmm1, %xmm1
	cvtss2sd	%xmm2, %xmm1
	movl	$.L.str.3, %edi
	movl	%r13d, %esi
	movb	$2, %al
	callq	printf
.LBB11_29:                              #   in Loop: Header=BB11_5 Depth=1
	cmpq	$10000, %r13                    # imm = 0x2710
	movq	48(%rsp), %rbx                  # 8-byte Reload
	jne	.LBB11_5
# %bb.30:
	movq	(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi                  # 8-byte Reload
	callq	free
	addq	$120, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_Z4testPKcPiPdS1_i, .Lfunc_end11-_Z4testPKcPiPdS1_i
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI12_0:
	.byte	46                              # 0x2e
	.byte	47                              # 0x2f
	.byte	109                             # 0x6d
	.byte	110                             # 0x6e
	.byte	105                             # 0x69
	.byte	115                             # 0x73
	.byte	116                             # 0x74
	.byte	95                              # 0x5f
	.byte	100                             # 0x64
	.byte	97                              # 0x61
	.byte	116                             # 0x74
	.byte	97                              # 0x61
	.byte	47                              # 0x2f
	.byte	116                             # 0x74
	.byte	114                             # 0x72
	.byte	97                              # 0x61
.LCPI12_1:
	.byte	46                              # 0x2e
	.byte	47                              # 0x2f
	.byte	109                             # 0x6d
	.byte	110                             # 0x6e
	.byte	105                             # 0x69
	.byte	115                             # 0x73
	.byte	116                             # 0x74
	.byte	95                              # 0x5f
	.byte	100                             # 0x64
	.byte	97                              # 0x61
	.byte	116                             # 0x74
	.byte	97                              # 0x61
	.byte	47                              # 0x2f
	.byte	116                             # 0x74
	.byte	101                             # 0x65
	.byte	115                             # 0x73
.LCPI12_2:
	.long	784                             # 0x310
	.long	300                             # 0x12c
	.long	100                             # 0x64
	.long	10                              # 0xa
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI12_3:
	.quad	0x4008000000000000              # double 3
.LCPI12_4:
	.quad	0x41dfffffffc00000              # double 2147483647
.LCPI12_5:
	.quad	0x3f40624dd2f1a9fc              # double 5.0000000000000001E-4
.LCPI12_6:
	.quad	0x3f847ae147ae147b              # double 0.01
.LCPI12_7:
	.quad	0x0000000000000000              # double 0
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$264, %rsp                      # imm = 0x108
	.cfi_def_cfa_offset 320
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movaps	.LCPI12_0(%rip), %xmm0          # xmm0 = [46,47,109,110,105,115,116,95,100,97,116,97,47,116,114,97]
	movaps	%xmm0, 224(%rsp)
	movabsq	$7306916042979110505, %rax      # imm = 0x6567616D695F6E69
	movq	%rax, 240(%rsp)
	movl	$1935879795, %eax               # imm = 0x73632E73
	movl	%eax, 248(%rsp)
	movw	$118, %cx
	movw	%cx, 252(%rsp)
	movaps	%xmm0, 192(%rsp)
	movabsq	$7810757299313536617, %rdx      # imm = 0x6C6562616C5F6E69
	movq	%rdx, 208(%rsp)
	movl	%eax, 216(%rsp)
	movw	%cx, 220(%rsp)
	movaps	.LCPI12_1(%rip), %xmm0          # xmm0 = [46,47,109,110,105,115,116,95,100,97,116,97,47,116,101,115]
	movaps	%xmm0, 160(%rsp)
	movabsq	$8315165955154599796, %rax      # imm = 0x736567616D695F74
	movq	%rax, 176(%rsp)
	movl	$1987273518, %eax               # imm = 0x7673632E
	movl	%eax, 184(%rsp)
	xorl	%ebx, %ebx
	movb	%bl, 188(%rsp)
	movaps	%xmm0, 128(%rsp)
	movabsq	$8317134085062156148, %rcx      # imm = 0x736C6562616C5F74
	movq	%rcx, 144(%rsp)
	movl	%eax, 152(%rsp)
	movb	%bl, 156(%rsp)
	cmpl	$1, %edi
	jle	.LBB12_20
# %bb.1:
	movq	8(%rsi), %rdi
	callq	atoi
	movl	%eax, 44(%rsp)                  # 4-byte Spill
	movapd	.LCPI12_2(%rip), %xmm0          # xmm0 = [784,300,100,10]
	movapd	%xmm0, 48(%rsp)
	movl	$1, %eax
.LBB12_2:                               # %.lr.ph.i
                                        # =>This Inner Loop Header: Depth=1
	movl	44(%rsp,%rax,4), %ecx
	incl	%ecx
	imull	48(%rsp,%rax,4), %ecx
	addl	%ecx, %ebx
	incq	%rax
	cmpq	$4, %rax
	jne	.LBB12_2
# %bb.3:                                # %_Z10param_sizePii.exit
	shll	$3, %ebx
	movl	$240000, %edi                   # imm = 0x3A980
	callq	malloc
	leaq	192(%rsp), %rdi
	movq	%rax, 96(%rsp)                  # 8-byte Spill
	movq	%rax, %rsi
	movl	$60000, %edx                    # imm = 0xEA60
	callq	_Z11read_labelsPKcPii
	movslq	%ebx, %rbx
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	movq	%rbx, %rdi
	callq	malloc
	movq	%rax, 88(%rsp)                  # 8-byte Spill
	leaq	8(%rsp), %rdi
	movq	%rbx, %rsi
	callq	hipMalloc
	leaq	32(%rsp), %rdi
	movq	%rbx, 80(%rsp)                  # 8-byte Spill
	movq	%rbx, %rsi
	callq	hipMalloc
	movl	$1, %edi
	callq	srandom
	movl	$1, %ebx
	movl	$784, %r15d                     # imm = 0x310
	xorl	%r14d, %r14d
.LBB12_4:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB12_9 Depth 2
                                        #     Child Loop BB12_14 Depth 2
                                        #       Child Loop BB12_16 Depth 3
	xorps	%xmm0, %xmm0
	cvtsi2ss	%r15d, %xmm0
	xorps	%xmm1, %xmm1
	cvtss2sd	%xmm0, %xmm1
	movsd	.LCPI12_3(%rip), %xmm0          # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	ucomisd	.LCPI12_7(%rip), %xmm0
	jb	.LBB12_6
# %bb.5:                                #   in Loop: Header=BB12_4 Depth=1
	sqrtsd	%xmm0, %xmm0
	jmp	.LBB12_7
.LBB12_6:                               # %call.sqrt
                                        #   in Loop: Header=BB12_4 Depth=1
	callq	sqrt
.LBB12_7:                               # %.split
                                        #   in Loop: Header=BB12_4 Depth=1
	xorl	%eax, %eax
	cmpq	$2, %rbx
	jb	.LBB12_10
# %bb.8:                                # %.lr.ph.i53.preheader
                                        #   in Loop: Header=BB12_4 Depth=1
	xorl	%ecx, %ecx
	xorl	%eax, %eax
.LBB12_9:                               # %.lr.ph.i53
                                        #   Parent Loop BB12_4 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	48(%rsp,%rcx), %edx
	incl	%edx
	imull	52(%rsp,%rcx), %edx
	addl	%edx, %eax
	addq	$4, %rcx
	cmpq	%rcx, %r14
	jne	.LBB12_9
.LBB12_10:                              # %_Z9param_indiPi.exit
                                        #   in Loop: Header=BB12_4 Depth=1
	movq	%r14, 104(%rsp)                 # 8-byte Spill
	movq	%rbx, 112(%rsp)                 # 8-byte Spill
	movslq	48(%rsp,%rbx,4), %rcx
	movl	%ecx, %r12d
	movslq	%eax, %rbx
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	testq	%rcx, %rcx
	movsd	%xmm0, 72(%rsp)                 # 8-byte Spill
	jle	.LBB12_12
# %bb.11:                               # %.lr.ph.preheader
                                        #   in Loop: Header=BB12_4 Depth=1
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(%rax,%rbx,8), %rdi
	leaq	(,%r12,8), %rdx
	xorl	%esi, %esi
	callq	memset@PLT
	movsd	72(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
.LBB12_12:                              # %.preheader57
                                        #   in Loop: Header=BB12_4 Depth=1
	testl	%r15d, %r15d
	jle	.LBB12_18
# %bb.13:                               # %.preheader.lr.ph
                                        #   in Loop: Header=BB12_4 Depth=1
	movapd	%xmm0, %xmm2
	addsd	%xmm0, %xmm2
	incl	%r15d
	shlq	$3, %rbx
	movq	24(%rsp), %r14                  # 8-byte Reload
	leaq	(%rbx,%r14,8), %rbx
	shlq	$3, %r14
	addq	16(%rsp), %rbx                  # 8-byte Folded Reload
	movl	$1, %ebp
	movsd	%xmm2, 120(%rsp)                # 8-byte Spill
.LBB12_14:                              # %.preheader
                                        #   Parent Loop BB12_4 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB12_16 Depth 3
	cmpl	$0, 24(%rsp)                    # 4-byte Folded Reload
	jle	.LBB12_17
# %bb.15:                               # %.lr.ph62
                                        #   in Loop: Header=BB12_14 Depth=2
	xorl	%r13d, %r13d
.LBB12_16:                              #   Parent Loop BB12_4 Depth=1
                                        #     Parent Loop BB12_14 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	callq	random
	movsd	120(%rsp), %xmm2                # 8-byte Reload
                                        # xmm2 = mem[0],zero
	movsd	72(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	xorps	%xmm1, %xmm1
	cvtsi2sd	%rax, %xmm1
	mulsd	%xmm2, %xmm1
	divsd	.LCPI12_4(%rip), %xmm1
	subsd	%xmm0, %xmm1
	movsd	%xmm1, (%rbx,%r13,8)
	incq	%r13
	cmpq	%r13, %r12
	jne	.LBB12_16
.LBB12_17:                              # %._crit_edge
                                        #   in Loop: Header=BB12_14 Depth=2
	incq	%rbp
	addq	%r14, %rbx
	cmpq	%r15, %rbp
	jne	.LBB12_14
.LBB12_18:                              # %._crit_edge65
                                        #   in Loop: Header=BB12_4 Depth=1
	movq	112(%rsp), %rbx                 # 8-byte Reload
	incq	%rbx
	movq	104(%rsp), %r14                 # 8-byte Reload
	addq	$4, %r14
	movq	24(%rsp), %r13                  # 8-byte Reload
	movl	%r13d, %r15d
	cmpq	$4, %rbx
	jne	.LBB12_4
# %bb.19:
	movq	88(%rsp), %r15                  # 8-byte Reload
	movq	%r15, %rdi
	xorl	%esi, %esi
	movq	80(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rdx
	callq	memset@PLT
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rbx                  # 8-byte Reload
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	hipMemcpy
	movq	8(%rsp), %rdx
	movq	32(%rsp), %rcx
	movl	44(%rsp), %eax                  # 4-byte Reload
	movl	%eax, (%rsp)
	leaq	224(%rsp), %rdi
	leaq	48(%rsp), %r12
	movsd	.LCPI12_5(%rip), %xmm0          # xmm0 = mem[0],zero
	movsd	.LCPI12_6(%rip), %xmm1          # xmm1 = mem[0],zero
	movq	96(%rsp), %r14                  # 8-byte Reload
	movq	%r14, %rsi
	movq	%r12, %r8
	movl	$4, %r9d
	callq	_Z5trainPKcPiPdS2_S1_iidd
	movq	%r15, %rdi
	callq	free
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	%r14, %rdi
	callq	free
	movl	$40000, %edi                    # imm = 0x9C40
	callq	malloc
	movq	%rax, %r14
	leaq	128(%rsp), %rdi
	movq	%rax, %rsi
	movl	$10000, %edx                    # imm = 0x2710
	callq	_Z11read_labelsPKcPii
	movq	8(%rsp), %rdx
	leaq	160(%rsp), %rdi
	movq	%r14, %rsi
	movq	%r12, %rcx
	movl	$4, %r8d
	callq	_Z4testPKcPiPdS1_i
	movq	%rbx, %rdi
	callq	free
	movq	8(%rsp), %rdi
	callq	hipFree
	movq	%r14, %rdi
	callq	free
	xorl	%eax, %eax
	addq	$264, %rsp                      # imm = 0x108
	.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
.LBB12_20:
	.cfi_def_cfa_offset 320
	movl	$.Lstr, %edi
	callq	puts@PLT
	movl	$1, %edi
	callq	exit
.Lfunc_end12:
	.size	main, .Lfunc_end12-main
	.cfi_endproc
                                        # -- End function
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -16
	movq	__hip_gpubin_handle(%rip), %rbx
	testq	%rbx, %rbx
	jne	.LBB13_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB13_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7forwardPdiS_iS_i, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14backward_part1PdiS_iS_S_id, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14backward_part2PdiS_iS_S_id, %esi
	movl	$.L__unnamed_3, %edx
	movl	$.L__unnamed_3, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z12update_paramPdS_idi, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end13:
	.size	__hip_module_ctor, .Lfunc_end13-__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	.LBB14_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
.LBB14_2:
	retq
.Lfunc_end14:
	.size	__hip_module_dtor, .Lfunc_end14-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"r"
	.size	.L.str, 2

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

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

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

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

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

	.type	.L.str.2,@object                # @.str.2
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.2:
	.asciz	"Ep: %zu/%d\t batch:%d \t train loss: %f\n"
	.size	.L.str.2, 39

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"Test set size: %d\tloss: %f\taccuracy:%f\n"
	.size	.L.str.3, 40

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7forwardPdiS_iS_i"
	.size	.L__unnamed_1, 20

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z14backward_part1PdiS_iS_S_id"
	.size	.L__unnamed_2, 31

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

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z12update_paramPdS_idi"
	.size	.L__unnamed_4, 24

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

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

	.type	.Lstr,@object                   # @str
	.section	.rodata.str1.1,"aMS",@progbits,1
.Lstr:
	.asciz	"Number of epochs is not given "
	.size	.Lstr, 31

	.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 _Z22__device_stub__forwardPdiS_iS_i
	.addrsig_sym _Z29__device_stub__backward_part1PdiS_iS_S_id
	.addrsig_sym _Z29__device_stub__backward_part2PdiS_iS_S_id
	.addrsig_sym _Z27__device_stub__update_paramPdS_idi
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z7forwardPdiS_iS_i
	.addrsig_sym _Z14backward_part1PdiS_iS_S_id
	.addrsig_sym _Z14backward_part2PdiS_iS_S_id
	.addrsig_sym _Z12update_paramPdS_idi
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7forwardPdiS_iS_i     ; -- Begin function _Z7forwardPdiS_iS_i
	.globl	_Z7forwardPdiS_iS_i
	.p2align	8
	.type	_Z7forwardPdiS_iS_i,@function
_Z7forwardPdiS_iS_i:                    ; @_Z7forwardPdiS_iS_i
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b32 s6, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_ashr_i32 s7, s6, 31
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_mov_b32_e32 v2, 0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u64_e64 s[6:7], v[1:2]
	s_cbranch_execz .LBB0_5
; %bb.1:
	s_clause 0x1
	s_load_b64 s[8:9], s[0:1], 0x20
	s_load_b32 s2, s[0:1], 0x8
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s9, v1, vcc_lo
	s_cmp_eq_u32 s2, 0
	global_load_b64 v[2:3], v[2:3], off
	s_cbranch_scc1 .LBB0_4
; %bb.2:                                ; %.lr.ph.preheader
	s_load_b64 s[4:5], s[0:1], 0x0
	s_lshl_b64 s[6:7], s[6:7], 3
	s_ashr_i32 s3, s2, 31
	s_add_u32 s8, s8, s6
	s_addc_u32 s9, s9, s7
	v_add_co_u32 v4, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s9, v1, vcc_lo
.LBB0_3:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[6:7], v[4:5], off
	s_waitcnt lgkmcnt(0)
	s_load_b64 s[8:9], s[4:5], 0x0
	v_add_co_u32 v4, vcc_lo, v4, s6
	s_add_u32 s2, s2, -1
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
	s_addc_u32 s3, s3, -1
	s_add_u32 s4, s4, 8
	s_addc_u32 s5, s5, 0
	s_cmp_lg_u64 s[2:3], 0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fma_f64 v[2:3], v[6:7], s[8:9], v[2:3]
	s_cbranch_scc1 .LBB0_3
.LBB0_4:                                ; %._crit_edge
	s_waitcnt vmcnt(0)
	s_delay_alu instid0(VALU_DEP_1)
	v_cmp_ge_f64_e32 vcc_lo, 0, v[2:3]
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x28
	s_load_b64 s[0:1], s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_cmp_gt_i32 s2, 0
	s_cselect_b32 s2, -1, 0
	s_delay_alu instid0(SALU_CYCLE_1)
	s_and_b32 s2, s2, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	v_cndmask_b32_e64 v3, v3, 0, s2
	v_cndmask_b32_e64 v2, v2, 0, s2
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	global_store_b64 v[0:1], v[2:3], off
.LBB0_5:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7forwardPdiS_iS_i
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z7forwardPdiS_iS_i, .Lfunc_end0-_Z7forwardPdiS_iS_i
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 336
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z14backward_part1PdiS_iS_S_id ; -- Begin function _Z14backward_part1PdiS_iS_S_id
	.globl	_Z14backward_part1PdiS_iS_S_id
	.p2align	8
	.type	_Z14backward_part1PdiS_iS_S_id,@function
_Z14backward_part1PdiS_iS_S_id:         ; @_Z14backward_part1PdiS_iS_S_id
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x4c
	s_load_b32 s8, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_ashr_i32 s9, s8, 31
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_mov_b32_e32 v2, 0
	s_mov_b32 s2, exec_lo
	s_delay_alu instid0(VALU_DEP_1)
	v_cmpx_gt_u64_e64 s[8:9], v[1:2]
	s_cbranch_execz .LBB1_4
; %bb.1:
	s_clause 0x1
	s_load_b64 s[10:11], s[0:1], 0x0
	s_load_b128 s[4:7], s[0:1], 0x20
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_load_b32 s2, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s10, v0
	v_add_co_ci_u32_e32 v3, vcc_lo, s11, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v1, vcc_lo
	s_cmp_eq_u32 s2, 0
	global_load_b64 v[2:3], v[2:3], off
	global_load_b64 v[6:7], v[4:5], off
	s_waitcnt vmcnt(0)
	v_add_f64 v[6:7], v[2:3], v[6:7]
	global_store_b64 v[4:5], v[6:7], off
	s_cbranch_scc1 .LBB1_4
; %bb.2:                                ; %.lr.ph
	s_clause 0x1
	s_load_b64 s[10:11], s[0:1], 0x38
	s_load_b64 s[0:1], s[0:1], 0x10
	s_lshl_b64 s[8:9], s[8:9], 3
	s_ashr_i32 s3, s2, 31
	s_add_u32 s6, s6, s8
	v_mov_b32_e32 v6, 0
	s_addc_u32 s7, s7, s9
	s_add_u32 s4, s4, s8
	s_addc_u32 s5, s5, s9
	s_waitcnt lgkmcnt(0)
	v_add_f64 v[4:5], s[10:11], s[10:11]
.LBB1_3:                                ; =>This Inner Loop Header: Depth=1
	v_add_co_u32 v7, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v8, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v11, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v12, vcc_lo, s7, v1, vcc_lo
	global_load_b64 v[7:8], v[7:8], off
	global_load_b64 v[9:10], v6, s[0:1]
	v_add_co_u32 v0, vcc_lo, v0, s8
	global_load_b64 v[13:14], v[11:12], off
	s_add_u32 s2, s2, -1
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	s_addc_u32 s3, s3, -1
	s_add_u32 s0, s0, 8
	s_addc_u32 s1, s1, 0
	s_cmp_lg_u64 s[2:3], 0
	s_waitcnt vmcnt(2)
	v_mul_f64 v[7:8], v[4:5], v[7:8]
	s_waitcnt vmcnt(1)
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[7:8], v[2:3], v[9:10], v[7:8]
	s_waitcnt vmcnt(0)
	v_add_f64 v[7:8], v[13:14], v[7:8]
	global_store_b64 v[11:12], v[7:8], off
	s_cbranch_scc1 .LBB1_3
.LBB1_4:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14backward_part1PdiS_iS_S_id
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 15
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end1:
	.size	_Z14backward_part1PdiS_iS_S_id, .Lfunc_end1-_Z14backward_part1PdiS_iS_S_id
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 384
; NumSgprs: 18
; NumVgprs: 15
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 15
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z14backward_part2PdiS_iS_S_id ; -- Begin function _Z14backward_part2PdiS_iS_S_id
	.globl	_Z14backward_part2PdiS_iS_S_id
	.p2align	8
	.type	_Z14backward_part2PdiS_iS_S_id,@function
_Z14backward_part2PdiS_iS_S_id:         ; @_Z14backward_part2PdiS_iS_S_id
; %bb.0:
	s_clause 0x1
	s_load_b32 s3, s[0:1], 0x4c
	s_load_b32 s2, s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s3, s3, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1)
	v_mad_u64_u32 v[4:5], null, s15, s3, v[0:1]
	v_mov_b32_e32 v5, 0
	s_ashr_i32 s3, s2, 31
	s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
	v_cmp_gt_u64_e32 vcc_lo, s[2:3], v[4:5]
	s_and_saveexec_b32 s2, vcc_lo
	s_cbranch_execz .LBB2_7
; %bb.1:
	s_load_b64 s[2:3], s[0:1], 0x10
	v_lshlrev_b64 v[0:1], 3, v[4:5]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v0, vcc_lo, s2, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s3, v1, vcc_lo
	global_load_b64 v[2:3], v[0:1], off
	s_waitcnt vmcnt(0)
	v_cmp_lt_f64_e32 vcc_lo, 0, v[2:3]
	v_mov_b32_e32 v2, 0
	v_mov_b32_e32 v3, 0
	s_and_saveexec_b32 s4, vcc_lo
	s_cbranch_execz .LBB2_6
; %bb.2:                                ; %.preheader
	s_load_b32 s2, s[0:1], 0x8
	s_waitcnt lgkmcnt(0)
	s_cmp_eq_u32 s2, 0
	s_cbranch_scc1 .LBB2_5
; %bb.3:                                ; %.lr.ph
	s_ashr_i32 s3, s2, 31
	s_load_b64 s[6:7], s[0:1], 0x20
	v_mad_u64_u32 v[2:3], null, s2, v4, s[2:3]
	s_load_b64 s[0:1], s[0:1], 0x0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[5:6], null, s3, v4, v[3:4]
	v_mov_b32_e32 v3, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_3) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[4:5], 3, v[2:3]
	v_mov_b32_e32 v2, 0
	v_mov_b32_e32 v3, 0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v4, vcc_lo, s6, v4
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v5, vcc_lo
.LBB2_4:                                ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[6:7], v[4:5], off
	s_load_b64 s[6:7], s[0:1], 0x0
	v_add_co_u32 v4, vcc_lo, v4, 8
	s_add_u32 s2, s2, -1
	v_add_co_ci_u32_e32 v5, vcc_lo, 0, v5, vcc_lo
	s_addc_u32 s3, s3, -1
	s_add_u32 s0, s0, 8
	s_addc_u32 s1, s1, 0
	s_cmp_lg_u64 s[2:3], 0
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fma_f64 v[2:3], s[6:7], v[6:7], v[2:3]
	s_cbranch_scc1 .LBB2_4
	s_branch .LBB2_6
.LBB2_5:
	v_mov_b32_e32 v2, 0
	v_mov_b32_e32 v3, 0
.LBB2_6:                                ; %.loopexit
	s_or_b32 exec_lo, exec_lo, s4
	global_store_b64 v[0:1], v[2:3], off
.LBB2_7:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14backward_part2PdiS_iS_S_id
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 8
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z14backward_part2PdiS_iS_S_id, .Lfunc_end2-_Z14backward_part2PdiS_iS_S_id
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 340
; NumSgprs: 18
; NumVgprs: 8
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 8
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z12update_paramPdS_idi ; -- Begin function _Z12update_paramPdS_idi
	.globl	_Z12update_paramPdS_idi
	.p2align	8
	.type	_Z12update_paramPdS_idi,@function
_Z12update_paramPdS_idi:                ; @_Z12update_paramPdS_idi
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x34
	s_load_b32 s3, s[0:1], 0x10
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	s_mov_b32 s2, exec_lo
	v_cmpx_gt_i32_e64 s3, v1
	s_cbranch_execz .LBB3_2
; %bb.1:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[2:3], s[0:1], 0x18
	v_ashrrev_i32_e32 v2, 31, v1
	s_load_b32 s0, s[0:1], 0x20
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 3, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s6, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s7, v1, vcc_lo
	v_cvt_f32_i32_e32 v4, s0
	v_add_co_u32 v0, vcc_lo, s4, v0
	global_load_b64 v[2:3], v[2:3], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	v_cvt_f64_f32_e32 v[4:5], v4
	global_load_b64 v[10:11], v[0:1], off
	s_waitcnt vmcnt(1)
	v_mul_f64 v[2:3], v[2:3], s[2:3]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_div_scale_f64 v[6:7], null, v[4:5], v[4:5], v[2:3]
	v_rcp_f64_e32 v[8:9], v[6:7]
	s_waitcnt_depctr 0xfff
	v_fma_f64 v[12:13], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[12:13], v[8:9]
	v_fma_f64 v[12:13], -v[6:7], v[8:9], 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f64 v[8:9], v[8:9], v[12:13], v[8:9]
	v_div_scale_f64 v[12:13], vcc_lo, v[2:3], v[4:5], v[2:3]
	v_mul_f64 v[14:15], v[12:13], v[8:9]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f64 v[6:7], -v[6:7], v[14:15], v[12:13]
	v_div_fmas_f64 v[6:7], v[6:7], v[8:9], v[14:15]
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_div_fixup_f64 v[2:3], v[6:7], v[4:5], v[2:3]
	s_waitcnt vmcnt(0)
	v_add_f64 v[2:3], v[10:11], -v[2:3]
	global_store_b64 v[0:1], v[2:3], off
.LBB3_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z12update_paramPdS_idi
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 296
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 16
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z12update_paramPdS_idi, .Lfunc_end3-_Z12update_paramPdS_idi
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 312
; NumSgprs: 18
; NumVgprs: 16
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 16
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
