// File: /workspace/github_cpp_makefile_star2_O1/stacksmith[P]picoasm/cassembler.cpp
// Function: CAssembler::exportVHDL(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
bool CAssembler::exportVHDL( string templateFile, string outputDir, string entityName, bool bVHDL)
{
	int addr, i, j, k, l, n ;
	unsigned char INIT[ 32 ][ 64 ] ;		/* 32 * 64 = 2048 bytes */
	unsigned char INITP[ 32 ][ 8 ] ;		/* 32 * 8 =   256 bytes */
	unsigned int d ;                        /*			 2304 Bytes Total = (18b * 1024 ) / 8 (1 instr = 18 bits )*/
	
	CInstruction *instr ;
	
	// ajg112 - Open Mem file
	string memFileName = outputDir + "/" + entityName + ".mem";
	FILE * memFile = fopen( memFileName.c_str(), "w" ) ;		
	if (memFile == NULL) {
		error(NO_LINE_NR, string( "Unable to open mem file '" + memFileName + "'" ).c_str());
		return FALSE ;
	}

	// ajg112 - Specify start address
	fprintf(memFile, "@0\n");

	for ( i = 0 ; i < 32 ; i++ )
		for( j = 0 ; j < 32 ; j++ )
			INIT[ i ][ j ] = 0 ;
			
	for ( i = 0 ; i < 32 ; i++ )
		for ( j = 0 ; j < 8 ; j++ )
			INITP[ i ][ j ] = 0 ;
	
	for ( addr = i = j = k = l = 0, n = 0 ; addr < 1024 ; addr++ ) {			
		instr = m_code->getInstruction( addr ) ;
		
		if ( instr == NULL ) d = 0 ;
		else d = instr->getHexCode() ;

		//cout << d <<"\n";

		// ajg112 - Output memory value
		fprintf(memFile, "%05X\n", d);
						
		INIT[ i++ ][ j ] =  d ;		// instruction( 15 downto 0 )
		INIT[ i++ ][ j ] =  d >> 8;
		
		INITP[ k ][ l ] |= ( ( d >> 16 ) & 0x3 ) << n ;	// instruction( 17 downto 16 ) ;
		n += 2 ;
				
		if ( n >= 8 ) {
			n = 0 ;
			k++ ;
			if ( k >= 32 ) {
				l++ ;
				k = 0 ;
			}
		}
		
		if ( i >= 32 ) {
			i = 0 ;
			j++ ;
		}
	}

	// ajg112 - Close Mem File
	fclose(memFile);
	
	FILE * infile = fopen( templateFile.c_str(), "r" ) ;
	if ( infile == NULL ) {
		error( NO_LINE_NR, string( "Unable to open template file '" + templateFile + "'" ).c_str() ) ;
		return FALSE ;
	}

	// RDC 02/02/2007 set VHDL or verilog file extension
	string exportExt;
	if (bVHDL){
	  exportExt = ".vhd"; 
	} else {
	  exportExt = ".v"; 
	}

	// RDC 02/02/2007 set VHDL or verilog file extension
	// string exportFile = outputDir + "/" + entityName + ".vhd" ;
	string exportFile = outputDir + "/" + entityName + exportExt;

	FILE * outfile = fopen( exportFile.c_str(), "w" ) ;		
	if ( outfile == NULL ) {
	  // RDC 02/02/2007 set VHDL or verilog file extension
	  // error( NO_LINE_NR , string( "Unable to open output file '" + exportFile + ".vhd'").c_str() ) ;
	  error( NO_LINE_NR , string( "Unable to open output file '" + exportFile + exportExt + "'").c_str() ) ;
	  return FALSE ;
	}
		
	bool store = false, copy = false;
	char varname[ 64 ] ;
	int p = 0 ;
	int line, c ;
	while ( ( c = fgetc( infile ) ) != EOF ) {
		if ( store && p < 64 )
			varname[ p++ ] = c ;
		
		if ( c == '{' ) {
			store = true ;		
			p = 0 ;
		}
		
		if ( !store && copy )
			fputc( c, outfile ) ;
		
		if ( c == '}' ) {
			store = false ;
			if ( p > 0 )
				varname[ p - 1 ] = '\0' ;
			else
				varname[ 0 ] = '\0' ;
			if ( strncmp( "INIT_", varname, 5 ) == 0 ) {
				sscanf( varname, "INIT_%02X", &line ) ;
				if ( line >= 0 && line < 64 ) {
					for( j = 31 ; j >= 0 ; j-- ) 
						fprintf( outfile, "%02X", INIT[ j ][ line ] ) ;
				}
			} else if ( strncmp( "INITP_", varname, 6 ) == 0 ) {
				sscanf( varname, "INITP_%02X", &line ) ;
				if ( line >= 0 && line < 8 ) 
					for( j = 31 ; j >= 0 ; j-- )
		 				fprintf( outfile, "%02X", INITP[ j ][ line ] ) ;
			} else if ( strcmp( "name", varname ) == 0 ) {
				fprintf( outfile, entityName.c_str() ) ;				
			} else if ( strcmp( "begin template", varname ) == 0 ) {
				copy = true ;
			}
		}
	}
		
	fclose( infile ) ;
	fclose( outfile ) ;
	
	return TRUE ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa28, %rsp            # imm = 0xA28
movl %r8d, %r12d
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, -0x128(%rbp)
movq %rdi, -0x130(%rbp)
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0x40546e
leaq 0x1803e6(%rip), %rsi    # 0x58819c
movq %rbx, %rdi
callq 0x47e260
movl %r12d, -0xcc(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq -0x50(%rbp), %rdi
callq 0x47e120
leaq -0x90(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x407e03
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x407e0b
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0xa0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x179918(%rip), %rsi    # 0x581748
callq 0x47e260
leaq -0xe0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x407e62
movq %rdx, -0xf0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xe0(%rbp)
jmp 0x407e68
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0xe8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x407e9d
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x407eb2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0xf0(%rbp), %rdi
leaq 0x17dc49(%rip), %rsi    # 0x585b09
callq 0x4e35a0
testq %rax, %rax
je 0x408117
movq %r13, -0x120(%rbp)
movq %r15, -0xf8(%rbp)
leaq 0x179884(%rip), %rdi    # 0x581767
movl $0x3, %esi
movl $0x1, %edx
movq %rax, -0xa8(%rbp)
movq %rax, %rcx
callq 0x4e38d0
xorl %eax, %eax
xorps %xmm0, %xmm0
movaps %xmm0, -0xa40(%rbp,%rax)
movaps %xmm0, -0xa50(%rbp,%rax)
addq $0x40, %rax
cmpq $0x800, %rax            # imm = 0x800
jne 0x407f01
leaq -0x250(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x401090
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq $0x0, -0x58(%rbp)
xorl %r14d, %r14d
movl $0x0, -0x2c(%rbp)
movq -0x130(%rbp), %rax
movq 0x80(%rax), %rdi
movzwl %r15w, %esi
callq 0x40c62e
testq %rax, %rax
je 0x407f6c
movl 0x1c(%rax), %ebx
jmp 0x407f6e
xorl %ebx, %ebx
movq -0xa8(%rbp), %rdi
leaq 0x1797ef(%rip), %rsi    # 0x58176b
movl %ebx, %edx
xorl %eax, %eax
callq 0x4d4720
movslq %r12d, %rax
movl %r13d, %ecx
shlq $0x6, %rax
addq %rbp, %rax
addq $-0xa50, %rax           # imm = 0xF5B0
movb %bl, (%rcx,%rax)
movb %bh, 0x40(%rcx,%rax)
shrl $0x10, %ebx
andl $0x3, %ebx
movl %r14d, %ecx
shll %cl, %ebx
movslq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
leaq -0x250(,%rax,8), %rax
addq %rbp, %rax
orb %bl, (%rcx,%rax)
cmpl $0x6, %r14d
jge 0x407fcc
addl $0x2, %r14d
jmp 0x407feb
xorl %r14d, %r14d
xorl %eax, %eax
movq -0x58(%rbp), %rcx
cmpl $0x1f, %ecx
leal 0x1(%rcx), %ecx
setge %al
cmovgel %r14d, %ecx
addl %eax, -0x2c(%rbp)
movl %ecx, %eax
movq %rax, -0x58(%rbp)
xorl %eax, %eax
cmpl $0x1e, %r12d
leal 0x2(%r12), %ecx
setge %al
movl $0x0, %edx
cmovgel %edx, %ecx
addl %eax, %r13d
incl %r15d
movl %ecx, %r12d
cmpl $0x400, %r15d           # imm = 0x400
jne 0x407f4b
movq -0xa8(%rbp), %rdi
callq 0x4e2d10
movq -0x128(%rbp), %rbx
movq (%rbx), %rdi
leaq 0x17e52b(%rip), %rsi    # 0x58655f
callq 0x4e35a0
movq %rax, -0x58(%rbp)
testq %rax, %rax
je 0x40816e
leaq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq 0x1790f3(%rip), %rax    # 0x581157
leaq 0x179083(%rip), %rcx    # 0x5810ee
movl -0xcc(%rbp), %edx
testb %dl, %dl
cmovneq %rax, %rcx
movzbl %dl, %eax
leaq 0x2(,%rax,2), %r8
xorl %esi, %esi
xorl %edx, %edx
callq 0x47d700
leaq -0x90(%rbp), %r14
leaq -0xb8(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x120(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x40546e
leaq 0x1800db(%rip), %rsi    # 0x58819c
leaq -0xc8(%rbp), %rdi
callq 0x47e260
movq -0xf8(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x47e120
movq %r14, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4081d3
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x4081da
leaq 0x17962f(%rip), %rsi    # 0x58174d
leaq -0x50(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x408f42
leaq 0x1790aa(%rip), %rsi    # 0x5811df
leaq -0x50(%rbp), %rdi
callq 0x47e260
movq %r12, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x408549
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x408551
leaq 0x1795fc(%rip), %rsi    # 0x581771
leaq -0x50(%rbp), %rdi
movq %rbx, %rdx
leaq -0xe0(%rbp), %rbx
callq 0x408f42
leaq -0x40(%rbp), %r14
leaq -0x90(%rbp), %r15
leaq 0x179045(%rip), %rsi    # 0x5811df
leaq -0x50(%rbp), %rdi
callq 0x47e260
movq %r15, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4085b4
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x4085bb
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0xa0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x47e120
leaq -0x108(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x408232
movq %rdx, -0x118(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x108(%rbp)
jmp 0x408238
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x110(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x40826d
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0xc8(%rbp), %rdi
cmpq %r13, %rdi
je 0x408288
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x118(%rbp), %rdi
leaq 0x17d873(%rip), %rsi    # 0x585b09
callq 0x4e35a0
testq %rax, %rax
setne %bl
movl %ebx, -0xa8(%rbp)
je 0x4084e0
movq %rax, %r12
movq -0x58(%rbp), %rdi
callq 0x4e7e00
cmpl $-0x1, %eax
je 0x4084bf
movl %eax, %ebx
leaq 0x1794ff(%rip), %r13    # 0x5817ca
xorl %r14d, %r14d
movl $0x0, -0x2c(%rbp)
xorl %r15d, %r15d
cmpl $0x40, %r14d
setl %al
andb %r15b, %al
cmpb $0x1, %al
jne 0x4082f3
movslq %r14d, %rax
incl %r14d
movb %bl, -0xa0(%rbp,%rax)
cmpl $0x7b, %ebx
movzbl %r15b, %r15d
movl $0x1, %eax
cmovel %eax, %r15d
movl $0x0, %eax
cmovel %eax, %r14d
testb $0x1, %r15b
jne 0x408322
testb $0x1, -0x2c(%rbp)
je 0x408322
movl %ebx, %edi
movq %r12, %rsi
callq 0x4e7cc0
cmpl $0x7d, %ebx
jne 0x4084ab
testl %r14d, %r14d
jle 0x40833e
leal -0x1(%r14), %eax
movb $0x0, -0xa0(%rbp,%rax)
jmp 0x408345
movb $0x0, -0xa0(%rbp)
movl $0x54494e49, %edx       # imm = 0x54494E49
movl -0xa0(%rbp), %eax
xorl %edx, %eax
movzbl -0x9c(%rbp), %ecx
xorl $0x5f, %ecx
orl %eax, %ecx
je 0x4083dd
movl -0xa0(%rbp), %eax
xorl %edx, %eax
movzwl -0x9c(%rbp), %ecx
xorl $0x5f50, %ecx           # imm = 0x5F50
orl %eax, %ecx
je 0x40843b
movl -0xa0(%rbp), %eax
movl $0x656d616e, %ecx       # imm = 0x656D616E
xorl %ecx, %eax
movzbl -0x9c(%rbp), %ecx
orl %eax, %ecx
je 0x408494
movq -0xa0(%rbp), %rax
movabsq $0x6574206e69676562, %rcx # imm = 0x6574206E69676562
xorq %rcx, %rax
movq -0x99(%rbp), %rcx
movabsq $0x6574616c706d65, %rdx # imm = 0x6574616C706D65
xorq %rdx, %rcx
orq %rax, %rcx
movl -0x2c(%rbp), %ecx
movzbl %cl, %ecx
movl $0x1, %eax
cmovel %eax, %ecx
movl %ecx, -0x2c(%rbp)
xorl %r15d, %r15d
jmp 0x4084ab
xorl %r15d, %r15d
leaq -0xa0(%rbp), %rdi
leaq 0x1793c5(%rip), %rsi    # 0x5817b3
leaq -0xc8(%rbp), %rdx
xorl %eax, %eax
callq 0x4d4a40
cmpl $0x3f, -0xc8(%rbp)
ja 0x4084ab
movl $0x800, %ebx            # imm = 0x800
movslq -0xc8(%rbp), %rax
addq %rbp, %rax
addq $-0xa50, %rax           # imm = 0xF5B0
movzbl -0x40(%rbx,%rax), %edx
xorl %r15d, %r15d
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4d4720
addq $-0x40, %rbx
jne 0x40840e
jmp 0x4084ab
xorl %r15d, %r15d
leaq -0xa0(%rbp), %rdi
leaq 0x179378(%rip), %rsi    # 0x5817c4
leaq -0xc8(%rbp), %rdx
xorl %eax, %eax
callq 0x4d4a40
cmpl $0x7, -0xc8(%rbp)
ja 0x4084ab
movl $0x1f, %ebx
movslq -0xc8(%rbp), %rax
addq %rbp, %rax
addq $-0x250, %rax           # imm = 0xFDB0
movzbl (%rax,%rbx,8), %edx
xorl %r15d, %r15d
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4d4720
addq $-0x1, %rbx
jb 0x408468
jmp 0x4084ab
movq -0xf8(%rbp), %rax
movq (%rax), %rsi
xorl %r15d, %r15d
movq %r12, %rdi
xorl %eax, %eax
callq 0x4d4720
movq -0x58(%rbp), %rdi
callq 0x4e7e00
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x4082d8
movq -0x58(%rbp), %rdi
callq 0x4e2d10
movq %r12, %rdi
callq 0x4e2d10
leaq -0xe0(%rbp), %rbx
leaq -0x40(%rbp), %r14
jmp 0x4086dd
leaq 0x1792a9(%rip), %rsi    # 0x581790
leaq -0x150(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x408f42
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x150(%rbp), %rdi
callq 0x47e120
leaq -0x90(%rbp), %r15
movq %r13, -0xc8(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq -0x40(%rbp), %r14
je 0x4085f4
movq %rdx, -0xc8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb8(%rbp)
jmp 0x4085fc
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa0(%rbp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x405742
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x408597
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x4085ac
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x40d0c0
xorl %r14d, %r14d
jmp 0x40871b
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa0(%rbp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x405742
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x408588
jmp 0x408597
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0xc8(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x178bbe(%rip), %rsi    # 0x5811df
callq 0x47e260
movq %r15, -0xa0(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40864f
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x408656
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xa0(%rbp), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x405742
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x40869c
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0xc8(%rbp), %rdi
cmpq %r13, %rdi
je 0x4086b7
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq -0xe0(%rbp), %rbx
je 0x4086dd
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x4086ff
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x408714
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movl -0xa8(%rbp), %r14d
movq -0xf0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x408736
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movl %r14d, %eax
addq $0xa28, %rsp            # imm = 0xA28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x40876e
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x40876e
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r13, %rdi
je 0x40878e
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x40878e
movq %rax, %rbx
leaq -0x140(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4087b2
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x4087b2
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x408850
movq -0x108(%rbp), %rsi
jmp 0x408841
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
jne 0x4087f9
jmp 0x408850
jmp 0x40884d
jmp 0x4088af
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x408850
movq -0x90(%rbp), %rsi
jmp 0x408841
jmp 0x40884d
jmp 0x4088af
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x40882e
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x40882e
jmp 0x40882b
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r13, %rdi
je 0x408850
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x408850
jmp 0x40884d
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x4088b2
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x4088b2
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x40888e
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x40d0c0
jmp 0x40888e
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
jne 0x4088a9
jmp 0x4088d4
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x4088d4
movq -0x40(%rbp), %rsi
jmp 0x4088cc
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x4088d4
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x40d0c0
movq %rbx, %rdi
callq 0x4ad960