#include <stdio.h>
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <iterator>
#include <algorithm>

using namespace std;

// Training image file name
const string training_image_fn = "train-images.idx3-ubyte";

// Training label file name
const string training_label_fn = "train-labels.idx1-ubyte";


__global__
void saxpy(float n, float a, float *x, float *w)
{
	int index = blockIdx.x * blockDim.x + threadIdx.x;
	int stride = blockDim.x * gridDim.x;
	for (int i = index; i < n; i += stride)
		w[i] = w[i]*x[i] + a;
}

__global__
void softMax(float n, float a, float *x, float *w)
{
	int index = blockIdx.x * blockDim.x + threadIdx.x;
	int stride = blockDim.x * gridDim.x;
	for (int i = index; i < n; i += stride)
		w[i] = w[i]*x[i] + a;
}

// Software: Training Artificial Neural Network for MNIST database
// Author: Hy Truong Son
// Major: BSc. Computer Science
// Class: 2013 - 2016
// Institution: Eotvos Lorand University
// Email: sonpascal93@gmail.com
// Website: http://people.inf.elte.hu/hytruongson/
// Copyright 2015 (c). All rights reserved.

// File stream to read data (image, label) and write down a report
ifstream image;
ifstream label;
ofstream report;

// Number of training samples
const int nTraining = 1;

// Image size in MNIST database
const int width = 28;
const int height = 28;

// Image. In MNIST: 28x28 gray scale images.
int d[width][height];

char inputNum;
int classes = 1;



void input() {
	// Reading image
	for(int i = 0; i < 10; i++ ) {

		for (int j = 0; j < height; ++j) {
			for (int i = 0; i < width; ++i) {
				image.read(&inputNum, sizeof(char));
				if (inputNum == 0) {
					d[i][j] = 0;
				} else {
					d[i][j] = 1;
				}
			}
		}
		label.read(&inputNum, sizeof(char));
		cout << "Label:" << (int)inputNum << endl;
	}
}

int main(void)
{
	float *x, *d_x;
	float **d_w;
	float **w;

	int N = width * height;

	cout << "Starting code......."  << endl;

	x = (float *)malloc( N *sizeof(float));
	w = (float **)malloc( classes *sizeof(float*));
	for(int i = 0; i < classes; i++) {
		w[i] = (float *)malloc( N *sizeof(float));
	}

	cudaMalloc(&d_x, N *sizeof(float));

	for(int i = 0; i < classes; i++) {
		cudaMalloc(&d_w[i], N *sizeof(float));
	}

	image.open(training_image_fn.c_str(), ios::in | ios::binary); // Binary image file
	label.open(training_label_fn.c_str(), ios::in | ios::binary ); // Binary label file

	// Reading file headers
	char number;
	for (int i = 1; i <= 16; ++i) {
		image.read(&number, sizeof(char));
	}
	for (int i = 1; i <= 8; ++i) {
		label.read(&number, sizeof(char));
	}

	// Neural Network Initialization
	//init_array();

	for (int sample = 1; sample <= nTraining; ++sample) {
		cout << "Sample ---------- **************" << sample << endl;

		// Getting (image, label)
		input();
	}


	report.close();
	image.close();
	label.close();


	for (int i = 0; i < width * height; i++) {
		x[i] = (float)d[i % width][i / width];
		for(int j = 0; j < 10; j++)
			w[j][i] = static_cast <float> (rand()) / static_cast <float> (RAND_MAX);
	}

	cout << "Image:" << endl;
	for (int j = 0; j < height; ++j) {
		for (int i = 0; i < width; ++i) {
			cout << x[ (j ) * height + (i )];
		}
		cout << endl;
	}
	cout << "Label:" << (int)inputNum << endl;

	cudaMemcpy(d_x, x, N * sizeof(float), cudaMemcpyHostToDevice);

	for(int i = 0; i < classes; i++)
		cudaMemcpy(d_w[i], w[i], N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);

	// Perform SAXPY on 1M elements
	int blockSize = 256;
	int numBlocks = (N + blockSize - 1) / blockSize;
	saxpy<<<numBlocks, blockSize>>>(N, 2.0f, d_x, d_w[0]);

	cudaMemcpy(w[0], d_w[0], N*sizeof(float), cudaMemcpyDeviceToHost);

	for (int j = 0; j < height; ++j) {
		for (int i = 0; i < width; ++i) {
			cout << (float)w[i][(j) * height + (i)] << " ";
		}
		cout << endl;
	}
	cout << "Label:" << (int)inputNum << endl;

	cudaFree(d_x);
	for(int i = 0; i < classes; i++)
		cudaFree(d_w[i]);
	free(x);
	for(int i = 0; i < classes; i++)
		free(w[i]);
}

	.file	"tmpxft_00370dfd_00000000-6_test.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4779:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4779:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5510:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5510:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Label:"
	.text
	.globl	_Z5inputv
	.type	_Z5inputv, @function
_Z5inputv:
.LFB4775:
	.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
	leaq	112+d(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$10, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	pushq	%rdx
	.cfi_def_cfa_offset 64
.L4:
	leaq	d(%rip), %rbx
	leaq	inputNum(%rip), %r15
.L8:
	movq	%rbx, %r14
	movl	$28, %r13d
.L5:
	movl	$1, %edx
	movq	%r15, %rsi
	leaq	image(%rip), %rdi
	call	_ZNSi4readEPcl@PLT
	xorl	%eax, %eax
	cmpb	$0, inputNum(%rip)
	setne	%al
	addq	$112, %r14
	movl	%eax, -112(%r14)
	decl	%r13d
	jne	.L5
	addq	$4, %rbx
	cmpq	%r12, %rbx
	jne	.L8
	movl	$1, %edx
	movq	%r15, %rsi
	leaq	label(%rip), %rdi
	call	_ZNSi4readEPcl@PLT
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsbl	inputNum(%rip), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	decl	%ebp
	jne	.L4
	popq	%rax
	.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
.LFE4775:
	.size	_Z5inputv, .-_Z5inputv
	.globl	_Z28__device_stub__Z5saxpyffPfS_ffPfS_
	.type	_Z28__device_stub__Z5saxpyffPfS_ffPfS_, @function
_Z28__device_stub__Z5saxpyffPfS_ffPfS_:
.LFB4801:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 16(%rsp)
	leaq	48(%rsp), %rcx
	leaq	40(%rsp), %rdx
	movq	%rsi, 8(%rsp)
	leaq	56(%rsp), %rdi
	leaq	68(%rsp), %rsi
	movss	%xmm0, 28(%rsp)
	movss	%xmm1, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L12
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z5saxpyffPfS_(%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
.L12:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4801:
	.size	_Z28__device_stub__Z5saxpyffPfS_ffPfS_, .-_Z28__device_stub__Z5saxpyffPfS_ffPfS_
	.globl	_Z5saxpyffPfS_
	.type	_Z5saxpyffPfS_, @function
_Z5saxpyffPfS_:
.LFB4802:
	.cfi_startproc
	endbr64
	jmp	_Z28__device_stub__Z5saxpyffPfS_ffPfS_
	.cfi_endproc
.LFE4802:
	.size	_Z5saxpyffPfS_, .-_Z5saxpyffPfS_
	.section	.rodata.str1.1
.LC1:
	.string	"Starting code......."
.LC2:
	.string	"Sample ---------- **************"
.LC4:
	.string	"Image:"
.LC7:
	.string	" "
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB4776:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movl	$3136, %edi
	call	malloc@PLT
	movslq	classes(%rip), %rdi
	movq	%rax, %r13
	movq	%rdi, %r14
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, %rbp
.L18:
	cmpl	%r12d, %r14d
	jle	.L47
	movl	$3136, %edi
	call	malloc@PLT
	movq	%rax, 0(%rbp,%r12,8)
	incq	%r12
	jmp	.L18
.L47:
	leaq	8(%rsp), %rdi
	movl	$3136, %esi
	xorl	%r12d, %r12d
	call	cudaMalloc@PLT
.L20:
	cmpl	%r12d, classes(%rip)
	jle	.L48
	leaq	0(,%r12,8), %rdi
	movl	$3136, %esi
	incq	%r12
	call	cudaMalloc@PLT
	jmp	.L20
.L48:
	movl	$12, %edx
	movq	_ZL17training_image_fn(%rip), %rsi
	leaq	image(%rip), %r14
	leaq	label(%rip), %r12
	movq	%r14, %rdi
	movl	$16, %ebx
	leaq	7(%rsp), %r15
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
	movq	_ZL17training_label_fn(%rip), %rsi
	movl	$12, %edx
	movq	%r12, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode@PLT
.L22:
	movl	$1, %edx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	_ZNSi4readEPcl@PLT
	decl	%ebx
	jne	.L22
	movl	$8, %ebx
.L23:
	movl	$1, %edx
	movq	%r15, %rsi
	movq	%r12, %rdi
	call	_ZNSi4readEPcl@PLT
	decl	%ebx
	jne	.L23
	leaq	.LC2(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	$1, %esi
	leaq	d(%rip), %r15
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	call	_Z5inputv
	leaq	report(%rip), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv@PLT
	movq	%r14, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
	movq	%r12, %rdi
	xorl	%r12d, %r12d
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
.L25:
	movl	%r12d, %eax
	movl	$28, %esi
	leaq	0(,%r12,4), %rbx
	xorl	%r14d, %r14d
	cltd
	idivl	%esi
	movslq	%edx, %rdx
	cltq
	imulq	$28, %rdx, %rdx
	addq	%rax, %rdx
	cvtsi2ssl	(%r15,%rdx,4), %xmm0
	movss	%xmm0, 0(%r13,%r12,4)
.L24:
	call	rand@PLT
	movq	0(%rbp,%r14,8), %rdx
	incq	%r14
	cvtsi2ssl	%eax, %xmm0
	mulss	.LC3(%rip), %xmm0
	movss	%xmm0, (%rdx,%rbx)
	cmpq	$10, %r14
	jne	.L24
	incq	%r12
	cmpq	$784, %r12
	jne	.L25
	leaq	.LC4(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	xorl	%r14d, %r14d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
.L26:
	imulq	$112, %r14, %r15
	xorl	%r12d, %r12d
	addq	%r13, %r15
.L27:
	cvtss2sd	(%r15,%r12,4), %xmm0
	leaq	_ZSt4cout(%rip), %rdi
	incq	%r12
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	cmpq	$28, %r12
	jne	.L27
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	incq	%r14
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpq	$28, %r14
	jne	.L26
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	xorl	%r12d, %r12d
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsbl	inputNum(%rip), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	8(%rsp), %rdi
	movl	$1, %ecx
	movq	%r13, %rsi
	movl	$3136, %edx
	call	cudaMemcpy@PLT
.L29:
	cmpl	%r12d, classes(%rip)
	jle	.L49
	movq	0(%rbp,%r12,8), %rsi
	movl	$1, %ecx
	movl	$3136, %edx
	movq	0(,%r12,8), %rdi
	incq	%r12
	call	cudaMemcpy@PLT
	jmp	.L29
.L49:
	movl	$16777217, %edx
	movl	$1073741825, %edi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	salq	$8, %rdx
	salq	$2, %rdi
	movl	$1, %ecx
	movl	$1, %esi
	movq	%rdx, 28(%rsp)
	movl	$1, 36(%rsp)
	movq	%rdi, 16(%rsp)
	movl	$1, 24(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L31
	movq	0, %rsi
	movq	8(%rsp), %rdi
	movss	.LC5(%rip), %xmm1
	movss	.LC6(%rip), %xmm0
	call	_Z28__device_stub__Z5saxpyffPfS_ffPfS_
.L31:
	movq	0, %rsi
	movq	0(%rbp), %rdi
	movl	$2, %ecx
	xorl	%r12d, %r12d
	movl	$3136, %edx
	leaq	.LC7(%rip), %r15
	call	cudaMemcpy@PLT
.L32:
	imulq	$112, %r12, %r14
	xorl	%ebx, %ebx
.L33:
	leaq	0(,%rbx,4), %rax
	leaq	_ZSt4cout(%rip), %rdi
	addq	0(%rbp,%rbx,8), %rax
	incq	%rbx
	cvtss2sd	(%rax,%r14), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cmpq	$28, %rbx
	jne	.L33
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	incq	%r12
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpq	$28, %r12
	jne	.L32
	leaq	.LC0(%rip), %rsi
	leaq	_ZSt4cout(%rip), %rdi
	xorl	%ebx, %ebx
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsbl	inputNum(%rip), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
.L35:
	movl	classes(%rip), %r12d
	cmpl	%ebx, %r12d
	jle	.L50
	movq	0(,%rbx,8), %rdi
	incq	%rbx
	call	cudaFree@PLT
	jmp	.L35
.L50:
	movq	%r13, %rdi
	xorl	%ebx, %ebx
	call	free@PLT
.L37:
	cmpl	%ebx, %r12d
	jle	.L51
	movq	0(%rbp,%rbx,8), %rdi
	incq	%rbx
	call	free@PLT
	jmp	.L37
.L51:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	addq	$56, %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
.LFE4776:
	.size	main, .-main
	.text
	.globl	_Z30__device_stub__Z7softMaxffPfS_ffPfS_
	.type	_Z30__device_stub__Z7softMaxffPfS_ffPfS_, @function
_Z30__device_stub__Z7softMaxffPfS_ffPfS_:
.LFB4803:
	.cfi_startproc
	endbr64
	subq	$152, %rsp
	.cfi_def_cfa_offset 160
	movq	%rdi, 16(%rsp)
	leaq	48(%rsp), %rcx
	leaq	40(%rsp), %rdx
	movq	%rsi, 8(%rsp)
	leaq	56(%rsp), %rdi
	leaq	68(%rsp), %rsi
	movss	%xmm0, 28(%rsp)
	movss	%xmm1, 24(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movl	$1, 64(%rsp)
	movq	%rax, 104(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 112(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 128(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 56(%rsp)
	movq	%rax, 68(%rsp)
	movl	$1, 76(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L52
	pushq	48(%rsp)
	.cfi_def_cfa_offset 168
	leaq	_Z7softMaxffPfS_(%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
.L52:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	je	.L54
	call	__stack_chk_fail@PLT
.L54:
	addq	$152, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4803:
	.size	_Z30__device_stub__Z7softMaxffPfS_ffPfS_, .-_Z30__device_stub__Z7softMaxffPfS_ffPfS_
	.globl	_Z7softMaxffPfS_
	.type	_Z7softMaxffPfS_, @function
_Z7softMaxffPfS_:
.LFB4804:
	.cfi_startproc
	endbr64
	jmp	_Z30__device_stub__Z7softMaxffPfS_ffPfS_
	.cfi_endproc
.LFE4804:
	.size	_Z7softMaxffPfS_, .-_Z7softMaxffPfS_
	.section	.rodata.str1.1
.LC8:
	.string	"_Z7softMaxffPfS_"
.LC9:
	.string	"_Z5saxpyffPfS_"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4806:
	.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	.LC8(%rip), %rdx
	movq	%rax, %rdi
	movq	%rax, %rbx
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	leaq	_Z7softMaxffPfS_(%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	.LC9(%rip), %rdx
	orl	$-1, %r8d
	leaq	_Z5saxpyffPfS_(%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
.LFE4806:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC10:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB5123:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L60
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	leaq	.LC10(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L60:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L62
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L62:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L63
.L65:
	call	__stack_chk_fail@PLT
.L63:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5123:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.rodata.str1.1
.LC11:
	.string	"train-images.idx3-ubyte"
.LC12:
	.string	"train-labels.idx1-ubyte"
	.section	.text.startup
	.type	_GLOBAL__sub_I_image, @function
_GLOBAL__sub_I_image:
.LFB5503:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	_ZL17training_image_fn(%rip), %r12
	leaq	.LC11(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	__dso_handle(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	7(%rsp), %rbp
	movq	%rbp, %rdx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	movq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@GOTPCREL(%rip), %rdi
	movq	%rbx, %rdx
	movq	%r12, %rsi
	call	__cxa_atexit@PLT
	movq	%rbp, %rdx
	leaq	_ZL17training_label_fn(%rip), %rbp
	leaq	.LC12(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	movq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev@GOTPCREL(%rip), %rdi
	movq	%rbp, %rsi
	movq	%rbx, %rdx
	leaq	image(%rip), %rbp
	call	__cxa_atexit@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
	movq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@GOTPCREL(%rip), %rdi
	movq	%rbp, %rsi
	movq	%rbx, %rdx
	leaq	label(%rip), %rbp
	call	__cxa_atexit@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev@PLT
	movq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@GOTPCREL(%rip), %rdi
	movq	%rbp, %rsi
	movq	%rbx, %rdx
	leaq	report(%rip), %rbp
	call	__cxa_atexit@PLT
	movq	%rbp, %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L67
	call	__stack_chk_fail@PLT
.L67:
	movq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@GOTPCREL(%rip), %rdi
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	__cxa_atexit@PLT
	.cfi_endproc
.LFE5503:
	.size	_GLOBAL__sub_I_image, .-_GLOBAL__sub_I_image
	.section	.init_array
	.align 8
	.quad	_GLOBAL__sub_I_image
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	classes
	.data
	.align 4
	.type	classes, @object
	.size	classes, 4
classes:
	.long	1
	.globl	inputNum
	.bss
	.type	inputNum, @object
	.size	inputNum, 1
inputNum:
	.zero	1
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 3136
d:
	.zero	3136
	.globl	report
	.align 32
	.type	report, @object
	.size	report, 512
report:
	.zero	512
	.globl	label
	.align 32
	.type	label, @object
	.size	label, 520
label:
	.zero	520
	.globl	image
	.align 32
	.type	image, @object
	.size	image, 520
image:
	.zero	520
	.local	_ZL17training_label_fn
	.comm	_ZL17training_label_fn,32,32
	.local	_ZL17training_image_fn
	.comm	_ZL17training_image_fn,32,32
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC3:
	.long	805306368
	.align 4
.LC5:
	.long	1073741824
	.align 4
.LC6:
	.long	1145307136
	.hidden	__dso_handle
	.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 <hip/hip_runtime.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <iterator>
#include <algorithm>

using namespace std;

// Training image file name
const string training_image_fn = "train-images.idx3-ubyte";

// Training label file name
const string training_label_fn = "train-labels.idx1-ubyte";


__global__
void saxpy(float n, float a, float *x, float *w)
{
	int index = blockIdx.x * blockDim.x + threadIdx.x;
	int stride = blockDim.x * gridDim.x;
	for (int i = index; i < n; i += stride)
		w[i] = w[i]*x[i] + a;
}

__global__
void softMax(float n, float a, float *x, float *w)
{
	int index = blockIdx.x * blockDim.x + threadIdx.x;
	int stride = blockDim.x * gridDim.x;
	for (int i = index; i < n; i += stride)
		w[i] = w[i]*x[i] + a;
}

// Software: Training Artificial Neural Network for MNIST database
// Author: Hy Truong Son
// Major: BSc. Computer Science
// Class: 2013 - 2016
// Institution: Eotvos Lorand University
// Email: sonpascal93@gmail.com
// Website: http://people.inf.elte.hu/hytruongson/
// Copyright 2015 (c). All rights reserved.

// File stream to read data (image, label) and write down a report
ifstream image;
ifstream label;
ofstream report;

// Number of training samples
const int nTraining = 1;

// Image size in MNIST database
const int width = 28;
const int height = 28;

// Image. In MNIST: 28x28 gray scale images.
int d[width][height];

char inputNum;
int classes = 1;



void input() {
	// Reading image
	for(int i = 0; i < 10; i++ ) {

		for (int j = 0; j < height; ++j) {
			for (int i = 0; i < width; ++i) {
				image.read(&inputNum, sizeof(char));
				if (inputNum == 0) {
					d[i][j] = 0;
				} else {
					d[i][j] = 1;
				}
			}
		}
		label.read(&inputNum, sizeof(char));
		cout << "Label:" << (int)inputNum << endl;
	}
}

int main(void)
{
	float *x, *d_x;
	float **d_w;
	float **w;

	int N = width * height;

	cout << "Starting code......."  << endl;

	x = (float *)malloc( N *sizeof(float));
	w = (float **)malloc( classes *sizeof(float*));
	for(int i = 0; i < classes; i++) {
		w[i] = (float *)malloc( N *sizeof(float));
	}

	hipMalloc(&d_x, N *sizeof(float));

	for(int i = 0; i < classes; i++) {
		hipMalloc(&d_w[i], N *sizeof(float));
	}

	image.open(training_image_fn.c_str(), ios::in | ios::binary); // Binary image file
	label.open(training_label_fn.c_str(), ios::in | ios::binary ); // Binary label file

	// Reading file headers
	char number;
	for (int i = 1; i <= 16; ++i) {
		image.read(&number, sizeof(char));
	}
	for (int i = 1; i <= 8; ++i) {
		label.read(&number, sizeof(char));
	}

	// Neural Network Initialization
	//init_array();

	for (int sample = 1; sample <= nTraining; ++sample) {
		cout << "Sample ---------- **************" << sample << endl;

		// Getting (image, label)
		input();
	}


	report.close();
	image.close();
	label.close();


	for (int i = 0; i < width * height; i++) {
		x[i] = (float)d[i % width][i / width];
		for(int j = 0; j < 10; j++)
			w[j][i] = static_cast <float> (rand()) / static_cast <float> (RAND_MAX);
	}

	cout << "Image:" << endl;
	for (int j = 0; j < height; ++j) {
		for (int i = 0; i < width; ++i) {
			cout << x[ (j ) * height + (i )];
		}
		cout << endl;
	}
	cout << "Label:" << (int)inputNum << endl;

	hipMemcpy(d_x, x, N * sizeof(float), hipMemcpyHostToDevice);

	for(int i = 0; i < classes; i++)
		hipMemcpy(d_w[i], w[i], N * sizeof(float), hipMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);
//	cudaMemcpy(d_w, w, N * sizeof(float), cudaMemcpyHostToDevice);

	// Perform SAXPY on 1M elements
	int blockSize = 256;
	int numBlocks = (N + blockSize - 1) / blockSize;
	saxpy<<<numBlocks, blockSize>>>(N, 2.0f, d_x, d_w[0]);

	hipMemcpy(w[0], d_w[0], N*sizeof(float), hipMemcpyDeviceToHost);

	for (int j = 0; j < height; ++j) {
		for (int i = 0; i < width; ++i) {
			cout << (float)w[i][(j) * height + (i)] << " ";
		}
		cout << endl;
	}
	cout << "Label:" << (int)inputNum << endl;

	hipFree(d_x);
	for(int i = 0; i < classes; i++)
		hipFree(d_w[i]);
	free(x);
	for(int i = 0; i < classes; i++)
		free(w[i]);
}

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

                                        # End of file scope inline assembly
	.globl	_Z20__device_stub__saxpyffPfS_  # -- Begin function _Z20__device_stub__saxpyffPfS_
	.type	_Z20__device_stub__saxpyffPfS_,@function
_Z20__device_stub__saxpyffPfS_:         # @_Z20__device_stub__saxpyffPfS_
	.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	12(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	8(%rsp), %rcx
	movss	%xmm1, (%rcx)
	leaq	40(%rsp), %rdx
	movq	%rdi, (%rdx)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	movq	%rdi, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z5saxpyffPfS_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$128, %rsp
	.cfi_adjust_cfa_offset -128
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_Z20__device_stub__saxpyffPfS_, .Lfunc_end0-_Z20__device_stub__saxpyffPfS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__softMaxffPfS_ # -- Begin function _Z22__device_stub__softMaxffPfS_
	.type	_Z22__device_stub__softMaxffPfS_,@function
_Z22__device_stub__softMaxffPfS_:       # @_Z22__device_stub__softMaxffPfS_
	.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	12(%rsp), %rax
	movss	%xmm0, (%rax)
	leaq	8(%rsp), %rcx
	movss	%xmm1, (%rcx)
	leaq	40(%rsp), %rdx
	movq	%rdi, (%rdx)
	leaq	32(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	80(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rdx, 16(%rbx)
	movq	%rdi, 24(%rbx)
	leaq	64(%rsp), %r14
	leaq	48(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	16(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7softMaxffPfS_, %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	_Z22__device_stub__softMaxffPfS_, .Lfunc_end1-_Z22__device_stub__softMaxffPfS_
	.cfi_endproc
                                        # -- End function
	.globl	_Z5inputv                       # -- Begin function _Z5inputv
	.type	_Z5inputv,@function
_Z5inputv:                              # @_Z5inputv
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	xorl	%r14d, %r14d
.LBB2_1:                                # %.preheader12
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_2 Depth 2
                                        #       Child Loop BB2_3 Depth 3
	movl	$d, %ebx
	xorl	%r15d, %r15d
.LBB2_2:                                # %.preheader
                                        #   Parent Loop BB2_1 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB2_3 Depth 3
	movq	$-3136, %r12                    # imm = 0xF3C0
.LBB2_3:                                #   Parent Loop BB2_1 Depth=1
                                        #     Parent Loop BB2_2 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movl	$image, %edi
	movl	$inputNum, %esi
	movl	$1, %edx
	callq	_ZNSi4readEPcl
	xorl	%eax, %eax
	cmpb	$0, inputNum(%rip)
	setne	%al
	movl	%eax, 3136(%rbx,%r12)
	addq	$112, %r12
	jne	.LBB2_3
# %bb.4:                                #   in Loop: Header=BB2_2 Depth=2
	incq	%r15
	addq	$4, %rbx
	cmpq	$28, %r15
	jne	.LBB2_2
# %bb.5:                                #   in Loop: Header=BB2_1 Depth=1
	movl	$label, %edi
	movl	$inputNum, %esi
	movl	$1, %edx
	callq	_ZNSi4readEPcl
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movsbl	inputNum(%rip), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incl	%r14d
	cmpl	$10, %r14d
	jne	.LBB2_1
# %bb.6:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end2:
	.size	_Z5inputv, .Lfunc_end2-_Z5inputv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI3_0:
	.long	0x30000000                      # float 4.65661287E-10
.LCPI3_1:
	.long	0x44440000                      # float 784
.LCPI3_2:
	.long	0x40000000                      # float 2
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	.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	$_ZSt4cout, %ebx
	movl	$_ZSt4cout, %edi
	movl	$.L.str.7, %esi
	movl	$20, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$3136, %edi                     # imm = 0xC40
	callq	malloc
	movq	%rax, %r14
	movslq	classes(%rip), %r15
	leaq	(,%r15,8), %rdi
	callq	malloc
	movq	%rax, %rbx
	testq	%r15, %r15
	jle	.LBB3_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%r15d, %r15d
	xorl	%r12d, %r12d
.LBB3_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	$3136, %edi                     # imm = 0xC40
	callq	malloc
	movq	%rax, (%rbx,%r12,8)
	incq	%r12
	cmpq	%r12, %r15
	jne	.LBB3_2
.LBB3_3:                                # %._crit_edge
	leaq	16(%rsp), %rdi
	movl	$3136, %esi                     # imm = 0xC40
	callq	hipMalloc
	cmpl	$0, classes(%rip)
	jle	.LBB3_6
# %bb.4:                                # %.lr.ph98.preheader
	xorl	%ebp, %ebp
.LBB3_5:                                # %.lr.ph98
                                        # =>This Inner Loop Header: Depth=1
	movl	$3136, %esi                     # imm = 0xC40
	callq	hipMalloc
	incl	%ebp
	cmpl	classes(%rip), %ebp
	jl	.LBB3_5
.LBB3_6:                                # %._crit_edge99
	movq	_ZL17training_image_fnB5cxx11(%rip), %rsi
	movl	$image, %edi
	movl	$12, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
	movq	_ZL17training_label_fnB5cxx11(%rip), %rsi
	movl	$label, %edi
	movl	$12, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
	movl	$16, %ebp
	leaq	15(%rsp), %r15
.LBB3_7:                                # =>This Inner Loop Header: Depth=1
	movl	$image, %edi
	movl	$1, %edx
	movq	%r15, %rsi
	callq	_ZNSi4readEPcl
	decl	%ebp
	jne	.LBB3_7
# %bb.8:                                # %.preheader94.preheader
	movl	$8, %ebp
	leaq	15(%rsp), %r15
.LBB3_9:                                # %.preheader94
                                        # =>This Inner Loop Header: Depth=1
	movl	$label, %edi
	movl	$1, %edx
	movq	%r15, %rsi
	callq	_ZNSi4readEPcl
	decl	%ebp
	jne	.LBB3_9
# %bb.10:                               # %.critedge
	movl	$_ZSt4cout, %edi
	movl	$.L.str.8, %esi
	movl	$32, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movl	$_ZSt4cout, %edi
	movl	$1, %esi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	callq	_Z5inputv
	movl	$report, %edi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv
	movl	$image, %edi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
	movl	$label, %edi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
	xorl	%r15d, %r15d
	movl	$65535, %ebp                    # imm = 0xFFFF
.LBB3_11:                               # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_12 Depth 2
	movl	%r15d, %eax
	andl	%ebp, %eax
	shrl	$2, %eax
	imull	$18725, %eax, %eax              # imm = 0x4925
	shrl	$17, %eax
	leal	(%rax,%rax,8), %ecx
	leal	(%rcx,%rcx,2), %ecx
	addl	%eax, %ecx
	movl	%r15d, %edx
	subl	%ecx, %edx
	andl	%ebp, %edx
	imulq	$112, %rdx, %rcx
	xorps	%xmm0, %xmm0
	cvtsi2ssl	d(%rcx,%rax,4), %xmm0
	movss	%xmm0, (%r14,%r15,4)
	xorl	%r12d, %r12d
.LBB3_12:                               #   Parent Loop BB3_11 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	callq	rand
	movss	.LCPI3_0(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	xorps	%xmm0, %xmm0
	cvtsi2ss	%eax, %xmm0
	mulss	%xmm1, %xmm0
	movq	(%rbx,%r12,8), %rax
	movss	%xmm0, (%rax,%r15,4)
	incq	%r12
	cmpq	$10, %r12
	jne	.LBB3_12
# %bb.13:                               #   in Loop: Header=BB3_11 Depth=1
	incq	%r15
	cmpq	$784, %r15                      # imm = 0x310
	jne	.LBB3_11
# %bb.14:
	movl	$_ZSt4cout, %r15d
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	xorl	%r12d, %r12d
	movq	%r14, %r13
.LBB3_15:                               # %.preheader93
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_16 Depth 2
	xorl	%ebp, %ebp
.LBB3_16:                               #   Parent Loop BB3_15 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r13,%rbp,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	incq	%rbp
	cmpq	$28, %rbp
	jne	.LBB3_16
# %bb.17:                               #   in Loop: Header=BB3_15 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r12
	addq	$112, %r13
	cmpq	$28, %r12
	jne	.LBB3_15
# %bb.18:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movsbl	inputNum(%rip), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	16(%rsp), %rdi
	movl	$3136, %edx                     # imm = 0xC40
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	cmpl	$0, classes(%rip)
	jle	.LBB3_21
# %bb.19:                               # %.lr.ph108.preheader
	xorl	%r15d, %r15d
.LBB3_20:                               # %.lr.ph108
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r15,8), %rsi
	movl	$3136, %edx                     # imm = 0xC40
	movl	$1, %ecx
	callq	hipMemcpy
	incq	%r15
	movslq	classes(%rip), %rax
	cmpq	%rax, %r15
	jl	.LBB3_20
.LBB3_21:                               # %._crit_edge109
	movabsq	$4294967300, %rdi               # imm = 0x100000004
	leaq	252(%rdi), %rdx
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB3_23
# %bb.22:
	movq	16(%rsp), %rdi
	movss	.LCPI3_1(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI3_2(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	callq	_Z20__device_stub__saxpyffPfS_
.LBB3_23:
	movq	(%rbx), %rdi
	movl	$3136, %edx                     # imm = 0xC40
	movl	$2, %ecx
	callq	hipMemcpy
	xorl	%r15d, %r15d
	movl	$_ZSt4cout, %r12d
	xorl	%r13d, %r13d
.LBB3_24:                               # %.preheader
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB3_25 Depth 2
	xorl	%ebp, %ebp
.LBB3_25:                               #   Parent Loop BB3_24 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%rbx,%rbp,8), %rax
	addq	%r15, %rax
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rax,%rbp,4), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movl	$.L.str.10, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	incq	%rbp
	cmpq	$28, %rbp
	jne	.LBB3_25
# %bb.26:                               #   in Loop: Header=BB3_24 Depth=1
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	addq	%r12, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incq	%r13
	addq	$112, %r15
	cmpq	$28, %r13
	jne	.LBB3_24
# %bb.27:
	movl	$_ZSt4cout, %edi
	movl	$.L.str.6, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movsbl	inputNum(%rip), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movq	16(%rsp), %rdi
	callq	hipFree
	cmpl	$0, classes(%rip)
	jle	.LBB3_33
# %bb.28:                               # %.lr.ph114.preheader
	xorl	%ebp, %ebp
.LBB3_29:                               # %.lr.ph114
                                        # =>This Inner Loop Header: Depth=1
	callq	hipFree
	incl	%ebp
	movl	classes(%rip), %r15d
	cmpl	%r15d, %ebp
	jl	.LBB3_29
# %bb.30:                               # %._crit_edge115
	movq	%r14, %rdi
	callq	free
	testl	%r15d, %r15d
	jle	.LBB3_34
# %bb.31:                               # %.lr.ph118.preheader
	xorl	%r14d, %r14d
.LBB3_32:                               # %.lr.ph118
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r14,8), %rdi
	callq	free
	incq	%r14
	movslq	classes(%rip), %rax
	cmpq	%rax, %r14
	jl	.LBB3_32
	jmp	.LBB3_34
.LBB3_33:                               # %._crit_edge115.thread
	movq	%r14, %rdi
	callq	free
.LBB3_34:                               # %._crit_edge119
	xorl	%eax, %eax
	addq	$24, %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_end3:
	.size	main, .Lfunc_end3-main
	.cfi_endproc
                                        # -- End function
	.section	.text.startup,"ax",@progbits
	.type	_GLOBAL__sub_I_test.hip,@function # -- Begin function _GLOBAL__sub_I_test.hip
_GLOBAL__sub_I_test.hip:                # @_GLOBAL__sub_I_test.hip
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	$_ZL17training_image_fnB5cxx11+16, _ZL17training_image_fnB5cxx11(%rip)
	movl	$23, %r15d
	leaq	8(%rsp), %rbx
	movq	%r15, (%rbx)
	xorl	%r14d, %r14d
	movl	$_ZL17training_image_fnB5cxx11, %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, _ZL17training_image_fnB5cxx11(%rip)
	movq	(%rbx), %rcx
	movq	%rcx, _ZL17training_image_fnB5cxx11+16(%rip)
	movups	.L.str(%rip), %xmm0
	movups	%xmm0, (%rax)
	movabsq	$7310601558908810104, %rdx      # imm = 0x65747962752D3378
	movq	%rdx, 15(%rax)
	movq	%rcx, _ZL17training_image_fnB5cxx11+8(%rip)
	movq	_ZL17training_image_fnB5cxx11(%rip), %rax
	movb	%r14b, (%rax,%rcx)
	movl	$_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev, %edi
	movl	$_ZL17training_image_fnB5cxx11, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	movq	$_ZL17training_label_fnB5cxx11+16, _ZL17training_label_fnB5cxx11(%rip)
	movq	%r15, (%rbx)
	leaq	8(%rsp), %rbx
	movl	$_ZL17training_label_fnB5cxx11, %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, _ZL17training_label_fnB5cxx11(%rip)
	movq	(%rbx), %rcx
	movq	%rcx, _ZL17training_label_fnB5cxx11+16(%rip)
	movups	.L.str.2(%rip), %xmm0
	movups	%xmm0, (%rax)
	movabsq	$7310601558908809592, %rdx      # imm = 0x65747962752D3178
	movq	%rdx, 15(%rax)
	movq	%rcx, _ZL17training_label_fnB5cxx11+8(%rip)
	movq	_ZL17training_label_fnB5cxx11(%rip), %rax
	movb	%r14b, (%rax,%rcx)
	movl	$_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev, %edi
	movl	$_ZL17training_label_fnB5cxx11, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	movl	$image, %edi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
	movl	$_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev, %edi
	movl	$image, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	movl	$label, %edi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1Ev
	movl	$_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev, %edi
	movl	$label, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	movl	$report, %edi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev
	movl	$_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev, %edi
	movl	$report, %esi
	movl	$__dso_handle, %edx
	callq	__cxa_atexit
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_GLOBAL__sub_I_test.hip, .Lfunc_end4-_GLOBAL__sub_I_test.hip
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	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	.LBB5_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rbx
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB5_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z5saxpyffPfS_, %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	$_Z7softMaxffPfS_, %esi
	movl	$.L__unnamed_2, %edx
	movl	$.L__unnamed_2, %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_end5:
	.size	__hip_module_ctor, .Lfunc_end5-__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	.LBB6_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
.LBB6_2:
	retq
.Lfunc_end6:
	.size	__hip_module_dtor, .Lfunc_end6-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	_ZL17training_image_fnB5cxx11,@object # @_ZL17training_image_fnB5cxx11
	.local	_ZL17training_image_fnB5cxx11
	.comm	_ZL17training_image_fnB5cxx11,32,8
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"train-images.idx3-ubyte"
	.size	.L.str, 24

	.hidden	__dso_handle
	.type	_ZL17training_label_fnB5cxx11,@object # @_ZL17training_label_fnB5cxx11
	.local	_ZL17training_label_fnB5cxx11
	.comm	_ZL17training_label_fnB5cxx11,32,8
	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"train-labels.idx1-ubyte"
	.size	.L.str.2, 24

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

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

	.type	image,@object                   # @image
	.bss
	.globl	image
	.p2align	3, 0x0
image:
	.zero	520
	.size	image, 520

	.type	label,@object                   # @label
	.globl	label
	.p2align	3, 0x0
label:
	.zero	520
	.size	label, 520

	.type	report,@object                  # @report
	.globl	report
	.p2align	3, 0x0
report:
	.zero	512
	.size	report, 512

	.type	d,@object                       # @d
	.globl	d
	.p2align	4, 0x0
d:
	.zero	3136
	.size	d, 3136

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

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

	.type	.L.str.6,@object                # @.str.6
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.6:
	.asciz	"Label:"
	.size	.L.str.6, 7

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"Starting code......."
	.size	.L.str.7, 21

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"Sample ---------- **************"
	.size	.L.str.8, 33

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"Image:"
	.size	.L.str.9, 7

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z5saxpyffPfS_"
	.size	.L__unnamed_1, 15

	.type	.L__unnamed_2,@object           # @1
.L__unnamed_2:
	.asciz	"_Z7softMaxffPfS_"
	.size	.L__unnamed_2, 17

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

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

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Z20__device_stub__saxpyffPfS_
	.addrsig_sym _Z22__device_stub__softMaxffPfS_
	.addrsig_sym _GLOBAL__sub_I_test.hip
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _ZL17training_image_fnB5cxx11
	.addrsig_sym __dso_handle
	.addrsig_sym _ZL17training_label_fnB5cxx11
	.addrsig_sym _Z5saxpyffPfS_
	.addrsig_sym _Z7softMaxffPfS_
	.addrsig_sym image
	.addrsig_sym label
	.addrsig_sym report
	.addrsig_sym inputNum
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z5saxpyffPfS_          ; -- Begin function _Z5saxpyffPfS_
	.globl	_Z5saxpyffPfS_
	.p2align	8
	.type	_Z5saxpyffPfS_,@function
_Z5saxpyffPfS_:                         ; @_Z5saxpyffPfS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s6, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x0
	s_add_u32 s4, s0, 24
	s_addc_u32 s5, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s6, 0xffff
	s_mov_b32 s6, exec_lo
	v_mad_u64_u32 v[3:4], null, s15, s8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_i32_e32 v1, v3
	v_cmpx_gt_f32_e32 s2, v1
	s_cbranch_execz .LBB0_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b32 s9, s[4:5], 0x0
	s_load_b128 s[4:7], s[0:1], 0x8
	v_ashrrev_i32_e32 v4, 31, v3
	s_mov_b32 s1, 0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s15, s15, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s8, v[0:1]
	s_mul_i32 s8, s9, s8
	v_lshlrev_b64 v[2:3], 2, v[3:4]
	s_ashr_i32 s9, s8, 31
	s_lshl_b64 s[10:11], s[8:9], 2
.LBB0_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v2, vcc_lo, v2, s10
	global_load_b32 v0, v[4:5], off
	global_load_b32 v6, v[6:7], off
	v_cvt_f32_i32_e32 v7, v1
	v_add_co_ci_u32_e32 v3, vcc_lo, s11, v3, vcc_lo
	v_add_nc_u32_e32 v1, s8, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ngt_f32_e64 s0, s2, v7
	s_or_b32 s1, s0, s1
	s_waitcnt vmcnt(0)
	v_fma_f32 v0, v0, v6, s3
	global_store_b32 v[4:5], v0, off
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB0_2
.LBB0_3:                                ; %Flow28
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z5saxpyffPfS_
		.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 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	_Z5saxpyffPfS_, .Lfunc_end0-_Z5saxpyffPfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 252
; 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	_Z7softMaxffPfS_        ; -- Begin function _Z7softMaxffPfS_
	.globl	_Z7softMaxffPfS_
	.p2align	8
	.type	_Z7softMaxffPfS_,@function
_Z7softMaxffPfS_:                       ; @_Z7softMaxffPfS_
; %bb.0:
	s_clause 0x1
	s_load_b32 s6, s[0:1], 0x24
	s_load_b64 s[2:3], s[0:1], 0x0
	s_add_u32 s4, s0, 24
	s_addc_u32 s5, s1, 0
	s_waitcnt lgkmcnt(0)
	s_and_b32 s8, s6, 0xffff
	s_mov_b32 s6, exec_lo
	v_mad_u64_u32 v[3:4], null, s15, s8, v[0:1]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cvt_f32_i32_e32 v1, v3
	v_cmpx_gt_f32_e32 s2, v1
	s_cbranch_execz .LBB1_3
; %bb.1:                                ; %.lr.ph.preheader
	s_load_b32 s9, s[4:5], 0x0
	s_load_b128 s[4:7], s[0:1], 0x8
	v_ashrrev_i32_e32 v4, 31, v3
	s_mov_b32 s1, 0
	s_waitcnt lgkmcnt(0)
	s_add_i32 s15, s15, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_3) | instid1(SALU_CYCLE_1)
	v_mad_u64_u32 v[1:2], null, s15, s8, v[0:1]
	s_mul_i32 s8, s9, s8
	v_lshlrev_b64 v[2:3], 2, v[3:4]
	s_ashr_i32 s9, s8, 31
	s_lshl_b64 s[10:11], s[8:9], 2
.LBB1_2:                                ; %.lr.ph
                                        ; =>This Inner Loop Header: Depth=1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v4, vcc_lo, s6, v2
	v_add_co_ci_u32_e32 v5, vcc_lo, s7, v3, vcc_lo
	v_add_co_u32 v6, vcc_lo, s4, v2
	v_add_co_ci_u32_e32 v7, vcc_lo, s5, v3, vcc_lo
	v_add_co_u32 v2, vcc_lo, v2, s10
	global_load_b32 v0, v[4:5], off
	global_load_b32 v6, v[6:7], off
	v_cvt_f32_i32_e32 v7, v1
	v_add_co_ci_u32_e32 v3, vcc_lo, s11, v3, vcc_lo
	v_add_nc_u32_e32 v1, s8, v1
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_cmp_ngt_f32_e64 s0, s2, v7
	s_or_b32 s1, s0, s1
	s_waitcnt vmcnt(0)
	v_fma_f32 v0, v0, v6, s3
	global_store_b32 v[4:5], v0, off
	s_and_not1_b32 exec_lo, exec_lo, s1
	s_cbranch_execnz .LBB1_2
.LBB1_3:                                ; %Flow28
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7softMaxffPfS_
		.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 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	_Z7softMaxffPfS_, .Lfunc_end1-_Z7softMaxffPfS_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 252
; 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
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgpu_metadata
---
amdhsa.kernels:
  - .args:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z5saxpyffPfS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z5saxpyffPfS_.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:
      - .offset:         0
        .size:           4
        .value_kind:     by_value
      - .offset:         4
        .size:           4
        .value_kind:     by_value
      - .address_space:  global
        .offset:         8
        .size:           8
        .value_kind:     global_buffer
      - .address_space:  global
        .offset:         16
        .size:           8
        .value_kind:     global_buffer
      - .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:           _Z7softMaxffPfS_
    .private_segment_fixed_size: 0
    .sgpr_count:     18
    .sgpr_spill_count: 0
    .symbol:         _Z7softMaxffPfS_.kd
    .uniform_work_group_size: 1
    .uses_dynamic_stack: false
    .vgpr_count:     8
    .vgpr_spill_count: 0
    .wavefront_size: 32
    .workgroup_processor_mode: 1
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
