#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <cuda_runtime.h>

#define ROW 773
#define COL 26
#define TRAIN_ROW 541
#define TEST_ROW 232
// define nodes
#define INPUT_NODES 26
#define HIDDEN_NODES 10
#define OUTPUT_NODES 1

#define ALPHA 0.1

// Activation Functions
__device__ float sigmoid_device(float x){
    return 1/(1 + exp(-x));
}
float sigmoid(float x){
    return 1/(1 + exp(-x));
}
__device__ float diff_Sigmoid(float x){
  return x * (1 - x);
}

__global__ void cuda_forward_1(float* input, float* weight1, float* layer1, float* bias_layer1){

  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < HIDDEN_NODES){
      float act = 0.0;
      for(int j = 0; j < INPUT_NODES; j++){
          act += input[j]*weight1[ind_x*INPUT_NODES + j] ;
      }
      layer1[ind_x] = sigmoid_device(act+ bias_layer1[ind_x]);
  }
}

__global__ void cuda_forward_2(float* weight2, float* layer1, float* layer2, float* bias_layer2){

  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < OUTPUT_NODES){
      float act = 0.0;
      for(int j = 0; j < HIDDEN_NODES; j++){
          act += layer1[j]*weight2[ind_x* HIDDEN_NODES + j] ;
      }
      layer2[ind_x] = sigmoid_device(act+ bias_layer2[ind_x]);
  }
}

__global__ void cuda_backprop_out(float* d3, float *layer2, float *label){

  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < OUTPUT_NODES){
    float err = layer2[ind_x] - label[ind_x];
    d3[ind_x] = err;
  }
  return;
}

__global__ void cuda_backprop_hidden(float* d2, float* layer1, float* weight2, float* d3){
  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < HIDDEN_NODES){
    float error_hidden = 0.0;
    for(int j = 0; j < OUTPUT_NODES; j++){
      error_hidden += d3[j]*weight2[j*HIDDEN_NODES + ind_x];
    }
      d2[ind_x] = error_hidden * (layer1[ind_x] * (1 - layer1[ind_x]));
  }
}

__global__ void update_weight2(float* weight2, float* layer1, float* d3){
  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < OUTPUT_NODES){
    for(int j = 0; j < HIDDEN_NODES; j++){
      weight2[ind_x*HIDDEN_NODES + j] -= layer1[j]*d3[ind_x]*ALPHA;
    }
  }
}

__global__ void update_weight1(float* weight1, float* input, float* d2){
  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < HIDDEN_NODES){
    for(int j = 0; j < INPUT_NODES; j++){
      weight1[ind_x*INPUT_NODES + j] -= input[j]*d2[ind_x]*ALPHA;
    }
  }
}

void predict(float *input_matrix,
            float *pred_arr,
            float *weight1,
            float *weight2,
            float layer1[HIDDEN_NODES],
            float layer2[OUTPUT_NODES])
            {

    //this will be each extracted input row
    float input[COL];
    //float output=0;

    // iterate through input matrix row by row, extracting each row for training
    for(int row = 0; row < TEST_ROW; row++){
        for(int col = 0; col < COL; col++){
            input[col] = input_matrix[row*COL + col];
        }

        // FORWARD PROPAGATION:
        for(int i = 0; i < HIDDEN_NODES; i++){
            float act = 0.0;
            for(int j = 0; j < INPUT_NODES; j++){
                act += input[j]*weight1[i * INPUT_NODES + j];
            }
            layer1[i] = sigmoid(act);
        }
        for(int i = 0; i < OUTPUT_NODES; i++){
            float act = 0.0;
            for(int j = 0; j < HIDDEN_NODES; j++){
                act += layer1[j]*weight2[i * HIDDEN_NODES + j];
            }
            layer2[i] = sigmoid(act);
        }

        //store predictions in an array
        for(int i = 0; i < OUTPUT_NODES; i++){
            if(layer2[i]>0.5){
                pred_arr[row] = 1;
            }
            else{
                pred_arr[row] = 0;
            }

        }
    }

    return;
}

float train_nn(float *input_matrix,
              float label[TRAIN_ROW],
              float *weight1,
              float *weight2,
              float layer1[HIDDEN_NODES],
              float layer2[OUTPUT_NODES],
              int p_epoch)
              {
    //this will be each extracted input row
    float input[COL];

    for(int epoch=0; epoch < p_epoch; epoch++){
      // iterate through input matrix row by row, extracting each row for training
      for(int row = 0; row < TRAIN_ROW; row++){
          for(int col = 0; col < COL; col++){
              input[col] = input_matrix[row*COL + col];
          }

          //this is for one row instance of forward and backprop
          // FORWARD PROPAGATION:
          for(int i = 0; i < HIDDEN_NODES; i++){
              float act = 0.0;
              for(int j = 0; j < INPUT_NODES; j++){
                  act += input[j]*weight1[i*INPUT_NODES + j];
              }
              layer1[i] = sigmoid(act);
          }
          for(int i = 0; i < OUTPUT_NODES; i++){
              float act = 0.0;
              for(int j = 0; j < HIDDEN_NODES; j++){
                  act += layer1[j]*weight2[i* HIDDEN_NODES + j];
              }
              layer2[i] = sigmoid(act);
          }
          // BACKPROPAGATION:

          // calculate errors
          float d3[OUTPUT_NODES];
          for(int i = 0; i < OUTPUT_NODES; i++){
              float error_output = layer2[i] - label[row];
              d3[i] = error_output;
          }
          float d2[HIDDEN_NODES];
          for(int i = 0; i < HIDDEN_NODES; i++){
              float error_hidden = 0.0;
              for(int j = 0; j < OUTPUT_NODES; j++){
                  error_hidden += d3[j]*weight2[j*HIDDEN_NODES + i];
              }
              d2[i] = error_hidden * (layer1[i] * (1 - layer1[i]));
          }

          // update weights
          for(int i = 0; i < OUTPUT_NODES; i++){
              for(int j = 0; j < HIDDEN_NODES; j++){
                  weight2[i*HIDDEN_NODES + j] -= layer1[j]*d3[i]*ALPHA;
              }
          }
          for(int i = 0; i < HIDDEN_NODES; i++){
              for(int j = 0; j < INPUT_NODES; j++){
                  weight1[i*INPUT_NODES + j] -= input[j]*d2[i]*ALPHA;
              }
          }
      }
    }

    return 0;
}

void import_data(float *train_arr, float *train_y_arr, float *test_arr , float *test_y_arr){
  FILE* str = fopen("train_data.csv", "r");

  char line[1024];
  int count = 0;
  while (fgets(line, 1024, str))
  {
    char* tmp = strdup(line);
    char* c = strtok(tmp,",");
    //train_arr[count] = new float[1];
    while(c != NULL){
      train_arr[count] = (float)atof(c);
      count ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }
  //IMPORT TRAINING LABELS

  FILE* str_y = fopen("train_y.csv", "r");

  char line_y[1024];
  int count_y = 0;
  while (fgets(line_y, 1024, str_y))
  {
    char* tmp = strdup(line_y);
    char* c = strtok(tmp,",");

    while(c != NULL){
      train_y_arr[count_y] = (float)atof(c);
      count_y ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }

  //IMPORT TESTING DATA

  FILE* str_t = fopen("test_data.csv", "r");

  char line_t[1024];
  int count_t = 0;
  while (fgets(line_t, 1024, str_t))
  {
    char* tmp = strdup(line_t);
    char* c = strtok(tmp,",");

    while(c != NULL){
      test_arr[count_t] = (float)atof(c);
      count_t ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }

  //IMPORT TEST LABELS

  FILE* str_ty = fopen("test_y.csv", "r");

  char line_ty[1024];
  int count_ty = 0;
  while (fgets(line_ty, 1024, str_ty))
  {
    char* tmp = strdup(line_ty);
    char* c = strtok(tmp,",");

    while(c != NULL){
      test_y_arr[count_ty] = (float)atof(c);
      count_ty ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }

}

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

  float train_arr[TRAIN_ROW*COL];
  float train_y_arr[TRAIN_ROW*1];
  float test_arr[TEST_ROW*COL];
  float test_y_arr[TEST_ROW*1];
  float weight_layer1[HIDDEN_NODES*INPUT_NODES];
  float weight_layer2[OUTPUT_NODES*HIDDEN_NODES];
  float bias_layer1[HIDDEN_NODES];
  float bias_layer2[OUTPUT_NODES];
  float layer1[HIDDEN_NODES];
  float layer2[OUTPUT_NODES];
  float d3[OUTPUT_NODES];
  float d2[HIDDEN_NODES];
  float** train_arr_device = new float*[TRAIN_ROW];
  float** train_arr_y_device = new float*[TRAIN_ROW];
  float* weight1_device;
  float* weight2_device;
  float* layer1_device;
  float* layer2_device;
  float* d3_device;
  float* d2_device;
  float* bias_layer1_device;
  float* bias_layer2_device;
  cudaDeviceReset();
  float** train_final = new float* [TRAIN_ROW];
  float** train_y_final = new float* [TRAIN_ROW];
  float *output = (float *)malloc(sizeof(TRAIN_ROW*sizeof(float)));
  float *output_test = (float *)malloc(sizeof(TEST_ROW*sizeof(float)));

  //IMPORT TRAINING DATA
  import_data(train_arr, train_y_arr, test_arr, test_y_arr);

  for (size_t i = 0; i < TRAIN_ROW; i++) {
    train_final[i] = new float[COL];
    train_y_final[i] = new float[COL];
    for (size_t j = 0; j < COL; j++) {
      train_final[i][j] = train_arr[i*COL + j];
    }
    for (size_t k = 0; k < 1; k++) {
      train_y_final[i][k] = train_y_arr[i];
    }
  }

  // generate random weights and biases
  for(int i = 0; i < HIDDEN_NODES; i++){
      for(int j = 0; j < INPUT_NODES; j++){
          weight_layer1[i*INPUT_NODES + j] = ((double)rand())/((double)RAND_MAX);
      }
  }
  for(int i = 0; i < OUTPUT_NODES; i++){
      for(int j = 0; j < HIDDEN_NODES; j++){
          weight_layer2[i*HIDDEN_NODES + j] = ((double)rand())/((double)RAND_MAX);
      }
  }
  for(int i = 0; i < HIDDEN_NODES; i++){
    bias_layer1[i] = ((double)rand())/((double)RAND_MAX);
  }
  for(int i = 0; i < OUTPUT_NODES; i++){
    bias_layer2[i] = ((double)rand())/((double)RAND_MAX);
  }

  for (size_t i = 0; i < TRAIN_ROW; i++) {
    cudaMalloc(&train_arr_device[i], sizeof(float)*COL);
    cudaMemcpy(train_arr_device[i], train_final[i], sizeof(float)*COL, cudaMemcpyHostToDevice);

    cudaMalloc(&train_arr_y_device[i], sizeof(float)*1);
    cudaMemcpy(train_arr_y_device[i], train_y_final[i], sizeof(float)*1, cudaMemcpyHostToDevice);
  }

  //cudaMalloc(&train_arr_y_device, sizeof(float)*TRAIN_ROW*1);
  //cudaMemcpy(train_arr_y_device, train_y_arr, sizeof(float)*TRAIN_ROW*1, cudaMemcpyHostToDevice);

  cudaMalloc(&weight1_device, sizeof(float)*HIDDEN_NODES*INPUT_NODES);
  cudaMemcpy(weight1_device, weight_layer1, sizeof(float)*HIDDEN_NODES*INPUT_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&weight2_device, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES);
  cudaMemcpy(weight2_device, weight_layer2, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&layer1_device, sizeof(float)*HIDDEN_NODES);
  cudaMemcpy(layer1_device, layer1, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&layer2_device, sizeof(float)*OUTPUT_NODES);
  cudaMemcpy(layer2_device, layer2, sizeof(float)*OUTPUT_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&d3_device, sizeof(float)*OUTPUT_NODES);
  cudaMemcpy(d3_device, d3, sizeof(float)*OUTPUT_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&d2_device, sizeof(float)*HIDDEN_NODES);
  cudaMemcpy(d2_device, d2, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&bias_layer1_device, sizeof(float)*HIDDEN_NODES);
  cudaMemcpy(bias_layer1_device, bias_layer1, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);

  cudaMalloc(&bias_layer2_device, sizeof(float)*HIDDEN_NODES);
  cudaMemcpy(bias_layer2_device, bias_layer2, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);

  // NEURAL NETWORK
  //ceil(541/14) = 39
  //ceil(26/14) = 2
  dim3 dimGrid(39,2,1);
	dim3 dimBlock(14,14,1);

  /*printf("%s\n","Weight Layer 1:" );
  for (size_t i = 0; i < HIDDEN_NODES; i++) {
    for (size_t j = 0; j < INPUT_NODES; j++) {
      printf("%f ",weight_layer1[i*INPUT_NODES + j] );
    }
    printf("\n");
  }
  printf("%s\n","Weight Layer 2:" );
  for (size_t i = 0; i < OUTPUT_NODES; i++) {
    for (size_t j = 0; j < HIDDEN_NODES; j++) {
      printf("%f ",weight_layer2[i*HIDDEN_NODES + j] );
    }
    printf("\n");
  }*/
  int epoch = 400;

  printf("                          TRAINING WITH %d EPOCHS:\n__________________________________________________________________________\n__________________________________________________________________________\n\n", epoch);

  cudaEvent_t beginLaunch, endLaunch;
  cudaEventCreate(&beginLaunch);
  cudaEventCreate(&endLaunch);
  cudaEventRecord(beginLaunch,0);
  float mse_total;
  float mse_old = 100000;
  float mse_difference = 100000;
  float mse_abs = 10000;
  int max_epoch = 0;
  while(mse_abs > 0.0001 && max_epoch < epoch){ //
  //for (size_t i = 0; i < epoch; i++) {
    mse_total = 0.0;

    for (size_t j = 0; j < TRAIN_ROW; j++) { //TRAIN_ROW

      cuda_forward_1<<<dimBlock , dimGrid>>>(train_arr_device[j], weight1_device, layer1_device, bias_layer1_device);
      //cudaMemcpy(layer1, layer1_device, sizeof(float)*HIDDEN_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(layer1_device, layer1, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      cuda_forward_2<<<dimBlock , dimGrid>>>(weight2_device, layer1_device, layer2_device, bias_layer2_device);
      //cudaMemcpy(layer2, layer2_device, sizeof(float)*OUTPUT_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(layer2_device, layer2, sizeof(float)*OUTPUT_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      cuda_backprop_out<<<dimBlock , dimGrid>>>(d3_device, layer2_device, train_arr_y_device[j]);
      cudaMemcpy(d3, d3_device, sizeof(float)*OUTPUT_NODES, cudaMemcpyDeviceToHost);
      cudaMemcpy(d3_device, d3, sizeof(float)*OUTPUT_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));
      mse_total += abs(0.5*d3[0]*d3[0]);
      //printf("%f\n", d3[0]);
      cuda_backprop_hidden<<<dimBlock , dimGrid>>>(d2_device, layer1_device, weight2_device, d3_device);
      //cudaMemcpy(d2, d2, sizeof(float)*HIDDEN_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(d2, d2, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      update_weight2<<<dimBlock , dimGrid>>>(weight2_device, layer1_device, d3_device);
      //cudaMemcpy(weight_layer2, weight2_device, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(weight2_device, weight_layer2, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      update_weight1<<<dimBlock , dimGrid>>>(weight1_device, train_arr_device[j], d2_device);
      //cudaMemcpy(weight_layer1, weight1_device, sizeof(float)*HIDDEN_NODES*INPUT_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(weight1_device, weight_layer1, sizeof(float)*HIDDEN_NODES*INPUT_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

    }
    printf("%f\n", mse_total);
    mse_difference = mse_old - mse_total;
    mse_abs = abs(mse_difference);
    mse_old = mse_total;
    max_epoch += 1;
    printf("MSE ABS DIFFERENCE FOR EPOCH: %f\n", mse_abs);

  }
  float mse_final = mse_total;
  cudaEventRecord(endLaunch,0);
  cudaEventSynchronize(endLaunch);
  cudaMemcpy(weight_layer1, weight1_device, sizeof(float)*HIDDEN_NODES*INPUT_NODES, cudaMemcpyDeviceToHost);
  cudaMemcpy(weight_layer2, weight2_device, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, cudaMemcpyDeviceToHost);


  float time_share = 0;
	cudaEventElapsedTime(&time_share, beginLaunch, endLaunch);
  printf("The time taken to train with %d epochs is: %fms\n", max_epoch, time_share);
  printf("MSE FINAL: %f\n", mse_final);
  //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));
  /*printf("%s\n","Weight Layer 1:" );
  for (size_t i = 0; i < HIDDEN_NODES; i++) {
    for (size_t j = 0; j < INPUT_NODES; j++) {
      printf("%f ",weight_layer1[i*INPUT_NODES + j] );
    }
    printf("\n");
  }
  printf("%s\n","Weight Layer 2:" );
  for (size_t i = 0; i < OUTPUT_NODES; i++) {
    for (size_t j = 0; j < HIDDEN_NODES; j++) {
      printf("%f ",weight_layer2[i*HIDDEN_NODES + j] );
    }
    printf("\n");
  }*/


  predict(test_arr, output, weight_layer1, weight_layer2, layer1, layer2);

  int count_final=0;

  for(int i = 0; i < TEST_ROW; i++){
    //printf("predicted %f\n", output[i]);
    //printf("actual %f\n", train_y_arr[i]);
    if(output[i] == test_y_arr[i]){
        count_final +=1;
    }
  }
  float prediction = (float)count_final/TEST_ROW;
  printf("The final prediction accuracy is: %f \n", prediction);
  free(output);
  cudaFree(train_arr_device);
  cudaFree(train_arr_y_device);
  cudaFree(weight1_device);
  cudaFree(weight2_device);
  cudaFree(bias_layer1_device);
  cudaFree(bias_layer2_device);
  cudaFree(layer1_device);
  cudaFree(layer2_device);
  cudaFree(d3_device);
  cudaFree(d2_device);
  return 0;
}

	.file	"tmpxft_0030b2c5_00000000-6_NN_cuda.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2036:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2036:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0, @function
_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0:
.LFB2190:
	.cfi_startproc
	jmp	cudaMalloc@PLT
	.cfi_endproc
.LFE2190:
	.size	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0, .-_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	.globl	_Z14sigmoid_devicef
	.type	_Z14sigmoid_devicef, @function
_Z14sigmoid_devicef:
.LFB2027:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2027:
	.size	_Z14sigmoid_devicef, .-_Z14sigmoid_devicef
	.globl	_Z7sigmoidf
	.type	_Z7sigmoidf, @function
_Z7sigmoidf:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorps	.LC0(%rip), %xmm0
	call	expf@PLT
	movss	.LC1(%rip), %xmm1
	popq	%rdx
	.cfi_def_cfa_offset 8
	addss	%xmm1, %xmm0
	divss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE2028:
	.size	_Z7sigmoidf, .-_Z7sigmoidf
	.globl	_Z12diff_Sigmoidf
	.type	_Z12diff_Sigmoidf, @function
_Z12diff_Sigmoidf:
.LFB2189:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z14sigmoid_devicef
	.cfi_endproc
.LFE2189:
	.size	_Z12diff_Sigmoidf, .-_Z12diff_Sigmoidf
	.globl	_Z7predictPfS_S_S_S_S_
	.type	_Z7predictPfS_S_S_S_S_, @function
_Z7predictPfS_S_S_S_S_:
.LFB2030:
	.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
	movq	%r9, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rcx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r8, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 8(%rsp)
	movq	%rsi, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
.L10:
	imulq	$104, %rbx, %rsi
	movq	8(%rsp), %rax
	leaq	32(%rsp), %rdx
	xorl	%r15d, %r15d
	movl	$26, %ecx
	movq	%rdx, %rdi
	addq	%rax, %rsi
	rep movsl
.L15:
	imulq	$104, %r15, %rsi
	xorl	%ecx, %ecx
	xorps	%xmm0, %xmm0
	addq	%r12, %rsi
.L11:
	movss	(%rdx,%rcx), %xmm1
	mulss	(%rsi,%rcx), %xmm1
	addq	$4, %rcx
	addss	%xmm1, %xmm0
	cmpq	$104, %rcx
	jne	.L11
	movq	%rdx, 24(%rsp)
	call	_Z7sigmoidf
	movq	24(%rsp), %rdx
	movss	%xmm0, 0(%rbp,%r15,4)
	incq	%r15
	cmpq	$10, %r15
	jne	.L15
	xorl	%edx, %edx
	xorps	%xmm0, %xmm0
.L12:
	movss	0(%rbp,%rdx), %xmm1
	mulss	0(%r13,%rdx), %xmm1
	addq	$4, %rdx
	addss	%xmm1, %xmm0
	cmpq	$40, %rdx
	jne	.L12
	call	_Z7sigmoidf
	movss	.LC3(%rip), %xmm1
	xorps	%xmm3, %xmm3
	movss	.LC1(%rip), %xmm2
	movq	16(%rsp), %rax
	movss	%xmm0, (%r14)
	cmpltss	%xmm0, %xmm1
	andps	%xmm1, %xmm2
	andnps	%xmm3, %xmm1
	orps	%xmm2, %xmm1
	movss	%xmm1, (%rax,%rbx,4)
	incq	%rbx
	cmpq	$232, %rbx
	jne	.L10
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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
	ret
	.cfi_endproc
.LFE2030:
	.size	_Z7predictPfS_S_S_S_S_, .-_Z7predictPfS_S_S_S_S_
	.globl	_Z8train_nnPfS_S_S_S_S_i
	.type	_Z8train_nnPfS_S_S_S_S_i, @function
_Z8train_nnPfS_S_S_S_S_i:
.LFB2031:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r9, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r8, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdx, %rbx
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%rdi, (%rsp)
	movq	%rsi, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
.L24:
	cmpl	256(%rsp), %ebp
	jge	.L44
	xorl	%r13d, %r13d
.L34:
	imulq	$104, %r13, %rsi
	movq	(%rsp), %rax
	leaq	80(%rsp), %r9
	xorl	%edx, %edx
	movl	$26, %ecx
	movq	%r9, %rdi
	addq	%rax, %rsi
	rep movsl
.L33:
	imulq	$104, %rdx, %rsi
	xorl	%ecx, %ecx
	xorps	%xmm0, %xmm0
	addq	%rbx, %rsi
.L25:
	movss	(%r9,%rcx), %xmm1
	mulss	(%rsi,%rcx), %xmm1
	addq	$4, %rcx
	addss	%xmm1, %xmm0
	cmpq	$104, %rcx
	jne	.L25
	movq	%r9, 24(%rsp)
	movq	%rdx, 16(%rsp)
	call	_Z7sigmoidf
	movq	16(%rsp), %rdx
	movq	24(%rsp), %r9
	movss	%xmm0, (%r12,%rdx,4)
	incq	%rdx
	cmpq	$10, %rdx
	jne	.L33
	xorl	%edx, %edx
	xorps	%xmm0, %xmm0
.L26:
	movss	(%r12,%rdx), %xmm1
	mulss	(%r15,%rdx), %xmm1
	addq	$4, %rdx
	addss	%xmm1, %xmm0
	cmpq	$40, %rdx
	jne	.L26
	call	_Z7sigmoidf
	movq	8(%rsp), %rax
	xorl	%edx, %edx
	xorps	%xmm4, %xmm4
	movss	%xmm0, (%r14)
	subss	(%rax,%r13,4), %xmm0
.L27:
	movss	(%r12,%rdx), %xmm3
	movss	(%r15,%rdx), %xmm1
	movss	.LC1(%rip), %xmm2
	mulss	%xmm0, %xmm1
	subss	%xmm3, %xmm2
	mulss	%xmm3, %xmm2
	addss	%xmm4, %xmm1
	mulss	%xmm2, %xmm1
	movss	%xmm1, 40(%rsp,%rdx)
	addq	$4, %rdx
	cmpq	$40, %rdx
	jne	.L27
	movsd	.LC4(%rip), %xmm3
	xorl	%edx, %edx
.L28:
	movss	(%r12,%rdx), %xmm2
	cvtss2sd	(%r15,%rdx), %xmm1
	mulss	%xmm0, %xmm2
	cvtss2sd	%xmm2, %xmm2
	mulsd	%xmm3, %xmm2
	subsd	%xmm2, %xmm1
	cvtsd2ss	%xmm1, %xmm1
	movss	%xmm1, (%r15,%rdx)
	addq	$4, %rdx
	cmpq	$40, %rdx
	jne	.L28
	xorl	%ecx, %ecx
	leaq	80(%rsp), %rdi
.L29:
	imulq	$104, %rcx, %rdx
	movss	40(%rsp,%rcx,4), %xmm2
	xorl	%esi, %esi
	addq	%rbx, %rdx
.L30:
	movss	(%rsi,%rdi), %xmm1
	cvtss2sd	(%rdx), %xmm0
	addq	$4, %rsi
	addq	$4, %rdx
	mulss	%xmm2, %xmm1
	cvtss2sd	%xmm1, %xmm1
	mulsd	%xmm3, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4(%rdx)
	cmpq	$104, %rsi
	jne	.L30
	incq	%rcx
	cmpq	$10, %rcx
	jne	.L29
	incq	%r13
	cmpq	$541, %r13
	jne	.L34
	incl	%ebp
	jmp	.L24
.L44:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	addq	$200, %rsp
	.cfi_def_cfa_offset 56
	xorps	%xmm0, %xmm0
	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
.LFE2031:
	.size	_Z8train_nnPfS_S_S_S_S_i, .-_Z8train_nnPfS_S_S_S_S_i
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"r"
.LC6:
	.string	"train_data.csv"
.LC7:
	.string	","
.LC8:
	.string	"train_y.csv"
.LC9:
	.string	"test_data.csv"
.LC10:
	.string	"test_y.csv"
	.text
	.globl	_Z11import_dataPfS_S_S_
	.type	_Z11import_dataPfS_S_S_, @function
_Z11import_dataPfS_S_S_:
.LFB2032:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$40, %rsp
	.cfi_def_cfa_offset 4192
	xorl	%ebx, %ebx
	movq	%rdi, %r15
	movq	%rsi, %r14
	leaq	.LC6(%rip), %rdi
	movq	%rdx, %r13
	movq	%fs:40, %rax
	movq	%rax, 4120(%rsp)
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rsi
	movq	%rcx, %r12
	call	fopen@PLT
	movq	%rax, 8(%rsp)
.L46:
	leaq	24(%rsp), %rbp
	movq	8(%rsp), %rcx
	movl	$1024, %edx
	movl	$1024, %esi
	movq	%rbp, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L64
	movq	%rbp, %rdi
	movslq	%ebx, %rbx
	call	strdup@PLT
	leaq	.LC7(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	strtok@PLT
.L47:
	testq	%rax, %rax
	je	.L65
	movq	%rax, %rdi
	call	atof@PLT
	leaq	.LC7(%rip), %rsi
	xorl	%edi, %edi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r15,%rbx,4)
	incq	%rbx
	call	strtok@PLT
	jmp	.L47
.L65:
	movq	%rbp, %rdi
	call	free@PLT
	jmp	.L46
.L64:
	leaq	.LC5(%rip), %rsi
	leaq	.LC8(%rip), %rdi
	xorl	%ebx, %ebx
	call	fopen@PLT
	leaq	.LC7(%rip), %r15
	movq	%rax, 8(%rsp)
.L50:
	movq	8(%rsp), %rcx
	movl	$1024, %edx
	movl	$1024, %esi
	leaq	1048(%rsp), %rbp
	movq	%rbp, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L66
	movq	%rbp, %rdi
	movslq	%ebx, %rbx
	call	strdup@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	strtok@PLT
.L51:
	testq	%rax, %rax
	je	.L67
	movq	%rax, %rdi
	call	atof@PLT
	movq	%r15, %rsi
	xorl	%edi, %edi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r14,%rbx,4)
	incq	%rbx
	call	strtok@PLT
	jmp	.L51
.L67:
	movq	%rbp, %rdi
	call	free@PLT
	jmp	.L50
.L66:
	leaq	.LC5(%rip), %rsi
	leaq	.LC9(%rip), %rdi
	xorl	%ebx, %ebx
	call	fopen@PLT
	leaq	.LC7(%rip), %r15
	movq	%rax, %r14
.L54:
	leaq	2072(%rsp), %rbp
	movq	%r14, %rcx
	movl	$1024, %edx
	movl	$1024, %esi
	movq	%rbp, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L68
	movq	%rbp, %rdi
	movslq	%ebx, %rbx
	call	strdup@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	strtok@PLT
.L55:
	testq	%rax, %rax
	je	.L69
	movq	%rax, %rdi
	call	atof@PLT
	movq	%r15, %rsi
	xorl	%edi, %edi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 0(%r13,%rbx,4)
	incq	%rbx
	call	strtok@PLT
	jmp	.L55
.L69:
	movq	%rbp, %rdi
	call	free@PLT
	jmp	.L54
.L68:
	leaq	.LC5(%rip), %rsi
	leaq	.LC10(%rip), %rdi
	xorl	%ebx, %ebx
	call	fopen@PLT
	leaq	.LC7(%rip), %r14
	movq	%rax, %r13
.L58:
	leaq	3096(%rsp), %rbp
	movq	%r13, %rcx
	movl	$1024, %edx
	movl	$1024, %esi
	movq	%rbp, %rdi
	call	__fgets_chk@PLT
	testq	%rax, %rax
	je	.L70
	movq	%rbp, %rdi
	movslq	%ebx, %rbx
	call	strdup@PLT
	movq	%r14, %rsi
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	strtok@PLT
.L59:
	testq	%rax, %rax
	je	.L71
	movq	%rax, %rdi
	call	atof@PLT
	movq	%r14, %rsi
	xorl	%edi, %edi
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r12,%rbx,4)
	incq	%rbx
	call	strtok@PLT
	jmp	.L59
.L71:
	movq	%rbp, %rdi
	call	free@PLT
	jmp	.L58
.L70:
	movq	4120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L62
	call	__stack_chk_fail@PLT
.L62:
	addq	$4136, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2032:
	.size	_Z11import_dataPfS_S_S_, .-_Z11import_dataPfS_S_S_
	.globl	_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_
	.type	_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_, @function
_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_:
.LFB2058:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L72
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z14cuda_forward_1PfS_S_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L72:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L74
	call	__stack_chk_fail@PLT
.L74:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2058:
	.size	_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_, .-_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_
	.globl	_Z14cuda_forward_1PfS_S_S_
	.type	_Z14cuda_forward_1PfS_S_S_, @function
_Z14cuda_forward_1PfS_S_S_:
.LFB2059:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_
	.cfi_endproc
.LFE2059:
	.size	_Z14cuda_forward_1PfS_S_S_, .-_Z14cuda_forward_1PfS_S_S_
	.globl	_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_
	.type	_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_, @function
_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_:
.LFB2060:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L77
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z14cuda_forward_2PfS_S_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L77:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L79
	call	__stack_chk_fail@PLT
.L79:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2060:
	.size	_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_, .-_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_
	.globl	_Z14cuda_forward_2PfS_S_S_
	.type	_Z14cuda_forward_2PfS_S_S_, @function
_Z14cuda_forward_2PfS_S_S_:
.LFB2061:
	.cfi_startproc
	endbr64
	jmp	_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_
	.cfi_endproc
.LFE2061:
	.size	_Z14cuda_forward_2PfS_S_S_, .-_Z14cuda_forward_2PfS_S_S_
	.globl	_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_
	.type	_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_, @function
_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_:
.LFB2062:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L82
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z17cuda_backprop_outPfS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L82:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L84
	call	__stack_chk_fail@PLT
.L84:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2062:
	.size	_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_, .-_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_
	.globl	_Z17cuda_backprop_outPfS_S_
	.type	_Z17cuda_backprop_outPfS_S_, @function
_Z17cuda_backprop_outPfS_S_:
.LFB2063:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_
	.cfi_endproc
.LFE2063:
	.size	_Z17cuda_backprop_outPfS_S_, .-_Z17cuda_backprop_outPfS_S_
	.globl	_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_
	.type	_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_, @function
_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_:
.LFB2064:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 24(%rsp)
	leaq	56(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	68(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rsp)
	leaq	48(%rsp), %rcx
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 120(%rsp)
	movq	%rsp, %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L87
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z20cuda_backprop_hiddenPfS_S_S_(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 176
	movq	84(%rsp), %rcx
	movl	92(%rsp), %r8d
	movq	72(%rsp), %rsi
	movl	80(%rsp), %edx
	leaq	120(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 168
	popq	%rdx
	.cfi_def_cfa_offset 160
.L87:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L89
	call	__stack_chk_fail@PLT
.L89:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2064:
	.size	_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_, .-_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_
	.globl	_Z20cuda_backprop_hiddenPfS_S_S_
	.type	_Z20cuda_backprop_hiddenPfS_S_S_, @function
_Z20cuda_backprop_hiddenPfS_S_S_:
.LFB2065:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_
	.cfi_endproc
.LFE2065:
	.size	_Z20cuda_backprop_hiddenPfS_S_S_, .-_Z20cuda_backprop_hiddenPfS_S_S_
	.globl	_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_
	.type	_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_, @function
_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_:
.LFB2066:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L92
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z14update_weight2PfS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L92:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L94
	call	__stack_chk_fail@PLT
.L94:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2066:
	.size	_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_, .-_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_
	.globl	_Z14update_weight2PfS_S_
	.type	_Z14update_weight2PfS_S_, @function
_Z14update_weight2PfS_S_:
.LFB2067:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_
	.cfi_endproc
.LFE2067:
	.size	_Z14update_weight2PfS_S_, .-_Z14update_weight2PfS_S_
	.globl	_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_
	.type	_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_, @function
_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_:
.LFB2068:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movq	%rdi, 24(%rsp)
	leaq	40(%rsp), %rcx
	leaq	48(%rsp), %rdi
	movq	%rsi, 16(%rsp)
	leaq	60(%rsp), %rsi
	movq	%rdx, 8(%rsp)
	leaq	32(%rsp), %rdx
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movl	$1, 56(%rsp)
	movq	%rax, 96(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 104(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 112(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 48(%rsp)
	movq	%rax, 60(%rsp)
	movl	$1, 68(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L97
	pushq	40(%rsp)
	.cfi_def_cfa_offset 152
	leaq	_Z14update_weight1PfS_S_(%rip), %rdi
	pushq	40(%rsp)
	.cfi_def_cfa_offset 160
	movq	76(%rsp), %rcx
	movl	84(%rsp), %r8d
	movq	64(%rsp), %rsi
	movl	72(%rsp), %edx
	leaq	112(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 152
	popq	%rdx
	.cfi_def_cfa_offset 144
.L97:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	je	.L99
	call	__stack_chk_fail@PLT
.L99:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2068:
	.size	_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_, .-_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_
	.globl	_Z14update_weight1PfS_S_
	.type	_Z14update_weight1PfS_S_, @function
_Z14update_weight1PfS_S_:
.LFB2069:
	.cfi_startproc
	endbr64
	jmp	_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_
	.cfi_endproc
.LFE2069:
	.size	_Z14update_weight1PfS_S_, .-_Z14update_weight1PfS_S_
	.section	.rodata.str1.1
.LC14:
	.string	"                          TRAINING WITH %d EPOCHS:\n__________________________________________________________________________\n__________________________________________________________________________\n\n"
.LC17:
	.string	"%f\n"
.LC19:
	.string	"MSE ABS DIFFERENCE FOR EPOCH: %f\n"
.LC21:
	.string	"The time taken to train with %d epochs is: %fms\n"
.LC22:
	.string	"MSE FINAL: %f\n"
.LC24:
	.string	"The final prediction accuracy is: %f \n"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-81920(%rsp), %r11
	.cfi_def_cfa 11, 81976
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2968, %rsp
	.cfi_def_cfa_offset 84944
	movl	$4328, %edi
	xorl	%r12d, %r12d
	movq	%fs:40, %rax
	movq	%rax, 84872(%rsp)
	xorl	%eax, %eax
	leaq	2316(%rsp), %r15
	call	_Znam@PLT
	movl	$4328, %edi
	movq	%rax, %rbx
	call	_Znam@PLT
	movq	%rax, %rbp
	call	cudaDeviceReset@PLT
	movl	$4328, %edi
	call	_Znam@PLT
	movl	$4328, %edi
	movq	%rax, %r14
	call	_Znam@PLT
	movl	$8, %edi
	movq	%rax, %r13
	call	malloc@PLT
	movq	%r15, %rsi
	movq	%rax, 16(%rsp)
	leaq	348(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	4480(%rsp), %rax
	movq	32(%rsp), %rcx
	movq	%rax, 40(%rsp)
	leaq	28608(%rsp), %rax
	movq	40(%rsp), %rdx
	movq	%rax, %rdi
	movq	%rax, 24(%rsp)
	call	_Z11import_dataPfS_S_S_
.L103:
	movl	$104, %edi
	call	_Znam@PLT
	movl	$104, %edi
	movq	%rax, (%r14,%r12,8)
	movq	%rax, 48(%rsp)
	call	_Znam@PLT
	imulq	$104, %r12, %rsi
	movss	(%r15,%r12,4), %xmm0
	movq	24(%rsp), %rdx
	movq	%rax, 0(%r13,%r12,8)
	incq	%r12
	movq	48(%rsp), %rdi
	movl	$26, %ecx
	addq	%rdx, %rsi
	rep movsl
	movss	%xmm0, (%rax)
	cmpq	$541, %r12
	jne	.L103
	leaq	1276(%rsp), %rdx
	movq	%rdx, 24(%rsp)
.L104:
	xorl	%r15d, %r15d
.L105:
	movq	%rdx, 56(%rsp)
	movl	%ecx, 48(%rsp)
	call	rand@PLT
	movq	56(%rsp), %rdx
	movl	48(%rsp), %ecx
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC13(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rdx,%r15,4)
	incq	%r15
	cmpq	$26, %r15
	jne	.L105
	addl	$26, %ecx
	addq	$104, %rdx
	cmpl	$260, %ecx
	jne	.L104
	xorl	%r15d, %r15d
	leaq	188(%rsp), %r12
.L106:
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC13(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r12,%r15,4)
	incq	%r15
	cmpq	$10, %r15
	jne	.L106
	leaq	228(%rsp), %rax
	xorl	%r15d, %r15d
	movq	%rax, 48(%rsp)
.L107:
	call	rand@PLT
	cvtsi2sdl	%eax, %xmm0
	movq	48(%rsp), %rax
	divsd	.LC13(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%rax,%r15,4)
	incq	%r15
	cmpq	$10, %r15
	jne	.L107
	call	rand@PLT
	xorl	%r15d, %r15d
	cvtsi2sdl	%eax, %xmm0
	divsd	.LC13(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 176(%rsp)
.L108:
	leaq	(%rbx,%r15), %rdi
	movl	$104, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	(%r14,%r15), %rsi
	movq	(%rbx,%r15), %rdi
	movl	$1, %ecx
	movl	$104, %edx
	call	cudaMemcpy@PLT
	leaq	0(%rbp,%r15), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	0(%r13,%r15), %rsi
	movq	0(%rbp,%r15), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	addq	$8, %r15
	call	cudaMemcpy@PLT
	cmpq	$4328, %r15
	jne	.L108
	leaq	72(%rsp), %rdi
	movl	$1040, %esi
	xorl	%r14d, %r14d
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	24(%rsp), %rsi
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movl	$1040, %edx
	call	cudaMemcpy@PLT
	leaq	80(%rsp), %rdi
	movl	$40, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	80(%rsp), %rdi
	movl	$1, %ecx
	movq	%r12, %rsi
	movl	$40, %edx
	call	cudaMemcpy@PLT
	leaq	88(%rsp), %rdi
	movl	$40, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	88(%rsp), %rdi
	movl	$1, %ecx
	movl	$40, %edx
	leaq	268(%rsp), %rsi
	call	cudaMemcpy@PLT
	leaq	96(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	96(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	leaq	180(%rsp), %rsi
	call	cudaMemcpy@PLT
	leaq	104(%rsp), %rdi
	movl	$4, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	104(%rsp), %rdi
	movl	$1, %ecx
	movl	$4, %edx
	leaq	184(%rsp), %rsi
	call	cudaMemcpy@PLT
	leaq	112(%rsp), %rdi
	movl	$40, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	112(%rsp), %rdi
	movl	$1, %ecx
	movl	$40, %edx
	leaq	308(%rsp), %rsi
	call	cudaMemcpy@PLT
	leaq	120(%rsp), %rdi
	movl	$40, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movq	48(%rsp), %rsi
	movq	120(%rsp), %rdi
	movl	$1, %ecx
	movl	$40, %edx
	call	cudaMemcpy@PLT
	leaq	128(%rsp), %rdi
	movl	$40, %esi
	call	_Z10cudaMallocIfE9cudaErrorPPT_m.isra.0
	movl	$1, %ecx
	movl	$40, %edx
	movq	128(%rsp), %rdi
	leaq	176(%rsp), %rsi
	call	cudaMemcpy@PLT
	movl	$400, %edx
	movl	$2, %edi
	movabsq	$8589934631, %rax
	movq	%rax, 152(%rsp)
	movabsq	$60129542158, %rax
	leaq	.LC14(%rip), %rsi
	movq	%rax, 164(%rsp)
	xorl	%eax, %eax
	movl	$1, 160(%rsp)
	movl	$1, 172(%rsp)
	call	__printf_chk@PLT
	leaq	136(%rsp), %rdi
	call	cudaEventCreate@PLT
	leaq	144(%rsp), %rdi
	call	cudaEventCreate@PLT
	movq	136(%rsp), %rdi
	xorl	%esi, %esi
	call	cudaEventRecord@PLT
	movss	.LC12(%rip), %xmm2
	movss	.LC11(%rip), %xmm1
	movd	%xmm2, %r12d
.L109:
	cvtss2sd	%xmm1, %xmm1
	comisd	.LC20(%rip), %xmm1
	jbe	.L117
	cmpl	$400, %r14d
	je	.L117
	movl	$0x00000000, 12(%rsp)
	xorl	%r13d, %r13d
.L116:
	movl	160(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	152(%rsp), %rdx
	movq	164(%rsp), %rdi
	movl	172(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L110
	movq	(%rbx,%r13,8), %rdi
	movq	120(%rsp), %rcx
	movq	88(%rsp), %rdx
	movq	72(%rsp), %rsi
	call	_Z40__device_stub__Z14cuda_forward_1PfS_S_S_PfS_S_S_
.L110:
	movl	160(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	152(%rsp), %rdx
	movq	164(%rsp), %rdi
	movl	172(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L111
	movq	128(%rsp), %rcx
	movq	96(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z40__device_stub__Z14cuda_forward_2PfS_S_S_PfS_S_S_
.L111:
	movl	160(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	152(%rsp), %rdx
	movq	164(%rsp), %rdi
	movl	172(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L112
	movq	0(%rbp,%r13,8), %rdx
	movq	96(%rsp), %rsi
	movq	104(%rsp), %rdi
	call	_Z41__device_stub__Z17cuda_backprop_outPfS_S_PfS_S_
.L112:
	movq	104(%rsp), %rsi
	movl	$2, %ecx
	movl	$4, %edx
	leaq	184(%rsp), %r15
	movq	%r15, %rdi
	call	cudaMemcpy@PLT
	movq	104(%rsp), %rdi
	movl	$1, %ecx
	movq	%r15, %rsi
	movl	$4, %edx
	call	cudaMemcpy@PLT
	movsd	.LC15(%rip), %xmm0
	xorl	%r9d, %r9d
	cvtss2sd	184(%rsp), %xmm1
	movl	160(%rsp), %ecx
	movq	152(%rsp), %rdx
	xorl	%r8d, %r8d
	mulsd	%xmm1, %xmm0
	movq	164(%rsp), %rdi
	movl	172(%rsp), %esi
	mulsd	%xmm1, %xmm0
	cvtss2sd	12(%rsp), %xmm1
	andps	.LC16(%rip), %xmm0
	addsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm3
	movss	%xmm3, 12(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L113
	movq	104(%rsp), %rcx
	movq	80(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	112(%rsp), %rdi
	call	_Z46__device_stub__Z20cuda_backprop_hiddenPfS_S_S_PfS_S_S_
.L113:
	movl	160(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	152(%rsp), %rdx
	movq	164(%rsp), %rdi
	movl	172(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L114
	movq	104(%rsp), %rdx
	movq	88(%rsp), %rsi
	movq	80(%rsp), %rdi
	call	_Z38__device_stub__Z14update_weight2PfS_S_PfS_S_
.L114:
	movl	160(%rsp), %ecx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	152(%rsp), %rdx
	movq	164(%rsp), %rdi
	movl	172(%rsp), %esi
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L115
	movq	(%rbx,%r13,8), %rsi
	movq	112(%rsp), %rdx
	movq	72(%rsp), %rdi
	call	_Z38__device_stub__Z14update_weight1PfS_S_PfS_S_
.L115:
	incq	%r13
	cmpq	$541, %r13
	jne	.L116
	movl	$2, %edi
	leaq	.LC17(%rip), %rsi
	movb	$1, %al
	incl	%r14d
	cvtss2sd	12(%rsp), %xmm0
	call	__printf_chk@PLT
	movd	%r12d, %xmm1
	movb	$1, %al
	subss	12(%rsp), %xmm1
	andps	.LC18(%rip), %xmm1
	movl	$2, %edi
	leaq	.LC19(%rip), %rsi
	movss	%xmm1, 48(%rsp)
	cvtss2sd	%xmm1, %xmm0
	call	__printf_chk@PLT
	movss	12(%rsp), %xmm5
	movss	48(%rsp), %xmm1
	movd	%xmm5, %r12d
	jmp	.L109
.L117:
	movq	144(%rsp), %rdi
	xorl	%esi, %esi
	leaq	188(%rsp), %r13
	call	cudaEventRecord@PLT
	movq	144(%rsp), %rdi
	call	cudaEventSynchronize@PLT
	movq	72(%rsp), %rsi
	movq	24(%rsp), %rdi
	movl	$2, %ecx
	movl	$1040, %edx
	call	cudaMemcpy@PLT
	movq	80(%rsp), %rsi
	movl	$2, %ecx
	movq	%r13, %rdi
	movl	$40, %edx
	call	cudaMemcpy@PLT
	movq	144(%rsp), %rdx
	movq	136(%rsp), %rsi
	leaq	68(%rsp), %rdi
	movl	$0x00000000, 68(%rsp)
	call	cudaEventElapsedTime@PLT
	movl	%r14d, %edx
	movl	$2, %edi
	movb	$1, %al
	leaq	.LC21(%rip), %rsi
	cvtss2sd	68(%rsp), %xmm0
	call	__printf_chk@PLT
	leaq	.LC22(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtss2sd	12(%rsp), %xmm0
	call	__printf_chk@PLT
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	40(%rsp), %rdi
	leaq	180(%rsp), %r9
	leaq	268(%rsp), %r8
	movq	%r13, %rcx
	call	_Z7predictPfS_S_S_S_S_
	xorl	%eax, %eax
	xorl	%edx, %edx
.L121:
	movq	16(%rsp), %rcx
	movss	(%rcx,%rax), %xmm0
	movq	32(%rsp), %rcx
	ucomiss	(%rcx,%rax), %xmm0
	jp	.L119
	jne	.L119
	incl	%edx
.L119:
	addq	$4, %rax
	cmpq	$928, %rax
	jne	.L121
	leaq	.LC24(%rip), %rsi
	movl	$2, %edi
	movb	$1, %al
	cvtsi2ssl	%edx, %xmm0
	divss	.LC23(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	call	__printf_chk@PLT
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	%rbx, %rdi
	call	cudaFree@PLT
	movq	%rbp, %rdi
	call	cudaFree@PLT
	movq	72(%rsp), %rdi
	call	cudaFree@PLT
	movq	80(%rsp), %rdi
	call	cudaFree@PLT
	movq	120(%rsp), %rdi
	call	cudaFree@PLT
	movq	128(%rsp), %rdi
	call	cudaFree@PLT
	movq	88(%rsp), %rdi
	call	cudaFree@PLT
	movq	96(%rsp), %rdi
	call	cudaFree@PLT
	movq	104(%rsp), %rdi
	call	cudaFree@PLT
	movq	112(%rsp), %rdi
	call	cudaFree@PLT
	movq	84872(%rsp), %rax
	subq	%fs:40, %rax
	je	.L122
	call	__stack_chk_fail@PLT
.L122:
	addq	$84888, %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
.LFE2033:
	.size	main, .-main
	.section	.rodata.str1.1
.LC25:
	.string	"_Z14update_weight1PfS_S_"
.LC26:
	.string	"_Z14update_weight2PfS_S_"
.LC27:
	.string	"_Z20cuda_backprop_hiddenPfS_S_S_"
.LC28:
	.string	"_Z17cuda_backprop_outPfS_S_"
.LC29:
	.string	"_Z14cuda_forward_2PfS_S_S_"
.LC30:
	.string	"_Z14cuda_forward_1PfS_S_S_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2071:
	.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	.LC25(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z14update_weight1PfS_S_(%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	.LC26(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14update_weight2PfS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC27(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z20cuda_backprop_hiddenPfS_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC28(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z17cuda_backprop_outPfS_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC29(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14cuda_forward_2PfS_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	pushq	$0
	.cfi_def_cfa_offset 24
	leaq	.LC30(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z14cuda_forward_1PfS_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 32
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 40
	pushq	$0
	.cfi_def_cfa_offset 48
	call	__cudaRegisterFunction@PLT
	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
.LFE2071:
	.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.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	-2147483648
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1065353216
	.align 4
.LC3:
	.long	1056964608
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	-1717986918
	.long	1069128089
	.section	.rodata.cst4
	.align 4
.LC11:
	.long	1176256512
	.align 4
.LC12:
	.long	1203982336
	.section	.rodata.cst8
	.align 8
.LC13:
	.long	-4194304
	.long	1105199103
	.align 8
.LC15:
	.long	0
	.long	1071644672
	.section	.rodata.cst16
	.align 16
.LC16:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 16
.LC18:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC20:
	.long	-350469331
	.long	1058682594
	.section	.rodata.cst4
	.align 4
.LC23:
	.long	1130889216
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

#define ROW 773
#define COL 26
#define TRAIN_ROW 541
#define TEST_ROW 232
// define nodes
#define INPUT_NODES 26
#define HIDDEN_NODES 10
#define OUTPUT_NODES 1

#define ALPHA 0.1

// Activation Functions
__device__ float sigmoid_device(float x){
    return 1/(1 + exp(-x));
}
float sigmoid(float x){
    return 1/(1 + exp(-x));
}
__device__ float diff_Sigmoid(float x){
  return x * (1 - x);
}

__global__ void cuda_forward_1(float* input, float* weight1, float* layer1, float* bias_layer1){

  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < HIDDEN_NODES){
      float act = 0.0;
      for(int j = 0; j < INPUT_NODES; j++){
          act += input[j]*weight1[ind_x*INPUT_NODES + j] ;
      }
      layer1[ind_x] = sigmoid_device(act+ bias_layer1[ind_x]);
  }
}

__global__ void cuda_forward_2(float* weight2, float* layer1, float* layer2, float* bias_layer2){

  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < OUTPUT_NODES){
      float act = 0.0;
      for(int j = 0; j < HIDDEN_NODES; j++){
          act += layer1[j]*weight2[ind_x* HIDDEN_NODES + j] ;
      }
      layer2[ind_x] = sigmoid_device(act+ bias_layer2[ind_x]);
  }
}

__global__ void cuda_backprop_out(float* d3, float *layer2, float *label){

  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < OUTPUT_NODES){
    float err = layer2[ind_x] - label[ind_x];
    d3[ind_x] = err;
  }
  return;
}

__global__ void cuda_backprop_hidden(float* d2, float* layer1, float* weight2, float* d3){
  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < HIDDEN_NODES){
    float error_hidden = 0.0;
    for(int j = 0; j < OUTPUT_NODES; j++){
      error_hidden += d3[j]*weight2[j*HIDDEN_NODES + ind_x];
    }
      d2[ind_x] = error_hidden * (layer1[ind_x] * (1 - layer1[ind_x]));
  }
}

__global__ void update_weight2(float* weight2, float* layer1, float* d3){
  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < OUTPUT_NODES){
    for(int j = 0; j < HIDDEN_NODES; j++){
      weight2[ind_x*HIDDEN_NODES + j] -= layer1[j]*d3[ind_x]*ALPHA;
    }
  }
}

__global__ void update_weight1(float* weight1, float* input, float* d2){
  int ind_x = blockIdx.x * blockDim.x + threadIdx.x;
  if(ind_x < HIDDEN_NODES){
    for(int j = 0; j < INPUT_NODES; j++){
      weight1[ind_x*INPUT_NODES + j] -= input[j]*d2[ind_x]*ALPHA;
    }
  }
}

void predict(float *input_matrix,
            float *pred_arr,
            float *weight1,
            float *weight2,
            float layer1[HIDDEN_NODES],
            float layer2[OUTPUT_NODES])
            {

    //this will be each extracted input row
    float input[COL];
    //float output=0;

    // iterate through input matrix row by row, extracting each row for training
    for(int row = 0; row < TEST_ROW; row++){
        for(int col = 0; col < COL; col++){
            input[col] = input_matrix[row*COL + col];
        }

        // FORWARD PROPAGATION:
        for(int i = 0; i < HIDDEN_NODES; i++){
            float act = 0.0;
            for(int j = 0; j < INPUT_NODES; j++){
                act += input[j]*weight1[i * INPUT_NODES + j];
            }
            layer1[i] = sigmoid(act);
        }
        for(int i = 0; i < OUTPUT_NODES; i++){
            float act = 0.0;
            for(int j = 0; j < HIDDEN_NODES; j++){
                act += layer1[j]*weight2[i * HIDDEN_NODES + j];
            }
            layer2[i] = sigmoid(act);
        }

        //store predictions in an array
        for(int i = 0; i < OUTPUT_NODES; i++){
            if(layer2[i]>0.5){
                pred_arr[row] = 1;
            }
            else{
                pred_arr[row] = 0;
            }

        }
    }

    return;
}

float train_nn(float *input_matrix,
              float label[TRAIN_ROW],
              float *weight1,
              float *weight2,
              float layer1[HIDDEN_NODES],
              float layer2[OUTPUT_NODES],
              int p_epoch)
              {
    //this will be each extracted input row
    float input[COL];

    for(int epoch=0; epoch < p_epoch; epoch++){
      // iterate through input matrix row by row, extracting each row for training
      for(int row = 0; row < TRAIN_ROW; row++){
          for(int col = 0; col < COL; col++){
              input[col] = input_matrix[row*COL + col];
          }

          //this is for one row instance of forward and backprop
          // FORWARD PROPAGATION:
          for(int i = 0; i < HIDDEN_NODES; i++){
              float act = 0.0;
              for(int j = 0; j < INPUT_NODES; j++){
                  act += input[j]*weight1[i*INPUT_NODES + j];
              }
              layer1[i] = sigmoid(act);
          }
          for(int i = 0; i < OUTPUT_NODES; i++){
              float act = 0.0;
              for(int j = 0; j < HIDDEN_NODES; j++){
                  act += layer1[j]*weight2[i* HIDDEN_NODES + j];
              }
              layer2[i] = sigmoid(act);
          }
          // BACKPROPAGATION:

          // calculate errors
          float d3[OUTPUT_NODES];
          for(int i = 0; i < OUTPUT_NODES; i++){
              float error_output = layer2[i] - label[row];
              d3[i] = error_output;
          }
          float d2[HIDDEN_NODES];
          for(int i = 0; i < HIDDEN_NODES; i++){
              float error_hidden = 0.0;
              for(int j = 0; j < OUTPUT_NODES; j++){
                  error_hidden += d3[j]*weight2[j*HIDDEN_NODES + i];
              }
              d2[i] = error_hidden * (layer1[i] * (1 - layer1[i]));
          }

          // update weights
          for(int i = 0; i < OUTPUT_NODES; i++){
              for(int j = 0; j < HIDDEN_NODES; j++){
                  weight2[i*HIDDEN_NODES + j] -= layer1[j]*d3[i]*ALPHA;
              }
          }
          for(int i = 0; i < HIDDEN_NODES; i++){
              for(int j = 0; j < INPUT_NODES; j++){
                  weight1[i*INPUT_NODES + j] -= input[j]*d2[i]*ALPHA;
              }
          }
      }
    }

    return 0;
}

void import_data(float *train_arr, float *train_y_arr, float *test_arr , float *test_y_arr){
  FILE* str = fopen("train_data.csv", "r");

  char line[1024];
  int count = 0;
  while (fgets(line, 1024, str))
  {
    char* tmp = strdup(line);
    char* c = strtok(tmp,",");
    //train_arr[count] = new float[1];
    while(c != NULL){
      train_arr[count] = (float)atof(c);
      count ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }
  //IMPORT TRAINING LABELS

  FILE* str_y = fopen("train_y.csv", "r");

  char line_y[1024];
  int count_y = 0;
  while (fgets(line_y, 1024, str_y))
  {
    char* tmp = strdup(line_y);
    char* c = strtok(tmp,",");

    while(c != NULL){
      train_y_arr[count_y] = (float)atof(c);
      count_y ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }

  //IMPORT TESTING DATA

  FILE* str_t = fopen("test_data.csv", "r");

  char line_t[1024];
  int count_t = 0;
  while (fgets(line_t, 1024, str_t))
  {
    char* tmp = strdup(line_t);
    char* c = strtok(tmp,",");

    while(c != NULL){
      test_arr[count_t] = (float)atof(c);
      count_t ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }

  //IMPORT TEST LABELS

  FILE* str_ty = fopen("test_y.csv", "r");

  char line_ty[1024];
  int count_ty = 0;
  while (fgets(line_ty, 1024, str_ty))
  {
    char* tmp = strdup(line_ty);
    char* c = strtok(tmp,",");

    while(c != NULL){
      test_y_arr[count_ty] = (float)atof(c);
      count_ty ++;
      c = strtok(NULL, ",");
    }
    free(tmp);
  }

}

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

  float train_arr[TRAIN_ROW*COL];
  float train_y_arr[TRAIN_ROW*1];
  float test_arr[TEST_ROW*COL];
  float test_y_arr[TEST_ROW*1];
  float weight_layer1[HIDDEN_NODES*INPUT_NODES];
  float weight_layer2[OUTPUT_NODES*HIDDEN_NODES];
  float bias_layer1[HIDDEN_NODES];
  float bias_layer2[OUTPUT_NODES];
  float layer1[HIDDEN_NODES];
  float layer2[OUTPUT_NODES];
  float d3[OUTPUT_NODES];
  float d2[HIDDEN_NODES];
  float** train_arr_device = new float*[TRAIN_ROW];
  float** train_arr_y_device = new float*[TRAIN_ROW];
  float* weight1_device;
  float* weight2_device;
  float* layer1_device;
  float* layer2_device;
  float* d3_device;
  float* d2_device;
  float* bias_layer1_device;
  float* bias_layer2_device;
  hipDeviceReset();
  float** train_final = new float* [TRAIN_ROW];
  float** train_y_final = new float* [TRAIN_ROW];
  float *output = (float *)malloc(sizeof(TRAIN_ROW*sizeof(float)));
  float *output_test = (float *)malloc(sizeof(TEST_ROW*sizeof(float)));

  //IMPORT TRAINING DATA
  import_data(train_arr, train_y_arr, test_arr, test_y_arr);

  for (size_t i = 0; i < TRAIN_ROW; i++) {
    train_final[i] = new float[COL];
    train_y_final[i] = new float[COL];
    for (size_t j = 0; j < COL; j++) {
      train_final[i][j] = train_arr[i*COL + j];
    }
    for (size_t k = 0; k < 1; k++) {
      train_y_final[i][k] = train_y_arr[i];
    }
  }

  // generate random weights and biases
  for(int i = 0; i < HIDDEN_NODES; i++){
      for(int j = 0; j < INPUT_NODES; j++){
          weight_layer1[i*INPUT_NODES + j] = ((double)rand())/((double)RAND_MAX);
      }
  }
  for(int i = 0; i < OUTPUT_NODES; i++){
      for(int j = 0; j < HIDDEN_NODES; j++){
          weight_layer2[i*HIDDEN_NODES + j] = ((double)rand())/((double)RAND_MAX);
      }
  }
  for(int i = 0; i < HIDDEN_NODES; i++){
    bias_layer1[i] = ((double)rand())/((double)RAND_MAX);
  }
  for(int i = 0; i < OUTPUT_NODES; i++){
    bias_layer2[i] = ((double)rand())/((double)RAND_MAX);
  }

  for (size_t i = 0; i < TRAIN_ROW; i++) {
    hipMalloc(&train_arr_device[i], sizeof(float)*COL);
    hipMemcpy(train_arr_device[i], train_final[i], sizeof(float)*COL, hipMemcpyHostToDevice);

    hipMalloc(&train_arr_y_device[i], sizeof(float)*1);
    hipMemcpy(train_arr_y_device[i], train_y_final[i], sizeof(float)*1, hipMemcpyHostToDevice);
  }

  //cudaMalloc(&train_arr_y_device, sizeof(float)*TRAIN_ROW*1);
  //cudaMemcpy(train_arr_y_device, train_y_arr, sizeof(float)*TRAIN_ROW*1, cudaMemcpyHostToDevice);

  hipMalloc(&weight1_device, sizeof(float)*HIDDEN_NODES*INPUT_NODES);
  hipMemcpy(weight1_device, weight_layer1, sizeof(float)*HIDDEN_NODES*INPUT_NODES, hipMemcpyHostToDevice);

  hipMalloc(&weight2_device, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES);
  hipMemcpy(weight2_device, weight_layer2, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, hipMemcpyHostToDevice);

  hipMalloc(&layer1_device, sizeof(float)*HIDDEN_NODES);
  hipMemcpy(layer1_device, layer1, sizeof(float)*HIDDEN_NODES, hipMemcpyHostToDevice);

  hipMalloc(&layer2_device, sizeof(float)*OUTPUT_NODES);
  hipMemcpy(layer2_device, layer2, sizeof(float)*OUTPUT_NODES, hipMemcpyHostToDevice);

  hipMalloc(&d3_device, sizeof(float)*OUTPUT_NODES);
  hipMemcpy(d3_device, d3, sizeof(float)*OUTPUT_NODES, hipMemcpyHostToDevice);

  hipMalloc(&d2_device, sizeof(float)*HIDDEN_NODES);
  hipMemcpy(d2_device, d2, sizeof(float)*HIDDEN_NODES, hipMemcpyHostToDevice);

  hipMalloc(&bias_layer1_device, sizeof(float)*HIDDEN_NODES);
  hipMemcpy(bias_layer1_device, bias_layer1, sizeof(float)*HIDDEN_NODES, hipMemcpyHostToDevice);

  hipMalloc(&bias_layer2_device, sizeof(float)*HIDDEN_NODES);
  hipMemcpy(bias_layer2_device, bias_layer2, sizeof(float)*HIDDEN_NODES, hipMemcpyHostToDevice);

  // NEURAL NETWORK
  //ceil(541/14) = 39
  //ceil(26/14) = 2
  dim3 dimGrid(39,2,1);
	dim3 dimBlock(14,14,1);

  /*printf("%s\n","Weight Layer 1:" );
  for (size_t i = 0; i < HIDDEN_NODES; i++) {
    for (size_t j = 0; j < INPUT_NODES; j++) {
      printf("%f ",weight_layer1[i*INPUT_NODES + j] );
    }
    printf("\n");
  }
  printf("%s\n","Weight Layer 2:" );
  for (size_t i = 0; i < OUTPUT_NODES; i++) {
    for (size_t j = 0; j < HIDDEN_NODES; j++) {
      printf("%f ",weight_layer2[i*HIDDEN_NODES + j] );
    }
    printf("\n");
  }*/
  int epoch = 400;

  printf("                          TRAINING WITH %d EPOCHS:\n__________________________________________________________________________\n__________________________________________________________________________\n\n", epoch);

  hipEvent_t beginLaunch, endLaunch;
  hipEventCreate(&beginLaunch);
  hipEventCreate(&endLaunch);
  hipEventRecord(beginLaunch,0);
  float mse_total;
  float mse_old = 100000;
  float mse_difference = 100000;
  float mse_abs = 10000;
  int max_epoch = 0;
  while(mse_abs > 0.0001 && max_epoch < epoch){ //
  //for (size_t i = 0; i < epoch; i++) {
    mse_total = 0.0;

    for (size_t j = 0; j < TRAIN_ROW; j++) { //TRAIN_ROW

      cuda_forward_1<<<dimBlock , dimGrid>>>(train_arr_device[j], weight1_device, layer1_device, bias_layer1_device);
      //cudaMemcpy(layer1, layer1_device, sizeof(float)*HIDDEN_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(layer1_device, layer1, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      cuda_forward_2<<<dimBlock , dimGrid>>>(weight2_device, layer1_device, layer2_device, bias_layer2_device);
      //cudaMemcpy(layer2, layer2_device, sizeof(float)*OUTPUT_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(layer2_device, layer2, sizeof(float)*OUTPUT_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      cuda_backprop_out<<<dimBlock , dimGrid>>>(d3_device, layer2_device, train_arr_y_device[j]);
      hipMemcpy(d3, d3_device, sizeof(float)*OUTPUT_NODES, hipMemcpyDeviceToHost);
      hipMemcpy(d3_device, d3, sizeof(float)*OUTPUT_NODES, hipMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));
      mse_total += abs(0.5*d3[0]*d3[0]);
      //printf("%f\n", d3[0]);
      cuda_backprop_hidden<<<dimBlock , dimGrid>>>(d2_device, layer1_device, weight2_device, d3_device);
      //cudaMemcpy(d2, d2, sizeof(float)*HIDDEN_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(d2, d2, sizeof(float)*HIDDEN_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      update_weight2<<<dimBlock , dimGrid>>>(weight2_device, layer1_device, d3_device);
      //cudaMemcpy(weight_layer2, weight2_device, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(weight2_device, weight_layer2, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

      update_weight1<<<dimBlock , dimGrid>>>(weight1_device, train_arr_device[j], d2_device);
      //cudaMemcpy(weight_layer1, weight1_device, sizeof(float)*HIDDEN_NODES*INPUT_NODES, cudaMemcpyDeviceToHost);
      //cudaMemcpy(weight1_device, weight_layer1, sizeof(float)*HIDDEN_NODES*INPUT_NODES, cudaMemcpyHostToDevice);
      //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));

    }
    printf("%f\n", mse_total);
    mse_difference = mse_old - mse_total;
    mse_abs = abs(mse_difference);
    mse_old = mse_total;
    max_epoch += 1;
    printf("MSE ABS DIFFERENCE FOR EPOCH: %f\n", mse_abs);

  }
  float mse_final = mse_total;
  hipEventRecord(endLaunch,0);
  hipEventSynchronize(endLaunch);
  hipMemcpy(weight_layer1, weight1_device, sizeof(float)*HIDDEN_NODES*INPUT_NODES, hipMemcpyDeviceToHost);
  hipMemcpy(weight_layer2, weight2_device, sizeof(float)*OUTPUT_NODES*HIDDEN_NODES, hipMemcpyDeviceToHost);


  float time_share = 0;
	hipEventElapsedTime(&time_share, beginLaunch, endLaunch);
  printf("The time taken to train with %d epochs is: %fms\n", max_epoch, time_share);
  printf("MSE FINAL: %f\n", mse_final);
  //printf("Device Variable Copying:\t%s\n", cudaGetErrorString(cudaGetLastError()));
  /*printf("%s\n","Weight Layer 1:" );
  for (size_t i = 0; i < HIDDEN_NODES; i++) {
    for (size_t j = 0; j < INPUT_NODES; j++) {
      printf("%f ",weight_layer1[i*INPUT_NODES + j] );
    }
    printf("\n");
  }
  printf("%s\n","Weight Layer 2:" );
  for (size_t i = 0; i < OUTPUT_NODES; i++) {
    for (size_t j = 0; j < HIDDEN_NODES; j++) {
      printf("%f ",weight_layer2[i*HIDDEN_NODES + j] );
    }
    printf("\n");
  }*/


  predict(test_arr, output, weight_layer1, weight_layer2, layer1, layer2);

  int count_final=0;

  for(int i = 0; i < TEST_ROW; i++){
    //printf("predicted %f\n", output[i]);
    //printf("actual %f\n", train_y_arr[i]);
    if(output[i] == test_y_arr[i]){
        count_final +=1;
    }
  }
  float prediction = (float)count_final/TEST_ROW;
  printf("The final prediction accuracy is: %f \n", prediction);
  free(output);
  hipFree(train_arr_device);
  hipFree(train_arr_y_device);
  hipFree(weight1_device);
  hipFree(weight2_device);
  hipFree(bias_layer1_device);
  hipFree(bias_layer2_device);
  hipFree(layer1_device);
  hipFree(layer2_device);
  hipFree(d3_device);
  hipFree(d2_device);
  return 0;
}

	.text
	.file	"NN_cuda.hip"
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z7sigmoidf
.LCPI0_0:
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI0_1:
	.long	0x3f800000                      # float 1
	.text
	.globl	_Z7sigmoidf
	.type	_Z7sigmoidf,@function
_Z7sigmoidf:                            # @_Z7sigmoidf
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorps	.LCPI0_0(%rip), %xmm0
	callq	expf
	movss	.LCPI0_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	divss	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z7sigmoidf, .Lfunc_end0-_Z7sigmoidf
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__cuda_forward_1PfS_S_S_ # -- Begin function _Z29__device_stub__cuda_forward_1PfS_S_S_
	.type	_Z29__device_stub__cuda_forward_1PfS_S_S_,@function
_Z29__device_stub__cuda_forward_1PfS_S_S_: # @_Z29__device_stub__cuda_forward_1PfS_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z14cuda_forward_1PfS_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z29__device_stub__cuda_forward_1PfS_S_S_, .Lfunc_end1-_Z29__device_stub__cuda_forward_1PfS_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__cuda_forward_2PfS_S_S_ # -- Begin function _Z29__device_stub__cuda_forward_2PfS_S_S_
	.type	_Z29__device_stub__cuda_forward_2PfS_S_S_,@function
_Z29__device_stub__cuda_forward_2PfS_S_S_: # @_Z29__device_stub__cuda_forward_2PfS_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z14cuda_forward_2PfS_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z29__device_stub__cuda_forward_2PfS_S_S_, .Lfunc_end2-_Z29__device_stub__cuda_forward_2PfS_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z32__device_stub__cuda_backprop_outPfS_S_ # -- Begin function _Z32__device_stub__cuda_backprop_outPfS_S_
	.type	_Z32__device_stub__cuda_backprop_outPfS_S_,@function
_Z32__device_stub__cuda_backprop_outPfS_S_: # @_Z32__device_stub__cuda_backprop_outPfS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z17cuda_backprop_outPfS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z32__device_stub__cuda_backprop_outPfS_S_, .Lfunc_end3-_Z32__device_stub__cuda_backprop_outPfS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_ # -- Begin function _Z35__device_stub__cuda_backprop_hiddenPfS_S_S_
	.type	_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_,@function
_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_: # @_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	16(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	8(%rsp), %r12
	movq	%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	$_Z20cuda_backprop_hiddenPfS_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_, .Lfunc_end4-_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__update_weight2PfS_S_ # -- Begin function _Z29__device_stub__update_weight2PfS_S_
	.type	_Z29__device_stub__update_weight2PfS_S_,@function
_Z29__device_stub__update_weight2PfS_S_: # @_Z29__device_stub__update_weight2PfS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z14update_weight2PfS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z29__device_stub__update_weight2PfS_S_, .Lfunc_end5-_Z29__device_stub__update_weight2PfS_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z29__device_stub__update_weight1PfS_S_ # -- Begin function _Z29__device_stub__update_weight1PfS_S_
	.type	_Z29__device_stub__update_weight1PfS_S_,@function
_Z29__device_stub__update_weight1PfS_S_: # @_Z29__device_stub__update_weight1PfS_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$112, %rsp
	.cfi_def_cfa_offset 160
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	40(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	32(%rsp), %rcx
	movq	%rsi, (%rcx)
	leaq	24(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rsi, 16(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	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	$_Z14update_weight1PfS_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_Z29__device_stub__update_weight1PfS_S_, .Lfunc_end6-_Z29__device_stub__update_weight1PfS_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z7predictPfS_S_S_S_S_
.LCPI7_0:
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI7_1:
	.long	0x3f800000                      # float 1
.LCPI7_2:
	.long	0x3f000000                      # float 0.5
	.text
	.globl	_Z7predictPfS_S_S_S_S_
	.type	_Z7predictPfS_S_S_S_S_,@function
_Z7predictPfS_S_S_S_S_:                 # @_Z7predictPfS_S_S_S_S_
	.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	$136, %rsp
	.cfi_def_cfa_offset 192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 24(%rsp)                   # 8-byte Spill
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	movq	%rsi, 8(%rsp)                   # 8-byte Spill
	movq	%rdi, %rbp
	xorl	%ebx, %ebx
.LBB7_1:                                # %.preheader52
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_2 Depth 2
                                        #       Child Loop BB7_3 Depth 3
                                        #     Child Loop BB7_6 Depth 2
	imulq	$104, %rbx, %rsi
	addq	%rbp, %rsi
	movl	$26, %ecx
	leaq	32(%rsp), %rdi
	rep;movsl (%rsi), %es:(%rdi)
	movq	16(%rsp), %r12                  # 8-byte Reload
	xorl	%r13d, %r13d
.LBB7_2:                                # %.preheader
                                        #   Parent Loop BB7_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB7_3 Depth 3
	xorps	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB7_3:                                #   Parent Loop BB7_1 Depth=1
                                        #     Parent Loop BB7_2 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	32(%rsp,%rax,4), %xmm1          # xmm1 = mem[0],zero,zero,zero
	mulss	(%r12,%rax,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rax
	cmpq	$26, %rax
	jne	.LBB7_3
# %bb.4:                                #   in Loop: Header=BB7_2 Depth=2
	xorps	.LCPI7_0(%rip), %xmm0
	callq	expf
	movss	.LCPI7_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	divss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%r13,4)
	incq	%r13
	addq	$104, %r12
	cmpq	$10, %r13
	jne	.LBB7_2
# %bb.5:                                # %.preheader50.preheader
                                        #   in Loop: Header=BB7_1 Depth=1
	xorps	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB7_6:                                # %.preheader50
                                        #   Parent Loop BB7_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	(%r14,%rax,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	(%r15,%rax,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rax
	cmpq	$10, %rax
	jne	.LBB7_6
# %bb.7:                                # %.critedge
                                        #   in Loop: Header=BB7_1 Depth=1
	xorps	.LCPI7_0(%rip), %xmm0
	callq	expf
	movss	.LCPI7_1(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	addss	%xmm2, %xmm0
	movaps	%xmm2, %xmm1
	divss	%xmm0, %xmm1
	movq	24(%rsp), %rax                  # 8-byte Reload
	movss	%xmm1, (%rax)
	movss	.LCPI7_2(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	cmpltss	%xmm1, %xmm0
	andps	%xmm2, %xmm0
	movq	8(%rsp), %rax                   # 8-byte Reload
	movss	%xmm0, (%rax,%rbx,4)
	incq	%rbx
	cmpq	$232, %rbx
	jne	.LBB7_1
# %bb.8:
	addq	$136, %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_end7:
	.size	_Z7predictPfS_S_S_S_S_, .Lfunc_end7-_Z7predictPfS_S_S_S_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function _Z8train_nnPfS_S_S_S_S_i
.LCPI8_0:
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.long	0x80000000                      # float -0
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI8_1:
	.long	0x3f800000                      # float 1
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI8_2:
	.quad	0xbfb999999999999a              # double -0.10000000000000001
	.text
	.globl	_Z8train_nnPfS_S_S_S_S_i
	.type	_Z8train_nnPfS_S_S_S_S_i,@function
_Z8train_nnPfS_S_S_S_S_i:               # @_Z8train_nnPfS_S_S_S_S_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	$184, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%r9, 24(%rsp)                   # 8-byte Spill
	movq	%rsi, 16(%rsp)                  # 8-byte Spill
	movq	%rdi, 8(%rsp)                   # 8-byte Spill
	cmpl	$0, 240(%rsp)
	jle	.LBB8_19
# %bb.1:                                # %.preheader104.preheader
	movq	%r8, %r14
	movq	%rcx, %r15
	movq	%rdx, %r13
	xorl	%eax, %eax
.LBB8_2:                                # %.preheader104
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB8_3 Depth 2
                                        #       Child Loop BB8_4 Depth 3
                                        #         Child Loop BB8_5 Depth 4
                                        #       Child Loop BB8_8 Depth 3
                                        #       Child Loop BB8_10 Depth 3
                                        #       Child Loop BB8_12 Depth 3
                                        #       Child Loop BB8_14 Depth 3
                                        #         Child Loop BB8_15 Depth 4
	movq	%rax, (%rsp)                    # 8-byte Spill
	xorl	%ebx, %ebx
.LBB8_3:                                # %.preheader103
                                        #   Parent Loop BB8_2 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB8_4 Depth 3
                                        #         Child Loop BB8_5 Depth 4
                                        #       Child Loop BB8_8 Depth 3
                                        #       Child Loop BB8_10 Depth 3
                                        #       Child Loop BB8_12 Depth 3
                                        #       Child Loop BB8_14 Depth 3
                                        #         Child Loop BB8_15 Depth 4
	imulq	$104, %rbx, %rsi
	addq	8(%rsp), %rsi                   # 8-byte Folded Reload
	movl	$26, %ecx
	leaq	80(%rsp), %rdi
	rep;movsl (%rsi), %es:(%rdi)
	movq	%r13, %r12
	xorl	%ebp, %ebp
.LBB8_4:                                # %.preheader99
                                        #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB8_5 Depth 4
	xorps	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB8_5:                                #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        #       Parent Loop BB8_4 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movss	80(%rsp,%rax,4), %xmm1          # xmm1 = mem[0],zero,zero,zero
	mulss	(%r12,%rax,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rax
	cmpq	$26, %rax
	jne	.LBB8_5
# %bb.6:                                #   in Loop: Header=BB8_4 Depth=3
	xorps	.LCPI8_0(%rip), %xmm0
	callq	expf
	movss	.LCPI8_1(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	addss	%xmm1, %xmm0
	divss	%xmm0, %xmm1
	movss	%xmm1, (%r14,%rbp,4)
	incq	%rbp
	addq	$104, %r12
	cmpq	$10, %rbp
	jne	.LBB8_4
# %bb.7:                                # %.preheader101.preheader
                                        #   in Loop: Header=BB8_3 Depth=2
	xorps	%xmm0, %xmm0
	xorl	%eax, %eax
.LBB8_8:                                # %.preheader101
                                        #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r14,%rax,4), %xmm1            # xmm1 = mem[0],zero,zero,zero
	mulss	(%r15,%rax,4), %xmm1
	addss	%xmm1, %xmm0
	incq	%rax
	cmpq	$10, %rax
	jne	.LBB8_8
# %bb.9:                                # %.critedge
                                        #   in Loop: Header=BB8_3 Depth=2
	xorps	.LCPI8_0(%rip), %xmm0
	callq	expf
	movss	.LCPI8_1(%rip), %xmm4           # xmm4 = mem[0],zero,zero,zero
	addss	%xmm4, %xmm0
	movaps	%xmm4, %xmm1
	divss	%xmm0, %xmm1
	movq	24(%rsp), %rax                  # 8-byte Reload
	movss	%xmm1, (%rax)
	movq	16(%rsp), %rax                  # 8-byte Reload
	subss	(%rax,%rbx,4), %xmm1
	xorl	%eax, %eax
	xorps	%xmm5, %xmm5
.LBB8_10:                               # %.preheader98
                                        #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r15,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	addss	%xmm5, %xmm0
	movss	(%r14,%rax,4), %xmm2            # xmm2 = mem[0],zero,zero,zero
	movaps	%xmm4, %xmm3
	subss	%xmm2, %xmm3
	mulss	%xmm2, %xmm3
	mulss	%xmm0, %xmm3
	movss	%xmm3, 32(%rsp,%rax,4)
	incq	%rax
	cmpq	$10, %rax
	jne	.LBB8_10
# %bb.11:                               # %.preheader100.preheader
                                        #   in Loop: Header=BB8_3 Depth=2
	xorl	%eax, %eax
	movsd	.LCPI8_2(%rip), %xmm3           # xmm3 = mem[0],zero
.LBB8_12:                               # %.preheader100
                                        #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movss	(%r14,%rax,4), %xmm0            # xmm0 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm0
	cvtss2sd	%xmm0, %xmm0
	xorps	%xmm2, %xmm2
	cvtss2sd	(%r15,%rax,4), %xmm2
	mulsd	%xmm3, %xmm0
	addsd	%xmm0, %xmm2
	xorps	%xmm0, %xmm0
	cvtsd2ss	%xmm2, %xmm0
	movss	%xmm0, (%r15,%rax,4)
	incq	%rax
	cmpq	$10, %rax
	jne	.LBB8_12
# %bb.13:                               # %.preheader.preheader
                                        #   in Loop: Header=BB8_3 Depth=2
	movq	%r13, %rax
	xorl	%ecx, %ecx
.LBB8_14:                               # %.preheader
                                        #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        # =>    This Loop Header: Depth=3
                                        #         Child Loop BB8_15 Depth 4
	movss	32(%rsp,%rcx,4), %xmm0          # xmm0 = mem[0],zero,zero,zero
	xorl	%edx, %edx
.LBB8_15:                               #   Parent Loop BB8_2 Depth=1
                                        #     Parent Loop BB8_3 Depth=2
                                        #       Parent Loop BB8_14 Depth=3
                                        # =>      This Inner Loop Header: Depth=4
	movss	80(%rsp,%rdx,4), %xmm1          # xmm1 = mem[0],zero,zero,zero
	mulss	%xmm0, %xmm1
	cvtss2sd	%xmm1, %xmm1
	xorps	%xmm2, %xmm2
	cvtss2sd	(%rax,%rdx,4), %xmm2
	mulsd	%xmm3, %xmm1
	addsd	%xmm1, %xmm2
	xorps	%xmm1, %xmm1
	cvtsd2ss	%xmm2, %xmm1
	movss	%xmm1, (%rax,%rdx,4)
	incq	%rdx
	cmpq	$26, %rdx
	jne	.LBB8_15
# %bb.16:                               # %.critedge96
                                        #   in Loop: Header=BB8_14 Depth=3
	incq	%rcx
	addq	$104, %rax
	cmpq	$10, %rcx
	jne	.LBB8_14
# %bb.17:                               #   in Loop: Header=BB8_3 Depth=2
	incq	%rbx
	cmpq	$541, %rbx                      # imm = 0x21D
	jne	.LBB8_3
# %bb.18:                               #   in Loop: Header=BB8_2 Depth=1
	movq	(%rsp), %rax                    # 8-byte Reload
	incl	%eax
	cmpl	240(%rsp), %eax
	jne	.LBB8_2
.LBB8_19:                               # %._crit_edge
	xorps	%xmm0, %xmm0
	addq	$184, %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_end8:
	.size	_Z8train_nnPfS_S_S_S_S_i, .Lfunc_end8-_Z8train_nnPfS_S_S_S_S_i
	.cfi_endproc
                                        # -- End function
	.globl	_Z11import_dataPfS_S_S_         # -- Begin function _Z11import_dataPfS_S_S_
	.type	_Z11import_dataPfS_S_S_,@function
_Z11import_dataPfS_S_S_:                # @_Z11import_dataPfS_S_S_
	.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	$4136, %rsp                     # imm = 0x1028
	.cfi_def_cfa_offset 4192
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rcx, 24(%rsp)                  # 8-byte Spill
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	movq	%rsi, 8(%rsp)                   # 8-byte Spill
	movq	%rdi, %r12
	movl	$.L.str, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r13
	leaq	3104(%rsp), %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	je	.LBB9_6
# %bb.1:                                # %.lr.ph54.preheader
	xorl	%r14d, %r14d
	leaq	3104(%rsp), %rbp
.LBB9_2:                                # %.lr.ph54
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_4 Depth 2
	movq	%rbp, %rdi
	callq	strdup
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	strtok
	testq	%rax, %rax
	je	.LBB9_5
# %bb.3:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB9_2 Depth=1
	movslq	%r14d, %rcx
	leaq	(%r12,%rcx,4), %r15
.LBB9_4:                                # %.lr.ph
                                        #   Parent Loop BB9_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r15)
	movl	$.L.str.2, %esi
	xorl	%edi, %edi
	callq	strtok
	addq	$4, %r15
	incl	%r14d
	testq	%rax, %rax
	jne	.LBB9_4
.LBB9_5:                                # %._crit_edge
                                        #   in Loop: Header=BB9_2 Depth=1
	movq	%rbx, %rdi
	callq	free
	movq	%rbp, %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%r13, %rdx
	callq	fgets
	testq	%rax, %rax
	jne	.LBB9_2
.LBB9_6:                                # %._crit_edge55
	movl	$.L.str.3, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r12
	leaq	2080(%rsp), %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	movq	8(%rsp), %rbp                   # 8-byte Reload
	je	.LBB9_12
# %bb.7:                                # %.lr.ph66.preheader
	xorl	%r14d, %r14d
	leaq	2080(%rsp), %r13
.LBB9_8:                                # %.lr.ph66
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_10 Depth 2
	movq	%r13, %rdi
	callq	strdup
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	strtok
	testq	%rax, %rax
	je	.LBB9_11
# %bb.9:                                # %.lr.ph60.preheader
                                        #   in Loop: Header=BB9_8 Depth=1
	movslq	%r14d, %rcx
	leaq	(,%rcx,4), %r15
	addq	%rbp, %r15
.LBB9_10:                               # %.lr.ph60
                                        #   Parent Loop BB9_8 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r15)
	movl	$.L.str.2, %esi
	xorl	%edi, %edi
	callq	strtok
	addq	$4, %r15
	incl	%r14d
	testq	%rax, %rax
	jne	.LBB9_10
.LBB9_11:                               # %._crit_edge61
                                        #   in Loop: Header=BB9_8 Depth=1
	movq	%rbx, %rdi
	callq	free
	movq	%r13, %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%r12, %rdx
	callq	fgets
	testq	%rax, %rax
	jne	.LBB9_8
.LBB9_12:                               # %._crit_edge67
	movl	$.L.str.4, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r15
	leaq	1056(%rsp), %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	movq	16(%rsp), %rbp                  # 8-byte Reload
	je	.LBB9_18
# %bb.13:                               # %.lr.ph78.preheader
	xorl	%r14d, %r14d
	leaq	1056(%rsp), %r12
.LBB9_14:                               # %.lr.ph78
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_16 Depth 2
	movq	%r12, %rdi
	callq	strdup
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	strtok
	testq	%rax, %rax
	je	.LBB9_17
# %bb.15:                               # %.lr.ph72.preheader
                                        #   in Loop: Header=BB9_14 Depth=1
	movslq	%r14d, %rcx
	leaq	(,%rcx,4), %r13
	addq	%rbp, %r13
.LBB9_16:                               # %.lr.ph72
                                        #   Parent Loop BB9_14 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r13)
	movl	$.L.str.2, %esi
	xorl	%edi, %edi
	callq	strtok
	addq	$4, %r13
	incl	%r14d
	testq	%rax, %rax
	jne	.LBB9_16
.LBB9_17:                               # %._crit_edge73
                                        #   in Loop: Header=BB9_14 Depth=1
	movq	%rbx, %rdi
	callq	free
	movq	%r12, %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%r15, %rdx
	callq	fgets
	testq	%rax, %rax
	jne	.LBB9_14
.LBB9_18:                               # %._crit_edge79
	movl	$.L.str.5, %edi
	movl	$.L.str.1, %esi
	callq	fopen
	movq	%rax, %r14
	leaq	32(%rsp), %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%rax, %rdx
	callq	fgets
	testq	%rax, %rax
	movq	24(%rsp), %rbp                  # 8-byte Reload
	je	.LBB9_24
# %bb.19:                               # %.lr.ph90.preheader
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r15
.LBB9_20:                               # %.lr.ph90
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_22 Depth 2
	movq	%r15, %rdi
	callq	strdup
	movq	%rax, %rbx
	movl	$.L.str.2, %esi
	movq	%rax, %rdi
	callq	strtok
	testq	%rax, %rax
	je	.LBB9_23
# %bb.21:                               # %.lr.ph84.preheader
                                        #   in Loop: Header=BB9_20 Depth=1
	movslq	%r12d, %rcx
	leaq	(,%rcx,4), %r13
	addq	%rbp, %r13
.LBB9_22:                               # %.lr.ph84
                                        #   Parent Loop BB9_20 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	%rax, %rdi
	callq	atof
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r13)
	movl	$.L.str.2, %esi
	xorl	%edi, %edi
	callq	strtok
	addq	$4, %r13
	incl	%r12d
	testq	%rax, %rax
	jne	.LBB9_22
.LBB9_23:                               # %._crit_edge85
                                        #   in Loop: Header=BB9_20 Depth=1
	movq	%rbx, %rdi
	callq	free
	movq	%r15, %rdi
	movl	$1024, %esi                     # imm = 0x400
	movq	%r14, %rdx
	callq	fgets
	testq	%rax, %rax
	jne	.LBB9_20
.LBB9_24:                               # %._crit_edge91
	addq	$4136, %rsp                     # imm = 0x1028
	.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_end9:
	.size	_Z11import_dataPfS_S_S_, .Lfunc_end9-_Z11import_dataPfS_S_S_
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI10_0:
	.quad	0x41dfffffffc00000              # double 2147483647
.LCPI10_2:
	.quad	0x3fe0000000000000              # double 0.5
.LCPI10_5:
	.quad	0x3f1a36e2eb1c432d              # double 1.0E-4
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0
.LCPI10_1:
	.long	0x47c35000                      # float 1.0E+5
.LCPI10_6:
	.long	0x43680000                      # float 232
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0
.LCPI10_3:
	.quad	0x7fffffffffffffff              # double NaN
	.quad	0x7fffffffffffffff              # double NaN
.LCPI10_4:
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.long	0x7fffffff                      # float NaN
	.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	$84920, %rsp                    # imm = 0x14BB8
	.cfi_def_cfa_offset 84976
	.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	$4328, %edi                     # imm = 0x10E8
	callq	_Znam
	movq	%rax, %rbx
	movl	$4328, %edi                     # imm = 0x10E8
	callq	_Znam
	movq	%rax, %r14
	callq	hipDeviceReset
	movl	$4328, %edi                     # imm = 0x10E8
	callq	_Znam
	movq	%rax, 8(%rsp)                   # 8-byte Spill
	movl	$4328, %edi                     # imm = 0x10E8
	callq	_Znam
	movq	%rax, %r13
	movl	$8, %edi
	callq	malloc
	movq	%rax, 136(%rsp)                 # 8-byte Spill
	leaq	28656(%rsp), %r15
	leaq	2352(%rsp), %rsi
	leaq	4528(%rsp), %rdx
	leaq	1424(%rsp), %rcx
	movq	%r15, %rdi
	callq	_Z11import_dataPfS_S_S_
	xorl	%r12d, %r12d
.LBB10_1:                               # %.critedge
                                        # =>This Inner Loop Header: Depth=1
	movl	$104, %edi
	callq	_Znam
	movq	%rax, %rbp
	movq	8(%rsp), %rax                   # 8-byte Reload
	movq	%rbp, (%rax,%r12,2)
	movl	$104, %edi
	callq	_Znam
	movl	$26, %ecx
	movq	%rax, (%r13,%r12,2)
	movq	%rbp, %rdi
	movq	%r15, %rsi
	rep;movsl (%rsi), %es:(%rdi)
	movss	2352(%rsp,%r12), %xmm0          # xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, (%rax)
	addq	$104, %r15
	addq	$4, %r12
	cmpq	$2164, %r12                     # imm = 0x874
	jne	.LBB10_1
# %bb.2:                                # %.preheader181.preheader
	movq	%r13, 96(%rsp)                  # 8-byte Spill
	movq	8(%rsp), %r13                   # 8-byte Reload
	leaq	384(%rsp), %r15
	xorl	%ebp, %ebp
.LBB10_3:                               # %.preheader181
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_4 Depth 2
	xorl	%r12d, %r12d
.LBB10_4:                               #   Parent Loop BB10_3 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	movsd	.LCPI10_0(%rip), %xmm1          # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, (%r15,%r12,4)
	incq	%r12
	cmpq	$26, %r12
	jne	.LBB10_4
# %bb.5:                                #   in Loop: Header=BB10_3 Depth=1
	incq	%rbp
	addq	$104, %r15
	cmpq	$10, %rbp
	jne	.LBB10_3
# %bb.6:                                # %.preheader180.preheader
	xorl	%r15d, %r15d
.LBB10_7:                               # %.preheader180
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI10_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 192(%rsp,%r15,4)
	incq	%r15
	cmpq	$10, %r15
	jne	.LBB10_7
# %bb.8:                                # %.critedge155.preheader
	xorl	%r15d, %r15d
	movq	%r13, %r12
.LBB10_9:                               # %.critedge155
                                        # =>This Inner Loop Header: Depth=1
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI10_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 288(%rsp,%r15,4)
	incq	%r15
	cmpq	$10, %r15
	jne	.LBB10_9
# %bb.10:                               # %.critedge157
	callq	rand
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	divsd	.LCPI10_0(%rip), %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, 92(%rsp)
	xorl	%r15d, %r15d
	movq	96(%rsp), %r13                  # 8-byte Reload
.LBB10_11:                              # =>This Inner Loop Header: Depth=1
	leaq	(%rbx,%r15), %rdi
	movl	$104, %esi
	callq	hipMalloc
	movq	(%rbx,%r15), %rdi
	movq	(%r12,%r15), %rsi
	movl	$104, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	(%r14,%r15), %rdi
	movl	$4, %esi
	callq	hipMalloc
	movq	(%r14,%r15), %rdi
	movq	(%r13,%r15), %rsi
	movl	$4, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	addq	$8, %r15
	cmpq	$4328, %r15                     # imm = 0x10E8
	jne	.LBB10_11
# %bb.12:
	movabsq	$60129542158, %r12              # imm = 0xE0000000E
	movabsq	$8589934631, %r13               # imm = 0x200000027
	leaq	40(%rsp), %r15
	movl	$1040, %esi                     # imm = 0x410
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	384(%rsp), %rsi
	movl	$1040, %edx                     # imm = 0x410
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	32(%rsp), %r15
	movl	$40, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	192(%rsp), %rsi
	movl	$40, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	24(%rsp), %r15
	movl	$40, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	240(%rsp), %rsi
	movl	$40, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	72(%rsp), %r15
	movl	$4, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	88(%rsp), %rsi
	movl	$4, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	16(%rsp), %r15
	movl	$4, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	84(%rsp), %rbp
	movl	$4, %edx
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	64(%rsp), %r15
	movl	$40, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	336(%rsp), %rsi
	movl	$40, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	128(%rsp), %r15
	movl	$40, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	288(%rsp), %rsi
	movl	$40, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	120(%rsp), %r15
	movl	$40, %esi
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%r15), %rdi
	leaq	92(%rsp), %rsi
	movl	$40, %edx
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$.L.str.6, %edi
	movl	$400, %esi                      # imm = 0x190
	xorl	%eax, %eax
	callq	printf
	leaq	160(%rsp), %r15
	movq	%r15, %rdi
	callq	hipEventCreate
	leaq	56(%rsp), %rdi
	callq	hipEventCreate
	movq	(%r15), %rdi
	xorl	%esi, %esi
	callq	hipEventRecord
	xorl	%eax, %eax
	movss	.LCPI10_1(%rip), %xmm0          # xmm0 = mem[0],zero,zero,zero
	movq	%rbx, 144(%rsp)                 # 8-byte Spill
.LBB10_13:                              # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB10_14 Depth 2
	movaps	%xmm0, 176(%rsp)                # 16-byte Spill
	movq	%rax, 152(%rsp)                 # 8-byte Spill
	xorpd	%xmm1, %xmm1
	xorl	%r15d, %r15d
.LBB10_14:                              #   Parent Loop BB10_13 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_16
# %bb.15:                               #   in Loop: Header=BB10_14 Depth=2
	movq	(%rbx,%r15,8), %rdi
	movq	40(%rsp), %rsi
	movq	24(%rsp), %rdx
	movq	128(%rsp), %rcx
	callq	_Z29__device_stub__cuda_forward_1PfS_S_S_
.LBB10_16:                              #   in Loop: Header=BB10_14 Depth=2
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_18
# %bb.17:                               #   in Loop: Header=BB10_14 Depth=2
	movq	32(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	72(%rsp), %rdx
	movq	120(%rsp), %rcx
	callq	_Z29__device_stub__cuda_forward_2PfS_S_S_
.LBB10_18:                              #   in Loop: Header=BB10_14 Depth=2
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_20
# %bb.19:                               #   in Loop: Header=BB10_14 Depth=2
	movq	16(%rsp), %rdi
	movq	72(%rsp), %rsi
	movq	(%r14,%r15,8), %rdx
	callq	_Z32__device_stub__cuda_backprop_outPfS_S_
.LBB10_20:                              #   in Loop: Header=BB10_14 Depth=2
	movq	16(%rsp), %rsi
	movl	$4, %edx
	movq	%rbp, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	movq	16(%rsp), %rdi
	movl	$4, %edx
	movq	%rbp, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	xorps	%xmm0, %xmm0
	cvtss2sd	84(%rsp), %xmm0
	movsd	%xmm0, 48(%rsp)                 # 8-byte Spill
	mulsd	.LCPI10_2(%rip), %xmm0
	movapd	%xmm0, 96(%rsp)                 # 16-byte Spill
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_22
# %bb.21:                               #   in Loop: Header=BB10_14 Depth=2
	movq	64(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	32(%rsp), %rdx
	movq	16(%rsp), %rcx
	callq	_Z35__device_stub__cuda_backprop_hiddenPfS_S_S_
.LBB10_22:                              #   in Loop: Header=BB10_14 Depth=2
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_24
# %bb.23:                               #   in Loop: Header=BB10_14 Depth=2
	movq	32(%rsp), %rdi
	movq	24(%rsp), %rsi
	movq	16(%rsp), %rdx
	callq	_Z29__device_stub__update_weight2PfS_S_
.LBB10_24:                              #   in Loop: Header=BB10_14 Depth=2
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r13, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB10_26
# %bb.25:                               #   in Loop: Header=BB10_14 Depth=2
	movq	40(%rsp), %rdi
	movq	(%rbx,%r15,8), %rsi
	movq	64(%rsp), %rdx
	callq	_Z29__device_stub__update_weight1PfS_S_
.LBB10_26:                              #   in Loop: Header=BB10_14 Depth=2
	movapd	96(%rsp), %xmm1                 # 16-byte Reload
	mulsd	48(%rsp), %xmm1                 # 8-byte Folded Reload
	andpd	.LCPI10_3(%rip), %xmm1
	xorps	%xmm0, %xmm0
	cvtss2sd	8(%rsp), %xmm0                  # 4-byte Folded Reload
	addsd	%xmm1, %xmm0
	xorps	%xmm1, %xmm1
	cvtsd2ss	%xmm0, %xmm1
	incq	%r15
	cmpq	$541, %r15                      # imm = 0x21D
	jne	.LBB10_14
# %bb.27:                               #   in Loop: Header=BB10_13 Depth=1
	xorps	%xmm0, %xmm0
	cvtss2sd	%xmm1, %xmm0
	movl	$.L.str.7, %edi
	movss	%xmm1, 8(%rsp)                  # 4-byte Spill
	movsd	%xmm0, 48(%rsp)                 # 8-byte Spill
	movb	$1, %al
	callq	printf
	movaps	176(%rsp), %xmm0                # 16-byte Reload
	subss	8(%rsp), %xmm0                  # 4-byte Folded Reload
	andps	.LCPI10_4(%rip), %xmm0
	movq	%r14, %rbx
	movq	152(%rsp), %r14                 # 8-byte Reload
	leal	1(%r14), %r15d
	cvtss2sd	%xmm0, %xmm0
	movsd	%xmm0, 96(%rsp)                 # 8-byte Spill
	movl	$.L.str.8, %edi
	movb	$1, %al
	callq	printf
	movq	%r14, %rax
	movq	%rbx, %r14
	movq	144(%rsp), %rbx                 # 8-byte Reload
	movsd	96(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	ucomisd	.LCPI10_5(%rip), %xmm0
	jbe	.LBB10_29
# %bb.28:                               #   in Loop: Header=BB10_13 Depth=1
	movss	8(%rsp), %xmm0                  # 4-byte Reload
                                        # xmm0 = mem[0],zero,zero,zero
	cmpl	$399, %eax                      # imm = 0x18F
	movl	%r15d, %eax
	jb	.LBB10_13
.LBB10_29:
	movq	56(%rsp), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	hipEventRecord
	movq	56(%rsp), %rdi
	callq	hipEventSynchronize
	movq	40(%rsp), %rsi
	leaq	384(%rsp), %rdi
	movl	$1040, %edx                     # imm = 0x410
	movl	$2, %ecx
	callq	hipMemcpy
	movq	32(%rsp), %rsi
	leaq	192(%rsp), %r13
	movl	$40, %edx
	movq	%r13, %rdi
	movl	$2, %ecx
	callq	hipMemcpy
	leaq	172(%rsp), %rbp
	movl	$0, (%rbp)
	movq	160(%rsp), %rsi
	movq	56(%rsp), %rdx
	movq	%rbp, %rdi
	callq	hipEventElapsedTime
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbp), %xmm0
	movl	$.L.str.9, %edi
	movl	%r15d, %esi
	movb	$1, %al
	callq	printf
	movl	$.L.str.10, %edi
	movsd	48(%rsp), %xmm0                 # 8-byte Reload
                                        # xmm0 = mem[0],zero
	movb	$1, %al
	callq	printf
	leaq	4528(%rsp), %rdi
	leaq	240(%rsp), %r8
	leaq	88(%rsp), %r9
	movq	136(%rsp), %r15                 # 8-byte Reload
	movq	%r15, %rsi
	leaq	384(%rsp), %rdx
	movq	%r13, %rcx
	callq	_Z7predictPfS_S_S_S_S_
	xorl	%eax, %eax
.LBB10_30:                              # =>This Inner Loop Header: Depth=1
	movss	1424(%rsp,%r12,4), %xmm0        # xmm0 = mem[0],zero,zero,zero
	cmpeqss	(%r15,%r12,4), %xmm0
	movd	%xmm0, %ecx
	subl	%ecx, %eax
	incq	%r12
	cmpq	$232, %r12
	jne	.LBB10_30
# %bb.31:
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	divss	.LCPI10_6(%rip), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	$.L.str.11, %edi
	movb	$1, %al
	callq	printf
	movq	%r15, %rdi
	callq	free
	movq	%rbx, %rdi
	callq	hipFree
	movq	%r14, %rdi
	callq	hipFree
	movq	40(%rsp), %rdi
	callq	hipFree
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	128(%rsp), %rdi
	callq	hipFree
	movq	120(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	72(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	movq	64(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$84920, %rsp                    # imm = 0x14BB8
	.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	main, .Lfunc_end10-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	.LBB11_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB11_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14cuda_forward_1PfS_S_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14cuda_forward_2PfS_S_S_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z17cuda_backprop_outPfS_S_, %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	$_Z20cuda_backprop_hiddenPfS_S_S_, %esi
	movl	$.L__unnamed_4, %edx
	movl	$.L__unnamed_4, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14update_weight2PfS_S_, %esi
	movl	$.L__unnamed_5, %edx
	movl	$.L__unnamed_5, %ecx
	movq	%rbx, %rdi
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z14update_weight1PfS_S_, %esi
	movl	$.L__unnamed_6, %edx
	movl	$.L__unnamed_6, %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_end11:
	.size	__hip_module_ctor, .Lfunc_end11-__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	.LBB12_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
.LBB12_2:
	retq
.Lfunc_end12:
	.size	__hip_module_dtor, .Lfunc_end12-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_Z14cuda_forward_1PfS_S_S_,@object # @_Z14cuda_forward_1PfS_S_S_
	.section	.rodata,"a",@progbits
	.globl	_Z14cuda_forward_1PfS_S_S_
	.p2align	3, 0x0
_Z14cuda_forward_1PfS_S_S_:
	.quad	_Z29__device_stub__cuda_forward_1PfS_S_S_
	.size	_Z14cuda_forward_1PfS_S_S_, 8

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

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"train_data.csv"
	.size	.L.str, 15

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"r"
	.size	.L.str.1, 2

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"test_data.csv"
	.size	.L.str.4, 14

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"test_y.csv"
	.size	.L.str.5, 11

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"                          TRAINING WITH %d EPOCHS:\n__________________________________________________________________________\n__________________________________________________________________________\n\n"
	.size	.L.str.6, 203

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"%f\n"
	.size	.L.str.7, 4

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"MSE ABS DIFFERENCE FOR EPOCH: %f\n"
	.size	.L.str.8, 34

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"The time taken to train with %d epochs is: %fms\n"
	.size	.L.str.9, 49

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"MSE FINAL: %f\n"
	.size	.L.str.10, 15

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"The final prediction accuracy is: %f \n"
	.size	.L.str.11, 39

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

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z14cuda_forward_2PfS_S_S_"
	.size	.L__unnamed_2, 27

	.type	.L__unnamed_3,@object           # @2
.L__unnamed_3:
	.asciz	"_Z17cuda_backprop_outPfS_S_"
	.size	.L__unnamed_3, 28

	.type	.L__unnamed_4,@object           # @3
.L__unnamed_4:
	.asciz	"_Z20cuda_backprop_hiddenPfS_S_S_"
	.size	.L__unnamed_4, 33

	.type	.L__unnamed_5,@object           # @4
.L__unnamed_5:
	.asciz	"_Z14update_weight2PfS_S_"
	.size	.L__unnamed_5, 25

	.type	.L__unnamed_6,@object           # @5
.L__unnamed_6:
	.asciz	"_Z14update_weight1PfS_S_"
	.size	.L__unnamed_6, 25

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _Z29__device_stub__cuda_forward_1PfS_S_S_
	.addrsig_sym _Z29__device_stub__cuda_forward_2PfS_S_S_
	.addrsig_sym _Z32__device_stub__cuda_backprop_outPfS_S_
	.addrsig_sym _Z35__device_stub__cuda_backprop_hiddenPfS_S_S_
	.addrsig_sym _Z29__device_stub__update_weight2PfS_S_
	.addrsig_sym _Z29__device_stub__update_weight1PfS_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Z14cuda_forward_1PfS_S_S_
	.addrsig_sym _Z14cuda_forward_2PfS_S_S_
	.addrsig_sym _Z17cuda_backprop_outPfS_S_
	.addrsig_sym _Z20cuda_backprop_hiddenPfS_S_S_
	.addrsig_sym _Z14update_weight2PfS_S_
	.addrsig_sym _Z14update_weight1PfS_S_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z14cuda_forward_1PfS_S_S_ ; -- Begin function _Z14cuda_forward_1PfS_S_S_
	.globl	_Z14cuda_forward_1PfS_S_S_
	.p2align	8
	.type	_Z14cuda_forward_1PfS_S_S_,@function
_Z14cuda_forward_1PfS_S_S_:             ; @_Z14cuda_forward_1PfS_S_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x2c
	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_e32 10, v1
	s_cbranch_execz .LBB0_4
; %bb.1:                                ; %.preheader
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mul_lo_u32 v2, v1, 26
	v_mov_b32_e32 v0, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s2, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v3, vcc_lo
	s_mov_b64 s[2:3], 0
.LBB0_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v4, vcc_lo, v2, s2
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s3, v3, vcc_lo
	s_add_u32 s8, s0, s2
	s_addc_u32 s9, s1, s3
	s_add_u32 s2, s2, 4
	global_load_b32 v4, v[4:5], off
	s_load_b32 s8, s[8:9], 0x0
	s_addc_u32 s3, s3, 0
	s_cmpk_eq_i32 s2, 0x68
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fmac_f32_e32 v0, s8, v4
	s_cbranch_scc0 .LBB0_2
; %bb.3:
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	v_add_co_u32 v3, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v2, vcc_lo
	global_load_b32 v3, v[3:4], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, v0, v3
	v_mul_f32_e32 v3, 0xbfb8aa3b, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v4, 0xbfb8aa3b, v0, -v3
	v_rndne_f32_e32 v5, v3
	v_sub_f32_e32 v3, v3, v5
	v_cmp_nlt_f32_e32 vcc_lo, 0x42ce8ed0, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v4, v0, 0xb2a5705f, v4
	v_add_f32_e32 v3, v3, v4
	v_cvt_i32_f32_e32 v4, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_exp_f32_e32 v3, v3
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v3, v3, v4
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2b17218, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, 0x7f800000, v3, vcc_lo
	v_add_f32_e32 v0, 1.0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v3, null, v0, v0, 1.0
	v_div_scale_f32 v6, vcc_lo, 1.0, v0, 1.0
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v3, v4, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v5, v4
	v_mul_f32_e32 v5, v6, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, -v3, v5, v6
	v_fmac_f32_e32 v5, v7, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v3, -v3, v5, v6
	v_div_fmas_f32 v3, v3, v4, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f32 v3, v3, v0, 1.0
	v_add_co_u32 v0, vcc_lo, s4, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v2, vcc_lo
	global_store_b32 v[0:1], v3, off
.LBB0_4:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14cuda_forward_1PfS_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 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	_Z14cuda_forward_1PfS_S_S_, .Lfunc_end0-_Z14cuda_forward_1PfS_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 456
; 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	_Z14cuda_forward_2PfS_S_S_ ; -- Begin function _Z14cuda_forward_2PfS_S_S_
	.globl	_Z14cuda_forward_2PfS_S_S_
	.p2align	8
	.type	_Z14cuda_forward_2PfS_S_S_,@function
_Z14cuda_forward_2PfS_S_S_:             ; @_Z14cuda_forward_2PfS_S_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x2c
	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_e32 1, v1
	s_cbranch_execz .LBB1_4
; %bb.1:                                ; %.preheader
	s_load_b256 s[0:7], s[0:1], 0x0
	v_mul_lo_u32 v2, v1, 10
	v_mov_b32_e32 v0, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v3, 31, v2
	v_lshlrev_b64 v[2:3], 2, v[2:3]
	s_waitcnt lgkmcnt(0)
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	s_mov_b64 s[0:1], 0
.LBB1_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v4, vcc_lo, v2, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v5, vcc_lo, s1, v3, vcc_lo
	s_add_u32 s8, s2, s0
	s_addc_u32 s9, s3, s1
	s_add_u32 s0, s0, 4
	global_load_b32 v4, v[4:5], off
	s_load_b32 s8, s[8:9], 0x0
	s_addc_u32 s1, s1, 0
	s_cmp_eq_u32 s0, 40
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fmac_f32_e32 v0, s8, v4
	s_cbranch_scc0 .LBB1_2
; %bb.3:
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	v_add_co_u32 v3, vcc_lo, s6, v1
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_3) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e32 v4, vcc_lo, s7, v2, vcc_lo
	global_load_b32 v3, v[3:4], off
	s_waitcnt vmcnt(0)
	v_add_f32_e32 v0, v0, v3
	v_mul_f32_e32 v3, 0xbfb8aa3b, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_fma_f32 v4, 0xbfb8aa3b, v0, -v3
	v_rndne_f32_e32 v5, v3
	v_sub_f32_e32 v3, v3, v5
	v_cmp_nlt_f32_e32 vcc_lo, 0x42ce8ed0, v0
	s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmamk_f32 v4, v0, 0xb2a5705f, v4
	v_add_f32_e32 v3, v3, v4
	v_cvt_i32_f32_e32 v4, v5
	s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_exp_f32_e32 v3, v3
	s_waitcnt_depctr 0xfff
	v_ldexp_f32 v3, v3, v4
	v_cndmask_b32_e32 v3, 0, v3, vcc_lo
	v_cmp_ngt_f32_e32 vcc_lo, 0xc2b17218, v0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cndmask_b32_e32 v0, 0x7f800000, v3, vcc_lo
	v_add_f32_e32 v0, 1.0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
	v_div_scale_f32 v3, null, v0, v0, 1.0
	v_div_scale_f32 v6, vcc_lo, 1.0, v0, 1.0
	v_rcp_f32_e32 v4, v3
	s_waitcnt_depctr 0xfff
	v_fma_f32 v5, -v3, v4, 1.0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fmac_f32_e32 v4, v5, v4
	v_mul_f32_e32 v5, v6, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v7, -v3, v5, v6
	v_fmac_f32_e32 v5, v7, v4
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_fma_f32 v3, -v3, v5, v6
	v_div_fmas_f32 v3, v3, v4, v5
	s_delay_alu instid0(VALU_DEP_1)
	v_div_fixup_f32 v3, v3, v0, 1.0
	v_add_co_u32 v0, vcc_lo, s4, v1
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v2, vcc_lo
	global_store_b32 v[0:1], v3, off
.LBB1_4:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14cuda_forward_2PfS_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 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_end1:
	.size	_Z14cuda_forward_2PfS_S_S_, .Lfunc_end1-_Z14cuda_forward_2PfS_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 456
; 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	_Z17cuda_backprop_outPfS_S_ ; -- Begin function _Z17cuda_backprop_outPfS_S_
	.globl	_Z17cuda_backprop_outPfS_S_
	.p2align	8
	.type	_Z17cuda_backprop_outPfS_S_,@function
_Z17cuda_backprop_outPfS_S_:            ; @_Z17cuda_backprop_outPfS_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x24
	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_e32 1, v1
	s_cbranch_execz .LBB2_2
; %bb.1:
	s_clause 0x1
	s_load_b128 s[4:7], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, 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_add_co_u32 v4, vcc_lo, s0, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s1, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s4, v0
	global_load_b32 v2, v[2:3], off
	global_load_b32 v3, v[4:5], off
	v_add_co_ci_u32_e32 v1, vcc_lo, s5, v1, vcc_lo
	s_waitcnt vmcnt(0)
	v_sub_f32_e32 v2, v2, v3
	global_store_b32 v[0:1], v2, off
.LBB2_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z17cuda_backprop_outPfS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 6
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end2:
	.size	_Z17cuda_backprop_outPfS_S_, .Lfunc_end2-_Z17cuda_backprop_outPfS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 168
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z20cuda_backprop_hiddenPfS_S_S_ ; -- Begin function _Z20cuda_backprop_hiddenPfS_S_S_
	.globl	_Z20cuda_backprop_hiddenPfS_S_S_
	.p2align	8
	.type	_Z20cuda_backprop_hiddenPfS_S_S_,@function
_Z20cuda_backprop_hiddenPfS_S_S_:       ; @_Z20cuda_backprop_hiddenPfS_S_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x2c
	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_e32 10, v1
	s_cbranch_execz .LBB3_2
; %bb.1:                                ; %.preheader
	s_load_b256 s[0:7], s[0:1], 0x0
	v_ashrrev_i32_e32 v2, 31, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v2, vcc_lo, s2, v0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v3, vcc_lo, s3, v1, vcc_lo
	v_add_co_u32 v4, vcc_lo, s4, v0
	v_add_co_ci_u32_e32 v5, vcc_lo, s5, v1, vcc_lo
	v_add_co_u32 v0, vcc_lo, s0, v0
	global_load_b32 v2, v[2:3], off
	global_load_b32 v3, v[4:5], off
	s_load_b32 s2, s[6:7], 0x0
	v_add_co_ci_u32_e32 v1, vcc_lo, s1, v1, vcc_lo
	s_waitcnt vmcnt(1)
	v_sub_f32_e32 v4, 1.0, v2
	s_waitcnt vmcnt(0) lgkmcnt(0)
	v_fma_f32 v3, s2, v3, 0
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mul_f32_e32 v2, v2, v4
	v_mul_f32_e32 v2, v3, v2
	global_store_b32 v[0:1], v2, off
.LBB3_2:
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z20cuda_backprop_hiddenPfS_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 288
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 6
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end3:
	.size	_Z20cuda_backprop_hiddenPfS_S_S_, .Lfunc_end3-_Z20cuda_backprop_hiddenPfS_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 188
; NumSgprs: 18
; NumVgprs: 6
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 0
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 6
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.protected	_Z14update_weight2PfS_S_ ; -- Begin function _Z14update_weight2PfS_S_
	.globl	_Z14update_weight2PfS_S_
	.p2align	8
	.type	_Z14update_weight2PfS_S_,@function
_Z14update_weight2PfS_S_:               ; @_Z14update_weight2PfS_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x24
	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_e32 1, v1
	s_cbranch_execz .LBB4_3
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b64 s[6:7], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mul_lo_u32 v3, v1, 10
	v_ashrrev_i32_e32 v2, 31, v1
	s_mov_b32 s4, 0x9999999a
	s_mov_b32 s5, 0xbfb99999
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_lshlrev_b64 v[2:3], 2, v[3:4]
	v_mov_b32_e32 v4, 0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	s_mov_b64 s[0:1], 0
.LBB4_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v5, vcc_lo, v2, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v3, vcc_lo
	s_add_u32 s6, s2, s0
	s_addc_u32 s7, s3, s1
	global_load_b32 v7, v[0:1], off
	global_load_b32 v8, v4, s[6:7]
	global_load_b32 v9, v[5:6], off
	s_add_u32 s0, s0, 4
	s_addc_u32 s1, s1, 0
	s_cmp_lg_u32 s0, 40
	s_waitcnt vmcnt(1)
	v_mul_f32_e32 v10, v8, v7
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[7:8], v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f64_f32_e32 v[9:10], v10
	v_fma_f64 v[7:8], v[9:10], s[4:5], v[7:8]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f32_f64_e32 v7, v[7:8]
	global_store_b32 v[5:6], v7, off
	s_cbranch_scc1 .LBB4_2
.LBB4_3:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14update_weight2PfS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 11
		.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_end4:
	.size	_Z14update_weight2PfS_S_, .Lfunc_end4-_Z14update_weight2PfS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 288
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; 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	_Z14update_weight1PfS_S_ ; -- Begin function _Z14update_weight1PfS_S_
	.globl	_Z14update_weight1PfS_S_
	.p2align	8
	.type	_Z14update_weight1PfS_S_,@function
_Z14update_weight1PfS_S_:               ; @_Z14update_weight1PfS_S_
; %bb.0:
	s_load_b32 s2, s[0:1], 0x24
	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_e32 10, v1
	s_cbranch_execz .LBB5_3
; %bb.1:                                ; %.preheader
	s_clause 0x1
	s_load_b64 s[6:7], s[0:1], 0x10
	s_load_b128 s[0:3], s[0:1], 0x0
	v_mul_lo_u32 v3, v1, 26
	v_ashrrev_i32_e32 v2, 31, v1
	s_mov_b32 s4, 0x9999999a
	s_mov_b32 s5, 0xbfb99999
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b64 v[0:1], 2, v[1:2]
	v_ashrrev_i32_e32 v4, 31, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_4)
	v_lshlrev_b64 v[2:3], 2, v[3:4]
	v_mov_b32_e32 v4, 0
	s_waitcnt lgkmcnt(0)
	v_add_co_u32 v0, vcc_lo, s6, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s7, v1, vcc_lo
	s_delay_alu instid0(VALU_DEP_4)
	v_add_co_u32 v2, vcc_lo, s0, v2
	v_add_co_ci_u32_e32 v3, vcc_lo, s1, v3, vcc_lo
	s_mov_b64 s[0:1], 0
.LBB5_2:                                ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)
	v_add_co_u32 v5, vcc_lo, v2, s0
	s_delay_alu instid0(VALU_DEP_2)
	v_add_co_ci_u32_e32 v6, vcc_lo, s1, v3, vcc_lo
	s_add_u32 s6, s2, s0
	s_addc_u32 s7, s3, s1
	global_load_b32 v7, v[0:1], off
	global_load_b32 v8, v4, s[6:7]
	global_load_b32 v9, v[5:6], off
	s_add_u32 s0, s0, 4
	s_addc_u32 s1, s1, 0
	s_cmpk_lg_i32 s0, 0x68
	s_waitcnt vmcnt(1)
	v_mul_f32_e32 v10, v8, v7
	s_waitcnt vmcnt(0)
	v_cvt_f64_f32_e32 v[7:8], v9
	s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f64_f32_e32 v[9:10], v10
	v_fma_f64 v[7:8], v[9:10], s[4:5], v[7:8]
	s_delay_alu instid0(VALU_DEP_1)
	v_cvt_f32_f64_e32 v7, v[7:8]
	global_store_b32 v[5:6], v7, off
	s_cbranch_scc1 .LBB5_2
.LBB5_3:                                ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z14update_weight1PfS_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 280
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 11
		.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_end5:
	.size	_Z14update_weight1PfS_S_, .Lfunc_end5-_Z14update_weight1PfS_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 288
; NumSgprs: 18
; NumVgprs: 11
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 11
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14cuda_forward_1PfS_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14cuda_forward_1PfS_S_S_.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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14cuda_forward_2PfS_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14cuda_forward_2PfS_S_S_.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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z17cuda_backprop_outPfS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z17cuda_backprop_outPfS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         24
        .size:           8
        .value_kind:     global_buffer
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         36
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         40
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         44
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         46
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         48
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         50
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         52
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         54
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         88
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         96
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 288
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z20cuda_backprop_hiddenPfS_S_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z20cuda_backprop_hiddenPfS_S_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     6
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
  - .args:
      - .address_space:  global
        .offset:         0
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14update_weight2PfS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14update_weight2PfS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .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
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .offset:         24
        .size:           4
        .value_kind:     hidden_block_count_x
      - .offset:         28
        .size:           4
        .value_kind:     hidden_block_count_y
      - .offset:         32
        .size:           4
        .value_kind:     hidden_block_count_z
      - .offset:         36
        .size:           2
        .value_kind:     hidden_group_size_x
      - .offset:         38
        .size:           2
        .value_kind:     hidden_group_size_y
      - .offset:         40
        .size:           2
        .value_kind:     hidden_group_size_z
      - .offset:         42
        .size:           2
        .value_kind:     hidden_remainder_x
      - .offset:         44
        .size:           2
        .value_kind:     hidden_remainder_y
      - .offset:         46
        .size:           2
        .value_kind:     hidden_remainder_z
      - .offset:         64
        .size:           8
        .value_kind:     hidden_global_offset_x
      - .offset:         72
        .size:           8
        .value_kind:     hidden_global_offset_y
      - .offset:         80
        .size:           8
        .value_kind:     hidden_global_offset_z
      - .offset:         88
        .size:           2
        .value_kind:     hidden_grid_dims
    .group_segment_fixed_size: 0
    .kernarg_segment_align: 8
    .kernarg_segment_size: 280
    .language:       OpenCL C
    .language_version:
      - 2
      - 0
    .max_flat_workgroup_size: 1024
    .name:           _Z14update_weight1PfS_S_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z14update_weight1PfS_S_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     11
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
