#include <iostream>
#include <cstdlib>
#include <unistd.h>
#include <string>
#include <chrono>

using namespace std;

int GAP = -1, MATCH = 1, MISMATCH=-1;
int WIDTH, HEIGHT;

int *M;
#define M(i, j) (M[(i) * WIDTH + (j)])


void printMatrix(string seq1, string seq2)
{
    int seq1len = HEIGHT;
    int seq2len = WIDTH;

    for(int i = 0; i < seq1len; ++i)
    {
        if ( i == 0 )
        {
            printf("\t\t");
            for (int j = 0; j < seq2len; ++j)
            {
                printf("%c\t", seq2[j]);
            }
            printf("\n");
        }

        if (i == 0)
            printf("\t");

        if ( i >= 1 )
            printf("%c\t", seq1[i-1]);
        
        for(int j = 0; j < seq2len; ++j)
        {

            if ((M(i, j) >= 0) || (M(i, j) >= 10))
            {
                printf(" %d\t", M(i, j));
                continue;
            }

            printf("%d\t", M(i, j));

        }
        printf("\n");
    }
}


void initializeMatrix()
{
    int seq1len = HEIGHT;
    int seq2len = WIDTH;

    for(int i = 0; i < seq1len; ++i)
    {
        M(i, 0) = i == 0 ? 0 : i * (GAP);
    }

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

        M(0, j) = j == 0 ? 0 : j * (GAP);
    }

}

void traceback(string seq1, string seq2)
{
    int i = seq1.length();
    int j = seq2.length();

    string align = "";
    string ref = "";
    string v, w;

    int scoreDiag;

    while(i > 0 && j > 0)
    {
        v = seq1[i-1];
        w = seq2[j-1];

        if (seq1[i-1] == seq2[j-1])
            scoreDiag = MATCH;
        else
            scoreDiag = MISMATCH;

        if (i > 0 && j > 0 && M(i, j) == M(i-1, j-1) + scoreDiag)
        {
            align = v + align;
            ref = w + ref;

            i--;
            j--;
        }
        else if (i > 0 && M(i, j) == M(i-1, j) + GAP)
        {
            align = v + align;
            ref = "-" + ref;

            i--;
        }
        else if (j > 0 && M(i, j) == M(i, j-1) + GAP)
        {
            align = "-" + align;
            ref = w + ref;

            j--;
        }

    }


    cout << align << endl;
    cout << ref << endl;

}

__global__ void needlemanKernel(int *devM, char *seq1, char *seq2, int width, 
                                int height, int MATCH, int MISMATCH, int GAP, int k) 
{

    int by = blockIdx.y;
    int tx = threadIdx.x;
    int bdx = blockDim.x;

    int i = by * bdx + tx;
    int j = -i + width - (width - 2) + k;


    if (i >= height || i <= 0 || j >= width || j <= 0)
        return;


    int scoreDiag = 0;

    if (seq1[i - 1] == seq2[j - 1])
        scoreDiag = devM[(i - 1) * width + (j - 1)] + MATCH;
    else
    {
        // printf("%d, %d\n", i, j);
        //
        // printf("%c %c", seq1[i-1], seq2[j-1]);
        // printf("\n");
        scoreDiag = devM[(i - 1) * width + (j - 1)] + MISMATCH;

    }

    int scoreLeft = devM[i * width + (j - 1)] + GAP;
    int scoreUp = devM[(i - 1) * width + j] + GAP;

    devM[i * width + j] = max(max(scoreDiag, scoreLeft), scoreUp);

    __syncthreads();
}


int main(int argc, char *argv[])
{
    int c;
    string seq1;    
    string seq2;

    if(argc < 1)
    {
        seq1 = "GAATTCAGTTA"; //First Sequence
        seq2 = "GGATCGA"; //Second Sequence
    }

    while((c = getopt(argc, argv, ":r:")) != -1 ) 
    {
        switch(c)
        {
            case 'r':
                seq1 = optarg;
                break;
            case '?':
                printf("%c\n", optopt);
                break;
            default:
                break;
        }
    }

    for (int index = optind; index < argc; ++index)
        seq2 = argv[index];
         

    HEIGHT = seq1.length() + 1;
    WIDTH = seq2.length() + 1;
    M = (int*) malloc(sizeof(int) * (WIDTH) * (HEIGHT));

    initializeMatrix();

    char hostSeq1[seq1.length()];
    char hostSeq2[seq2.length()];

    strcpy(hostSeq1, seq1.c_str());
    strcpy(hostSeq2, seq2.c_str());

    int *deviceM;
    char *deviceSeq1;
    char *deviceSeq2;
    
    cudaMalloc(&deviceM, WIDTH * HEIGHT * sizeof(int));
    cudaMalloc(&deviceSeq1, seq1.length());
    cudaMalloc(&deviceSeq2, seq2.length());

    cudaMemcpy(deviceM, M, WIDTH * HEIGHT * sizeof(int), cudaMemcpyHostToDevice);
    cudaMemcpy(deviceSeq1, hostSeq1, seq1.length(), cudaMemcpyHostToDevice);
    cudaMemcpy(deviceSeq2, hostSeq2, seq2.length(), cudaMemcpyHostToDevice);

    int nThreads = 1024;
    
    dim3 dimGrid(1, (HEIGHT-1)/nThreads+1, 1);   
    dim3 dimBlock(HEIGHT, 1, 1);                                       
                                                                                
    auto t1 = chrono::high_resolution_clock::now();

    for(int k = 0; k < (WIDTH + HEIGHT) - 1; ++k)
    {
        needlemanKernel<<<dimGrid,dimBlock>>>(deviceM, deviceSeq1, deviceSeq2,
                                              WIDTH, HEIGHT, MATCH, MISMATCH, GAP,
                                              k);
    }

    auto t2 = chrono::high_resolution_clock::now();
    auto duration = chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();

    cout << duration << endl;  

    cudaMemcpy(M, deviceM, WIDTH * HEIGHT * sizeof(int), cudaMemcpyDeviceToHost);
    
    cudaFree(deviceM);
    cudaFree(deviceSeq1);
    cudaFree(deviceSeq2);

    
    // printMatrix(seq1, seq2);
    // traceback(seq1, seq2);

    free(M);

    return 0;
}

	.file	"tmpxft_00230383_00000000-6_NeedlemanWunsch.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3759:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3759:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"basic_string::append"
	.text
	.align 2
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0:
.LFB4505:
	.cfi_startproc
	movabsq	$4611686018427387903, %rax
	subq	8(%rdi), %rax
	cmpq	%rdx, %rax
	jnb	.L3
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	.LC0(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L3:
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm@PLT
	.cfi_endproc
.LFE4505:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
	.align 2
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0:
.LFB4507:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	pushq	%rax
	.cfi_def_cfa_offset 32
	call	strlen@PLT
	movq	8(%rbx), %rdx
	movq	%rbp, %rcx
	popq	%r9
	.cfi_def_cfa_offset 24
	movq	%rbx, %rdi
	movq	%rax, %r8
	popq	%rbx
	.cfi_def_cfa_offset 16
	xorl	%esi, %esi
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm@PLT
	.cfi_endproc
.LFE4507:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	.align 2
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0:
.LFB4509:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	movq	%rsi, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rsi, %rbx
	call	_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv@PLT
	testb	%al, %al
	je	.L11
	cmpq	%rbp, %rbx
	je	.L12
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	.L13
	movq	(%rbx), %rsi
	movq	0(%rbp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_S_copyEPcPKcm@PLT
.L13:
	movq	8(%rbx), %rax
	movq	0(%rbp), %rdx
	movq	%rax, 8(%rbp)
	movb	$0, (%rdx,%rax)
	jmp	.L12
.L11:
	movq	%rbp, %rdi
	call	_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv@PLT
	movl	%eax, %edx
	xorl	%eax, %eax
	testb	%dl, %dl
	jne	.L14
	movq	0(%rbp), %rax
	movq	16(%rbp), %r12
.L14:
	movq	(%rbx), %rdx
	movq	%rdx, 0(%rbp)
	movq	8(%rbx), %rdx
	movq	%rdx, 8(%rbp)
	movq	16(%rbx), %rdx
	movq	%rdx, 16(%rbp)
	testq	%rax, %rax
	je	.L15
	movq	%rax, (%rbx)
	movq	%r12, 16(%rbx)
	jmp	.L12
.L15:
	leaq	16(%rbx), %rax
	movq	%rax, (%rbx)
.L12:
	xorl	%eax, %eax
	movq	%rax, 8(%rbx)
	movq	(%rbx), %rax
	movb	$0, (%rax)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4509:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	.section	.rodata.str1.1
.LC1:
	.string	"%c\t"
.LC2:
	.string	"\t\t"
.LC3:
	.string	"\n"
.LC4:
	.string	"\t"
.LC5:
	.string	" %d\t"
.LC6:
	.string	"%d\t"
	.text
	.globl	_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, @function
_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_:
.LFB3747:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	HEIGHT(%rip), %eax
	movl	WIDTH(%rip), %r14d
	movl	%eax, 12(%rsp)
.L22:
	movl	%ebx, %r15d
	cmpl	%ebx, 12(%rsp)
	jle	.L34
	testq	%rbx, %rbx
	je	.L23
	movq	(%r12), %rax
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	movsbl	-1(%rax,%rbx), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L24
.L23:
	leaq	.LC2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	call	__printf_chk@PLT
.L25:
	cmpl	%ebp, %r14d
	jle	.L35
	movq	0(%r13), %rax
	leaq	.LC1(%rip), %rsi
	movl	$2, %edi
	movsbl	(%rax,%rbp), %edx
	xorl	%eax, %eax
	incq	%rbp
	call	__printf_chk@PLT
	jmp	.L25
.L35:
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC4(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L24:
	xorl	%ebp, %ebp
.L27:
	cmpl	%r14d, %ebp
	jge	.L36
	movl	WIDTH(%rip), %eax
	movq	M(%rip), %rdx
	leaq	.LC5(%rip), %rsi
	imull	%r15d, %eax
	addl	%ebp, %eax
	cltq
	movl	(%rdx,%rax,4), %edx
	testl	%edx, %edx
	jns	.L33
	leaq	.LC6(%rip), %rsi
.L33:
	movl	$2, %edi
	xorl	%eax, %eax
	incl	%ebp
	call	__printf_chk@PLT
	jmp	.L27
.L36:
	leaq	.LC3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	incq	%rbx
	call	__printf_chk@PLT
	jmp	.L22
.L34:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3747:
	.size	_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .-_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.globl	_Z16initializeMatrixv
	.type	_Z16initializeMatrixv, @function
_Z16initializeMatrixv:
.LFB3748:
	.cfi_startproc
	endbr64
	movl	HEIGHT(%rip), %r8d
	movl	WIDTH(%rip), %edi
	xorl	%eax, %eax
	movq	M(%rip), %rcx
.L38:
	cmpl	%r8d, %eax
	jge	.L46
	xorl	%esi, %esi
	testl	%eax, %eax
	je	.L39
	movl	GAP(%rip), %esi
	imull	%eax, %esi
.L39:
	movl	WIDTH(%rip), %edx
	imull	%eax, %edx
	incl	%eax
	movslq	%edx, %rdx
	movl	%esi, (%rcx,%rdx,4)
	jmp	.L38
.L46:
	xorl	%eax, %eax
.L41:
	cmpl	%eax, %edi
	jle	.L47
	xorl	%edx, %edx
	testq	%rax, %rax
	je	.L42
	movl	GAP(%rip), %edx
	imull	%eax, %edx
.L42:
	movl	%edx, (%rcx,%rax,4)
	incq	%rax
	jmp	.L41
.L47:
	ret
	.cfi_endproc
.LFE3748:
	.size	_Z16initializeMatrixv, .-_Z16initializeMatrixv
	.globl	_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii
	.type	_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii, @function
_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii:
.LFB3781:
	.cfi_startproc
	endbr64
	subq	$200, %rsp
	.cfi_def_cfa_offset 208
	movq	%rdi, 40(%rsp)
	leaq	64(%rsp), %rdi
	movq	%rsi, 32(%rsp)
	leaq	76(%rsp), %rsi
	movq	%rdx, 24(%rsp)
	leaq	48(%rsp), %rdx
	movl	%ecx, 20(%rsp)
	leaq	56(%rsp), %rcx
	movl	%r8d, 16(%rsp)
	movl	%r9d, 12(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movl	$1, 72(%rsp)
	movq	%rax, 112(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 120(%rsp)
	leaq	24(%rsp), %rax
	movq	%rax, 128(%rsp)
	leaq	20(%rsp), %rax
	movq	%rax, 136(%rsp)
	leaq	16(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	12(%rsp), %rax
	movq	%rax, 152(%rsp)
	leaq	208(%rsp), %rax
	movq	%rax, 160(%rsp)
	leaq	216(%rsp), %rax
	movq	%rax, 168(%rsp)
	leaq	224(%rsp), %rax
	movq	%rax, 176(%rsp)
	movabsq	$4294967297, %rax
	movq	%rax, 64(%rsp)
	movq	%rax, 76(%rsp)
	movl	$1, 84(%rsp)
	call	__cudaPopCallConfiguration@PLT
	testl	%eax, %eax
	jne	.L48
	pushq	56(%rsp)
	.cfi_def_cfa_offset 216
	leaq	_Z15needlemanKernelPiPcS0_iiiiii(%rip), %rdi
	pushq	56(%rsp)
	.cfi_def_cfa_offset 224
	movq	92(%rsp), %rcx
	movl	100(%rsp), %r8d
	movq	80(%rsp), %rsi
	movl	88(%rsp), %edx
	leaq	128(%rsp), %r9
	call	cudaLaunchKernel@PLT
	popq	%rax
	.cfi_def_cfa_offset 216
	popq	%rdx
	.cfi_def_cfa_offset 208
.L48:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	je	.L50
	call	__stack_chk_fail@PLT
.L50:
	addq	$200, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3781:
	.size	_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii, .-_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii
	.globl	_Z15needlemanKernelPiPcS0_iiiiii
	.type	_Z15needlemanKernelPiPcS0_iiiiii, @function
_Z15needlemanKernelPiPcS0_iiiiii:
.LFB3782:
	.cfi_startproc
	endbr64
	jmp	_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii
	.cfi_endproc
.LFE3782:
	.size	_Z15needlemanKernelPiPcS0_iiiiii, .-_Z15needlemanKernelPiPcS0_iiiiii
	.section	.rodata.str1.1
.LC7:
	.string	"GAATTCAGTTA"
.LC8:
	.string	"GGATCGA"
.LC9:
	.string	"%c\n"
.LC10:
	.string	":r:"
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3754:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3754
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	movq	%rsi, %r13
	pushq	%r12
	.cfi_offset 12, -48
	leaq	-120(%rbp), %r12
	pushq	%rbx
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-104(%rbp), %rax
	movq	%rdx, -112(%rbp)
	movq	%rax, -120(%rbp)
	leaq	-72(%rbp), %rax
	movb	$0, -104(%rbp)
	movq	%rax, -88(%rbp)
	movq	%rcx, -80(%rbp)
	movb	$0, -72(%rbp)
	testl	%edi, %edi
	jle	.L54
.L56:
	leaq	.LC10(%rip), %r14
	jmp	.L58
.L54:
	leaq	.LC7(%rip), %rsi
	movq	%r12, %rdi
.LEHB0:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	leaq	-88(%rbp), %rdi
	leaq	.LC8(%rip), %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	jmp	.L56
.L60:
	cmpl	$63, %eax
	je	.L57
	cmpl	$114, %eax
	je	.L87
.L58:
	movq	%r14, %rdx
	movq	%r13, %rsi
	movl	%ebx, %edi
	call	getopt@PLT
	cmpl	$-1, %eax
	jne	.L60
	jmp	.L88
.L87:
	movq	optarg(%rip), %rsi
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
	jmp	.L58
.L57:
	movl	optopt(%rip), %edx
	leaq	.LC9(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L58
.L88:
	movslq	optind(%rip), %r14
	leaq	-88(%rbp), %r15
.L61:
	cmpl	%r14d, %ebx
	jle	.L89
	movq	0(%r13,%r14,8), %rsi
	movq	%r15, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.isra.0
.LEHE0:
	incq	%r14
	jmp	.L61
.L89:
	movq	-112(%rbp), %r13
	movq	-80(%rbp), %rbx
	movq	%rsp, %r15
	leal	1(%r13), %eax
	leal	1(%rbx), %edi
	movl	%eax, HEIGHT(%rip)
	cltq
	movl	%edi, WIDTH(%rip)
	movslq	%edi, %rdi
	imulq	%rax, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, M(%rip)
	call	_Z16initializeMatrixv
	leaq	15(%r13), %rdx
	movq	%rsp, %rcx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L63:
	cmpq	%rcx, %rsp
	je	.L64
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L63
.L64:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L65
	orq	$0, -8(%rsp,%rax)
.L65:
	leaq	15(%rbx), %rdx
	movq	%rsp, %rcx
	movq	%rsp, %r14
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L66:
	cmpq	%rcx, %rsp
	je	.L67
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L66
.L67:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L68
	orq	$0, -8(%rsp,%rax)
.L68:
	movq	-120(%rbp), %rsi
	movq	%r13, %rdx
	movq	%r14, %rdi
	movq	%rsp, -184(%rbp)
	call	__strcpy_chk@PLT
	movq	-88(%rbp), %rsi
	movq	%rsp, %rdi
	movq	%rbx, %rdx
	call	__strcpy_chk@PLT
	movl	WIDTH(%rip), %esi
	imull	HEIGHT(%rip), %esi
	leaq	-168(%rbp), %rdi
	movslq	%esi, %rsi
	salq	$2, %rsi
.LEHB1:
	call	cudaMalloc@PLT
	movq	-112(%rbp), %rsi
	leaq	-160(%rbp), %rdi
	call	cudaMalloc@PLT
	movq	-80(%rbp), %rsi
	leaq	-152(%rbp), %rdi
	call	cudaMalloc@PLT
	movl	WIDTH(%rip), %edx
	imull	HEIGHT(%rip), %edx
	movl	$1, %ecx
	movq	M(%rip), %rsi
	movq	-168(%rbp), %rdi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	-112(%rbp), %rdx
	movq	-160(%rbp), %rdi
	movl	$1, %ecx
	movq	%r14, %rsi
	call	cudaMemcpy@PLT
	movq	-80(%rbp), %rdx
	movq	-184(%rbp), %rsi
	movl	$1, %ecx
	movq	-152(%rbp), %rdi
	call	cudaMemcpy@PLT
	movl	HEIGHT(%rip), %ecx
	movl	$1024, %esi
	xorl	%r13d, %r13d
	movl	$1, -144(%rbp)
	movl	$1, -136(%rbp)
	leal	-1(%rcx), %eax
	movl	%ecx, -132(%rbp)
	cltd
	idivl	%esi
	incl	%eax
	movl	%eax, -140(%rbp)
	movabsq	$4294967297, %rax
	movq	%rax, -128(%rbp)
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	%rax, %rbx
.L69:
	movl	HEIGHT(%rip), %eax
	addl	WIDTH(%rip), %eax
	decl	%eax
	cmpl	%r13d, %eax
	jle	.L90
	movl	-124(%rbp), %ecx
	movq	-132(%rbp), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	-144(%rbp), %rdi
	movl	-136(%rbp), %esi
	call	__cudaPushCallConfiguration@PLT
	movl	HEIGHT(%rip), %r8d
	movl	WIDTH(%rip), %ecx
	testl	%eax, %eax
	jne	.L70
	movl	MATCH(%rip), %r9d
	movq	-152(%rbp), %rdx
	movq	-160(%rbp), %rsi
	movq	-168(%rbp), %rdi
	pushq	%rax
	pushq	%r13
	movl	GAP(%rip), %eax
	pushq	%rax
	movl	MISMATCH(%rip), %eax
	pushq	%rax
	.cfi_escape 0x2e,0x20
	call	_Z46__device_stub__Z15needlemanKernelPiPcS0_iiiiiiPiPcS0_iiiiii
	addq	$32, %rsp
.L70:
	incl	%r13d
	jmp	.L69
.L90:
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$1000, %ecx
	leaq	_ZSt4cout(%rip), %rdi
	subq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	.cfi_escape 0x2e,0
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movl	WIDTH(%rip), %edx
	imull	HEIGHT(%rip), %edx
	movl	$2, %ecx
	movq	-168(%rbp), %rsi
	movq	M(%rip), %rdi
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	cudaMemcpy@PLT
	movq	-168(%rbp), %rdi
	call	cudaFree@PLT
	movq	-160(%rbp), %rdi
	call	cudaFree@PLT
	movq	-152(%rbp), %rdi
	call	cudaFree@PLT
.LEHE1:
	movq	M(%rip), %rdi
	call	free@PLT
	leaq	-88(%rbp), %rdi
	movq	%r15, %rsp
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	je	.L75
	jmp	.L85
.L77:
	endbr64
	movq	%rax, %rbx
.L72:
	movq	%r15, %rsp
	jmp	.L73
.L76:
	endbr64
	movq	%rax, %rbx
.L73:
	leaq	-88(%rbp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L85
	movq	%rbx, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L85:
	call	__stack_chk_fail@PLT
.L75:
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3754:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA3754:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3754-.LLSDACSB3754
.LLSDACSB3754:
	.uleb128 .LEHB0-.LFB3754
	.uleb128 .LEHE0-.LEHB0
	.uleb128 .L76-.LFB3754
	.uleb128 0
	.uleb128 .LEHB1-.LFB3754
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L77-.LFB3754
	.uleb128 0
	.uleb128 .LEHB2-.LFB3754
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE3754:
	.section	.text.startup
	.size	main, .-main
	.section	.rodata.str1.1
.LC11:
	.string	"_Z15needlemanKernelPiPcS0_iiiiii"
	.section	.text.startup
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3784:
	.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	.LC11(%rip), %rdx
	movq	%rax, %rdi
	leaq	_Z15needlemanKernelPiPcS0_iiiiii(%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
.LFE3784:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.str1.1,"aMS",@progbits,1
.LC12:
	.string	"basic_string: construction from null is not valid"
	.section	.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_,"axG",@progbits,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_,comdat
	.align 2
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.type	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, @function
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_:
.LFB4113:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	16(%rdi), %rax
	movq	%rax, (%rdi)
	testq	%rsi, %rsi
	jne	.L94
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L99
	leaq	.LC12(%rip), %rdi
	call	_ZSt19__throw_logic_errorPKc@PLT
.L94:
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rsi, %rbp
	call	strlen@PLT
	movq	%rax, (%rsp)
	leaq	0(%rbp,%rax), %r12
	cmpq	$15, %rax
	jbe	.L96
	movq	%rsp, %rsi
	xorl	%edx, %edx
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@PLT
	movq	%rax, (%rbx)
	movq	(%rsp), %rax
	movq	%rax, 16(%rbx)
.L96:
	movq	(%rbx), %rdi
	movq	%r12, %rdx
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_@PLT
	movq	(%rsp), %rax
	movq	(%rbx), %rdx
	movq	%rax, 8(%rbx)
	movb	$0, (%rdx,%rax)
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L97
.L99:
	call	__stack_chk_fail@PLT
.L97:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4113:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_, .-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.weak	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
	.set	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_,_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_,comdat
	.weak	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_
	.type	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_, @function
_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_:
.LFB4119:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4119
	endbr64
	leaq	16(%rdi), %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	8(%rdx), %rbp
	movq	%rdi, %rbx
	movq	8(%rsi), %r12
	movq	(%rsi), %r14
	movq	(%rdx), %r13
	movq	%rax, (%rdi)
	xorl	%eax, %eax
	movq	%rax, 8(%rdi)
	leaq	0(%rbp,%r12), %rsi
	movb	$0, 16(%rdi)
.LEHB3:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm@PLT
	movq	%r12, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
	movq	%rbp, %rdx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
.LEHE3:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L103:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbp
.L102:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
.LEHB4:
	call	_Unwind_Resume@PLT
.LEHE4:
	.cfi_endproc
.LFE4119:
	.section	.gcc_except_table
.LLSDA4119:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4119-.LLSDACSB4119
.LLSDACSB4119:
	.uleb128 .LEHB3-.LFB4119
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L103-.LFB4119
	.uleb128 0
	.uleb128 .LEHB4-.LFB4119
	.uleb128 .LEHE4-.LEHB4
	.uleb128 0
	.uleb128 0
.LLSDACSE4119:
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_,comdat
	.size	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_, .-_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,comdat
	.weak	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
	.type	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_, @function
_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_:
.LFB4121:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4121
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	8(%rdx), %r13
	movq	(%rdx), %r14
	call	strlen@PLT
	movb	$0, 16(%rbx)
	movq	%rbx, %rdi
	movq	%rax, %r12
	leaq	16(%rbx), %rax
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	leaq	0(%r13,%r12), %rsi
	movq	%rax, 8(%rbx)
.LEHB5:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm@PLT
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
	movq	%r13, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.isra.0
.LEHE5:
	movq	%rbx, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L109:
	.cfi_restore_state
	endbr64
	movq	%rax, %rbp
.L108:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbp, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
	.cfi_endproc
.LFE4121:
	.section	.gcc_except_table
.LLSDA4121:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4121-.LLSDACSB4121
.LLSDACSB4121:
	.uleb128 .LEHB5-.LFB4121
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L109-.LFB4121
	.uleb128 0
	.uleb128 .LEHB6-.LFB4121
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE4121:
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_,comdat
	.size	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_, .-_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
	.section	.rodata.str1.1
.LC13:
	.string	""
.LC14:
	.string	"-"
	.text
	.globl	_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, @function
_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_:
.LFB3749:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3749
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC13(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rsi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$232, %rsp
	.cfi_def_cfa_offset 288
	movl	8(%rdi), %ebp
	movl	8(%rsi), %ebx
	movq	%r14, %rsi
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	leaq	55(%rsp), %r15
	leaq	56(%rsp), %rax
	movq	%rax, %rdi
	movq	%r15, %rdx
	movq	%rax, 8(%rsp)
.LEHB7:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE7:
	leaq	88(%rsp), %rax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
.LEHB8:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1IS3_EEPKcRKS3_
.LEHE8:
	leaq	136(%rsp), %rax
	xorl	%edx, %edx
	movb	$0, 136(%rsp)
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movq	%rax, 128(%rsp)
	leaq	168(%rsp), %rax
	movq	%rax, 152(%rsp)
	movq	%rdx, 160(%rsp)
	movb	$0, 168(%rsp)
.L113:
	leaq	152(%rsp), %rax
	testl	%ebp, %ebp
	leaq	120(%rsp), %r14
	movq	%rax, 40(%rsp)
	jle	.L127
	testl	%ebx, %ebx
	jle	.L127
	leal	-1(%rbp), %eax
	movq	128(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	movl	%eax, 28(%rsp)
	cltq
	movq	%rax, 32(%rsp)
	movq	(%r12), %rax
	movq	32(%rsp), %rcx
	movsbl	(%rax,%rcx), %r8d
	movl	$1, %ecx
.LEHB9:
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE14_M_replace_auxEmmmc@PLT
	movq	0(%r13), %rax
	leal	-1(%rbx), %r15d
	movl	$1, %ecx
	xorl	%esi, %esi
	movslq	%r15d, %r14
	movq	160(%rsp), %rdx
	leaq	152(%rsp), %rdi
	movsbl	(%rax,%r14), %r8d
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE14_M_replace_auxEmmmc@PLT
	movq	0(%r13), %rax
	movq	(%r12), %rdx
	movq	32(%rsp), %rsi
	movl	MISMATCH(%rip), %ecx
	movb	(%rax,%r14), %al
	cmpb	%al, (%rdx,%rsi)
	jne	.L115
	movl	MATCH(%rip), %ecx
.L115:
	movl	WIDTH(%rip), %r8d
	movq	M(%rip), %rdi
	leaq	120(%rsp), %rsi
	leaq	152(%rsp), %r14
	movl	%r8d, %eax
	imull	%ebp, %eax
	leal	(%rax,%rbx), %edx
	movslq	%edx, %rdx
	movl	(%rdi,%rdx,4), %r9d
	movl	%eax, %edx
	subl	%r8d, %edx
	leal	(%r15,%rdx), %r8d
	movslq	%r8d, %r8
	addl	(%rdi,%r8,4), %ecx
	cmpl	%ecx, %r9d
	jne	.L116
	leaq	184(%rsp), %rbx
	movq	8(%rsp), %rdx
	movq	%rbx, %rdi
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_
	movq	8(%rsp), %rdi
	movq	%rbx, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	movq	%rbx, %rdi
	movl	%r15d, %ebx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L133
.L116:
	addl	%ebx, %edx
	movl	GAP(%rip), %ecx
	movslq	%edx, %rdx
	movl	(%rdi,%rdx,4), %r10d
	addl	%ecx, %r10d
	cmpl	%r10d, %r9d
	jne	.L118
	leaq	184(%rsp), %rbp
	movq	8(%rsp), %rdx
	movq	%rbp, %rdi
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_
	movq	8(%rsp), %rdi
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdx
	leaq	.LC14(%rip), %rsi
	movq	%rbp, %rdi
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
	movq	16(%rsp), %rdi
	movq	%rbp, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	movq	%rbp, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
.L133:
	movl	28(%rsp), %ebp
	jmp	.L113
.L118:
	addl	%r15d, %eax
	cltq
	addl	(%rdi,%rax,4), %ecx
	cmpl	%ecx, %r9d
	jne	.L113
	leaq	184(%rsp), %rbx
	movq	8(%rsp), %rdx
	leaq	.LC14(%rip), %rsi
	movq	%rbx, %rdi
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_
	movq	8(%rsp), %rdi
	movq	%rbx, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_
	movq	16(%rsp), %rdi
	movq	%rbx, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_.isra.0
	movq	%rbx, %rdi
	movl	%r15d, %ebx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L113
.L127:
	leaq	_ZSt4cout(%rip), %rbx
	movq	8(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	movq	16(%rsp), %rsi
	movq	%rbx, %rdi
	call	_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE9:
	movq	40(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%r14, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	je	.L124
	jmp	.L131
.L126:
	endbr64
	movq	%rax, %rbx
.L121:
	movq	40(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	120(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	16(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L122
.L125:
	endbr64
	movq	%rax, %rbx
.L122:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L131
	movq	%rbx, %rdi
.LEHB10:
	call	_Unwind_Resume@PLT
.LEHE10:
.L131:
	call	__stack_chk_fail@PLT
.L124:
	addq	$232, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3749:
	.section	.gcc_except_table
.LLSDA3749:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3749-.LLSDACSB3749
.LLSDACSB3749:
	.uleb128 .LEHB7-.LFB3749
	.uleb128 .LEHE7-.LEHB7
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB8-.LFB3749
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L125-.LFB3749
	.uleb128 0
	.uleb128 .LEHB9-.LFB3749
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L126-.LFB3749
	.uleb128 0
	.uleb128 .LEHB10-.LFB3749
	.uleb128 .LEHE10-.LEHB10
	.uleb128 0
	.uleb128 0
.LLSDACSE3749:
	.text
	.size	_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .-_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.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	M
	.bss
	.align 8
	.type	M, @object
	.size	M, 8
M:
	.zero	8
	.globl	HEIGHT
	.align 4
	.type	HEIGHT, @object
	.size	HEIGHT, 4
HEIGHT:
	.zero	4
	.globl	WIDTH
	.align 4
	.type	WIDTH, @object
	.size	WIDTH, 4
WIDTH:
	.zero	4
	.globl	MISMATCH
	.data
	.align 4
	.type	MISMATCH, @object
	.size	MISMATCH, 4
MISMATCH:
	.long	-1
	.globl	MATCH
	.align 4
	.type	MATCH, @object
	.size	MATCH, 4
MATCH:
	.long	1
	.globl	GAP
	.align 4
	.type	GAP, @object
	.size	GAP, 4
GAP:
	.long	-1
	.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 <unistd.h>
#include <string>
#include <chrono>

using namespace std;

int GAP = -1, MATCH = 1, MISMATCH=-1;
int WIDTH, HEIGHT;

int *M;
#define M(i, j) (M[(i) * WIDTH + (j)])


void printMatrix(string seq1, string seq2)
{
    int seq1len = HEIGHT;
    int seq2len = WIDTH;

    for(int i = 0; i < seq1len; ++i)
    {
        if ( i == 0 )
        {
            printf("\t\t");
            for (int j = 0; j < seq2len; ++j)
            {
                printf("%c\t", seq2[j]);
            }
            printf("\n");
        }

        if (i == 0)
            printf("\t");

        if ( i >= 1 )
            printf("%c\t", seq1[i-1]);
        
        for(int j = 0; j < seq2len; ++j)
        {

            if ((M(i, j) >= 0) || (M(i, j) >= 10))
            {
                printf(" %d\t", M(i, j));
                continue;
            }

            printf("%d\t", M(i, j));

        }
        printf("\n");
    }
}


void initializeMatrix()
{
    int seq1len = HEIGHT;
    int seq2len = WIDTH;

    for(int i = 0; i < seq1len; ++i)
    {
        M(i, 0) = i == 0 ? 0 : i * (GAP);
    }

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

        M(0, j) = j == 0 ? 0 : j * (GAP);
    }

}

void traceback(string seq1, string seq2)
{
    int i = seq1.length();
    int j = seq2.length();

    string align = "";
    string ref = "";
    string v, w;

    int scoreDiag;

    while(i > 0 && j > 0)
    {
        v = seq1[i-1];
        w = seq2[j-1];

        if (seq1[i-1] == seq2[j-1])
            scoreDiag = MATCH;
        else
            scoreDiag = MISMATCH;

        if (i > 0 && j > 0 && M(i, j) == M(i-1, j-1) + scoreDiag)
        {
            align = v + align;
            ref = w + ref;

            i--;
            j--;
        }
        else if (i > 0 && M(i, j) == M(i-1, j) + GAP)
        {
            align = v + align;
            ref = "-" + ref;

            i--;
        }
        else if (j > 0 && M(i, j) == M(i, j-1) + GAP)
        {
            align = "-" + align;
            ref = w + ref;

            j--;
        }

    }


    cout << align << endl;
    cout << ref << endl;

}

__global__ void needlemanKernel(int *devM, char *seq1, char *seq2, int width, 
                                int height, int MATCH, int MISMATCH, int GAP, int k) 
{

    int by = blockIdx.y;
    int tx = threadIdx.x;
    int bdx = blockDim.x;

    int i = by * bdx + tx;
    int j = -i + width - (width - 2) + k;


    if (i >= height || i <= 0 || j >= width || j <= 0)
        return;


    int scoreDiag = 0;

    if (seq1[i - 1] == seq2[j - 1])
        scoreDiag = devM[(i - 1) * width + (j - 1)] + MATCH;
    else
    {
        // printf("%d, %d\n", i, j);
        //
        // printf("%c %c", seq1[i-1], seq2[j-1]);
        // printf("\n");
        scoreDiag = devM[(i - 1) * width + (j - 1)] + MISMATCH;

    }

    int scoreLeft = devM[i * width + (j - 1)] + GAP;
    int scoreUp = devM[(i - 1) * width + j] + GAP;

    devM[i * width + j] = max(max(scoreDiag, scoreLeft), scoreUp);

    __syncthreads();
}


int main(int argc, char *argv[])
{
    int c;
    string seq1;    
    string seq2;

    if(argc < 1)
    {
        seq1 = "GAATTCAGTTA"; //First Sequence
        seq2 = "GGATCGA"; //Second Sequence
    }

    while((c = getopt(argc, argv, ":r:")) != -1 ) 
    {
        switch(c)
        {
            case 'r':
                seq1 = optarg;
                break;
            case '?':
                printf("%c\n", optopt);
                break;
            default:
                break;
        }
    }

    for (int index = optind; index < argc; ++index)
        seq2 = argv[index];
         

    HEIGHT = seq1.length() + 1;
    WIDTH = seq2.length() + 1;
    M = (int*) malloc(sizeof(int) * (WIDTH) * (HEIGHT));

    initializeMatrix();

    char hostSeq1[seq1.length()];
    char hostSeq2[seq2.length()];

    strcpy(hostSeq1, seq1.c_str());
    strcpy(hostSeq2, seq2.c_str());

    int *deviceM;
    char *deviceSeq1;
    char *deviceSeq2;
    
    hipMalloc(&deviceM, WIDTH * HEIGHT * sizeof(int));
    hipMalloc(&deviceSeq1, seq1.length());
    hipMalloc(&deviceSeq2, seq2.length());

    hipMemcpy(deviceM, M, WIDTH * HEIGHT * sizeof(int), hipMemcpyHostToDevice);
    hipMemcpy(deviceSeq1, hostSeq1, seq1.length(), hipMemcpyHostToDevice);
    hipMemcpy(deviceSeq2, hostSeq2, seq2.length(), hipMemcpyHostToDevice);

    int nThreads = 1024;
    
    dim3 dimGrid(1, (HEIGHT-1)/nThreads+1, 1);   
    dim3 dimBlock(HEIGHT, 1, 1);                                       
                                                                                
    auto t1 = chrono::high_resolution_clock::now();

    for(int k = 0; k < (WIDTH + HEIGHT) - 1; ++k)
    {
        needlemanKernel<<<dimGrid,dimBlock>>>(deviceM, deviceSeq1, deviceSeq2,
                                              WIDTH, HEIGHT, MATCH, MISMATCH, GAP,
                                              k);
    }

    auto t2 = chrono::high_resolution_clock::now();
    auto duration = chrono::duration_cast<std::chrono::microseconds>( t2 - t1 ).count();

    cout << duration << endl;  

    hipMemcpy(M, deviceM, WIDTH * HEIGHT * sizeof(int), hipMemcpyDeviceToHost);
    
    hipFree(deviceM);
    hipFree(deviceSeq1);
    hipFree(deviceSeq2);

    
    // printMatrix(seq1, seq2);
    // traceback(seq1, seq2);

    free(M);

    return 0;
}

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

                                        # End of file scope inline assembly
	.globl	_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_ # -- Begin function _Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_,@function
_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_: # @_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.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	%rdi, 8(%rsp)                   # 8-byte Spill
	movl	HEIGHT(%rip), %eax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	testl	%eax, %eax
	jle	.LBB0_12
# %bb.1:                                # %.lr.ph32
	movq	%rsi, %rbx
	movl	WIDTH(%rip), %r12d
	movl	$.L.str.4, %r13d
	xorl	%ebp, %ebp
.LBB0_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_5 Depth 2
                                        #     Child Loop BB0_10 Depth 2
	testq	%rbp, %rbp
	je	.LBB0_3
# %bb.7:                                # %.critedge.thread
                                        #   in Loop: Header=BB0_2 Depth=1
	movq	8(%rsp), %rax                   # 8-byte Reload
	movq	(%rax), %rax
	movsbl	-1(%rax,%rbp), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	jmp	.LBB0_8
.LBB0_3:                                #   in Loop: Header=BB0_2 Depth=1
	movl	$.L.str, %edi
	xorl	%eax, %eax
	callq	printf
	testl	%r12d, %r12d
	jle	.LBB0_6
# %bb.4:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
.LBB0_5:                                # %.lr.ph
                                        #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	(%rbx), %rax
	movsbl	(%rax,%r14), %esi
	movl	$.L.str.1, %edi
	xorl	%eax, %eax
	callq	printf
	incq	%r14
	cmpq	%r14, %r12
	jne	.LBB0_5
.LBB0_6:                                # %.critedge
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	movl	$9, %edi
	callq	putchar@PLT
.LBB0_8:                                #   in Loop: Header=BB0_2 Depth=1
	testl	%r12d, %r12d
	jle	.LBB0_11
# %bb.9:                                # %.lr.ph29.preheader
                                        #   in Loop: Header=BB0_2 Depth=1
	movslq	%ebp, %r14
	xorl	%r15d, %r15d
.LBB0_10:                               # %.lr.ph29
                                        #   Parent Loop BB0_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movq	M(%rip), %rax
	movslq	WIDTH(%rip), %rcx
	imulq	%r14, %rcx
	addq	%r15, %rcx
	movl	(%rax,%rcx,4), %esi
	testl	%esi, %esi
	movl	$.L.str.5, %edi
	cmovnsq	%r13, %rdi
	xorl	%eax, %eax
	callq	printf
	incq	%r15
	cmpl	%r15d, %r12d
	jne	.LBB0_10
.LBB0_11:                               # %._crit_edge
                                        #   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	putchar@PLT
	incq	%rbp
	cmpq	16(%rsp), %rbp                  # 8-byte Folded Reload
	jne	.LBB0_2
.LBB0_12:                               # %._crit_edge33
	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_end0:
	.size	_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .Lfunc_end0-_Z11printMatrixNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.cfi_endproc
                                        # -- End function
	.globl	_Z16initializeMatrixv           # -- Begin function _Z16initializeMatrixv
	.type	_Z16initializeMatrixv,@function
_Z16initializeMatrixv:                  # @_Z16initializeMatrixv
	.cfi_startproc
# %bb.0:
	movl	HEIGHT(%rip), %ecx
	movl	WIDTH(%rip), %eax
	testl	%ecx, %ecx
	jle	.LBB1_3
# %bb.1:                                # %.lr.ph
	xorl	%esi, %esi
	movq	M(%rip), %rdx
.LBB1_2:                                # =>This Inner Loop Header: Depth=1
	movslq	%esi, %rdi
	imull	GAP(%rip), %esi
	movslq	WIDTH(%rip), %r8
	imulq	%rdi, %r8
	movl	%esi, (%rdx,%r8,4)
	incl	%edi
	movl	%edi, %esi
	cmpl	%edi, %ecx
	jne	.LBB1_2
.LBB1_3:                                # %.preheader
	testl	%eax, %eax
	jle	.LBB1_6
# %bb.4:                                # %.lr.ph16
	movq	M(%rip), %rcx
	xorl	%edx, %edx
.LBB1_5:                                # =>This Inner Loop Header: Depth=1
	movl	GAP(%rip), %esi
	imull	%edx, %esi
	movl	%esi, (%rcx,%rdx,4)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	.LBB1_5
.LBB1_6:                                # %._crit_edge
	retq
.Lfunc_end1:
	.size	_Z16initializeMatrixv, .Lfunc_end1-_Z16initializeMatrixv
	.cfi_endproc
                                        # -- End function
	.globl	_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_ # -- Begin function _Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.type	_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_,@function
_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_: # @_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$184, %rsp
	.cfi_def_cfa_offset 240
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdi, 104(%rsp)                 # 8-byte Spill
	movq	8(%rdi), %r15
	movq	%rsi, 176(%rsp)                 # 8-byte Spill
	movq	8(%rsi), %r12
	leaq	80(%rsp), %rax
	movq	%rax, -16(%rax)
	leaq	64(%rsp), %rdi
	movl	$.L.str.6, %esi
	movl	$.L.str.6, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	leaq	48(%rsp), %rax
	movq	%rax, -16(%rax)
.Ltmp0:
	leaq	32(%rsp), %rdi
	movl	$.L.str.6, %esi
	movl	$.L.str.6, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
.Ltmp1:
# %bb.1:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit40
	leaq	160(%rsp), %rcx
	movq	%rcx, -16(%rcx)
	xorl	%eax, %eax
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
	leaq	128(%rsp), %rcx
	movq	%rcx, -16(%rcx)
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
	testl	%r15d, %r15d
	jle	.LBB2_52
# %bb.2:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_.exit40
	testl	%r12d, %r12d
	jle	.LBB2_52
.LBB2_3:                                # =>This Inner Loop Header: Depth=1
	leal	-1(%r15), %r14d
	movq	104(%rsp), %rax                 # 8-byte Reload
	movq	(%rax), %rax
	movsbl	(%rax,%r14), %r8d
	movq	152(%rsp), %rdx
.Ltmp3:
	movl	$1, %ecx
	leaq	144(%rsp), %rdi
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE14_M_replace_auxEmmmc
.Ltmp4:
	movq	176(%rsp), %rbx                 # 8-byte Reload
# %bb.4:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEc.exit
                                        #   in Loop: Header=BB2_3 Depth=1
	leal	-1(%r12), %r13d
	movq	(%rbx), %rax
	movsbl	(%rax,%r13), %r8d
	movq	120(%rsp), %rdx
.Ltmp5:
	movl	$1, %ecx
	leaq	112(%rsp), %rdi
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE14_M_replace_auxEmmmc
.Ltmp6:
# %bb.5:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEc.exit41
                                        #   in Loop: Header=BB2_3 Depth=1
	movq	104(%rsp), %rax                 # 8-byte Reload
	movq	(%rax), %rax
	movb	(%rax,%r14), %al
	movq	(%rbx), %rcx
	cmpb	(%rcx,%r13), %al
	movl	$MISMATCH, %edi
	movl	$MATCH, %eax
	cmoveq	%rax, %rdi
	movq	M(%rip), %rax
	movl	WIDTH(%rip), %esi
	movl	%esi, %ecx
	imull	%r15d, %ecx
	leal	(%rcx,%r12), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	imull	%r14d, %esi
	leal	(%rsi,%r13), %r8d
	movslq	%r8d, %r8
	movl	(%rax,%r8,4), %r8d
	addl	(%rdi), %r8d
	cmpl	%r8d, %edx
	jne	.LBB2_23
# %bb.6:                                #   in Loop: Header=BB2_3 Depth=1
	movq	%r14, 96(%rsp)                  # 8-byte Spill
	movq	144(%rsp), %r12
	movq	152(%rsp), %rbx
	movq	64(%rsp), %r15
	movq	72(%rsp), %rbp
	leaq	16(%rsp), %rax
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movb	$0, 16(%rsp)
	leaq	(%rbp,%rbx), %rsi
.Ltmp36:
	movq	%rsp, %r14
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp37:
# %bb.7:                                #   in Loop: Header=BB2_3 Depth=1
.Ltmp38:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp39:
# %bb.8:                                #   in Loop: Header=BB2_3 Depth=1
.Ltmp40:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp41:
# %bb.9:                                # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_.exit
                                        #   in Loop: Header=BB2_3 Depth=1
	leaq	64(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_11
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
                                        #   in Loop: Header=BB2_3 Depth=1
	callq	_ZdlPv
.LBB2_11:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
                                        #   in Loop: Header=BB2_3 Depth=1
	movq	112(%rsp), %rbx
	movq	120(%rsp), %r12
	movq	32(%rsp), %r15
	movq	40(%rsp), %rbp
	leaq	16(%rsp), %rax
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movb	$0, 16(%rsp)
	leaq	(%rbp,%r12), %rsi
.Ltmp43:
	movq	%rsp, %r14
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp44:
# %bb.12:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp45:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp46:
# %bb.13:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp47:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp48:
# %bb.14:                               # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_.exit47
                                        #   in Loop: Header=BB2_3 Depth=1
	leaq	32(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_16
# %bb.15:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i48
                                        #   in Loop: Header=BB2_3 Depth=1
	callq	_ZdlPv
.LBB2_16:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit50
                                        #   in Loop: Header=BB2_3 Depth=1
	movq	96(%rsp), %r14                  # 8-byte Reload
	jmp	.LBB2_50
.LBB2_23:                               #   in Loop: Header=BB2_3 Depth=1
	addl	%r12d, %esi
	movslq	%esi, %rdi
	movl	GAP(%rip), %esi
	movl	(%rax,%rdi,4), %edi
	addl	%esi, %edi
	cmpl	%edi, %edx
	jne	.LBB2_37
# %bb.24:                               #   in Loop: Header=BB2_3 Depth=1
	movq	%r12, 96(%rsp)                  # 8-byte Spill
	movq	144(%rsp), %rbx
	movq	152(%rsp), %r12
	movq	64(%rsp), %r15
	movq	72(%rsp), %rbp
	leaq	16(%rsp), %rax
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movb	$0, 16(%rsp)
	leaq	(%rbp,%r12), %rsi
.Ltmp22:
	movq	%rsp, %r13
	movq	%r13, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp23:
# %bb.25:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp24:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp25:
# %bb.26:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp26:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%rbp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp27:
# %bb.27:                               # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_.exit56
                                        #   in Loop: Header=BB2_3 Depth=1
	leaq	64(%rsp), %rdi
	movq	%r13, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_29
# %bb.28:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i57
                                        #   in Loop: Header=BB2_3 Depth=1
	callq	_ZdlPv
.LBB2_29:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit59
                                        #   in Loop: Header=BB2_3 Depth=1
	movq	32(%rsp), %rbp
	movq	40(%rsp), %r15
	leaq	16(%rsp), %rax
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movb	$0, 16(%rsp)
	leaq	1(%r15), %rsi
.Ltmp29:
	movq	%r13, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp30:
	movq	96(%rsp), %rbx                  # 8-byte Reload
# %bb.30:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp31:
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%r13, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp32:
# %bb.31:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp33:
	movq	%r13, %rdi
	movq	%rbp, %rsi
	movq	%r15, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp34:
# %bb.32:                               # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_.exit
                                        #   in Loop: Header=BB2_3 Depth=1
	leaq	32(%rsp), %rdi
	movq	%r13, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_34
# %bb.33:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i65
                                        #   in Loop: Header=BB2_3 Depth=1
	callq	_ZdlPv
.LBB2_34:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit67
                                        #   in Loop: Header=BB2_3 Depth=1
	movl	%ebx, %r13d
	jmp	.LBB2_50
.LBB2_37:                               #   in Loop: Header=BB2_3 Depth=1
	addl	%r13d, %ecx
	movslq	%ecx, %rcx
	addl	(%rax,%rcx,4), %esi
	cmpl	%esi, %edx
	jne	.LBB2_38
# %bb.39:                               #   in Loop: Header=BB2_3 Depth=1
	movq	64(%rsp), %rbx
	movq	72(%rsp), %rbp
	leaq	16(%rsp), %rax
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movb	$0, 16(%rsp)
	leaq	1(%rbp), %rsi
.Ltmp8:
	movq	%rsp, %r14
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp9:
# %bb.40:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp10:
	movl	$.L.str.7, %esi
	movl	$1, %edx
	movq	%r14, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp11:
# %bb.41:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp12:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rbp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp13:
# %bb.42:                               # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_.exit73
                                        #   in Loop: Header=BB2_3 Depth=1
	leaq	64(%rsp), %rdi
	movq	%r14, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_44
# %bb.43:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i74
                                        #   in Loop: Header=BB2_3 Depth=1
	callq	_ZdlPv
.LBB2_44:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit76
                                        #   in Loop: Header=BB2_3 Depth=1
	movq	112(%rsp), %rbx
	movq	120(%rsp), %r12
	movq	32(%rsp), %r14
	movq	40(%rsp), %rbp
	leaq	16(%rsp), %rax
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movb	$0, 16(%rsp)
	leaq	(%r12,%rbp), %rsi
.Ltmp15:
	movq	%rsp, %rdi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm
.Ltmp16:
# %bb.45:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp17:
	movq	%rsp, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp18:
# %bb.46:                               #   in Loop: Header=BB2_3 Depth=1
.Ltmp19:
	movq	%rsp, %rdi
	movq	%r14, %rsi
	movq	%rbp, %rdx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm
.Ltmp20:
# %bb.47:                               # %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_SA_.exit82
                                        #   in Loop: Header=BB2_3 Depth=1
	leaq	32(%rsp), %rdi
	movq	%rsp, %rsi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_49
# %bb.48:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i83
                                        #   in Loop: Header=BB2_3 Depth=1
	callq	_ZdlPv
.LBB2_49:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit85
                                        #   in Loop: Header=BB2_3 Depth=1
	movl	%r15d, %r14d
	jmp	.LBB2_50
.LBB2_38:                               #   in Loop: Header=BB2_3 Depth=1
	movl	%r15d, %r14d
	movl	%r12d, %r13d
.LBB2_50:                               #   in Loop: Header=BB2_3 Depth=1
	testl	%r14d, %r14d
	jle	.LBB2_52
# %bb.51:                               #   in Loop: Header=BB2_3 Depth=1
	movl	%r13d, %r12d
	movl	%r14d, %r15d
	testl	%r13d, %r13d
	jg	.LBB2_3
.LBB2_52:                               # %._crit_edge
	movq	64(%rsp), %rsi
	movq	72(%rsp), %rdx
.Ltmp50:
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp51:
# %bb.53:                               # %_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp52:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp53:
# %bb.54:                               # %.noexc
.Ltmp54:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp55:
# %bb.55:                               # %.noexc112
.Ltmp56:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp57:
# %bb.56:                               # %_ZNSolsEPFRSoS_E.exit
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdx
.Ltmp58:
	movl	$_ZSt4cout, %edi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp59:
# %bb.57:                               # %_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE.exit86
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp60:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp61:
# %bb.58:                               # %.noexc114
.Ltmp62:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp63:
# %bb.59:                               # %.noexc115
.Ltmp64:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp65:
# %bb.60:                               # %_ZNSolsEPFRSoS_E.exit87
	movq	112(%rsp), %rdi
	leaq	128(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_62
# %bb.61:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i88
	callq	_ZdlPv
.LBB2_62:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit90
	movq	144(%rsp), %rdi
	leaq	160(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_64
# %bb.63:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i91
	callq	_ZdlPv
.LBB2_64:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit93
	movq	32(%rsp), %rdi
	leaq	48(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_66
# %bb.65:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i94
	callq	_ZdlPv
.LBB2_66:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit96
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_68
# %bb.67:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i97
	callq	_ZdlPv
.LBB2_68:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit99
	addq	$184, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB2_17:
	.cfi_def_cfa_offset 240
.Ltmp2:
	movq	%rax, %rbx
	jmp	.LBB2_79
.LBB2_69:
.Ltmp14:
	jmp	.LBB2_20
.LBB2_70:
.Ltmp21:
	jmp	.LBB2_20
.LBB2_18:                               # %.loopexit.split-lp
.Ltmp66:
	jmp	.LBB2_72
.LBB2_36:
.Ltmp35:
	jmp	.LBB2_20
.LBB2_35:
.Ltmp28:
	jmp	.LBB2_20
.LBB2_22:
.Ltmp49:
	jmp	.LBB2_20
.LBB2_19:
.Ltmp42:
.LBB2_20:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	leaq	16(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_73
# %bb.21:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i.i.i
	callq	_ZdlPv
	jmp	.LBB2_73
.LBB2_71:                               # %.loopexit
.Ltmp7:
.LBB2_72:
	movq	%rax, %rbx
.LBB2_73:
	movq	112(%rsp), %rdi
	leaq	128(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_75
# %bb.74:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i100
	callq	_ZdlPv
.LBB2_75:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit102
	movq	144(%rsp), %rdi
	leaq	160(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_77
# %bb.76:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i103
	callq	_ZdlPv
.LBB2_77:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit105
	movq	32(%rsp), %rdi
	leaq	48(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_79
# %bb.78:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i106
	callq	_ZdlPv
.LBB2_79:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit108
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB2_81
# %bb.80:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i109
	callq	_ZdlPv
.LBB2_81:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit111
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_, .Lfunc_end2-_Z9tracebackNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.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 .Ltmp6-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp41-.Ltmp36                #   Call between .Ltmp36 and .Ltmp41
	.uleb128 .Ltmp42-.Lfunc_begin0          #     jumps to .Ltmp42
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp43-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp48-.Ltmp43                #   Call between .Ltmp43 and .Ltmp48
	.uleb128 .Ltmp49-.Lfunc_begin0          #     jumps to .Ltmp49
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp22-.Lfunc_begin0          # >> Call Site 6 <<
	.uleb128 .Ltmp27-.Ltmp22                #   Call between .Ltmp22 and .Ltmp27
	.uleb128 .Ltmp28-.Lfunc_begin0          #     jumps to .Ltmp28
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp29-.Lfunc_begin0          # >> Call Site 7 <<
	.uleb128 .Ltmp34-.Ltmp29                #   Call between .Ltmp29 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin0          #     jumps to .Ltmp35
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp8-.Lfunc_begin0           # >> Call Site 8 <<
	.uleb128 .Ltmp13-.Ltmp8                 #   Call between .Ltmp8 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp20-.Ltmp15                #   Call between .Ltmp15 and .Ltmp20
	.uleb128 .Ltmp21-.Lfunc_begin0          #     jumps to .Ltmp21
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp50-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp65-.Ltmp50                #   Call between .Ltmp50 and .Ltmp65
	.uleb128 .Ltmp66-.Lfunc_begin0          #     jumps to .Ltmp66
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp65-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Lfunc_end2-.Ltmp65            #   Call between .Ltmp65 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z30__device_stub__needlemanKernelPiPcS0_iiiiii # -- Begin function _Z30__device_stub__needlemanKernelPiPcS0_iiiiii
	.type	_Z30__device_stub__needlemanKernelPiPcS0_iiiiii,@function
_Z30__device_stub__needlemanKernelPiPcS0_iiiiii: # @_Z30__device_stub__needlemanKernelPiPcS0_iiiiii
	.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	$176, %rsp
	.cfi_def_cfa_offset 224
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r13, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	56(%rsp), %rax
	movq	%rdi, (%rax)
	leaq	48(%rsp), %rdi
	movq	%rsi, (%rdi)
	leaq	40(%rsp), %rsi
	movq	%rdx, (%rsi)
	leaq	20(%rsp), %rdx
	movl	%ecx, (%rdx)
	leaq	16(%rsp), %rcx
	movl	%r8d, (%rcx)
	leaq	12(%rsp), %r8
	movl	%r9d, (%r8)
	leaq	96(%rsp), %rbx
	movq	%rax, (%rbx)
	movq	%rdi, 8(%rbx)
	movq	%rsi, 16(%rbx)
	movq	%rdx, 24(%rbx)
	movq	%rcx, 32(%rbx)
	movq	%r8, 40(%rbx)
	leaq	224(%rsp), %rax
	movq	%rax, 48(%rbx)
	leaq	232(%rsp), %rax
	movq	%rax, 56(%rbx)
	leaq	240(%rsp), %rax
	movq	%rax, 64(%rbx)
	leaq	80(%rsp), %r14
	leaq	64(%rsp), %r15
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %r13
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	__hipPopCallConfiguration
	movq	(%r14), %rsi
	movl	8(%r14), %edx
	movq	(%r15), %rcx
	movl	8(%r15), %r8d
	movl	$_Z15needlemanKernelPiPcS0_iiiiii, %edi
	movq	%rbx, %r9
	pushq	(%r13)
	.cfi_adjust_cfa_offset 8
	pushq	(%r12)
	.cfi_adjust_cfa_offset 8
	callq	hipLaunchKernel
	addq	$192, %rsp
	.cfi_adjust_cfa_offset -192
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end3:
	.size	_Z30__device_stub__needlemanKernelPiPcS0_iiiiii, .Lfunc_end3-_Z30__device_stub__needlemanKernelPiPcS0_iiiiii
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	leaq	-112(%rbp), %rcx
	movq	%rcx, -16(%rcx)
	xorl	%eax, %eax
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
	leaq	-80(%rbp), %rcx
	movq	%rcx, -16(%rcx)
	movq	%rax, -8(%rcx)
	movb	%al, (%rcx)
	testl	%edi, %edi
	jg	.LBB4_3
# %bb.1:
.Ltmp67:
	.cfi_escape 0x2e, 0x00
	leaq	-128(%rbp), %rdi
	movl	$.L.str.8, %ecx
	movl	$11, %r8d
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp68:
# %bb.2:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit
	leaq	-96(%rbp), %rdi
	movq	8(%rdi), %rdx
.Ltmp69:
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.9, %ecx
	movl	$7, %r8d
	xorl	%esi, %esi
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp70:
	jmp	.LBB4_3
.LBB4_37:                               #   in Loop: Header=BB4_3 Depth=1
	movq	optarg(%rip), %r15
	leaq	-128(%rbp), %r12
	movq	8(%r12), %r13
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	strlen
.Ltmp72:
	.cfi_escape 0x2e, 0x00
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r13, %rdx
	movq	%r15, %rcx
	movq	%rax, %r8
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp73:
	jmp	.LBB4_3
.LBB4_38:                               #   in Loop: Header=BB4_3 Depth=1
	movl	optopt(%rip), %esi
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.11, %edi
	xorl	%eax, %eax
	callq	printf
.LBB4_3:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit37
                                        # =>This Inner Loop Header: Depth=1
	.cfi_escape 0x2e, 0x00
	movl	$.L.str.10, %edx
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	getopt
	cmpl	$63, %eax
	je	.LBB4_38
# %bb.4:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit37
                                        #   in Loop: Header=BB4_3 Depth=1
	cmpl	$114, %eax
	je	.LBB4_37
# %bb.5:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit37
                                        #   in Loop: Header=BB4_3 Depth=1
	cmpl	$-1, %eax
	jne	.LBB4_3
# %bb.6:
	movslq	optind(%rip), %rax
	cmpl	%eax, %ebx
	jle	.LBB4_10
# %bb.7:                                # %.lr.ph.preheader
	leaq	(%r14,%rax,8), %r13
	subl	%eax, %ebx
	xorl	%r14d, %r14d
.LBB4_8:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r13,%r14,8), %r15
	movq	-88(%rbp), %r12
	.cfi_escape 0x2e, 0x00
	movq	%r15, %rdi
	callq	strlen
.Ltmp75:
	.cfi_escape 0x2e, 0x00
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	%rax, %r8
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm
.Ltmp76:
# %bb.9:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc.exit39
                                        #   in Loop: Header=BB4_8 Depth=1
	incq	%r14
	cmpl	%r14d, %ebx
	jne	.LBB4_8
.LBB4_10:                               # %._crit_edge
	movl	-120(%rbp), %eax
	incl	%eax
	movl	%eax, HEIGHT(%rip)
	movl	-88(%rbp), %ecx
	incl	%ecx
	movl	%ecx, WIDTH(%rip)
	movslq	%ecx, %rcx
	movslq	%eax, %rdi
	imulq	%rcx, %rdi
	shlq	$2, %rdi
	.cfi_escape 0x2e, 0x00
	callq	malloc
	movq	%rax, M(%rip)
	.cfi_escape 0x2e, 0x00
	callq	_Z16initializeMatrixv
	movq	%rsp, %r12
	movq	-120(%rbp), %rax
	.cfi_escape 0x2e, 0x00
	movq	%rsp, %rbx
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rbx
	movq	%rbx, %rsp
	movq	-88(%rbp), %rax
	.cfi_escape 0x2e, 0x00
	movq	%rsp, %r14
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %r14
	movq	%r14, %rsp
	movq	-128(%rbp), %rsi
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	strcpy
	movq	-96(%rbp), %rsi
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	callq	strcpy
	movslq	WIDTH(%rip), %rax
	movslq	HEIGHT(%rip), %rsi
	imulq	%rax, %rsi
	shlq	$2, %rsi
.Ltmp78:
	.cfi_escape 0x2e, 0x00
	leaq	-48(%rbp), %rdi
	callq	hipMalloc
.Ltmp79:
# %bb.11:                               # %_ZL9hipMallocIiE10hipError_tPPT_m.exit
	movq	-120(%rbp), %rsi
.Ltmp80:
	.cfi_escape 0x2e, 0x00
	leaq	-64(%rbp), %rdi
	callq	hipMalloc
.Ltmp81:
# %bb.12:                               # %_ZL9hipMallocIcE10hipError_tPPT_m.exit
	movq	-88(%rbp), %rsi
.Ltmp82:
	.cfi_escape 0x2e, 0x00
	leaq	-56(%rbp), %rdi
	callq	hipMalloc
.Ltmp83:
# %bb.13:                               # %_ZL9hipMallocIcE10hipError_tPPT_m.exit40
	movq	-48(%rbp), %rdi
	movq	M(%rip), %rsi
	movslq	WIDTH(%rip), %rax
	movslq	HEIGHT(%rip), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
.Ltmp84:
	.cfi_escape 0x2e, 0x00
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp85:
# %bb.14:
	movq	-64(%rbp), %rdi
	movq	-120(%rbp), %rdx
.Ltmp86:
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp87:
# %bb.15:
	movq	-56(%rbp), %rdi
	movq	-88(%rbp), %rdx
.Ltmp88:
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
.Ltmp89:
# %bb.16:
	movl	HEIGHT(%rip), %ebx
	leal	-1(%rbx), %eax
	leal	1022(%rbx), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	.cfi_escape 0x2e, 0x00
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, %r15
	movl	WIDTH(%rip), %eax
	movl	HEIGHT(%rip), %ecx
	addl	%ecx, %eax
	decl	%eax
	testl	%eax, %eax
	jle	.LBB4_22
# %bb.17:                               # %.lr.ph61.preheader
	sarl	$10, %r14d
	incl	%r14d
	shlq	$32, %r14
	orq	$1, %r14
	btsq	$32, %rbx
	xorl	%r13d, %r13d
.LBB4_18:                               # %.lr.ph61
                                        # =>This Inner Loop Header: Depth=1
.Ltmp91:
	.cfi_escape 0x2e, 0x00
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	__hipPushCallConfiguration
.Ltmp92:
# %bb.19:                               #   in Loop: Header=BB4_18 Depth=1
	testl	%eax, %eax
	jne	.LBB4_21
# %bb.20:                               #   in Loop: Header=BB4_18 Depth=1
	movq	-48(%rbp), %rdi
	movq	-64(%rbp), %rsi
	movq	-56(%rbp), %rdx
	movl	WIDTH(%rip), %ecx
	movl	HEIGHT(%rip), %r8d
	movl	MATCH(%rip), %r9d
	movl	MISMATCH(%rip), %eax
	movl	GAP(%rip), %r10d
.Ltmp93:
	.cfi_escape 0x2e, 0x20
	subq	$8, %rsp
	pushq	%r13
	pushq	%r10
	pushq	%rax
	callq	_Z30__device_stub__needlemanKernelPiPcS0_iiiiii
	addq	$32, %rsp
.Ltmp94:
.LBB4_21:                               #   in Loop: Header=BB4_18 Depth=1
	incl	%r13d
	movl	WIDTH(%rip), %eax
	movl	HEIGHT(%rip), %ecx
	addl	%ecx, %eax
	decl	%eax
	cmpl	%eax, %r13d
	jl	.LBB4_18
.LBB4_22:                               # %._crit_edge62
	.cfi_escape 0x2e, 0x00
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	%r15, %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
.Ltmp96:
	.cfi_escape 0x2e, 0x00
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIlEERSoT_
.Ltmp97:
# %bb.23:                               # %_ZNSolsEl.exit
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp98:
	.cfi_escape 0x2e, 0x00
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp99:
# %bb.24:                               # %.noexc
.Ltmp100:
	.cfi_escape 0x2e, 0x00
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp101:
# %bb.25:                               # %.noexc50
.Ltmp102:
	.cfi_escape 0x2e, 0x00
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp103:
# %bb.26:                               # %_ZNSolsEPFRSoS_E.exit
	movq	M(%rip), %rdi
	movq	-48(%rbp), %rsi
	movslq	WIDTH(%rip), %rax
	movslq	HEIGHT(%rip), %rdx
	imulq	%rax, %rdx
	shlq	$2, %rdx
.Ltmp104:
	.cfi_escape 0x2e, 0x00
	movl	$2, %ecx
	callq	hipMemcpy
.Ltmp105:
# %bb.27:
	movq	-48(%rbp), %rdi
.Ltmp106:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp107:
# %bb.28:
	movq	-64(%rbp), %rdi
.Ltmp108:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp109:
# %bb.29:
	movq	-56(%rbp), %rdi
.Ltmp110:
	.cfi_escape 0x2e, 0x00
	callq	hipFree
.Ltmp111:
# %bb.30:
	movq	M(%rip), %rdi
	.cfi_escape 0x2e, 0x00
	callq	free
	movq	%r12, %rsp
	movq	-96(%rbp), %rdi
	leaq	-80(%rbp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_32
# %bb.31:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB4_32:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	movq	-128(%rbp), %rdi
	leaq	-112(%rbp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_34
# %bb.33:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i41
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB4_34:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit43
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa %rsp, 8
	retq
.LBB4_36:                               # %.loopexit.split-lp
	.cfi_def_cfa %rbp, 16
.Ltmp71:
	jmp	.LBB4_43
.LBB4_40:
.Ltmp90:
	jmp	.LBB4_43
.LBB4_42:
.Ltmp112:
	jmp	.LBB4_43
.LBB4_39:
.Ltmp77:
	jmp	.LBB4_43
.LBB4_41:
.Ltmp95:
	jmp	.LBB4_43
.LBB4_35:                               # %.loopexit
.Ltmp74:
.LBB4_43:
	movq	%rax, %rbx
	movq	-96(%rbp), %rdi
	leaq	-80(%rbp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_45
# %bb.44:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i44
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB4_45:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit46
	movq	-128(%rbp), %rdi
	leaq	-112(%rbp), %rax
	cmpq	%rax, %rdi
	je	.LBB4_47
# %bb.46:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i47
	.cfi_escape 0x2e, 0x00
	callq	_ZdlPv
.LBB4_47:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit49
	.cfi_escape 0x2e, 0x00
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end4:
	.size	main, .Lfunc_end4-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table4:
.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 .Ltmp67-.Lfunc_begin1          # >> Call Site 1 <<
	.uleb128 .Ltmp70-.Ltmp67                #   Call between .Ltmp67 and .Ltmp70
	.uleb128 .Ltmp71-.Lfunc_begin1          #     jumps to .Ltmp71
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp72-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp73-.Ltmp72                #   Call between .Ltmp72 and .Ltmp73
	.uleb128 .Ltmp74-.Lfunc_begin1          #     jumps to .Ltmp74
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp75-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp76-.Ltmp75                #   Call between .Ltmp75 and .Ltmp76
	.uleb128 .Ltmp77-.Lfunc_begin1          #     jumps to .Ltmp77
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp78-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp89-.Ltmp78                #   Call between .Ltmp78 and .Ltmp89
	.uleb128 .Ltmp90-.Lfunc_begin1          #     jumps to .Ltmp90
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp91-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp94-.Ltmp91                #   Call between .Ltmp91 and .Ltmp94
	.uleb128 .Ltmp95-.Lfunc_begin1          #     jumps to .Ltmp95
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp96-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Ltmp111-.Ltmp96               #   Call between .Ltmp96 and .Ltmp111
	.uleb128 .Ltmp112-.Lfunc_begin1         #     jumps to .Ltmp112
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp111-.Lfunc_begin1         # >> Call Site 7 <<
	.uleb128 .Lfunc_end4-.Ltmp111           #   Call between .Ltmp111 and .Lfunc_end4
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.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	.LBB5_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	.LBB5_3
.LBB5_1:                                # %._crit_edge
	movq	(%rbx), %rax
.LBB5_3:
	testq	%r14, %r14
	je	.LBB5_7
# %bb.4:
	cmpq	$1, %r14
	jne	.LBB5_6
# %bb.5:
	movb	(%r15), %cl
	movb	%cl, (%rax)
	jmp	.LBB5_7
.LBB5_6:
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	memcpy@PLT
.LBB5_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_end5:
	.size	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag, .Lfunc_end5-_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag
	.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	.LBB6_2
# %bb.1:
	movl	$__hip_fatbin_wrapper, %edi
	callq	__hipRegisterFatBinary
	movq	%rax, %rdi
	movq	%rax, __hip_gpubin_handle(%rip)
.LBB6_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movups	%xmm0, (%rsp)
	movl	$_Z15needlemanKernelPiPcS0_iiiiii, %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_end6:
	.size	__hip_module_ctor, .Lfunc_end6-__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	.LBB7_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
.LBB7_2:
	retq
.Lfunc_end7:
	.size	__hip_module_dtor, .Lfunc_end7-__hip_module_dtor
	.cfi_endproc
                                        # -- End function
	.type	GAP,@object                     # @GAP
	.data
	.globl	GAP
	.p2align	2, 0x0
GAP:
	.long	4294967295                      # 0xffffffff
	.size	GAP, 4

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

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

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

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

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

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"\t\t"
	.size	.L.str, 3

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"%c\t"
	.size	.L.str.1, 4

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	" %d\t"
	.size	.L.str.4, 5

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"%d\t"
	.size	.L.str.5, 4

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.zero	1
	.size	.L.str.6, 1

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

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

	.type	.L.str.8,@object                # @.str.8
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str.8:
	.asciz	"GAATTCAGTTA"
	.size	.L.str.8, 12

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"GGATCGA"
	.size	.L.str.9, 8

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

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

	.type	.L__unnamed_1,@object           # @0
.L__unnamed_1:
	.asciz	"_Z15needlemanKernelPiPcS0_iiiiii"
	.size	.L__unnamed_1, 33

	.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 _Z30__device_stub__needlemanKernelPiPcS0_iiiiii
	.addrsig_sym __hip_module_ctor
	.addrsig_sym __hip_module_dtor
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.addrsig_sym _Z15needlemanKernelPiPcS0_iiiiii
	.addrsig_sym __hip_fatbin
	.addrsig_sym __hip_fatbin_wrapper
	.addrsig_sym __hip_cuid_

	.text
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.protected	_Z15needlemanKernelPiPcS0_iiiiii ; -- Begin function _Z15needlemanKernelPiPcS0_iiiiii
	.globl	_Z15needlemanKernelPiPcS0_iiiiii
	.p2align	8
	.type	_Z15needlemanKernelPiPcS0_iiiiii,@function
_Z15needlemanKernelPiPcS0_iiiiii:       ; @_Z15needlemanKernelPiPcS0_iiiiii
; %bb.0:
	s_clause 0x1
	s_load_b32 s2, s[0:1], 0x3c
	s_load_b128 s[4:7], s[0:1], 0x18
	s_waitcnt lgkmcnt(0)
	s_and_b32 s2, s2, 0xffff
	s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_mad_u64_u32 v[1:2], null, s15, s2, v[0:1]
	v_cmp_gt_i32_e32 vcc_lo, s5, v1
	v_cmp_lt_i32_e64 s2, 0, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_saveexec_b32 s3, s2
	s_cbranch_execz .LBB0_3
; %bb.1:
	s_load_b64 s[12:13], s[0:1], 0x28
	s_waitcnt lgkmcnt(0)
	v_sub_nc_u32_e32 v0, s13, v1
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v0, 2, v0
	v_cmp_gt_i32_e32 vcc_lo, s4, v0
	v_cmp_lt_i32_e64 s2, 0, v0
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
	s_and_b32 s2, vcc_lo, s2
	s_and_b32 exec_lo, exec_lo, s2
	s_cbranch_execz .LBB0_3
; %bb.2:
	v_add_nc_u32_e32 v7, -1, v1
	v_mul_lo_u32 v8, v1, s4
	s_clause 0x1
	s_load_b128 s[8:11], s[0:1], 0x0
	s_load_b64 s[0:1], s[0:1], 0x10
	v_ashrrev_i32_e32 v6, 31, v0
	v_mul_lo_u32 v2, v7, s4
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2)
	v_ashrrev_i32_e32 v9, 31, v8
	v_ashrrev_i32_e32 v4, 31, v2
	v_add_co_u32 v3, vcc_lo, v0, v2
	v_add_nc_u32_e32 v1, v0, v2
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_2) | instid1(VALU_DEP_3)
	v_add_co_ci_u32_e32 v4, vcc_lo, v6, v4, vcc_lo
	v_add_co_u32 v5, vcc_lo, v0, v8
	v_add_co_ci_u32_e32 v6, vcc_lo, v6, v9, vcc_lo
	v_lshlrev_b64 v[3:4], 2, v[3:4]
	v_ashrrev_i32_e32 v2, 31, v1
	v_add_nc_u32_e32 v9, -1, v0
	s_delay_alu instid0(VALU_DEP_4)
	v_lshlrev_b64 v[5:6], 2, v[5:6]
	s_waitcnt lgkmcnt(0)
	global_load_u8 v7, v7, s[10:11]
	global_load_u8 v9, v9, s[0:1]
	v_lshlrev_b64 v[1:2], 2, v[1:2]
	v_add_co_u32 v3, vcc_lo, s8, v3
	v_add_co_ci_u32_e32 v4, vcc_lo, s9, v4, vcc_lo
	v_add_co_u32 v5, vcc_lo, s8, v5
	v_add_co_ci_u32_e32 v6, vcc_lo, s9, v6, vcc_lo
	v_add_co_u32 v1, vcc_lo, s8, v1
	v_add_co_ci_u32_e32 v2, vcc_lo, s9, v2, vcc_lo
	s_clause 0x2
	global_load_b32 v3, v[3:4], off offset:-4
	global_load_b32 v4, v[5:6], off offset:-4
	global_load_b32 v2, v[1:2], off
	v_dual_mov_b32 v5, s6 :: v_dual_add_nc_u32 v0, v0, v8
	s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
	v_ashrrev_i32_e32 v1, 31, v0
	v_lshlrev_b64 v[0:1], 2, v[0:1]
	s_waitcnt vmcnt(3)
	v_cmp_eq_u16_e32 vcc_lo, v7, v9
	v_cndmask_b32_e32 v5, s7, v5, vcc_lo
	s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_4)
	v_add_co_u32 v0, vcc_lo, s8, v0
	v_add_co_ci_u32_e32 v1, vcc_lo, s9, v1, vcc_lo
	s_waitcnt vmcnt(2)
	s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(VALU_DEP_1)
	v_add_nc_u32_e32 v3, v3, v5
	s_waitcnt vmcnt(1)
	v_add_nc_u32_e32 v4, s12, v4
	s_waitcnt vmcnt(0)
	v_add_nc_u32_e32 v2, s12, v2
	v_max3_i32 v2, v3, v4, v2
	global_store_b32 v[0:1], v2, off
	s_waitcnt_vscnt null, 0x0
	s_barrier
	buffer_gl0_inv
.LBB0_3:
	s_endpgm
	.section	.rodata,"a",@progbits
	.p2align	6, 0x0
	.amdhsa_kernel _Z15needlemanKernelPiPcS0_iiiiii
		.amdhsa_group_segment_fixed_size 0
		.amdhsa_private_segment_fixed_size 0
		.amdhsa_kernarg_size 304
		.amdhsa_user_sgpr_count 14
		.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 1
		.amdhsa_system_sgpr_workgroup_id_z 0
		.amdhsa_system_sgpr_workgroup_info 0
		.amdhsa_system_vgpr_workitem_id 0
		.amdhsa_next_free_vgpr 10
		.amdhsa_next_free_sgpr 16
		.amdhsa_float_round_mode_32 0
		.amdhsa_float_round_mode_16_64 0
		.amdhsa_float_denorm_mode_32 3
		.amdhsa_float_denorm_mode_16_64 3
		.amdhsa_dx10_clamp 1
		.amdhsa_ieee_mode 1
		.amdhsa_fp16_overflow 0
		.amdhsa_workgroup_processor_mode 1
		.amdhsa_memory_ordered 1
		.amdhsa_forward_progress 0
		.amdhsa_shared_vgpr_count 0
		.amdhsa_exception_fp_ieee_invalid_op 0
		.amdhsa_exception_fp_denorm_src 0
		.amdhsa_exception_fp_ieee_div_zero 0
		.amdhsa_exception_fp_ieee_overflow 0
		.amdhsa_exception_fp_ieee_underflow 0
		.amdhsa_exception_fp_ieee_inexact 0
		.amdhsa_exception_int_div_zero 0
	.end_amdhsa_kernel
	.text
.Lfunc_end0:
	.size	_Z15needlemanKernelPiPcS0_iiiiii, .Lfunc_end0-_Z15needlemanKernelPiPcS0_iiiiii
                                        ; -- End function
	.section	.AMDGPU.csdata,"",@progbits
; Kernel info:
; codeLenInByte = 448
; NumSgprs: 18
; NumVgprs: 10
; ScratchSize: 0
; MemoryBound: 0
; FloatMode: 240
; IeeeMode: 1
; LDSByteSize: 0 bytes/workgroup (compile time only)
; SGPRBlocks: 2
; VGPRBlocks: 1
; NumSGPRsForWavesPerEU: 18
; NumVGPRsForWavesPerEU: 10
; Occupancy: 16
; WaveLimiterHint : 0
; COMPUTE_PGM_RSRC2:SCRATCH_EN: 0
; COMPUTE_PGM_RSRC2:USER_SGPR: 14
; COMPUTE_PGM_RSRC2:TRAP_HANDLER: 0
; COMPUTE_PGM_RSRC2:TGID_X_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Y_EN: 1
; COMPUTE_PGM_RSRC2:TGID_Z_EN: 0
; COMPUTE_PGM_RSRC2:TIDIG_COMP_CNT: 0
	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

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

	.end_amdgpu_metadata
