#include <iostream>
#include <cstdlib>
#include <random>
#include <ctime>
#include <fstream>

using namespace std;
#define MAX_T 10000
#define MIN_T 1000
#define MAX_K 400
#define MIN_K  50
#define N 10

#define NUM_SAMPLES 50

double T1[MAX_K][MAX_T];
int T2[MAX_K][MAX_T];
double pi[MAX_K];
int Y[MAX_T];
int X[MAX_T];
double A[MAX_K][MAX_K];
double B[MAX_K][N];


void printPath(int nT){

    for (int i = 0; i < nT-1; ++i) {

        cout << X[i] << " -> ";
    }
    cout << X[nT-1] <<"\n";
}

void generateTransitionProbabilities(){

    double sum;
    double rands[MAX_K];

    for(int i =0; i<MAX_K;i++){

        sum = 0.0;
            for (int l = 0; l < MAX_K; ++l) {

                rands[l] = (double)rand();
                sum += rands[l];

            }



        for (int j = 0; j < MAX_K; j++) {


            A[i][j] = rands[j] / sum;
        }





    }


}

void generateEmmisionProbabilities(){

    double sum;
    double rands[N];

    for(int i =0; i<MAX_K;i++){

        sum = 0.0;
        for (int l = 0; l < N; ++l) {

            rands[l] = (double)rand();
            sum += rands[l];

        }



        for (int j = 0; j < N; j++) {


            B[i][j] = rands[j] / sum;
        }





    }


}

void generatePriors(){

    double rands[MAX_K];
    double sum = 0.0;
    for (int i = 0; i < MAX_K; ++i) {

        rands[i] = (double)rand();
        sum += rands[i];

    }

    for (int j = 0; j <MAX_K; ++j) {
        pi[j] = rands[j]/sum;
    }


}

void generateObservations(){


    random_device rd;
    mt19937 eng(rd());
    uniform_int_distribution<> distr(0, N-1);

    for(int i=0; i<MAX_T; ++i)
        Y[i] = distr(eng);




}

void generateInputs(){
    srand(time(NULL)); // New random seed

    generateTransitionProbabilities();
    generateEmmisionProbabilities();
    generatePriors();

    generateObservations();
}



void viterbiCPU(int nK, int nT){

    double maxT1=-1;
    double maxT2=-1;
    double tempMaxT1;
    double tempMaxT2;




    int argmax=-1;
    for (int i = 0; i <nK; ++i) { // For each state

        T1[i][0] = pi[i]*B[i][Y[0]];
        T2[i][0] = 0.0;
    }


    for (int j = 1; j <nT ; ++j) {  // For each observation

        for (int i = 0; i < nK; ++i) { // For each state

            maxT1 = -1;
            maxT2 = -1;
            for (int k = 0; k < nK; ++k) { // For each state

                tempMaxT2 = T1[k][j-1] * A[k][i];

                tempMaxT1= tempMaxT2*B[i][Y[j]];

                if( tempMaxT1 > maxT1) maxT1=tempMaxT1;

                if( tempMaxT2 > maxT2){

                    maxT2 = tempMaxT2;
                    argmax = k;
                }

            }

            T1[i][j] = maxT1;
            T2[i][j] = argmax;

        }
    }
    maxT1 = -1;
    argmax = -1;
    for (int k = 0; k < nK; ++k) {

        if(T1[k][nT-1] > maxT1){
            maxT1 = T1[k][nT-1];
            argmax = k;
        }

    }

    X[nT-1] = argmax;

    for (int j = nT-1; j >0 ; j--) {
        //
        X[j-1] = T2[X[j]][j];
    }


    }

double cpuFLOPS(double time, float k, float t){

    return (3*k +(3*k*k + 1)*(t-1))/(time + 1e-16);


}

__global__ void viterbi(int t, double *t1, int *t2, double * pi, int * y, int *x, double *a, double * b ){

  int idx = threadIdx.x;

  int states = blockDim.x;

  double tempTA;
  double maxTA=-1.0;
  int argmax;
  double tempTAB;
  double maxTAB =-1.0;
  double maxT1End = -1.0;
  double tempMaxT1End;
  int argmaxT1End;
  // Index t2 t2[i*MAX_T+j];
  // Index t1 t1[i*MAX_T+j];


  for(int j = 0; j <t;j++){

    if(j==0){

      t1[idx*MAX_T] = pi[idx]*b[idx*MAX_K+y[0]];

    }else{

      maxTA = -1.0;
      maxTAB = -1.0;

      for(int k=0; k< states; k++){

        tempTA = t1[k*MAX_T +j-1]* a[k*MAX_K+idx];

        if(tempTA>maxTA){

            maxTA = tempTA;
            argmax = k;
        }

        tempTAB = tempTA* b[idx*MAX_K+y[j]];

        if(tempTAB>maxTAB) maxTAB=tempTAB;

      }
      t1[idx*MAX_T+j] = maxTAB;
      t2[idx*MAX_T+j] = argmax;



    }


    __syncthreads();
  }


    if(idx==0){

      for(int k =0; k <states; k++){

      tempMaxT1End = t1[k*MAX_T+t-1];

      if(tempMaxT1End>maxT1End){

        maxT1End = tempMaxT1End;
        argmaxT1End = k;

      }

      }
      x[t-1] = argmaxT1End;
      for(int j = t-1; j>0; j--) x[j-1]= t2[x[j]*MAX_T+j];

      // for (int j = 0; j < 10; j++) {
      //
      //     printf("%d ->", x[j]);
      // }
      // printf("\n");
    }




}

double GPUFlops(double time, int k, int t){

  return (double)(2*k*k*(t-1) + 2*k) / (time);

}

int main() {
    generateInputs();

    double *d_T1;
    int *d_T2;
    double *d_pi;
    int *d_Y;
    int *d_X;
    double *d_A;
    double *d_B;

    int T1_size = MAX_K*MAX_T * sizeof(double);
    int T2_size = MAX_K*MAX_T * sizeof(int);
    int pi_size = MAX_K*sizeof(double);
    int Y_size = MAX_T * sizeof(int);
    int X_size = MAX_T * sizeof(int);
    int A_size = MAX_K * MAX_K * sizeof(double);
    int B_size = MAX_K * N * sizeof(double);

    cudaMalloc((void**)&d_T1, T1_size);
    cudaMalloc((void**)&d_T2, T2_size);
    cudaMalloc((void**)&d_pi, pi_size);
    cudaMalloc((void**)&d_Y, Y_size);
    cudaMalloc((void**)&d_X, X_size);
    cudaMalloc((void**)&d_A, A_size);
    cudaMalloc((void**)&d_B, B_size);

    cudaMemcpy(d_X,X, X_size, cudaMemcpyHostToDevice);
    int k = MAX_K;
    int t = MAX_K;


    cudaMemcpy(d_T1,T1, T1_size, cudaMemcpyHostToDevice);

    cudaMemcpy(d_T2,T2, T2_size, cudaMemcpyHostToDevice);

    cudaMemcpy(d_pi,pi, pi_size, cudaMemcpyHostToDevice);

    cudaMemcpy(d_Y,Y, Y_size, cudaMemcpyHostToDevice);



    cudaMemcpy(d_A,A, A_size, cudaMemcpyHostToDevice);

    cudaMemcpy(d_B,B, B_size, cudaMemcpyHostToDevice);
    cudaDeviceSynchronize();

    //
    //
    // clock_t start = clock();
    // viterbi<<<1,k>>>(t, d_T1, d_T2, d_pi, d_Y, d_X,d_A,d_B); //Kernel invocation
    // cudaDeviceSynchronize();
    // clock_t end = clock();
    //
    // viterbiCPU(k,t);
    // printPath(10);

    int Ks[NUM_SAMPLES];
    int Ts[NUM_SAMPLES];
    double Ktimes[NUM_SAMPLES], Ttimes[NUM_SAMPLES],Kflops[NUM_SAMPLES], Tflops[NUM_SAMPLES];


    for (int i = 1; i < NUM_SAMPLES+1; ++i) {

        Ks[i-1] =MIN_K +  (i-1)*((MAX_K-MIN_K)/NUM_SAMPLES);
        Ts[i-1] =MIN_T + (i-1)*((MAX_T-MIN_T)/NUM_SAMPLES);
    }

for(int i =0; i < NUM_SAMPLES; i++){
k = Ks[i];
t = MAX_T;

clock_t start = clock();
viterbi<<<1,k>>>(t, d_T1, d_T2, d_pi, d_Y, d_X,d_A,d_B); //Kernel invocation
cudaDeviceSynchronize();
clock_t end = clock();


Ktimes[i] = (end - start)/ (double) CLOCKS_PER_SEC;

Kflops[i] = GPUFlops(Ktimes[i], k,t);

}
for(int i =0; i < NUM_SAMPLES; i++){
k = MAX_K;
t = Ts[i];

clock_t start = clock();
viterbi<<<1,k>>>(t, d_T1, d_T2, d_pi, d_Y, d_X,d_A,d_B); //Kernel invocation
cudaDeviceSynchronize();
clock_t end = clock();


Ttimes[i] = (end - start)/ (double) CLOCKS_PER_SEC;

Tflops[i] = GPUFlops(Ttimes[i], k,t);
}


ofstream outK("CUDAvariedK.txt");
ofstream outT("CUDAvariedT.txt");


outK << "K, T, Time, Flops\n";
outT << "K, T, Time, Flops\n";

for (int k = 0; k <NUM_SAMPLES ; ++k) {
    outK << Ks[k] << ", " << MAX_T << ", " << Ktimes[k] << ", " << Kflops[k] <<endl;
    outT << MAX_K << ", " << Ts[k] << ", " << Ttimes[k] << ", " << Tflops[k] <<endl;

}
    return 0;



}

	.file	"tmpxft_0029582d_00000000-6_viterbiCUDA.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4862:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4862:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" -> "
.LC1:
	.string	"\n"
	.text
	.globl	_Z9printPathi
	.type	_Z9printPathi, @function
_Z9printPathi:
.LFB4850:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	X(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
.L3:
	leal	-1(%rbp), %eax
	leaq	_ZSt4cout(%rip), %rdi
	cmpl	%ebx, %eax
	jle	.L7
	movl	(%r12,%rbx,4), %esi
	incq	%rbx
	call	_ZNSolsEi@PLT
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	jmp	.L3
.L7:
	cltq
	movl	(%r12,%rax,4), %esi
	call	_ZNSolsEi@PLT
	popq	%rbx
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rsi
	popq	%rbp
	.cfi_def_cfa_offset 16
	movq	%rax, %rdi
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	.cfi_endproc
.LFE4850:
	.size	_Z9printPathi, .-_Z9printPathi
	.globl	_Z31generateTransitionProbabilitiesv
	.type	_Z31generateTransitionProbabilitiesv, @function
_Z31generateTransitionProbabilitiesv:
.LFB4851:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	A(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	1280000(%rbp), %r13
	subq	$3240, %rsp
	.cfi_def_cfa_offset 3280
	movq	%fs:40, %rax
	movq	%rax, 3224(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %r12
.L9:
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
.L10:
	movsd	%xmm0, 8(%rsp)
	call	rand@PLT
	movsd	8(%rsp), %xmm0
	cvtsi2sdl	%eax, %xmm1
	movsd	%xmm1, (%r12,%rbx,8)
	incq	%rbx
	addsd	%xmm1, %xmm0
	cmpq	$400, %rbx
	jne	.L10
	xorl	%eax, %eax
.L11:
	movsd	(%r12,%rax), %xmm1
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 0(%rbp,%rax)
	addq	$8, %rax
	cmpq	$3200, %rax
	jne	.L11
	addq	$3200, %rbp
	cmpq	%r13, %rbp
	jne	.L9
	movq	3224(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	addq	$3240, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4851:
	.size	_Z31generateTransitionProbabilitiesv, .-_Z31generateTransitionProbabilitiesv
	.globl	_Z29generateEmmisionProbabilitiesv
	.type	_Z29generateEmmisionProbabilitiesv, @function
_Z29generateEmmisionProbabilitiesv:
.LFB4852:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	B(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	32000(%rbp), %r13
	subq	$120, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %r12
.L18:
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
.L19:
	movsd	%xmm0, 8(%rsp)
	call	rand@PLT
	movsd	8(%rsp), %xmm0
	cvtsi2sdl	%eax, %xmm1
	movsd	%xmm1, (%r12,%rbx,8)
	incq	%rbx
	addsd	%xmm1, %xmm0
	cmpq	$10, %rbx
	jne	.L19
	xorl	%eax, %eax
.L20:
	movsd	(%r12,%rax), %xmm1
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 0(%rbp,%rax)
	addq	$8, %rax
	cmpq	$80, %rax
	jne	.L20
	addq	$80, %rbp
	cmpq	%r13, %rbp
	jne	.L18
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	addq	$120, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4852:
	.size	_Z29generateEmmisionProbabilitiesv, .-_Z29generateEmmisionProbabilitiesv
	.globl	_Z14generatePriorsv
	.type	_Z14generatePriorsv, @function
_Z14generatePriorsv:
.LFB4853:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorps	%xmm1, %xmm1
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	xorl	%ebx, %ebx
	subq	$3240, %rsp
	.cfi_def_cfa_offset 3264
	movq	%fs:40, %rax
	movq	%rax, 3224(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rbp
.L27:
	movsd	%xmm1, 8(%rsp)
	call	rand@PLT
	movsd	8(%rsp), %xmm1
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, 0(%rbp,%rbx,8)
	incq	%rbx
	addsd	%xmm0, %xmm1
	cmpq	$400, %rbx
	jne	.L27
	xorl	%eax, %eax
	leaq	pi(%rip), %rdx
.L28:
	movsd	0(%rbp,%rax), %xmm0
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addq	$8, %rax
	cmpq	$3200, %rax
	jne	.L28
	movq	3224(%rsp), %rax
	subq	%fs:40, %rax
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	addq	$3240, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4853:
	.size	_Z14generatePriorsv, .-_Z14generatePriorsv
	.globl	_Z10viterbiCPUii
	.type	_Z10viterbiCPUii, @function
_Z10viterbiCPUii:
.LFB4856:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	Y(%rip), %rcx
	movl	%edi, %edx
	movl	%esi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	T2(%rip), %r8
	leaq	T1(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r8, %r9
	leaq	pi(%rip), %r10
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	B(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	(%r12,%rcx,8), %rsi
	xorl	%ecx, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
.L34:
	cmpl	%ecx, %edx
	jle	.L53
	movsd	(%r10,%rcx,8), %xmm0
	mulsd	(%rsi), %xmm0
	xorl	%r11d, %r11d
	incq	%rcx
	movl	%r11d, (%r9)
	addq	$80, %rsi
	addq	$80000, %rdi
	addq	$40000, %r9
	movsd	%xmm0, -80000(%rdi)
	jmp	.L34
.L53:
	leaq	8+T1(%rip), %r9
	movl	$1, %ecx
	orl	$-1, %ebp
	leaq	Y(%rip), %r13
.L36:
	cmpl	%ecx, %eax
	jle	.L41
	leaq	(%r8,%rcx,4), %rbx
	leaq	A(%rip), %r11
	movq	%r9, %r10
	xorl	%edi, %edi
.L42:
	cmpl	%edx, %edi
	jge	.L40
	movslq	%edi, %rsi
	movslq	0(%r13,%rcx,4), %r14
	movsd	.LC3(%rip), %xmm1
	movq	%r11, %r15
	imulq	$10, %rsi, %rsi
	movaps	%xmm1, %xmm2
	addq	%r14, %rsi
	movq	%r9, %r14
	movsd	(%r12,%rsi,8), %xmm3
	xorl	%esi, %esi
.L39:
	movsd	-8(%r14), %xmm0
	mulsd	(%r15), %xmm0
	movaps	%xmm3, %xmm4
	mulsd	%xmm0, %xmm4
	comisd	%xmm1, %xmm0
	maxsd	%xmm1, %xmm0
	cmova	%esi, %ebp
	incl	%esi
	movaps	%xmm0, %xmm1
	addq	$80000, %r14
	addq	$3200, %r15
	maxsd	%xmm2, %xmm4
	movaps	%xmm4, %xmm2
	cmpl	%esi, %edx
	jne	.L39
	movl	%ebp, (%rbx)
	incl	%edi
	addq	$80000, %r10
	addq	$8, %r11
	movsd	%xmm4, -80000(%r10)
	addq	$40000, %rbx
	jmp	.L42
.L40:
	incq	%rcx
	addq	$8, %r9
	jmp	.L36
.L41:
	movslq	%eax, %rcx
	leaq	T1(%rip), %rsi
	movsd	.LC3(%rip), %xmm0
	orl	$-1, %edi
	leaq	(%rsi,%rcx,8), %rsi
	xorl	%ecx, %ecx
.L43:
	cmpl	%edx, %ecx
	jge	.L54
	movsd	-8(%rsi), %xmm1
	comisd	%xmm0, %xmm1
	ja	.L50
	movaps	%xmm0, %xmm1
	jmp	.L44
.L50:
	movl	%ecx, %edi
.L44:
	incl	%ecx
	addq	$80000, %rsi
	movaps	%xmm1, %xmm0
	jmp	.L43
.L54:
	decl	%eax
	leaq	X(%rip), %rcx
	cltq
	leaq	-4(%rcx), %rsi
	movl	%edi, (%rcx,%rax,4)
.L46:
	testl	%eax, %eax
	jle	.L55
	movslq	(%rcx,%rax,4), %rdx
	movslq	%eax, %rdi
	imulq	$10000, %rdx, %rdx
	addq	%rdi, %rdx
	movl	(%r8,%rdx,4), %edx
	movl	%edx, (%rsi,%rax,4)
	decq	%rax
	jmp	.L46
.L55:
	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
.LFE4856:
	.size	_Z10viterbiCPUii, .-_Z10viterbiCPUii
	.globl	_Z8cpuFLOPSdff
	.type	_Z8cpuFLOPSdff, @function
_Z8cpuFLOPSdff:
.LFB4857:
	.cfi_startproc
	endbr64
	movss	.LC4(%rip), %xmm3
	movss	.LC5(%rip), %xmm4
	addsd	.LC6(%rip), %xmm0
	mulss	%xmm1, %xmm3
	subss	%xmm4, %xmm2
	mulss	%xmm3, %xmm1
	addss	%xmm4, %xmm1
	mulss	%xmm2, %xmm1
	addss	%xmm3, %xmm1
	cvtss2sd	%xmm1, %xmm1
	divsd	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE4857:
	.size	_Z8cpuFLOPSdff, .-_Z8cpuFLOPSdff
	.globl	_Z8GPUFlopsdii
	.type	_Z8GPUFlopsdii, @function
_Z8GPUFlopsdii:
.LFB4858:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	decl	%esi
	movaps	%xmm0, %xmm1
	imull	%edi, %eax
	imull	%esi, %eax
	addl	%edi, %eax
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm0
	divsd	%xmm1, %xmm0
	ret
	.cfi_endproc
.LFE4858:
	.size	_Z8GPUFlopsdii, .-_Z8GPUFlopsdii
	.globl	_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_
	.type	_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_, @function
_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_:
.LFB4884:
	.cfi_startproc
	endbr64
	subq	$216, %rsp
	.cfi_def_cfa_offset 224
	movq	224(%rsp), %rax
	movl	%edi, 60(%rsp)
	leaq	88(%rsp), %rdi
	movq	%rsi, 48(%rsp)
	leaq	100(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	232(%rsp), %rax
	movq	%rdx, 40(%rsp)
	leaq	72(%rsp), %rdx
	movq	%rcx, 32(%rsp)
	leaq	80(%rsp), %rcx
	movq	%r8, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rax, (%rsp)
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movl	$1, 96(%rsp)
	movq	%rax, 136(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 176(%rsp)
	leaq	8(%rsp), %rax
	movq	%rax, 184(%rsp)
	movq	%rsp, %rax
	movq	%rax, 192(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 88(%rsp)
	movq	%rax, 100(%rsp)
	movl	$1, 108(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L58
	pushq	80(%rsp)
	.cfi_def_cfa_offset 232
	leaq	_Z7viterbiiPdPiS_S0_S0_S_S_(%rip), %rdi
	pushq	80(%rsp)
	.cfi_def_cfa_offset 240
	movq	116(%rsp), %rcx
	movl	124(%rsp), %r8d
	movq	104(%rsp), %rsi
	movl	112(%rsp), %edx
	leaq	152(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 232
	popq	%rdx
	.cfi_def_cfa_offset 224
.L58:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	je	.L60
	call	__stack_chk_fail@PLT
.L60:
	addq	$216, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4884:
	.size	_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_, .-_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_
	.globl	_Z7viterbiiPdPiS_S0_S0_S_S_
	.type	_Z7viterbiiPdPiS_S0_S0_S_S_, @function
_Z7viterbiiPdPiS_S0_S0_S_S_:
.LFB4885:
	.cfi_startproc
	endbr64
	jmp	_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_
	.cfi_endproc
.LFE4885:
	.size	_Z7viterbiiPdPiS_S0_S0_S_S_, .-_Z7viterbiiPdPiS_S0_S0_S_S_
	.section	.rodata.str1.1
.LC7:
	.string	"_Z7viterbiiPdPiS_S0_S0_S_S_"
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4887:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	pushq	$0
	.cfi_def_cfa_offset 24
	xorl	%r9d, %r9d
	orl	$-1, %r8d
	pushq	$0
	.cfi_def_cfa_offset 32
	leaq	.LC7(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z7viterbiiPdPiS_S0_S0_S_S_(%rip), %rsi
	pushq	$0
	.cfi_def_cfa_offset 40
	movq	%rdx, %rcx
	pushq	$0
	.cfi_def_cfa_offset 48
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFunction@PLT
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	addq	$32, %rsp
	.cfi_def_cfa_offset 16
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4887:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,comdat
	.align 2
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, @function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv:
.LFB5588:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	xorl	%edx, %edx
	movl	$2567483615, %edi
.L67:
	movq	(%rax,%rdx,8), %rsi
	incq	%rdx
	movq	(%rax,%rdx,8), %rcx
	andq	$-2147483648, %rsi
	andl	$2147483647, %ecx
	orq	%rsi, %rcx
	movq	%rcx, %rsi
	shrq	%rsi
	xorq	3168(%rax,%rdx,8), %rsi
	andl	$1, %ecx
	je	.L66
	movq	%rdi, %rcx
.L66:
	xorq	%rsi, %rcx
	movq	%rcx, -8(%rax,%rdx,8)
	cmpq	$227, %rdx
	jne	.L67
	movl	$2567483615, %edi
.L69:
	movq	(%rax,%rdx,8), %rsi
	incq	%rdx
	movq	(%rax,%rdx,8), %rcx
	andq	$-2147483648, %rsi
	andl	$2147483647, %ecx
	orq	%rsi, %rcx
	movq	%rcx, %rsi
	shrq	%rsi
	xorq	-1824(%rax,%rdx,8), %rsi
	andl	$1, %ecx
	je	.L68
	movq	%rdi, %rcx
.L68:
	xorq	%rsi, %rcx
	movq	%rcx, -8(%rax,%rdx,8)
	cmpq	$623, %rdx
	jne	.L69
	movq	4984(%rax), %rdx
	movq	(%rax), %rcx
	andq	$-2147483648, %rdx
	andl	$2147483647, %ecx
	orq	%rcx, %rdx
	movq	%rdx, %rcx
	shrq	%rcx
	xorq	3168(%rax), %rcx
	andl	$1, %edx
	je	.L70
	movl	$2567483615, %edx
.L70:
	xorq	%rcx, %rdx
	movq	%rdx, 4984(%rax)
	xorl	%edx, %edx
	movq	%rdx, 4992(%rax)
	ret
	.cfi_endproc
.LFE5588:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, .-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,comdat
	.align 2
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv, @function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv:
.LFB5520:
	.cfi_startproc
	endbr64
	cmpq	$623, 4992(%rdi)
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	jbe	.L83
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
.L83:
	movq	4992(%rbx), %rax
	leaq	1(%rax), %rdx
	movq	(%rbx,%rax,8), %rax
	movq	%rdx, 4992(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	movq	%rax, %rdx
	shrq	$11, %rdx
	movl	%edx, %edx
	xorq	%rax, %rdx
	movq	%rdx, %rax
	salq	$7, %rax
	andl	$2636928640, %eax
	xorq	%rdx, %rax
	movq	%rax, %rdx
	salq	$15, %rdx
	andl	$4022730752, %edx
	xorq	%rax, %rdx
	movq	%rdx, %rax
	shrq	$18, %rax
	xorq	%rdx, %rax
	ret
	.cfi_endproc
.LFE5520:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv, .-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.text
	.align 2
	.type	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE.isra.0, @function
_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE.isra.0:
.LFB5628:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movslq	%esi, %rax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rax, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	%edx, %rbx
	subq	%rax, %rbx
	movl	$4294967294, %eax
	movq	%rbx, %r13
	cmpq	%rbx, %rax
	jb	.L86
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	leaq	1(%rbx), %rbx
	imulq	%rbx, %rax
	movq	%rax, %rcx
	movl	%eax, %esi
	cmpl	%ebx, %eax
	jnb	.L87
	movl	%ebx, %eax
	xorl	%edx, %edx
	negl	%eax
	divl	%ebx
	movl	%edx, %r14d
.L88:
	cmpl	%r14d, %esi
	jnb	.L87
	movq	%rbp, %rdi
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	imulq	%rbx, %rax
	movq	%rax, %rcx
	movl	%eax, %esi
	jmp	.L88
.L87:
	shrq	$32, %rcx
	jmp	.L90
.L86:
	movl	$4294967295, %eax
	cmpq	%rax, %rbx
	je	.L91
.L95:
	orl	$-1, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE.isra.0
	movq	%rbp, %rdi
	movl	%eax, %ebx
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	movq	%rbx, %rcx
	salq	$32, %rcx
	addq	%rax, %rcx
	setc	%al
	movzbl	%al, %eax
	cmpq	%rcx, %r13
	jb	.L95
	testq	%rax, %rax
	jne	.L95
	jmp	.L90
.L91:
	call	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	movq	%rax, %rcx
.L90:
	popq	%rbx
	.cfi_def_cfa_offset 40
	leal	(%r12,%rcx), %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5628:
	.size	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE.isra.0, .-_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE.isra.0
	.section	.rodata.str1.1
.LC8:
	.string	"default"
	.text
	.globl	_Z20generateObservationsv
	.type	_Z20generateObservationsv, @function
_Z20generateObservationsv:
.LFB4854:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4854
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4136
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8232
	orq	$0, (%rsp)
	subq	$1832, %rsp
	.cfi_def_cfa_offset 10064
	leaq	7+.LC8(%rip), %rdx
	leaq	-7(%rdx), %rsi
	movq	%fs:40, %rax
	movq	%rax, 10008(%rsp)
	xorl	%eax, %eax
	leaq	5024(%rsp), %rdi
	leaq	8(%rsp), %rbp
	movq	%rdi, 5008(%rsp)
	leaq	5008(%rsp), %rbx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	5008(%rsp), %rax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	movq	$7, 5016(%rsp)
	movb	$0, 7(%rax)
.LEHB0:
	call	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE0:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
.LEHB1:
	call	_ZNSt13random_device9_M_getvalEv@PLT
.LEHE1:
	movl	%eax, %eax
	movl	$1, %edx
	movq	%rax, 5008(%rsp)
	jmp	.L101
.L107:
	endbr64
	movq	%rax, %rbp
.L99:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
	movq	10008(%rsp), %rax
	subq	%fs:40, %rax
	je	.L113
	jmp	.L110
.L101:
	movq	-8(%rbx,%rdx,8), %rax
	movq	%rax, %rcx
	shrq	$30, %rcx
	xorq	%rcx, %rax
	imulq	$1812433253, %rax, %rax
	addl	%edx, %eax
	movq	%rax, (%rbx,%rdx,8)
	incq	%rdx
	cmpq	$624, %rdx
	jne	.L101
	movq	$624, 10000(%rsp)
	leaq	Y(%rip), %r12
	leaq	40000(%r12), %r13
.L102:
	movl	$9, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	addq	$4, %r12
	call	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE.isra.0
	movl	%eax, -4(%r12)
	cmpq	%r13, %r12
	jne	.L102
	movq	%rbp, %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	movq	10008(%rsp), %rax
	subq	%fs:40, %rax
	je	.L105
	jmp	.L110
.L106:
	endbr64
	movq	%rax, %rbx
.L103:
	movq	%rbp, %rdi
	call	_ZNSt13random_device7_M_finiEv@PLT
	movq	%rbx, %rdi
	movq	10008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L110
.L113:
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L110:
	call	__stack_chk_fail@PLT
.L105:
	addq	$10024, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4854:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4854:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4854-.LLSDACSB4854
.LLSDACSB4854:
	.uleb128 .LEHB0-.LFB4854
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L107-.LFB4854
	.uleb128 0
	.uleb128 .LEHB1-.LFB4854
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L106-.LFB4854
	.uleb128 0
	.uleb128 .LEHB2-.LFB4854
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4854:
	.text
	.size	_Z20generateObservationsv, .-_Z20generateObservationsv
	.globl	_Z14generateInputsv
	.type	_Z14generateInputsv, @function
_Z14generateInputsv:
.LFB4855:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorl	%edi, %edi
	call	time@PLT
	movl	%eax, %edi
	call	srand@PLT
	call	_Z31generateTransitionProbabilitiesv
	call	_Z29generateEmmisionProbabilitiesv
	call	_Z14generatePriorsv
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	_Z20generateObservationsv
	.cfi_endproc
.LFE4855:
	.size	_Z14generateInputsv, .-_Z14generateInputsv
	.section	.rodata.str1.1
.LC10:
	.string	"CUDAvariedK.txt"
.LC11:
	.string	"CUDAvariedT.txt"
.LC12:
	.string	"K, T, Time, Flops\n"
.LC13:
	.string	", "
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4859:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4859
	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	$3160, %rsp
	.cfi_def_cfa_offset 3216
	movq	%fs:40, %rax
	movq	%rax, 3144(%rsp)
	xorl	%eax, %eax
	leaq	120(%rsp), %rbp
	leaq	320(%rsp), %r12
.LEHB3:
	call	_Z14generateInputsv
	leaq	40(%rsp), %rdi
	movl	$32000000, %esi
	call	cudaMalloc@PLT
	leaq	48(%rsp), %rdi
	movl	$16000000, %esi
	call	cudaMalloc@PLT
	leaq	56(%rsp), %rdi
	movl	$3200, %esi
	call	cudaMalloc@PLT
	leaq	64(%rsp), %rdi
	movl	$40000, %esi
	call	cudaMalloc@PLT
	leaq	72(%rsp), %rdi
	movl	$40000, %esi
	call	cudaMalloc@PLT
	leaq	80(%rsp), %rdi
	movl	$1280000, %esi
	call	cudaMalloc@PLT
	leaq	88(%rsp), %rdi
	movl	$32000, %esi
	call	cudaMalloc@PLT
	movq	72(%rsp), %rdi
	movl	$1, %ecx
	movl	$40000, %edx
	leaq	X(%rip), %rsi
	call	cudaMemcpy@PLT
	movq	40(%rsp), %rdi
	movl	$1, %ecx
	movl	$32000000, %edx
	leaq	T1(%rip), %rsi
	call	cudaMemcpy@PLT
	movq	48(%rsp), %rdi
	movl	$1, %ecx
	movl	$16000000, %edx
	leaq	T2(%rip), %rsi
	call	cudaMemcpy@PLT
	movq	56(%rsp), %rdi
	movl	$1, %ecx
	movl	$3200, %edx
	leaq	pi(%rip), %rsi
	call	cudaMemcpy@PLT
	movq	64(%rsp), %rdi
	movl	$1, %ecx
	movl	$40000, %edx
	leaq	Y(%rip), %rsi
	call	cudaMemcpy@PLT
	movq	80(%rsp), %rdi
	movl	$1, %ecx
	movl	$1280000, %edx
	leaq	A(%rip), %rsi
	call	cudaMemcpy@PLT
	movq	88(%rsp), %rdi
	movl	$1, %ecx
	movl	$32000, %edx
	leaq	B(%rip), %rsi
	call	cudaMemcpy@PLT
	call	cudaDeviceSynchronize@PLT
	xorl	%eax, %eax
.L117:
	imull	$7, %eax, %edx
	addl	$50, %edx
	movl	%edx, 0(%rbp,%rax,4)
	imull	$180, %eax, %edx
	addl	$1000, %edx
	movl	%edx, (%r12,%rax,4)
	incq	%rax
	cmpq	$50, %rax
	jne	.L117
	movabsq	$4294967297, %r14
	xorl	%ebx, %ebx
.L119:
	movl	0(%rbp,%rbx,4), %r13d
	call	clock@PLT
	movq	%r14, 112(%rsp)
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	%r13d, 108(%rsp)
	movl	116(%rsp), %ecx
	movq	%r14, %rdi
	movq	%rax, %r15
	movq	108(%rsp), %rdx
	movl	$1, %esi
	movq	%r14, 96(%rsp)
	movl	$1, 104(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L118
	pushq	88(%rsp)
	.cfi_def_cfa_offset 3224
	movl	$10000, %edi
	pushq	88(%rsp)
	.cfi_def_cfa_offset 3232
	movq	88(%rsp), %r9
	movq	80(%rsp), %r8
	movq	72(%rsp), %rcx
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	call	_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_
	popq	%rcx
	.cfi_def_cfa_offset 3224
	popq	%rsi
	.cfi_def_cfa_offset 3216
.L118:
	call	cudaDeviceSynchronize@PLT
	call	clock@PLT
	movl	%r13d, %edi
	movl	$10000, %esi
	leaq	1320(%rsp), %r13
	subq	%r15, %rax
	cvtsi2sdq	%rax, %xmm0
	leaq	520(%rsp), %rax
	divsd	.LC9(%rip), %xmm0
	movq	%rax, 24(%rsp)
	movsd	%xmm0, (%rax,%rbx,8)
	call	_Z8GPUFlopsdii
	movsd	%xmm0, 0(%r13,%rbx,8)
	incq	%rbx
	cmpq	$50, %rbx
	jne	.L119
	xorl	%ebx, %ebx
.L121:
	movl	(%r12,%rbx,4), %r15d
	call	clock@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movq	%rax, %r14
	movl	$268435481, %eax
	movabsq	$4294967297, %rdi
	movl	$1, %esi
	salq	$4, %rax
	movl	$1, 116(%rsp)
	movq	%rax, %rdx
	movq	%rax, 108(%rsp)
	movq	%rdi, 96(%rsp)
	movl	$1, 104(%rsp)
	call	__cudaPushCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L120
	pushq	88(%rsp)
	.cfi_def_cfa_offset 3224
	movl	%r15d, %edi
	pushq	88(%rsp)
	.cfi_def_cfa_offset 3232
	movq	88(%rsp), %r9
	movq	80(%rsp), %r8
	movq	72(%rsp), %rcx
	movq	64(%rsp), %rdx
	movq	56(%rsp), %rsi
	call	_Z41__device_stub__Z7viterbiiPdPiS_S0_S0_S_S_iPdPiS_S0_S0_S_S_
	popq	%rax
	.cfi_def_cfa_offset 3224
	popq	%rdx
	.cfi_def_cfa_offset 3216
.L120:
	call	cudaDeviceSynchronize@PLT
	call	clock@PLT
	movl	%r15d, %esi
	movl	$400, %edi
	leaq	1720(%rsp), %r15
	subq	%r14, %rax
	leaq	920(%rsp), %r14
	cvtsi2sdq	%rax, %xmm0
	divsd	.LC9(%rip), %xmm0
	movsd	%xmm0, (%r14,%rbx,8)
	call	_Z8GPUFlopsdii
	movsd	%xmm0, (%r15,%rbx,8)
	incq	%rbx
	cmpq	$50, %rbx
	jne	.L121
	leaq	2120(%rsp), %rax
	movl	$16, %edx
	leaq	.LC10(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE3:
	leaq	2632(%rsp), %rax
	movl	$16, %edx
	leaq	.LC11(%rip), %rsi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB4:
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE4:
	leaq	.LC12(%rip), %rbx
	movq	8(%rsp), %rdi
	movq	%rbx, %rsi
.LEHB5:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	xorl	%ebx, %ebx
.L122:
	movl	0(%rbp,%rbx), %esi
	movq	8(%rsp), %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movl	$10000, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	movq	24(%rsp), %rax
	movsd	(%rax,%rbx,2), %xmm0
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	0(%r13,%rbx,2), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movq	16(%rsp), %rdi
	movl	$400, %esi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movl	(%r12,%rbx), %esi
	movq	%rax, %rdi
	call	_ZNSolsEi@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	(%r14,%rbx,2), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC13(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movsd	(%r15,%rbx,2), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE5:
	addq	$4, %rbx
	cmpq	$200, %rbx
	jne	.L122
	movq	16(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	3144(%rsp), %rax
	subq	%fs:40, %rax
	je	.L126
	jmp	.L133
.L128:
	endbr64
	movq	%rax, %rbx
.L123:
	movq	16(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L124
.L127:
	endbr64
	movq	%rax, %rbx
.L124:
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	3144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L133
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L133:
	call	__stack_chk_fail@PLT
.L126:
	addq	$3160, %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
.LFE4859:
	.section	.gcc_except_table
.LLSDA4859:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4859-.LLSDACSB4859
.LLSDACSB4859:
	.uleb128 .LEHB3-.LFB4859
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4859
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L127-.LFB4859
	.uleb128 0
	.uleb128 .LEHB5-.LFB4859
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L128-.LFB4859
	.uleb128 0
	.uleb128 .LEHB6-.LFB4859
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE4859:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	B
	.bss
	.align 32
	.type	B, @object
	.size	B, 32000
B:
	.zero	32000
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1280000
A:
	.zero	1280000
	.globl	X
	.align 32
	.type	X, @object
	.size	X, 40000
X:
	.zero	40000
	.globl	Y
	.align 32
	.type	Y, @object
	.size	Y, 40000
Y:
	.zero	40000
	.globl	pi
	.align 32
	.type	pi, @object
	.size	pi, 3200
pi:
	.zero	3200
	.globl	T2
	.align 32
	.type	T2, @object
	.size	T2, 16000000
T2:
	.zero	16000000
	.globl	T1
	.align 32
	.type	T1, @object
	.size	T1, 32000000
T1:
	.zero	32000000
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	-1074790400
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.long	1077936128
	.align 4
.LC5:
	.long	1065353216
	.section	.rodata.cst8
	.align 8
.LC6:
	.long	-1747416644
	.long	1016910514
	.align 8
.LC9:
	.long	0
	.long	1093567616
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <iostream>
#include <cstdlib>
#include <random>
#include <ctime>
#include <fstream>

using namespace std;
#define MAX_T 10000
#define MIN_T 1000
#define MAX_K 400
#define MIN_K  50
#define N 10

#define NUM_SAMPLES 50

double T1[MAX_K][MAX_T];
int T2[MAX_K][MAX_T];
double pi[MAX_K];
int Y[MAX_T];
int X[MAX_T];
double A[MAX_K][MAX_K];
double B[MAX_K][N];


void printPath(int nT){

    for (int i = 0; i < nT-1; ++i) {

        cout << X[i] << " -> ";
    }
    cout << X[nT-1] <<"\n";
}

void generateTransitionProbabilities(){

    double sum;
    double rands[MAX_K];

    for(int i =0; i<MAX_K;i++){

        sum = 0.0;
            for (int l = 0; l < MAX_K; ++l) {

                rands[l] = (double)rand();
                sum += rands[l];

            }



        for (int j = 0; j < MAX_K; j++) {


            A[i][j] = rands[j] / sum;
        }





    }


}

void generateEmmisionProbabilities(){

    double sum;
    double rands[N];

    for(int i =0; i<MAX_K;i++){

        sum = 0.0;
        for (int l = 0; l < N; ++l) {

            rands[l] = (double)rand();
            sum += rands[l];

        }



        for (int j = 0; j < N; j++) {


            B[i][j] = rands[j] / sum;
        }





    }


}

void generatePriors(){

    double rands[MAX_K];
    double sum = 0.0;
    for (int i = 0; i < MAX_K; ++i) {

        rands[i] = (double)rand();
        sum += rands[i];

    }

    for (int j = 0; j <MAX_K; ++j) {
        pi[j] = rands[j]/sum;
    }


}

void generateObservations(){


    random_device rd;
    mt19937 eng(rd());
    uniform_int_distribution<> distr(0, N-1);

    for(int i=0; i<MAX_T; ++i)
        Y[i] = distr(eng);




}

void generateInputs(){
    srand(time(NULL)); // New random seed

    generateTransitionProbabilities();
    generateEmmisionProbabilities();
    generatePriors();

    generateObservations();
}



void viterbiCPU(int nK, int nT){

    double maxT1=-1;
    double maxT2=-1;
    double tempMaxT1;
    double tempMaxT2;




    int argmax=-1;
    for (int i = 0; i <nK; ++i) { // For each state

        T1[i][0] = pi[i]*B[i][Y[0]];
        T2[i][0] = 0.0;
    }


    for (int j = 1; j <nT ; ++j) {  // For each observation

        for (int i = 0; i < nK; ++i) { // For each state

            maxT1 = -1;
            maxT2 = -1;
            for (int k = 0; k < nK; ++k) { // For each state

                tempMaxT2 = T1[k][j-1] * A[k][i];

                tempMaxT1= tempMaxT2*B[i][Y[j]];

                if( tempMaxT1 > maxT1) maxT1=tempMaxT1;

                if( tempMaxT2 > maxT2){

                    maxT2 = tempMaxT2;
                    argmax = k;
                }

            }

            T1[i][j] = maxT1;
            T2[i][j] = argmax;

        }
    }
    maxT1 = -1;
    argmax = -1;
    for (int k = 0; k < nK; ++k) {

        if(T1[k][nT-1] > maxT1){
            maxT1 = T1[k][nT-1];
            argmax = k;
        }

    }

    X[nT-1] = argmax;

    for (int j = nT-1; j >0 ; j--) {
        //
        X[j-1] = T2[X[j]][j];
    }


    }

double cpuFLOPS(double time, float k, float t){

    return (3*k +(3*k*k + 1)*(t-1))/(time + 1e-16);


}

__global__ void viterbi(int t, double *t1, int *t2, double * pi, int * y, int *x, double *a, double * b ){

  int idx = threadIdx.x;

  int states = blockDim.x;

  double tempTA;
  double maxTA=-1.0;
  int argmax;
  double tempTAB;
  double maxTAB =-1.0;
  double maxT1End = -1.0;
  double tempMaxT1End;
  int argmaxT1End;
  // Index t2 t2[i*MAX_T+j];
  // Index t1 t1[i*MAX_T+j];


  for(int j = 0; j <t;j++){

    if(j==0){

      t1[idx*MAX_T] = pi[idx]*b[idx*MAX_K+y[0]];

    }else{

      maxTA = -1.0;
      maxTAB = -1.0;

      for(int k=0; k< states; k++){

        tempTA = t1[k*MAX_T +j-1]* a[k*MAX_K+idx];

        if(tempTA>maxTA){

            maxTA = tempTA;
            argmax = k;
        }

        tempTAB = tempTA* b[idx*MAX_K+y[j]];

        if(tempTAB>maxTAB) maxTAB=tempTAB;

      }
      t1[idx*MAX_T+j] = maxTAB;
      t2[idx*MAX_T+j] = argmax;



    }


    __syncthreads();
  }


    if(idx==0){

      for(int k =0; k <states; k++){

      tempMaxT1End = t1[k*MAX_T+t-1];

      if(tempMaxT1End>maxT1End){

        maxT1End = tempMaxT1End;
        argmaxT1End = k;

      }

      }
      x[t-1] = argmaxT1End;
      for(int j = t-1; j>0; j--) x[j-1]= t2[x[j]*MAX_T+j];

      // for (int j = 0; j < 10; j++) {
      //
      //     printf("%d ->", x[j]);
      // }
      // printf("\n");
    }




}

double GPUFlops(double time, int k, int t){

  return (double)(2*k*k*(t-1) + 2*k) / (time);

}

int main() {
    generateInputs();

    double *d_T1;
    int *d_T2;
    double *d_pi;
    int *d_Y;
    int *d_X;
    double *d_A;
    double *d_B;

    int T1_size = MAX_K*MAX_T * sizeof(double);
    int T2_size = MAX_K*MAX_T * sizeof(int);
    int pi_size = MAX_K*sizeof(double);
    int Y_size = MAX_T * sizeof(int);
    int X_size = MAX_T * sizeof(int);
    int A_size = MAX_K * MAX_K * sizeof(double);
    int B_size = MAX_K * N * sizeof(double);

    hipMalloc((void**)&d_T1, T1_size);
    hipMalloc((void**)&d_T2, T2_size);
    hipMalloc((void**)&d_pi, pi_size);
    hipMalloc((void**)&d_Y, Y_size);
    hipMalloc((void**)&d_X, X_size);
    hipMalloc((void**)&d_A, A_size);
    hipMalloc((void**)&d_B, B_size);

    hipMemcpy(d_X,X, X_size, hipMemcpyHostToDevice);
    int k = MAX_K;
    int t = MAX_K;


    hipMemcpy(d_T1,T1, T1_size, hipMemcpyHostToDevice);

    hipMemcpy(d_T2,T2, T2_size, hipMemcpyHostToDevice);

    hipMemcpy(d_pi,pi, pi_size, hipMemcpyHostToDevice);

    hipMemcpy(d_Y,Y, Y_size, hipMemcpyHostToDevice);



    hipMemcpy(d_A,A, A_size, hipMemcpyHostToDevice);

    hipMemcpy(d_B,B, B_size, hipMemcpyHostToDevice);
    hipDeviceSynchronize();

    //
    //
    // clock_t start = clock();
    // viterbi<<<1,k>>>(t, d_T1, d_T2, d_pi, d_Y, d_X,d_A,d_B); //Kernel invocation
    // cudaDeviceSynchronize();
    // clock_t end = clock();
    //
    // viterbiCPU(k,t);
    // printPath(10);

    int Ks[NUM_SAMPLES];
    int Ts[NUM_SAMPLES];
    double Ktimes[NUM_SAMPLES], Ttimes[NUM_SAMPLES],Kflops[NUM_SAMPLES], Tflops[NUM_SAMPLES];


    for (int i = 1; i < NUM_SAMPLES+1; ++i) {

        Ks[i-1] =MIN_K +  (i-1)*((MAX_K-MIN_K)/NUM_SAMPLES);
        Ts[i-1] =MIN_T + (i-1)*((MAX_T-MIN_T)/NUM_SAMPLES);
    }

for(int i =0; i < NUM_SAMPLES; i++){
k = Ks[i];
t = MAX_T;

clock_t start = clock();
viterbi<<<1,k>>>(t, d_T1, d_T2, d_pi, d_Y, d_X,d_A,d_B); //Kernel invocation
hipDeviceSynchronize();
clock_t end = clock();


Ktimes[i] = (end - start)/ (double) CLOCKS_PER_SEC;

Kflops[i] = GPUFlops(Ktimes[i], k,t);

}
for(int i =0; i < NUM_SAMPLES; i++){
k = MAX_K;
t = Ts[i];

clock_t start = clock();
viterbi<<<1,k>>>(t, d_T1, d_T2, d_pi, d_Y, d_X,d_A,d_B); //Kernel invocation
hipDeviceSynchronize();
clock_t end = clock();


Ttimes[i] = (end - start)/ (double) CLOCKS_PER_SEC;

Tflops[i] = GPUFlops(Ttimes[i], k,t);
}


ofstream outK("CUDAvariedK.txt");
ofstream outT("CUDAvariedT.txt");


outK << "K, T, Time, Flops\n";
outT << "K, T, Time, Flops\n";

for (int k = 0; k <NUM_SAMPLES ; ++k) {
    outK << Ks[k] << ", " << MAX_T << ", " << Ktimes[k] << ", " << Kflops[k] <<endl;
    outT << MAX_K << ", " << Ts[k] << ", " << Ttimes[k] << ", " << Tflops[k] <<endl;

}
    return 0;



}

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

                                        # End of file scope inline assembly
	.globl	_Z9printPathi                   # -- Begin function _Z9printPathi
	.type	_Z9printPathi,@function
_Z9printPathi:                          # @_Z9printPathi
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
                                        # kill: def $edi killed $edi def $rdi
	leal	-1(%rdi), %ebx
	cmpl	$2, %edi
	jl	.LBB0_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%ebx, %r14d
	shlq	$2, %r14
	xorl	%r15d, %r15d
.LBB0_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	X(%r15), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	addq	$4, %r15
	cmpq	%r15, %r14
	jne	.LBB0_2
.LBB0_3:                                # %._crit_edge
	movslq	%ebx, %rax
	movl	X(,%rax,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l # TAILCALL
.Lfunc_end0:
	.size	_Z9printPathi, .Lfunc_end0-_Z9printPathi
	.cfi_endproc
                                        # -- End function
	.globl	_Z31generateTransitionProbabilitiesv # -- Begin function _Z31generateTransitionProbabilitiesv
	.type	_Z31generateTransitionProbabilitiesv,@function
_Z31generateTransitionProbabilitiesv:   # @_Z31generateTransitionProbabilitiesv
	.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	$3216, %rsp                     # imm = 0xC90
	.cfi_def_cfa_offset 3248
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$A, %ebx
	xorl	%r14d, %r14d
.LBB1_1:                                # %.preheader15
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB1_2 Depth 2
                                        #     Child Loop BB1_4 Depth 2
	xorps	%xmm1, %xmm1
	xorl	%r15d, %r15d
.LBB1_2:                                #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	callq	rand
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, 16(%rsp,%r15,8)
	addsd	%xmm0, %xmm1
	incq	%r15
	cmpq	$400, %r15                      # imm = 0x190
	jne	.LBB1_2
# %bb.3:                                # %.preheader.preheader
                                        #   in Loop: Header=BB1_1 Depth=1
	xorl	%eax, %eax
.LBB1_4:                                # %.preheader
                                        #   Parent Loop BB1_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	16(%rsp,%rax,8), %xmm0          # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%rax,8)
	incq	%rax
	cmpq	$400, %rax                      # imm = 0x190
	jne	.LBB1_4
# %bb.5:                                #   in Loop: Header=BB1_1 Depth=1
	incq	%r14
	addq	$3200, %rbx                     # imm = 0xC80
	cmpq	$400, %r14                      # imm = 0x190
	jne	.LBB1_1
# %bb.6:
	addq	$3216, %rsp                     # imm = 0xC90
	.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_end1:
	.size	_Z31generateTransitionProbabilitiesv, .Lfunc_end1-_Z31generateTransitionProbabilitiesv
	.cfi_endproc
                                        # -- End function
	.globl	_Z29generateEmmisionProbabilitiesv # -- Begin function _Z29generateEmmisionProbabilitiesv
	.type	_Z29generateEmmisionProbabilitiesv,@function
_Z29generateEmmisionProbabilitiesv:     # @_Z29generateEmmisionProbabilitiesv
	.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	$96, %rsp
	.cfi_def_cfa_offset 128
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$B, %ebx
	xorl	%r14d, %r14d
.LBB2_1:                                # %.preheader15
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB2_2 Depth 2
                                        #     Child Loop BB2_4 Depth 2
	xorps	%xmm1, %xmm1
	xorl	%r15d, %r15d
.LBB2_2:                                #   Parent Loop BB2_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	callq	rand
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, 16(%rsp,%r15,8)
	addsd	%xmm0, %xmm1
	incq	%r15
	cmpq	$10, %r15
	jne	.LBB2_2
# %bb.3:                                # %.preheader.preheader
                                        #   in Loop: Header=BB2_1 Depth=1
	xorl	%eax, %eax
.LBB2_4:                                # %.preheader
                                        #   Parent Loop BB2_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movsd	16(%rsp,%rax,8), %xmm0          # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, (%rbx,%rax,8)
	incq	%rax
	cmpq	$10, %rax
	jne	.LBB2_4
# %bb.5:                                #   in Loop: Header=BB2_1 Depth=1
	incq	%r14
	addq	$80, %rbx
	cmpq	$400, %r14                      # imm = 0x190
	jne	.LBB2_1
# %bb.6:
	addq	$96, %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_end2:
	.size	_Z29generateEmmisionProbabilitiesv, .Lfunc_end2-_Z29generateEmmisionProbabilitiesv
	.cfi_endproc
                                        # -- End function
	.globl	_Z14generatePriorsv             # -- Begin function _Z14generatePriorsv
	.type	_Z14generatePriorsv,@function
_Z14generatePriorsv:                    # @_Z14generatePriorsv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	subq	$3216, %rsp                     # imm = 0xC90
	.cfi_def_cfa_offset 3232
	.cfi_offset %rbx, -16
	xorpd	%xmm1, %xmm1
	xorl	%ebx, %ebx
.LBB3_1:                                # =>This Inner Loop Header: Depth=1
	movsd	%xmm1, 8(%rsp)                  # 8-byte Spill
	callq	rand
	movsd	8(%rsp), %xmm1                  # 8-byte Reload
                                        # xmm1 = mem[0],zero
	xorps	%xmm0, %xmm0
	cvtsi2sd	%eax, %xmm0
	movsd	%xmm0, 16(%rsp,%rbx,8)
	addsd	%xmm0, %xmm1
	incq	%rbx
	cmpq	$400, %rbx                      # imm = 0x190
	jne	.LBB3_1
# %bb.2:                                # %.preheader.preheader
	xorl	%eax, %eax
.LBB3_3:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movsd	16(%rsp,%rax), %xmm0            # xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	movsd	%xmm0, pi(%rax)
	addq	$8, %rax
	cmpq	$3200, %rax                     # imm = 0xC80
	jne	.LBB3_3
# %bb.4:
	addq	$3216, %rsp                     # imm = 0xC90
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z14generatePriorsv, .Lfunc_end3-_Z14generatePriorsv
	.cfi_endproc
                                        # -- End function
	.globl	_Z20generateObservationsv       # -- Begin function _Z20generateObservationsv
	.type	_Z20generateObservationsv,@function
_Z20generateObservationsv:              # @_Z20generateObservationsv
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$10016, %rsp                    # imm = 0x2720
	.cfi_def_cfa_offset 10048
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	5016(%rsp), %rbx
	movq	%rbx, %rdi
	callq	_ZNSt13random_deviceC2Ev
.Ltmp0:
	movq	%rbx, %rdi
	callq	_ZNSt13random_device9_M_getvalEv
.Ltmp1:
# %bb.1:                                # %_ZNSt13random_deviceclEv.exit
	movl	%eax, %eax
	movq	%rax, 16(%rsp)
	movl	$1, %ecx
.LBB4_2:                                # =>This Inner Loop Header: Depth=1
	movq	%rax, %rdx
	shrq	$30, %rdx
	xorl	%eax, %edx
	imull	$1812433253, %edx, %eax         # imm = 0x6C078965
	addl	%ecx, %eax
	movq	%rax, 16(%rsp,%rcx,8)
	incq	%rcx
	cmpq	$624, %rcx                      # imm = 0x270
	jne	.LBB4_2
# %bb.3:
	leaq	16(%rsp), %rbx
	movq	$624, 4992(%rbx)                # imm = 0x270
	movabsq	$38654705664, %rax              # imm = 0x900000000
	leaq	8(%rsp), %r14
	movq	%rax, (%r14)
	movq	$-40000, %r15                   # imm = 0xFFFF63C0
.LBB4_4:                                # =>This Inner Loop Header: Depth=1
.Ltmp3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE
.Ltmp4:
# %bb.5:                                # %_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_.exit
                                        #   in Loop: Header=BB4_4 Depth=1
	movl	%eax, Y+40000(%r15)
	addq	$4, %r15
	jne	.LBB4_4
# %bb.6:
.Ltmp9:
	leaq	5016(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp10:
# %bb.7:                                # %_ZNSt13random_deviceD2Ev.exit
	addq	$10016, %rsp                    # imm = 0x2720
	.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
.LBB4_8:
	.cfi_def_cfa_offset 10048
.Ltmp11:
	jmp	.LBB4_9
.LBB4_10:
.Ltmp2:
	jmp	.LBB4_12
.LBB4_11:
.Ltmp5:
.LBB4_12:
	movq	%rax, %rbx
.Ltmp6:
	leaq	5016(%rsp), %rdi
	callq	_ZNSt13random_device7_M_finiEv
.Ltmp7:
# %bb.13:                               # %_ZNSt13random_deviceD2Ev.exit9
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB4_14:
.Ltmp8:
.LBB4_9:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end4:
	.size	_Z20generateObservationsv, .Lfunc_end4-_Z20generateObservationsv
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 5 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp7-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Lfunc_end4-.Ltmp7             #   Call between .Ltmp7 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt13random_deviceC2Ev,"axG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.weak	_ZNSt13random_deviceC2Ev        # -- Begin function _ZNSt13random_deviceC2Ev
	.p2align	1, 0x90
	.type	_ZNSt13random_deviceC2Ev,@function
_ZNSt13random_deviceC2Ev:               # @_ZNSt13random_deviceC2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	leaq	16(%rsp), %r15
	movq	%r15, -16(%r15)
	movq	%rsp, %r14
	movl	$.L.str.6, %esi
	movl	$.L.str.6+7, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp12:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp13:
# %bb.1:
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB5_3
# %bb.2:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB5_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	addq	$32, %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
.LBB5_4:
	.cfi_def_cfa_offset 64
.Ltmp14:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	cmpq	%r15, %rdi
	je	.LBB5_6
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i4
	callq	_ZdlPv
.LBB5_6:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit6
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end5:
	.size	_ZNSt13random_deviceC2Ev, .Lfunc_end5-_ZNSt13random_deviceC2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZNSt13random_deviceC2Ev,"aG",@progbits,_ZNSt13random_deviceC2Ev,comdat
	.p2align	2, 0x0
GCC_except_table5:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Lfunc_begin1-.Lfunc_begin1    # >> Call Site 1 <<
	.uleb128 .Ltmp12-.Lfunc_begin1          #   Call between .Lfunc_begin1 and .Ltmp12
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp12-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin1          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Lfunc_end5-.Ltmp13            #   Call between .Ltmp13 and .Lfunc_end5
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z14generateInputsv             # -- Begin function _Z14generateInputsv
	.type	_Z14generateInputsv,@function
_Z14generateInputsv:                    # @_Z14generateInputsv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	xorl	%edi, %edi
	callq	time
	movl	%eax, %edi
	callq	srand
	callq	_Z31generateTransitionProbabilitiesv
	callq	_Z29generateEmmisionProbabilitiesv
	callq	_Z14generatePriorsv
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Z20generateObservationsv       # TAILCALL
.Lfunc_end6:
	.size	_Z14generateInputsv, .Lfunc_end6-_Z14generateInputsv
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function _Z10viterbiCPUii
.LCPI7_0:
	.quad	0xbff0000000000000              # double -1
	.text
	.globl	_Z10viterbiCPUii
	.type	_Z10viterbiCPUii,@function
_Z10viterbiCPUii:                       # @_Z10viterbiCPUii
	.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
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
                                        # kill: def $esi killed $esi def $rsi
	movl	%edi, %eax
	testl	%edi, %edi
	jle	.LBB7_3
# %bb.1:                                # %.lr.ph
	movslq	Y(%rip), %rcx
	leaq	B(,%rcx,8), %rcx
	imulq	$40000, %rax, %rdx              # imm = 0x9C40
	movl	$pi, %r8d
	xorl	%r9d, %r9d
.LBB7_2:                                # =>This Inner Loop Header: Depth=1
	movsd	(%r8), %xmm0                    # xmm0 = mem[0],zero
	mulsd	(%rcx), %xmm0
	movsd	%xmm0, T1(%r9,%r9)
	movl	$0, T2(%r9)
	addq	$40000, %r9                     # imm = 0x9C40
	addq	$8, %r8
	addq	$80, %rcx
	cmpq	%r9, %rdx
	jne	.LBB7_2
.LBB7_3:                                # %.preheader71
	cmpl	$2, %esi
	jl	.LBB7_11
# %bb.4:                                # %.preheader70.lr.ph
	movl	%esi, %ecx
	movl	$-1, %edx
	movl	$1, %r8d
	movl	$T1, %r9d
	movsd	.LCPI7_0(%rip), %xmm0           # xmm0 = mem[0],zero
.LBB7_5:                                # %.preheader70
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB7_7 Depth 2
                                        #       Child Loop BB7_8 Depth 3
	testl	%edi, %edi
	jle	.LBB7_10
# %bb.6:                                # %.preheader69.lr.ph
                                        #   in Loop: Header=BB7_5 Depth=1
	movslq	Y(,%r8,4), %r10
	movl	$A, %r11d
	xorl	%ebx, %ebx
.LBB7_7:                                # %.preheader69
                                        #   Parent Loop BB7_5 Depth=1
                                        # =>  This Loop Header: Depth=2
                                        #       Child Loop BB7_8 Depth 3
	leaq	(%rbx,%rbx,4), %r14
	shlq	$4, %r14
	movsd	B(%r14,%r10,8), %xmm1           # xmm1 = mem[0],zero
	movq	%r11, %r14
	movq	%r9, %r15
	xorl	%r12d, %r12d
	movapd	%xmm0, %xmm2
	movapd	%xmm0, %xmm3
.LBB7_8:                                #   Parent Loop BB7_5 Depth=1
                                        #     Parent Loop BB7_7 Depth=2
                                        # =>    This Inner Loop Header: Depth=3
	movapd	%xmm2, %xmm4
	movsd	(%r15), %xmm5                   # xmm5 = mem[0],zero
	mulsd	(%r14), %xmm5
	movapd	%xmm5, %xmm2
	mulsd	%xmm1, %xmm2
	maxsd	%xmm4, %xmm2
	ucomisd	%xmm3, %xmm5
	maxsd	%xmm3, %xmm5
	cmoval	%r12d, %edx
	incq	%r12
	addq	$80000, %r15                    # imm = 0x13880
	addq	$3200, %r14                     # imm = 0xC80
	movapd	%xmm5, %xmm3
	cmpq	%r12, %rax
	jne	.LBB7_8
# %bb.9:                                # %._crit_edge
                                        #   in Loop: Header=BB7_7 Depth=2
	imulq	$80000, %rbx, %r14              # imm = 0x13880
	movsd	%xmm2, T1(%r14,%r8,8)
	imulq	$40000, %rbx, %r14              # imm = 0x9C40
	movl	%edx, T2(%r14,%r8,4)
	incq	%rbx
	addq	$8, %r11
	cmpq	%rax, %rbx
	jne	.LBB7_7
.LBB7_10:                               # %._crit_edge81
                                        #   in Loop: Header=BB7_5 Depth=1
	incq	%r8
	addq	$8, %r9
	cmpq	%rcx, %r8
	jne	.LBB7_5
.LBB7_11:                               # %.preheader
	leal	-1(%rsi), %ecx
	movslq	%ecx, %rdx
	testl	%edi, %edi
	jle	.LBB7_12
# %bb.17:                               # %.lr.ph88
	leaq	T1(,%rdx,8), %r8
	movsd	.LCPI7_0(%rip), %xmm0           # xmm0 = mem[0],zero
	movl	$-1, %edi
	xorl	%r9d, %r9d
.LBB7_18:                               # =>This Inner Loop Header: Depth=1
	movsd	(%r8), %xmm1                    # xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	maxsd	%xmm0, %xmm1
	cmoval	%r9d, %edi
	incq	%r9
	addq	$80000, %r8                     # imm = 0x13880
	movapd	%xmm1, %xmm0
	cmpq	%r9, %rax
	jne	.LBB7_18
	jmp	.LBB7_13
.LBB7_12:
	movl	$-1, %edi
.LBB7_13:                               # %._crit_edge89
	movl	%edi, X(,%rdx,4)
	cmpl	$2, %esi
	jl	.LBB7_16
# %bb.14:                               # %.lr.ph93.preheader
	movl	%ecx, %eax
	movl	X(,%rax,4), %ecx
	incq	%rax
.LBB7_15:                               # %.lr.ph93
                                        # =>This Inner Loop Header: Depth=1
	movslq	%ecx, %rcx
	imulq	$40000, %rcx, %rcx              # imm = 0x9C40
	movl	T2-4(%rcx,%rax,4), %ecx
	movl	%ecx, X-8(,%rax,4)
	decq	%rax
	cmpq	$1, %rax
	ja	.LBB7_15
.LBB7_16:                               # %._crit_edge94
	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_end7:
	.size	_Z10viterbiCPUii, .Lfunc_end7-_Z10viterbiCPUii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function _Z8cpuFLOPSdff
.LCPI8_0:
	.long	0x40400000                      # float 3
.LCPI8_1:
	.long	0x3f800000                      # float 1
.LCPI8_2:
	.long	0xbf800000                      # float -1
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI8_3:
	.quad	0x3c9cd2b297d889bc              # double 9.9999999999999997E-17
	.text
	.globl	_Z8cpuFLOPSdff
	.type	_Z8cpuFLOPSdff,@function
_Z8cpuFLOPSdff:                         # @_Z8cpuFLOPSdff
	.cfi_startproc
# %bb.0:
	movss	.LCPI8_0(%rip), %xmm3           # xmm3 = mem[0],zero,zero,zero
	mulss	%xmm1, %xmm3
	mulss	%xmm3, %xmm1
	addss	.LCPI8_1(%rip), %xmm1
	addss	.LCPI8_2(%rip), %xmm2
	mulss	%xmm1, %xmm2
	addss	%xmm3, %xmm2
	xorps	%xmm1, %xmm1
	cvtss2sd	%xmm2, %xmm1
	addsd	.LCPI8_3(%rip), %xmm0
	divsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	retq
.Lfunc_end8:
	.size	_Z8cpuFLOPSdff, .Lfunc_end8-_Z8cpuFLOPSdff
	.cfi_endproc
                                        # -- End function
	.globl	_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_ # -- Begin function _Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_
	.type	_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_,@function
_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_: # @_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r13
	.cfi_def_cfa_offset 32
	pushq	%r12
	.cfi_def_cfa_offset 40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	subq	$160, %rsp
	.cfi_def_cfa_offset 208
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	4(%rsp), %rax
	movl	%edi, (%rax)
	leaq	56(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	48(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	40(%rsp), %rdx
	movq	%rcx, (%rdx)
	leaq	32(%rsp), %rcx
	movq	%r8, (%rcx)
	leaq	24(%rsp), %r8
	movq	%r9, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	208(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	216(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z7viterbiiPdPiS_S0_S0_S_S_, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$176, %rsp
	.cfi_adjust_cfa_offset -176
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end9:
	.size	_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_, .Lfunc_end9-_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z8GPUFlopsdii                  # -- Begin function _Z8GPUFlopsdii
	.type	_Z8GPUFlopsdii,@function
_Z8GPUFlopsdii:                         # @_Z8GPUFlopsdii
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
                                        # kill: def $edi killed $edi def $rdi
	leal	(%rdi,%rdi), %eax
	imull	%edi, %eax
	decl	%esi
	imull	%eax, %esi
	leal	(%rsi,%rdi,2), %eax
	cvtsi2sd	%eax, %xmm1
	divsd	%xmm0, %xmm1
	movapd	%xmm1, %xmm0
	retq
.Lfunc_end10:
	.size	_Z8GPUFlopsdii, .Lfunc_end10-_Z8GPUFlopsdii
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0                          # -- Begin function main
.LCPI11_0:
	.quad	0x412e848000000000              # double 1.0E+6
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %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	$3112, %rsp                     # imm = 0xC28
	.cfi_def_cfa_offset 3168
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	.cfi_escape 0x2e, 0x00
	callq	_Z14generateInputsv
	.cfi_escape 0x2e, 0x00
	leaq	56(%rsp), %rbp
	movl	$32000000, %esi                 # imm = 0x1E84800
	movq	%rbp, %rdi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	48(%rsp), %r12
	movl	$16000000, %esi                 # imm = 0xF42400
	movq	%r12, %rdi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	40(%rsp), %r14
	movl	$3200, %esi                     # imm = 0xC80
	movq	%r14, %rdi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	8(%rsp), %rdi
	movl	$40000, %esi                    # imm = 0x9C40
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	32(%rsp), %rbx
	movl	$40000, %esi                    # imm = 0x9C40
	movq	%rbx, %rdi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	24(%rsp), %r13
	movl	$1280000, %esi                  # imm = 0x138800
	movq	%r13, %rdi
	callq	hipMalloc
	.cfi_escape 0x2e, 0x00
	leaq	16(%rsp), %r15
	movl	$32000, %esi                    # imm = 0x7D00
	movq	%r15, %rdi
	callq	hipMalloc
	movq	(%rbx), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$X, %esi
	movl	$40000, %edx                    # imm = 0x9C40
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%rbp), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$T1, %esi
	movl	$32000000, %edx                 # imm = 0x1E84800
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r12), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$T2, %esi
	movl	$16000000, %edx                 # imm = 0xF42400
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r14), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$pi, %esi
	movl	$3200, %edx                     # imm = 0xC80
	movl	$1, %ecx
	callq	hipMemcpy
	leaq	8(%rsp), %rax
	movq	(%rax), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$Y, %esi
	movl	$40000, %edx                    # imm = 0x9C40
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r13), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$A, %esi
	movl	$1280000, %edx                  # imm = 0x138800
	movl	$1, %ecx
	callq	hipMemcpy
	movq	(%r15), %rdi
	.cfi_escape 0x2e, 0x00
	movl	$B, %esi
	movl	$32000, %edx                    # imm = 0x7D00
	movl	$1, %ecx
	callq	hipMemcpy
	.cfi_escape 0x2e, 0x00
	callq	hipDeviceSynchronize
	movl	$1000, %eax                     # imm = 0x3E8
	movl	$50, %ecx
	xorl	%edx, %edx
.LBB11_1:                               # =>This Inner Loop Header: Depth=1
	movl	%ecx, 272(%rsp,%rdx,4)
	movl	%eax, 64(%rsp,%rdx,4)
	addl	$180, %eax
	addl	$7, %ecx
	incq	%rdx
	cmpq	$50, %rdx
	jne	.LBB11_1
# %bb.2:                                # %.preheader95.preheader
	movabsq	$4294967297, %rbx               # imm = 0x100000001
	xorl	%r15d, %r15d
.LBB11_3:                               # %.preheader95
                                        # =>This Inner Loop Header: Depth=1
	movl	272(%rsp,%r15,4), %r12d
	.cfi_escape 0x2e, 0x00
	callq	clock
	movq	%rax, %r14
	leaq	(%rbx,%r12), %rdx
	decq	%rdx
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	movl	$1, %esi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_5
# %bb.4:                                #   in Loop: Header=BB11_3 Depth=1
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rcx
	movq	8(%rsp), %r8
	movq	32(%rsp), %r9
	.cfi_escape 0x2e, 0x10
	movl	$10000, %edi                    # imm = 0x2710
	pushq	16(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	32(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB11_5:                               #   in Loop: Header=BB11_3 Depth=1
	.cfi_escape 0x2e, 0x00
	callq	hipDeviceSynchronize
	.cfi_escape 0x2e, 0x00
	callq	clock
	subq	%r14, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI11_0(%rip), %xmm0
	movsd	%xmm0, 2704(%rsp,%r15,8)
	imull	$9999, %r12d, %eax              # imm = 0x270F
	incl	%eax
	imull	%r12d, %eax
	addl	%eax, %eax
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 1904(%rsp,%r15,8)
	incq	%r15
	cmpq	$50, %r15
	jne	.LBB11_3
# %bb.6:                                # %.preheader.preheader
	xorl	%r12d, %r12d
	leaq	399(%rbx), %r14
.LBB11_7:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movl	64(%rsp,%r12,4), %ebp
	.cfi_escape 0x2e, 0x00
	callq	clock
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
	testl	%eax, %eax
	jne	.LBB11_9
# %bb.8:                                #   in Loop: Header=BB11_7 Depth=1
	movq	56(%rsp), %rsi
	movq	48(%rsp), %rdx
	movq	40(%rsp), %rcx
	movq	8(%rsp), %r8
	movq	32(%rsp), %r9
	.cfi_escape 0x2e, 0x10
	movl	%ebp, %edi
	pushq	16(%rsp)
	.cfi_adjust_cfa_offset 8
	pushq	32(%rsp)
	.cfi_adjust_cfa_offset 8
	callq	_Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_
	addq	$16, %rsp
	.cfi_adjust_cfa_offset -16
.LBB11_9:                               #   in Loop: Header=BB11_7 Depth=1
	.cfi_escape 0x2e, 0x00
	callq	hipDeviceSynchronize
	.cfi_escape 0x2e, 0x00
	callq	clock
	subq	%r15, %rax
	xorps	%xmm0, %xmm0
	cvtsi2sd	%rax, %xmm0
	divsd	.LCPI11_0(%rip), %xmm0
	movsd	%xmm0, 2304(%rsp,%r12,8)
	imull	$320000, %ebp, %eax             # imm = 0x4E200
	addl	$-319200, %eax                  # imm = 0xFFFB2120
	xorps	%xmm1, %xmm1
	cvtsi2sd	%eax, %xmm1
	divsd	%xmm0, %xmm1
	movsd	%xmm1, 1504(%rsp,%r12,8)
	incq	%r12
	cmpq	$50, %r12
	jne	.LBB11_7
# %bb.10:
	.cfi_escape 0x2e, 0x00
	leaq	992(%rsp), %rdi
	movl	$.L.str.2, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp15:
	.cfi_escape 0x2e, 0x00
	leaq	480(%rsp), %rdi
	movl	$.L.str.3, %esi
	movl	$16, %edx
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp16:
# %bb.11:
.Ltmp18:
	.cfi_escape 0x2e, 0x00
	leaq	992(%rsp), %rdi
	movl	$.L.str.4, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp19:
# %bb.12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
.Ltmp20:
	.cfi_escape 0x2e, 0x00
	leaq	480(%rsp), %rdi
	movl	$.L.str.4, %esi
	movl	$18, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp21:
# %bb.13:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit69.preheader.preheader
	xorl	%r12d, %r12d
	leaq	992(%rsp), %rbx
	leaq	480(%rsp), %r14
.LBB11_14:                              # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit69.preheader
                                        # =>This Inner Loop Header: Depth=1
	movl	272(%rsp,%r12), %esi
.Ltmp23:
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	_ZNSolsEi
.Ltmp24:
# %bb.15:                               #   in Loop: Header=BB11_14 Depth=1
.Ltmp25:
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp26:
# %bb.16:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit70
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp27:
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	movl	$10000, %esi                    # imm = 0x2710
	callq	_ZNSolsEi
.Ltmp28:
# %bb.17:                               #   in Loop: Header=BB11_14 Depth=1
.Ltmp29:
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp30:
# %bb.18:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit71
                                        #   in Loop: Header=BB11_14 Depth=1
	movsd	2704(%rsp,%r12,2), %xmm0        # xmm0 = mem[0],zero
.Ltmp31:
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp32:
# %bb.19:                               # %_ZNSolsEd.exit
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp33:
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp34:
# %bb.20:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit72
                                        #   in Loop: Header=BB11_14 Depth=1
	movsd	1904(%rsp,%r12,2), %xmm0        # xmm0 = mem[0],zero
.Ltmp35:
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp36:
# %bb.21:                               # %_ZNSolsEd.exit73
                                        #   in Loop: Header=BB11_14 Depth=1
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp37:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp38:
# %bb.22:                               # %.noexc
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp39:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp40:
# %bb.23:                               # %.noexc80
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp41:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp42:
# %bb.24:                               # %_ZNSolsEPFRSoS_E.exit
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp43:
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	movl	$400, %esi                      # imm = 0x190
	callq	_ZNSolsEi
.Ltmp44:
# %bb.25:                               #   in Loop: Header=BB11_14 Depth=1
.Ltmp45:
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp46:
# %bb.26:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit74
                                        #   in Loop: Header=BB11_14 Depth=1
	movl	64(%rsp,%r12), %esi
.Ltmp47:
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	_ZNSolsEi
.Ltmp48:
# %bb.27:                               #   in Loop: Header=BB11_14 Depth=1
.Ltmp49:
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp50:
# %bb.28:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit75
                                        #   in Loop: Header=BB11_14 Depth=1
	movsd	2304(%rsp,%r12,2), %xmm0        # xmm0 = mem[0],zero
.Ltmp51:
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp52:
# %bb.29:                               # %_ZNSolsEd.exit76
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp53:
	movq	%rax, %r15
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.5, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp54:
# %bb.30:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit77
                                        #   in Loop: Header=BB11_14 Depth=1
	movsd	1504(%rsp,%r12,2), %xmm0        # xmm0 = mem[0],zero
.Ltmp55:
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
.Ltmp56:
# %bb.31:                               # %_ZNSolsEd.exit78
                                        #   in Loop: Header=BB11_14 Depth=1
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
.Ltmp57:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp58:
# %bb.32:                               # %.noexc82
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp59:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
.Ltmp60:
# %bb.33:                               # %.noexc83
                                        #   in Loop: Header=BB11_14 Depth=1
.Ltmp61:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp62:
# %bb.34:                               # %_ZNSolsEPFRSoS_E.exit79
                                        #   in Loop: Header=BB11_14 Depth=1
	addq	$4, %r12
	cmpq	$200, %r12
	jne	.LBB11_14
# %bb.35:
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE(%rip), %r15
	leaq	488(%rsp), %rdi
	movq	%r15, -8(%rdi)
	movq	_ZTTSt14basic_ofstreamIcSt11char_traitsIcEE+24(%rip), %r12
	movq	-24(%r15), %rax
	movq	%r12, 480(%rsp,%rax)
	.cfi_escape 0x2e, 0x00
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	movl	$248, %r13d
	addq	%r13, %r14
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	callq	_ZNSt8ios_baseD2Ev
	leaq	1000(%rsp), %rdi
	movq	%r15, -8(%rdi)
	movq	-24(%r15), %rax
	movq	%r12, 992(%rsp,%rax)
	.cfi_escape 0x2e, 0x00
	callq	_ZNSt13basic_filebufIcSt11char_traitsIcEED2Ev
	addq	%r13, %rbx
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	_ZNSt8ios_baseD2Ev
	xorl	%eax, %eax
	addq	$3112, %rsp                     # imm = 0xC28
	.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
.LBB11_36:
	.cfi_def_cfa_offset 3168
.Ltmp17:
	movq	%rax, %rbx
	jmp	.LBB11_40
.LBB11_37:
.Ltmp22:
	jmp	.LBB11_39
.LBB11_38:
.Ltmp63:
.LBB11_39:
	movq	%rax, %rbx
	.cfi_escape 0x2e, 0x00
	leaq	480(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
.LBB11_40:
	.cfi_escape 0x2e, 0x00
	leaq	992(%rsp), %rdi
	callq	_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end11:
	.size	main, .Lfunc_end11-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table11:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp15-.Lfunc_begin2          #   Call between .Lfunc_begin2 and .Ltmp15
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin2          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Ltmp21-.Ltmp18                #   Call between .Ltmp18 and .Ltmp21
	.uleb128 .Ltmp22-.Lfunc_begin2          #     jumps to .Ltmp22
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp23-.Lfunc_begin2          # >> Call Site 4 <<
	.uleb128 .Ltmp62-.Ltmp23                #   Call between .Ltmp23 and .Ltmp62
	.uleb128 .Ltmp63-.Lfunc_begin2          #     jumps to .Ltmp63
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp62-.Lfunc_begin2          # >> Call Site 5 <<
	.uleb128 .Lfunc_end11-.Ltmp62           #   Call between .Ltmp62 and .Lfunc_end11
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,comdat
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag # -- Begin function _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.p2align	1, 0x90
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag,@function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag: # @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	subq	%rsi, %r14
	movq	%r14, (%rsp)
	cmpq	$15, %r14
	jbe	.LBB12_1
# %bb.2:
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm
	movq	%rax, (%rbx)
	movq	(%r12), %rcx
	movq	%rcx, 16(%rbx)
	jmp	.LBB12_3
.LBB12_1:                               # %._crit_edge
	movq	(%rbx), %rax
.LBB12_3:
	testq	%r14, %r14
	je	.LBB12_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB12_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB12_7
.LBB12_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB12_7:                               # %_ZZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tagEN6_GuardD2Ev.exit
	movq	(%rsp), %rax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end12:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end12-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.cfi_endproc
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end13:
	.size	__clang_call_terminate, .Lfunc_end13-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE,"axG",@progbits,_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE,comdat
	.weak	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE # -- Begin function _ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE
	.p2align	1, 0x90
	.type	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE,@function
_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE: # @_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE
	.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
	movq	%rsi, %r14
	movslq	4(%rdx), %r15
	movq	%rdx, 8(%rsp)                   # 8-byte Spill
	movslq	(%rdx), %rax
	subq	%rax, %r15
	movl	$4294967294, %eax               # imm = 0xFFFFFFFE
	cmpq	%rax, %r15
	ja	.LBB14_2
# %bb.1:
	incl	%r15d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_
	movl	%eax, %eax
	jmp	.LBB14_7
.LBB14_2:
	movl	$4294967295, %eax               # imm = 0xFFFFFFFF
	cmpq	%rax, %r15
	jne	.LBB14_3
# %bb.6:
	movq	%r14, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	jmp	.LBB14_7
.LBB14_3:                               # %.preheader
	movq	%rdi, %r12
	movabsq	$-4294967296, %rbx              # imm = 0xFFFFFFFF00000000
	leaq	16(%rsp), %r13
.LBB14_4:                               # =>This Inner Loop Header: Depth=1
	movq	%rbx, 16(%rsp)
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE
	movl	%eax, %ebp
	shlq	$32, %rbp
	movq	%r14, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	addq	%rbp, %rax
	setb	%cl
	cmpq	%r15, %rax
	ja	.LBB14_4
# %bb.5:                                #   in Loop: Header=BB14_4 Depth=1
	testb	%cl, %cl
	jne	.LBB14_4
.LBB14_7:                               # %.loopexit
	movq	8(%rsp), %rcx                   # 8-byte Reload
	addl	(%rcx), %eax
                                        # kill: def $eax killed $eax killed $rax
	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_end14:
	.size	_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE, .Lfunc_end14-_ZNSt24uniform_int_distributionIiEclISt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEEEiRT_RKNS0_10param_typeE
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_,"axG",@progbits,_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_,comdat
	.weak	_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_ # -- Begin function _ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_
	.p2align	1, 0x90
	.type	_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_,@function
_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_: # @_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %rbp, -16
	movl	%esi, %ebp
	movq	%rdi, %rbx
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	movq	%rax, %rcx
	movl	%ebp, %r14d
	imulq	%r14, %rcx
	cmpl	%ebp, %ecx
	jae	.LBB15_4
# %bb.1:
	movl	%ebp, %eax
	negl	%eax
	xorl	%edx, %edx
	divl	%ebp
	cmpl	%ecx, %edx
	jbe	.LBB15_4
# %bb.2:                                # %.lr.ph.preheader
	movl	%edx, %ebp
.LBB15_3:                               # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	movq	%rax, %rcx
	imulq	%r14, %rcx
	cmpl	%ecx, %ebp
	ja	.LBB15_3
.LBB15_4:                               # %.loopexit
	shrq	$32, %rcx
	movl	%ecx, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end15:
	.size	_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_, .Lfunc_end15-_ZNSt24uniform_int_distributionIiE5_S_ndImSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEjEET1_RT0_S4_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,comdat
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv # -- Begin function _ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.p2align	1, 0x90
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv,@function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv: # @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movq	4992(%rdi), %rax
	cmpq	$624, %rax                      # imm = 0x270
	jb	.LBB16_2
# %bb.1:
	movq	%rbx, %rdi
	callq	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	movq	4992(%rbx), %rax
.LBB16_2:
	leaq	1(%rax), %rcx
	movq	%rcx, 4992(%rbx)
	movq	(%rbx,%rax,8), %rax
	movq	%rax, %rcx
	shrq	$11, %rcx
	movl	%ecx, %ecx
	xorq	%rax, %rcx
	movl	%ecx, %eax
	shll	$7, %eax
	andl	$-1658038656, %eax              # imm = 0x9D2C5680
	xorq	%rcx, %rax
	movl	%eax, %ecx
	shll	$15, %ecx
	andl	$-272236544, %ecx               # imm = 0xEFC60000
	xorq	%rax, %rcx
	movq	%rcx, %rax
	shrq	$18, %rax
	xorq	%rcx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end16:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv, .Lfunc_end16-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EEclEv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,"axG",@progbits,_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,comdat
	.weak	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv # -- Begin function _ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.p2align	1, 0x90
	.type	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv,@function
_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv: # @_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.cfi_startproc
# %bb.0:
	movl	$2567483615, %eax               # imm = 0x9908B0DF
	movq	(%rdi), %rdx
	xorl	%ecx, %ecx
.LBB17_1:                               # =>This Inner Loop Header: Depth=1
	andq	$-2147483648, %rdx              # imm = 0x80000000
	movq	8(%rdi,%rcx,8), %rsi
	movl	%esi, %r8d
	andl	$2147483646, %r8d               # imm = 0x7FFFFFFE
	orq	%rdx, %r8
	shrq	%r8
	xorq	3176(%rdi,%rcx,8), %r8
	movq	%rsi, %rdx
                                        # kill: def $esi killed $esi killed $rsi def $rsi
	andl	$1, %esi
	negl	%esi
	andl	%eax, %esi
	xorq	%r8, %rsi
	movq	%rsi, (%rdi,%rcx,8)
	leaq	1(%rcx), %rsi
	movq	%rsi, %rcx
	cmpq	$227, %rsi
	jne	.LBB17_1
# %bb.2:                                # %.preheader.preheader
	movq	1816(%rdi), %rdx
	movl	$228, %ecx
.LBB17_3:                               # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	andq	$-2147483648, %rdx              # imm = 0x80000000
	movq	(%rdi,%rcx,8), %rsi
	movl	%esi, %r8d
	andl	$2147483646, %r8d               # imm = 0x7FFFFFFE
	orq	%rdx, %r8
	shrq	%r8
	xorq	-1824(%rdi,%rcx,8), %r8
	movq	%rsi, %rdx
                                        # kill: def $esi killed $esi killed $rsi def $rsi
	andl	$1, %esi
	negl	%esi
	andl	%eax, %esi
	xorq	%r8, %rsi
	movq	%rsi, -8(%rdi,%rcx,8)
	incq	%rcx
	cmpq	$624, %rcx                      # imm = 0x270
	jne	.LBB17_3
# %bb.4:
	movq	$-2147483648, %rcx              # imm = 0x80000000
	andq	4984(%rdi), %rcx
	movq	(%rdi), %rdx
	movl	%edx, %esi
	andl	$2147483646, %esi               # imm = 0x7FFFFFFE
	orq	%rcx, %rsi
	shrq	%rsi
	xorq	3168(%rdi), %rsi
	andl	$1, %edx
	negl	%edx
	andl	%eax, %edx
	xorq	%rsi, %rdx
	movq	%rdx, 4984(%rdi)
	movq	$0, 4992(%rdi)
	retq
.Lfunc_end17:
	.size	_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv, .Lfunc_end17-_ZNSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE11_M_gen_randEv
	.cfi_endproc
                                        # -- End function
	.text
	.p2align	4, 0x90                         # -- Begin function __hip_module_ctor
	.type	__hip_module_ctor,@function
__hip_module_ctor:                      # @__hip_module_ctor
	.cfi_startproc
# %bb.0:
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	movq	__hip_gpubin_handle(%rip), %rdi
	testq	%rdi, %rdi
	jne	.LBB18_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB18_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z7viterbiiPdPiS_S0_S0_S_S_, %esi
	movl	$.L__unnamed_1, %edx
	movl	$.L__unnamed_1, %ecx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	__hipRegisterFunction
	movl	$__hip_module_dtor, %edi
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	jmp	atexit                          # TAILCALL
.Lfunc_end18:
	.size	__hip_module_ctor, .Lfunc_end18-__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	.LBB19_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
.LBB19_2:
	retq
.Lfunc_end19:
	.size	__hip_module_dtor, .Lfunc_end19-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	T1,@object                      # @T1
	.bss
	.globl	T1
	.p2align	4, 0x0
T1:
	.zero	32000000
	.size	T1, 32000000

	.type	T2,@object                      # @T2
	.globl	T2
	.p2align	4, 0x0
T2:
	.zero	16000000
	.size	T2, 16000000

	.type	pi,@object                      # @pi
	.globl	pi
	.p2align	4, 0x0
pi:
	.zero	3200
	.size	pi, 3200

	.type	Y,@object                       # @Y
	.globl	Y
	.p2align	4, 0x0
Y:
	.zero	40000
	.size	Y, 40000

	.type	X,@object                       # @X
	.globl	X
	.p2align	4, 0x0
X:
	.zero	40000
	.size	X, 40000

	.type	A,@object                       # @A
	.globl	A
	.p2align	4, 0x0
A:
	.zero	1280000
	.size	A, 1280000

	.type	B,@object                       # @B
	.globl	B
	.p2align	4, 0x0
B:
	.zero	32000
	.size	B, 32000

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	" -> "
	.size	.L.str, 5

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

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

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

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

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"K, T, Time, Flops\n"
	.size	.L.str.4, 19

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

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"default"
	.size	.L.str.6, 8

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z7viterbiiPdPiS_S0_S0_S_S_"
	.size	.L__unnamed_1, 28

	.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 __gxx_personality_v0
	.addrsig_sym _Z22__device_stub__viterbiiPdPiS_S0_S0_S_S_
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym T1
	.addrsig_sym T2
	.addrsig_sym pi
	.addrsig_sym Y
	.addrsig_sym X
	.addrsig_sym A
	.addrsig_sym B
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z7viterbiiPdPiS_S0_S0_S_S_
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z7viterbiiPdPiS_S0_S0_S_S_ ; -- Begin function _Z7viterbiiPdPiS_S0_S0_S_S_
	.globl	_Z7viterbiiPdPiS_S0_S0_S_S_
	.p2align	8
	.type	_Z7viterbiiPdPiS_S0_S0_S_S_,@function
_Z7viterbiiPdPiS_S0_S0_S_S_:            ; @_Z7viterbiiPdPiS_S0_S0_S_S_
; %bb.0:
	s_clause 0x4
	s_load_b32 s3, s[0:1], 0x4c
	s_load_b32 s2, s[0:1], 0x0
	s_load_b256 s[4:11], s[0:1], 0x8
	s_load_b128 s[12:15], s[0:1], 0x28
	s_load_b64 s[16:17], s[0:1], 0x38
	s_waitcnt lgkmcnt(0)
	s_and_b32 s20, s3, 0xffff
	s_cmp_lt_i32 s2, 1
	s_cbranch_scc1 .LBB0_12
; %bb.1:                                ; %.lr.ph94
	v_mul_u32_u24_e32 v17, 0x2710, v0
	v_dual_mov_b32 v8, 0 :: v_dual_lshlrev_b32 v5, 3, v0
	s_cmp_lg_u32 s20, 0
	v_mul_u32_u24_e32 v18, 0x190, v0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_lshlrev_b32_e32 v3, 3, v17
	v_add_co_u32 v1, s0, s8, v5
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e64 v2, null, s9, 0, s0
	v_add_co_u32 v3, s0, s4, v3
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v4, null, s5, 0, s0
	v_add_co_u32 v5, s0, s14, v5
	v_add_co_ci_u32_e64 v6, null, s15, 0, s0
	s_mov_b32 s19, 0
	s_cselect_b32 s3, -1, 0
	s_add_u32 s8, s4, -8
	s_addc_u32 s9, s5, -1
	s_mov_b32 s18, s19
                                        ; implicit-def: $vgpr19
.LBB0_2:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_cmp_eq_u32 s18, 0
	s_cbranch_scc1 .LBB0_6
; %bb.3:                                ; %.preheader85
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_not1_b32 vcc_lo, exec_lo, s3
	s_cbranch_vccnz .LBB0_7
; %bb.4:                                ; %.lr.ph
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_lshl_b64 s[0:1], s[18:19], 2
	v_dual_mov_b32 v13, 0 :: v_dual_mov_b32 v16, v6
	s_add_u32 s0, s10, s0
	s_addc_u32 s1, s11, s1
	s_mov_b32 s21, 0
	global_load_b32 v7, v8, s[0:1]
	s_mov_b64 s[14:15], s[8:9]
	v_dual_mov_b32 v14, 0xbff00000 :: v_dual_mov_b32 v15, v5
	v_mov_b32_e32 v20, v19
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v9, v7, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v10, 31, v9
	v_lshlrev_b64 v[9:10], 3, v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, s16, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s17, v10, vcc_lo
	global_load_b64 v[11:12], v[9:10], off
	v_dual_mov_b32 v9, v13 :: v_dual_mov_b32 v10, v14
.LBB0_5:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	global_load_b64 v[21:22], v8, s[14:15]
	global_load_b64 v[23:24], v[15:16], off
	v_add_co_u32 v15, s1, 0xc80, v15
	s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
	v_add_co_ci_u32_e64 v16, s1, 0, v16, s1
	s_waitcnt vmcnt(0)
	v_mul_f64 v[21:22], v[21:22], v[23:24]
	v_mul_f64 v[23:24], v[21:22], v[11:12]
	v_cmp_gt_f64_e32 vcc_lo, v[21:22], v[13:14]
	s_delay_alu instid0(VALU_DEP_2)
	v_cmp_gt_f64_e64 s0, v[23:24], v[9:10]
	v_cndmask_b32_e64 v20, v20, s21, vcc_lo
	s_add_i32 s21, s21, 1
	v_dual_cndmask_b32 v14, v14, v22 :: v_dual_cndmask_b32 v13, v13, v21
	s_add_u32 s14, s14, 0x13880
	s_addc_u32 s15, s15, 0
	s_cmp_eq_u32 s20, s21
	s_delay_alu instid0(VALU_DEP_3)
	v_cndmask_b32_e64 v10, v10, v24, s0
	v_cndmask_b32_e64 v9, v9, v23, s0
	s_cbranch_scc0 .LBB0_5
	s_branch .LBB0_8
.LBB0_6:                                ;   in Loop: Header=BB0_2 Depth=1
	s_mov_b32 s0, -1
                                        ; implicit-def: $vgpr20
	s_branch .LBB0_9
.LBB0_7:                                ;   in Loop: Header=BB0_2 Depth=1
	v_dual_mov_b32 v9, 0 :: v_dual_mov_b32 v20, v19
	v_mov_b32_e32 v10, 0xbff00000
.LBB0_8:                                ; %Flow154
                                        ;   in Loop: Header=BB0_2 Depth=1
	v_add_nc_u32_e32 v7, s18, v17
	s_ashr_i32 s1, s18, 31
	s_mov_b32 s0, s18
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	s_lshl_b64 s[0:1], s[0:1], 3
	v_lshlrev_b64 v[11:12], 2, v[7:8]
	v_add_co_u32 v13, vcc_lo, v3, s0
	v_add_co_ci_u32_e32 v14, vcc_lo, s1, v4, vcc_lo
	s_mov_b32 s0, 0
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v11, vcc_lo, s6, v11
	v_add_co_ci_u32_e32 v12, vcc_lo, s7, v12, vcc_lo
	global_store_b64 v[13:14], v[9:10], off
	global_store_b32 v[11:12], v20, off
.LBB0_9:                                ; %Flow155
                                        ;   in Loop: Header=BB0_2 Depth=1
	s_and_b32 vcc_lo, exec_lo, s0
	s_cbranch_vccz .LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	global_load_b32 v7, v8, s[10:11]
	v_mov_b32_e32 v20, v19
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v9, v7, v18
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v10, 31, v9
	v_lshlrev_b64 v[9:10], 3, v[9:10]
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_add_co_u32 v9, vcc_lo, s16, v9
	v_add_co_ci_u32_e32 v10, vcc_lo, s17, v10, vcc_lo
	global_load_b64 v[11:12], v[1:2], off
	global_load_b64 v[9:10], v[9:10], off
	s_waitcnt vmcnt(0)
	v_mul_f64 v[9:10], v[11:12], v[9:10]
	global_store_b64 v[3:4], v[9:10], off
.LBB0_11:                               ;   in Loop: Header=BB0_2 Depth=1
	s_add_i32 s18, s18, 1
	v_mov_b32_e32 v19, v20
	s_add_u32 s8, s8, 8
	s_addc_u32 s9, s9, 0
	s_cmp_eq_u32 s18, s2
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
	s_cbranch_scc0 .LBB0_2
.LBB0_12:                               ; %._crit_edge95
	s_mov_b32 s0, exec_lo
	v_cmpx_eq_u32_e32 0, v0
	s_cbranch_execz .LBB0_20
; %bb.13:                               ; %.preheader
	s_cmp_eq_u32 s20, 0
	s_cbranch_scc1 .LBB0_16
; %bb.14:                               ; %.lr.ph101.preheader
	s_ashr_i32 s3, s2, 31
	v_mov_b32_e32 v0, 0
	s_lshl_b64 s[0:1], s[2:3], 3
	v_dual_mov_b32 v1, 0xbff00000 :: v_dual_mov_b32 v2, 0
	s_add_u32 s0, s0, s4
	s_addc_u32 s1, s1, s5
	s_add_u32 s0, s0, -8
	s_addc_u32 s1, s1, -1
	s_mov_b32 s3, 0
                                        ; implicit-def: $sgpr4
.LBB0_15:                               ; %.lr.ph101
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b64 v[3:4], v2, s[0:1]
	s_waitcnt vmcnt(0)
	v_cmp_gt_f64_e32 vcc_lo, v[3:4], v[0:1]
	s_and_b32 s5, vcc_lo, exec_lo
	v_dual_cndmask_b32 v1, v1, v4 :: v_dual_cndmask_b32 v0, v0, v3
	s_cselect_b32 s4, s3, s4
	s_add_i32 s3, s3, 1
	s_add_u32 s0, s0, 0x13880
	s_addc_u32 s1, s1, 0
	s_cmp_eq_u32 s20, s3
	s_cbranch_scc0 .LBB0_15
	s_branch .LBB0_17
.LBB0_16:
                                        ; implicit-def: $sgpr4
.LBB0_17:                               ; %._crit_edge102
	s_ashr_i32 s3, s2, 31
	v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, s4
	s_lshl_b64 s[0:1], s[2:3], 2
	s_delay_alu instid0(SALU_CYCLE_1)
	s_add_u32 s0, s12, s0
	s_addc_u32 s1, s13, s1
	s_cmp_lt_i32 s2, 2
	global_store_b32 v0, v1, s[0:1] offset:-4
	s_cbranch_scc1 .LBB0_20
; %bb.18:                               ; %.lr.ph106.preheader
	s_add_i32 s0, s2, -1
	s_mov_b32 s1, 0
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[0:1], s[0:1], 2
	s_add_u32 s0, s0, s12
	s_addc_u32 s1, s1, s13
	s_add_u32 s0, s0, -4
	s_addc_u32 s1, s1, -1
	s_add_u32 s4, s2, -1
	s_addc_u32 s3, s3, -1
.LBB0_19:                               ; %.lr.ph106
                                        ; =>This Inner Loop Header: Depth=1
	global_load_b32 v1, v0, s[0:1] offset:4
	s_waitcnt vmcnt(0)
	v_readfirstlane_b32 s5, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_mulk_i32 s5, 0x2710
	s_ashr_i32 s9, s5, 31
	s_add_u32 s8, s4, s5
	s_addc_u32 s9, s3, s9
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_lshl_b64 s[8:9], s[8:9], 2
	s_add_u32 s8, s6, s8
	s_addc_u32 s9, s7, s9
	s_add_i32 s2, s2, -1
	global_load_b32 v1, v0, s[8:9]
	s_waitcnt vmcnt(0)
	global_store_b32 v0, v1, s[0:1]
	s_add_u32 s0, s0, -4
	s_addc_u32 s1, s1, -1
	s_add_u32 s4, s4, -1
	s_addc_u32 s3, s3, -1
	s_cmp_gt_u32 s2, 1
	s_cbranch_scc1 .LBB0_19
.LBB0_20:                               ; %.loopexit
	s_nop 0
	s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z7viterbiiPdPiS_S0_S0_S_S_
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 320
		.amdhsa_user_sgpr_count 15
		.amdhsa_user_sgpr_dispatch_ptr 0
		.amdhsa_user_sgpr_queue_ptr 0
		.amdhsa_user_sgpr_kernarg_segment_ptr 1
		.amdhsa_user_sgpr_dispatch_id 0
		.amdhsa_user_sgpr_private_segment_size 0
		.amdhsa_wavefront_size32 1
		.amdhsa_uses_dynamic_stack 0
		.amdhsa_enable_private_segment 0
		.amdhsa_system_sgpr_workgroup_id_x 1
		.amdhsa_system_sgpr_workgroup_id_y 0
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 25
		.amdhsa_next_free_sgpr 22
		.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	_Z7viterbiiPdPiS_S0_S0_S_S_, .Lfunc_end0-_Z7viterbiiPdPiS_S0_S0_S_S_
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 1000
; NumSgprs: 24
; NumVgprs: 25
; ScratchSize: 0
; MemoryBound: 1
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 3
; NumSGPRsForWavesPerEU: 24
; NumVGPRsForWavesPerEU: 25
; Occupancy: 16
; WaveLimiterHint : 1
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 15
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 0
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
