// File: AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::evalExpr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, int)
string codeGenerator::evalExpr( string op, int size_left, int size_right, int type_left, int type_right ){
	if( !ShouldGenerate() ) return "";
	string lhs, rhs, result;
	int i, type_result;
	bool checkBool = false;
	// Ensure sizes are at least 1 so that loops will execute for scalars
	if( size_left == 0 ) size_left++;
	if( size_right == 0 ) size_right++;
	
	/* Invalidate OUT/INOUT arguments since an expresion such as <Name> * 2 has occurred
	 * there is no return value now and so there is no location to put an OUT argument */
	if( checkArguments() ) invalidateArgument();
	
	//Select int registers or float registers to put the result in
	if( type_left != type_right ){
		if( ( type_left == TYPE_FLOAT ) || ( type_right == TYPE_FLOAT ) ){ 
			type_result = TYPE_FLOAT;
		}
		else if( ( type_left == TYPE_BOOL ) || ( type_right == TYPE_BOOL ) ){
			type_result = TYPE_BOOL;
			if( (type_left == TYPE_INTEGER ) || (type_right == TYPE_INTEGER) ) checkBool = true;
		}
		else type_result = TYPE_INTEGER;
	}
	else type_result = type_left;

	// Convert operations for bitwise or boolean comparison to the correct C operator
	if(op.compare("&") == 0){ 
		if( (type_left == TYPE_BOOL) || (type_right == TYPE_BOOL) ){
			op = "&&";
			// add runtime check for integer/bool
		}
		else op = "&";
	}
	else if(op.compare("|") == 0){ 
		if( (type_left == TYPE_BOOL) || (type_right == TYPE_BOOL) ){
			op = "||";
			// add runtime check for integer/bool
		}
		else op = "|";
	}
	else if(op.compare("NOT") == 0){
		if( (type_left == TYPE_BOOL) || (type_right == TYPE_BOOL) ){
			op = "!";
			// add runtime check for integer/bool
		}
		else op = "~";
	}

	// Push the LHS and RHS operands to their respective stacks and then result to exprStack
	if( ( size_left > 1 ) && ( size_right > 1) ){
		// If LHS and RHS are both arrays ( same size checked by parser )
		for( i = 0; i < size_right; i++ ){
			rhs = popStack('E', type_right);
			pushStack(rhs, 'R', type_right);
		}
		for( i = 0; i < size_left; i++ ){
			lhs = popStack('E', type_left);
			pushStack(lhs, 'L', type_left);
		}
		for( i = 0; i < size_left; i++ ){
			rhs = popStack('R', type_right);
			lhs = popStack('L', type_left);
			result = newRegister(type_result);
			pushStack( result, 'E', type_result );
			if(checkBool) fprintf( oFile, "   handleBoolOp( %s, %s );\n", lhs.c_str(), rhs.c_str() );
			fprintf( oFile, "   %s = %s %s %s;\n", result.c_str(), lhs.c_str(), op.c_str(), rhs.c_str() );
		}
	}
	else if( size_left > 1 ){
		// If LHS is an array and RHS is a single value
		rhs = popStack('E', type_right);
		for( i = 0; i < size_left; i++ ){
			lhs = popStack('E', type_left);
			pushStack(lhs, 'L', type_left);
		}
		for( i = 0; i < size_left; i++ ){
			lhs = popStack('L', type_left);
			result = newRegister(type_result);
			pushStack( result, 'E', type_result );
			if(checkBool) fprintf( oFile, "   handleBoolOp( %s, %s );\n", lhs.c_str(), rhs.c_str() );
			fprintf( oFile, "   %s = %s %s %s;\n", result.c_str(), lhs.c_str(), op.c_str(), rhs.c_str() );
		}
	}
	else if( size_right > 1 ){
		// If LHS is a single value and RHS is an array
		for( i = 0; i < size_right; i++ ){
			rhs = popStack('R', type_right);
			pushStack(rhs, 'R', type_right);
		}
		lhs = popStack('E', type_left);
		for( i = 0; i < size_right; i++ ){
			rhs = popStack('R', type_right);
			result = newRegister(type_result);
			pushStack( result, 'E', type_result );
			if(checkBool) fprintf( oFile, "   handleBoolOp( %s, %s );\n", lhs.c_str(), rhs.c_str() );
			fprintf( oFile, "   %s = %s %s %s;\n", result.c_str(), lhs.c_str(), op.c_str(), rhs.c_str() );
		}
	}
	else{
		// If LHS and RHS are both single values
		rhs = popStack('E', type_right);
		lhs = popStack('E', type_left);
		result = newRegister(type_result);
		pushStack( result, 'E', type_result );
		if(checkBool) fprintf( oFile, "   handleBoolOp( %s, %s );\n", lhs.c_str(), rhs.c_str() );
		fprintf( oFile, "   %s = %s %s %s;\n", result.c_str(), lhs.c_str(), op.c_str(), rhs.c_str() );
	}
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x510, %rsp            # imm = 0x510
movq %rdx, -0x3a8(%rbp)
movq %rdi, -0x3a0(%rbp)
movq %rdi, %rax
movq %rax, -0x398(%rbp)
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x390(%rbp)
callq 0x19590
testb $0x1, %al
jne 0x1ac95
leaq -0x25(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x3430
movq -0x3a0(%rbp), %rdi
movq -0x3b0(%rbp), %rdx
leaq 0xc01b(%rip), %rsi      # 0x26c81
callq 0x62d0
jmp 0x1ac6d
leaq -0x25(%rbp), %rdi
callq 0x32e0
jmp 0x1ba6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x25(%rbp), %rdi
callq 0x32e0
jmp 0x1ba7c
leaq -0x58(%rbp), %rdi
callq 0x3370
leaq -0x78(%rbp), %rdi
callq 0x3370
movq -0x3a0(%rbp), %rdi
movb $0x0, -0x79(%rbp)
callq 0x3370
movb $0x0, -0x85(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x1accd
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x1acdc
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x390(%rbp), %rdi
callq 0x1ba90
movb %al, -0x3b1(%rbp)
jmp 0x1acf0
movb -0x3b1(%rbp), %al
testb $0x1, %al
jne 0x1acfc
jmp 0x1ad1d
movq -0x390(%rbp), %rdi
callq 0x1bad0
jmp 0x1ad0a
jmp 0x1ad1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1ba4c
movl -0x24(%rbp), %eax
cmpl 0x10(%rbp), %eax
je 0x1ad88
cmpl $0x10b, -0x24(%rbp)     # imm = 0x10B
je 0x1ad37
cmpl $0x10b, 0x10(%rbp)      # imm = 0x10B
jne 0x1ad43
movl $0x10b, -0x84(%rbp)     # imm = 0x10B
jmp 0x1ad86
cmpl $0x10c, -0x24(%rbp)     # imm = 0x10C
je 0x1ad55
cmpl $0x10c, 0x10(%rbp)      # imm = 0x10C
jne 0x1ad7a
movl $0x10c, -0x84(%rbp)     # imm = 0x10C
cmpl $0x10a, -0x24(%rbp)     # imm = 0x10A
je 0x1ad71
cmpl $0x10a, 0x10(%rbp)      # imm = 0x10A
jne 0x1ad78
movb $0x1, -0x85(%rbp)
jmp 0x1ad84
movl $0x10a, -0x84(%rbp)     # imm = 0x10A
jmp 0x1ad86
jmp 0x1ad91
movl -0x24(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x3a8(%rbp), %rdi
leaq 0xc35a(%rip), %rsi      # 0x270f9
callq 0x30d0
cmpl $0x0, %eax
jne 0x1adee
cmpl $0x10c, -0x24(%rbp)     # imm = 0x10C
je 0x1adbb
cmpl $0x10c, 0x10(%rbp)      # imm = 0x10C
jne 0x1add2
movq -0x3a8(%rbp), %rdi
leaq 0xc32f(%rip), %rsi      # 0x270f8
callq 0x3360
jmp 0x1add0
jmp 0x1ade9
movq -0x3a8(%rbp), %rdi
leaq 0xc319(%rip), %rsi      # 0x270f9
callq 0x3360
jmp 0x1ade7
jmp 0x1ade9
jmp 0x1aea6
movq -0x3a8(%rbp), %rdi
leaq 0xc300(%rip), %rsi      # 0x270fc
callq 0x30d0
cmpl $0x0, %eax
jne 0x1ae48
cmpl $0x10c, -0x24(%rbp)     # imm = 0x10C
je 0x1ae18
cmpl $0x10c, 0x10(%rbp)      # imm = 0x10C
jne 0x1ae2f
movq -0x3a8(%rbp), %rdi
leaq 0xc2d5(%rip), %rsi      # 0x270fb
callq 0x3360
jmp 0x1ae2d
jmp 0x1ae46
movq -0x3a8(%rbp), %rdi
leaq 0xc2bf(%rip), %rsi      # 0x270fc
callq 0x3360
jmp 0x1ae44
jmp 0x1ae46
jmp 0x1aea4
movq -0x3a8(%rbp), %rdi
leaq 0xa506(%rip), %rsi      # 0x2535c
callq 0x30d0
cmpl $0x0, %eax
jne 0x1aea2
cmpl $0x10c, -0x24(%rbp)     # imm = 0x10C
je 0x1ae72
cmpl $0x10c, 0x10(%rbp)      # imm = 0x10C
jne 0x1ae89
movq -0x3a8(%rbp), %rdi
leaq 0xbe30(%rip), %rsi      # 0x26cb0
callq 0x3360
jmp 0x1ae87
jmp 0x1aea0
movq -0x3a8(%rbp), %rdi
leaq 0xc267(%rip), %rsi      # 0x270fe
callq 0x3360
jmp 0x1ae9e
jmp 0x1aea0
jmp 0x1aea2
jmp 0x1aea4
jmp 0x1aea6
cmpl $0x1, -0x1c(%rbp)
jle 0x1b25e
cmpl $0x1, -0x20(%rbp)
jle 0x1b25e
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1af7d
movq -0x390(%rbp), %rsi
movl 0x10(%rbp), %ecx
leaq -0xa8(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1aeea
leaq -0x78(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
leaq -0xa8(%rbp), %rsi
movq %rsi, -0x3c8(%rbp)
callq 0x3340
movq -0x3c8(%rbp), %rdi
callq 0x31a0
movq -0x3c0(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x3130
jmp 0x1af29
movq -0x390(%rbp), %rdi
movl 0x10(%rbp), %ecx
leaq -0xc8(%rbp), %rsi
movl $0x52, %edx
callq 0x1a6b0
jmp 0x1af46
leaq -0xc8(%rbp), %rdi
callq 0x31a0
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1aec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1b040
movq -0x390(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0xe8(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1afad
leaq -0x58(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
leaq -0xe8(%rbp), %rsi
movq %rsi, -0x3d8(%rbp)
callq 0x3340
movq -0x3d8(%rbp), %rdi
callq 0x31a0
movq -0x3d0(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x3130
jmp 0x1afec
movq -0x390(%rbp), %rdi
movl -0x24(%rbp), %ecx
leaq -0x108(%rbp), %rsi
movl $0x4c, %edx
callq 0x1a6b0
jmp 0x1b009
leaq -0x108(%rbp), %rdi
callq 0x31a0
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1af84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1b259
movq -0x390(%rbp), %rsi
movl 0x10(%rbp), %ecx
leaq -0x128(%rbp), %rdi
movl $0x52, %edx
callq 0x1a7a0
jmp 0x1b070
leaq -0x78(%rbp), %rdi
leaq -0x128(%rbp), %rsi
movq %rsi, -0x3e0(%rbp)
callq 0x3340
movq -0x3e0(%rbp), %rdi
callq 0x31a0
movq -0x390(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0x148(%rbp), %rdi
movl $0x4c, %edx
callq 0x1a7a0
jmp 0x1b0b0
leaq -0x58(%rbp), %rdi
leaq -0x148(%rbp), %rsi
movq %rsi, -0x3e8(%rbp)
callq 0x3340
movq -0x3e8(%rbp), %rdi
callq 0x31a0
movq -0x390(%rbp), %rsi
movl -0x84(%rbp), %edx
leaq -0x168(%rbp), %rdi
callq 0x1baf0
jmp 0x1b0ee
movq -0x3a0(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movq %rsi, -0x3f0(%rbp)
callq 0x3340
movq -0x3f0(%rbp), %rdi
callq 0x31a0
movq -0x3a0(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x3130
jmp 0x1b129
movq -0x390(%rbp), %rdi
movl -0x84(%rbp), %ecx
leaq -0x188(%rbp), %rsi
movl $0x45, %edx
callq 0x1a6b0
jmp 0x1b149
leaq -0x188(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x85(%rbp)
je 0x1b1ca
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x400(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq %rax, -0x3f8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x400(%rbp), %rdi
movq -0x3f8(%rbp), %rdx
movq %rax, %rcx
leaq 0xbf5c(%rip), %rsi      # 0x27100
movb $0x0, %al
callq 0x3380
jmp 0x1b1ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movq -0x3a0(%rbp), %rdi
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x420(%rbp)
callq 0x3120
movq %rax, -0x418(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0x3a8(%rbp), %rdi
movq %rax, -0x410(%rbp)
callq 0x3120
movq %rax, -0x408(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x420(%rbp), %rdi
movq -0x418(%rbp), %rdx
movq -0x410(%rbp), %rcx
movq -0x408(%rbp), %r8
movq %rax, %r9
leaq 0xbed8(%rip), %rsi      # 0x2711c
movb $0x0, %al
callq 0x3380
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1b047
jmp 0x1ba22
cmpl $0x1, -0x1c(%rbp)
jle 0x1b542
movq -0x390(%rbp), %rsi
movl 0x10(%rbp), %ecx
leaq -0x1a8(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1b285
leaq -0x78(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x3340
leaq -0x1a8(%rbp), %rdi
callq 0x31a0
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1b364
movq -0x390(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0x1c8(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1b2d1
leaq -0x58(%rbp), %rdi
movq %rdi, -0x428(%rbp)
leaq -0x1c8(%rbp), %rsi
movq %rsi, -0x430(%rbp)
callq 0x3340
movq -0x430(%rbp), %rdi
callq 0x31a0
movq -0x428(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x3130
jmp 0x1b310
movq -0x390(%rbp), %rdi
movl -0x24(%rbp), %ecx
leaq -0x1e8(%rbp), %rsi
movl $0x4c, %edx
callq 0x1a6b0
jmp 0x1b32d
leaq -0x1e8(%rbp), %rdi
callq 0x31a0
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1b2a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1b53d
movq -0x390(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0x208(%rbp), %rdi
movl $0x4c, %edx
callq 0x1a7a0
jmp 0x1b394
leaq -0x58(%rbp), %rdi
leaq -0x208(%rbp), %rsi
movq %rsi, -0x438(%rbp)
callq 0x3340
movq -0x438(%rbp), %rdi
callq 0x31a0
movq -0x390(%rbp), %rsi
movl -0x84(%rbp), %edx
leaq -0x228(%rbp), %rdi
callq 0x1baf0
jmp 0x1b3d2
movq -0x3a0(%rbp), %rdi
leaq -0x228(%rbp), %rsi
movq %rsi, -0x440(%rbp)
callq 0x3340
movq -0x440(%rbp), %rdi
callq 0x31a0
movq -0x3a0(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq 0x3130
jmp 0x1b40d
movq -0x390(%rbp), %rdi
movl -0x84(%rbp), %ecx
leaq -0x248(%rbp), %rsi
movl $0x45, %edx
callq 0x1a6b0
jmp 0x1b42d
leaq -0x248(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x85(%rbp)
je 0x1b4ae
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x450(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq %rax, -0x448(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x450(%rbp), %rdi
movq -0x448(%rbp), %rdx
movq %rax, %rcx
leaq 0xbc78(%rip), %rsi      # 0x27100
movb $0x0, %al
callq 0x3380
jmp 0x1b4ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movq -0x3a0(%rbp), %rdi
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x470(%rbp)
callq 0x3120
movq %rax, -0x468(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0x3a8(%rbp), %rdi
movq %rax, -0x460(%rbp)
callq 0x3120
movq %rax, -0x458(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x470(%rbp), %rdi
movq -0x468(%rbp), %rdx
movq -0x460(%rbp), %rcx
movq -0x458(%rbp), %r8
movq %rax, %r9
leaq 0xbbf4(%rip), %rsi      # 0x2711c
movb $0x0, %al
callq 0x3380
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1b36b
jmp 0x1ba20
cmpl $0x1, -0x20(%rbp)
jle 0x1b826
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1b60f
movq -0x390(%rbp), %rsi
movl 0x10(%rbp), %ecx
leaq -0x268(%rbp), %rdi
movl $0x52, %edx
callq 0x1a7a0
jmp 0x1b57c
leaq -0x78(%rbp), %rdi
movq %rdi, -0x478(%rbp)
leaq -0x268(%rbp), %rsi
movq %rsi, -0x480(%rbp)
callq 0x3340
movq -0x480(%rbp), %rdi
callq 0x31a0
movq -0x478(%rbp), %rsi
leaq -0x288(%rbp), %rdi
callq 0x3130
jmp 0x1b5bb
movq -0x390(%rbp), %rdi
movl 0x10(%rbp), %ecx
leaq -0x288(%rbp), %rsi
movl $0x52, %edx
callq 0x1a6b0
jmp 0x1b5d8
leaq -0x288(%rbp), %rdi
callq 0x31a0
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1b553
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movq -0x390(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0x2a8(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1b62c
leaq -0x58(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x3340
leaq -0x2a8(%rbp), %rdi
callq 0x31a0
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1b821
movq -0x390(%rbp), %rsi
movl 0x10(%rbp), %ecx
leaq -0x2c8(%rbp), %rdi
movl $0x52, %edx
callq 0x1a7a0
jmp 0x1b678
leaq -0x78(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
movq %rsi, -0x488(%rbp)
callq 0x3340
movq -0x488(%rbp), %rdi
callq 0x31a0
movq -0x390(%rbp), %rsi
movl -0x84(%rbp), %edx
leaq -0x2e8(%rbp), %rdi
callq 0x1baf0
jmp 0x1b6b6
movq -0x3a0(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
movq %rsi, -0x490(%rbp)
callq 0x3340
movq -0x490(%rbp), %rdi
callq 0x31a0
movq -0x3a0(%rbp), %rsi
leaq -0x308(%rbp), %rdi
callq 0x3130
jmp 0x1b6f1
movq -0x390(%rbp), %rdi
movl -0x84(%rbp), %ecx
leaq -0x308(%rbp), %rsi
movl $0x45, %edx
callq 0x1a6b0
jmp 0x1b711
leaq -0x308(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x85(%rbp)
je 0x1b792
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x4a0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq %rax, -0x498(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x4a0(%rbp), %rdi
movq -0x498(%rbp), %rdx
movq %rax, %rcx
leaq 0xb994(%rip), %rsi      # 0x27100
movb $0x0, %al
callq 0x3380
jmp 0x1b792
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movq -0x3a0(%rbp), %rdi
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x4c0(%rbp)
callq 0x3120
movq %rax, -0x4b8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0x3a8(%rbp), %rdi
movq %rax, -0x4b0(%rbp)
callq 0x3120
movq %rax, -0x4a8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x4c0(%rbp), %rdi
movq -0x4b8(%rbp), %rdx
movq -0x4b0(%rbp), %rcx
movq -0x4a8(%rbp), %r8
movq %rax, %r9
leaq 0xb910(%rip), %rsi      # 0x2711c
movb $0x0, %al
callq 0x3380
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1b64f
jmp 0x1ba1e
movq -0x390(%rbp), %rsi
movl 0x10(%rbp), %ecx
leaq -0x328(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1b843
leaq -0x78(%rbp), %rdi
leaq -0x328(%rbp), %rsi
movq %rsi, -0x4c8(%rbp)
callq 0x3340
movq -0x4c8(%rbp), %rdi
callq 0x31a0
movq -0x390(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0x348(%rbp), %rdi
movl $0x45, %edx
callq 0x1a7a0
jmp 0x1b883
leaq -0x58(%rbp), %rdi
leaq -0x348(%rbp), %rsi
movq %rsi, -0x4d0(%rbp)
callq 0x3340
movq -0x4d0(%rbp), %rdi
callq 0x31a0
movq -0x390(%rbp), %rsi
movl -0x84(%rbp), %edx
leaq -0x368(%rbp), %rdi
callq 0x1baf0
jmp 0x1b8c1
movq -0x3a0(%rbp), %rdi
leaq -0x368(%rbp), %rsi
movq %rsi, -0x4d8(%rbp)
callq 0x3340
movq -0x4d8(%rbp), %rdi
callq 0x31a0
movq -0x3a0(%rbp), %rsi
leaq -0x388(%rbp), %rdi
callq 0x3130
jmp 0x1b8fc
movq -0x390(%rbp), %rdi
movl -0x84(%rbp), %ecx
leaq -0x388(%rbp), %rsi
movl $0x45, %edx
callq 0x1a6b0
jmp 0x1b91c
leaq -0x388(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x85(%rbp)
je 0x1b99d
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x4e8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq %rax, -0x4e0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x4e8(%rbp), %rdi
movq -0x4e0(%rbp), %rdx
movq %rax, %rcx
leaq 0xb789(%rip), %rsi      # 0x27100
movb $0x0, %al
callq 0x3380
jmp 0x1b99d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x31a0
jmp 0x1ba4c
movq -0x3a0(%rbp), %rdi
movq -0x390(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x508(%rbp)
callq 0x3120
movq %rax, -0x500(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0x3a8(%rbp), %rdi
movq %rax, -0x4f8(%rbp)
callq 0x3120
movq %rax, -0x4f0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3120
movq -0x508(%rbp), %rdi
movq -0x500(%rbp), %rdx
movq -0x4f8(%rbp), %rcx
movq -0x4f0(%rbp), %r8
movq %rax, %r9
leaq 0xb705(%rip), %rsi      # 0x2711c
movb $0x0, %al
callq 0x3380
jmp 0x1ba20
jmp 0x1ba22
movb $0x1, -0x79(%rbp)
testb $0x1, -0x79(%rbp)
jne 0x1ba38
movq -0x3a0(%rbp), %rdi
callq 0x31a0
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x58(%rbp), %rdi
callq 0x31a0
jmp 0x1ba6c
movq -0x3a0(%rbp), %rdi
callq 0x31a0
leaq -0x78(%rbp), %rdi
callq 0x31a0
leaq -0x58(%rbp), %rdi
callq 0x31a0
jmp 0x1ba7c
movq -0x398(%rbp), %rax
addq $0x510, %rsp            # imm = 0x510
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)