// File: /workspace/github_cpp_makefile_star2_O3/sangwoojun[P]rv32emulator/emulator.cpp
// Function: parse_pseudoinstructions(int, char*, instr*, int, label_loc*, char*, char*, char*, char*, source*)
int parse_pseudoinstructions(int line, char* ftok, instr* imem, int ioff, label_loc* labels, char* o1, char* o2, char* o3, char* o4, source* src) {

	if ( streq(ftok, "li" ) ) {
		if ( !o1 || !o2 || o3 ) print_syntax_error(line, "Invalid format");

		int reg = parse_reg(o1, line);
		long int imml = strtol(o2, NULL, 0);


		if (reg < 0 || imml > UINT32_MAX || imml < INT32_MIN ) {
			printf( "Syntax error at line %d -- %lx, %x\n", line, imml, INT32_MAX);
			exit(1);
		}
		uint64_t uv = *(uint64_t*)&imml;
		uint32_t hv = (uv&UINT32_MAX);

		char areg[4]; sprintf(areg, "x%02d", reg);
		char immu[12]; sprintf(immu, "0x%08x" , (hv>>12));
		char immd[12]; sprintf(immd, "0x%08x" , (hv&((1<<12)-1)));


		instr* i = &imem[ioff];
		i->op = LUI;
		i->a1.type = OPTYPE_REG; i->a1.reg = reg;
		i->a2.type = OPTYPE_IMM; i->a2.imm = hv>>12;
		i->orig_line = line;
		append_source("lui", areg, immu, NULL, src, i);
		instr* i2 = &imem[ioff+1];

		i2->op = ADDI;
		i2->a1.type = OPTYPE_REG; i2->a1.reg = reg;
		i2->a2.type = OPTYPE_REG; i2->a2.reg = reg;
		i2->a3.type = OPTYPE_IMM; i2->a3.imm = (hv&((1<<12)-1)); 
		i2->orig_line = line;
		append_source("addi", areg, areg, immd, src, i2);
		//printf( ">> %d %x %d\n", reg, i->a2.imm, i->a2.imm );
		//printf( ">> %d %x %d\n", reg, i2->a3.imm, i2->a3.imm );
		return 2;
	}
	if ( streq(ftok, "la") || streq(ftok, "lla") ) {
		if ( !o1 || !o2 || o3 ) print_syntax_error(line, "Invalid format");

		int reg = parse_reg(o1, line);

		instr* i = &imem[ioff];
		i->op = LUI;
		i->a1.type = OPTYPE_REG; i->a1.reg = reg;
		i->a2.type = OPTYPE_LABEL; strncpy(i->a2.label, o2, MAX_LABEL_LEN);
		i->orig_line = line;
		//append_source(ftok, o1, o2, o3, src, i); // done in normalize
		instr* i2 = &imem[ioff+1];
		i2->op = ADDI;
		i2->a1.type = OPTYPE_REG; i2->a1.reg = reg;
		i2->a2.type = OPTYPE_REG; i2->a2.reg = reg;
		i2->a3.type = OPTYPE_LABEL; strncpy(i2->a3.label, o2, MAX_LABEL_LEN);
		i2->orig_line = line;
		//append_source(ftok, o1, o2, o3, src, i2); // done in normalize
		return 2;
	}
	if ( streq(ftok, "nop" )) {
		if ( o1 ) print_syntax_error(line, "Invalid format");

		instr* i = &imem[ioff];
		i->op = ADDI;
		i->a1.type = OPTYPE_REG; i->a1.reg = 0;
		i->a2.type = OPTYPE_REG; i->a2.reg = 0;
		i->a3.type = OPTYPE_IMM; i->a3.imm = 0;
		i->orig_line = line;
		append_source("nop", "zero", "zero", "0", src, i);
		return 1;
	}
	if ( streq(ftok, "ret" )) {
		if ( o1 ) print_syntax_error(line, "Invalid format");

		instr* i = &imem[ioff];
		i->op = JALR;
		i->a1.type = OPTYPE_REG; i->a1.reg = 0;
		i->a2.type = OPTYPE_REG; i->a2.reg = 1;
		i->a3.type = OPTYPE_IMM; i->a3.imm = 0;
		i->orig_line = line;
		append_source("jalr", "x0", "x1", "x0", src, i);
		return 1;
	}
	if ( streq(ftok, "jr" )) {
		if ( !o1 || o2 ) print_syntax_error(line, "Invalid format");

		instr* i = &imem[ioff];
		i->op = JALR;
		i->a1.type = OPTYPE_REG; i->a1.reg = 0;
		i->a2.type = OPTYPE_REG; i->a2.reg = parse_reg(o1, line);
		i->a3.type = OPTYPE_IMM; i->a3.imm = 0;
		i->orig_line = line;
		append_source("jalr", "x0", o1, "x0", src, i);
		return 1;
	}
	if ( streq(ftok, "j" )) {
		if ( !o1 || o2 ) print_syntax_error(line, "Invalid format");

		instr* i = &imem[ioff];
		i->op = JAL;
		i->a1.type = OPTYPE_REG; i->a1.reg = 0;
		i->a2.type = OPTYPE_LABEL; strncpy(i->a2.label, o1, MAX_LABEL_LEN);
		i->orig_line = line;
		append_source("j", "x0", o1, NULL, src, i);
		return 1;
	}
	if ( streq(ftok, "call" )) {
		if ( !o1 || o2 ) print_syntax_error(line, "Invalid format");

		instr* i = &imem[ioff];
		i->op = JAL;
		i->a1.type = OPTYPE_REG; i->a1.reg = 1;
		i->a2.type = OPTYPE_LABEL; strncpy(i->a2.label, o1, MAX_LABEL_LEN);
		i->orig_line = line;
		append_source("jal", "x1", o1, NULL, src, i);
		return 1;
	}
	if ( streq(ftok, "mv" )) {
		if ( !o1 || !o2 || o3 ) print_syntax_error(line, "Invalid format");
		instr* i = &imem[ioff];
		i->op = ADDI;
		i->a1.type = OPTYPE_REG; i->a1.reg = parse_reg(o1, line);
		i->a2.type = OPTYPE_REG; i->a2.reg = parse_reg(o2, line);
		i->a3.type = OPTYPE_IMM; i->a3.imm = 0;
		i->orig_line = line;
		append_source("addi",o1, o2, NULL, src, i);
		return 1;
	}
	if ( streq(ftok, "bnez" )) {
		if ( !o1 || !o2 || o3 ) print_syntax_error(line, "Invalid format");
		instr* i = &imem[ioff];
		i->op = BNE;
		i->a1.type = OPTYPE_REG; i->a1.reg = parse_reg(o1, line);
		i->a2.type = OPTYPE_REG; i->a2.reg = 0;
		i->a3.type = OPTYPE_LABEL; strncpy(i->a3.label, o2, MAX_LABEL_LEN);
		i->orig_line = line;
		append_source("bne", "x0", o1, o2, src, i);
		return 1;
	}
	if ( streq(ftok, "beqz" )) {
		if ( !o1 || !o2 || o3 ) print_syntax_error(line, "Invalid format");
		instr* i = &imem[ioff];
		i->op = BEQ;
		i->a1.type = OPTYPE_REG; i->a1.reg = parse_reg(o1, line);
		i->a2.type = OPTYPE_REG; i->a2.reg = 0;
		i->a3.type = OPTYPE_LABEL; strncpy(i->a3.label, o2, MAX_LABEL_LEN);
		i->orig_line = line;
		append_source("beq", "x0", o1, o2, src, i);
		return 1;
	}
	if ( streq(ftok, "bgt" )) {
		if ( !o1 || !o2 || !o3 || o4 ) print_syntax_error(line, "Invalid format");
		instr* i = &imem[ioff];
		i->op = BLT;
		i->a1.type = OPTYPE_REG; i->a2.reg = parse_reg(o1, line);
		i->a2.type = OPTYPE_REG; i->a1.reg = parse_reg(o2, line);
		i->a3.type = OPTYPE_LABEL; strncpy(i->a3.label, o3, MAX_LABEL_LEN);
		i->orig_line = line;
		append_source("blt", o2, o1, o3, src, i);
		return 1;
	}
	if ( streq(ftok, "ble" )) {
		if ( !o1 || !o2 || !o3 || o4 ) print_syntax_error(line, "Invalid format");
		instr* i = &imem[ioff];
		i->op = BGE;
		i->a1.type = OPTYPE_REG; i->a2.reg = parse_reg(o1, line);
		i->a2.type = OPTYPE_REG; i->a1.reg = parse_reg(o2, line);
		i->a3.type = OPTYPE_LABEL; strncpy(i->a3.label, o3, MAX_LABEL_LEN);
		i->orig_line = line;
		append_source("bge", o2, o1, o3, src, i);
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movl %ecx, %r14d
movq %rdx, -0x40(%rbp)
movq %rsi, %r13
movl %edi, -0x2c(%rbp)
movq 0x10(%rbp), %r12
movb (%rsi), %bl
cmpb $0x6c, %bl
jne 0x38c5
cmpb $0x69, 0x1(%r13)
jne 0x38b3
cmpb $0x0, 0x2(%r13)
je 0x3c53
cmpb $0x61, 0x1(%r13)
jne 0x38c5
cmpb $0x0, 0x2(%r13)
je 0x3948
leaq 0x7ead(%rip), %rsi      # 0xb779
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3948
leaq 0x7e9e(%rip), %rsi      # 0xb77d
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3a1c
leaq 0x7e8b(%rip), %rsi      # 0xb781
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3a91
cmpb $0x6a, %bl
jne 0x3b0a
cmpb $0x72, 0x1(%r13)
jne 0x3921
cmpb $0x0, 0x2(%r13)
je 0x4025
cmpb $0x0, 0x1(%r13)
je 0x3ef4
leaq 0x7e5a(%rip), %rsi      # 0xb78d
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
jne 0x3b38
jmp 0x3de1
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
jne 0x424b
movq %r15, %rdi
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, %ebx
movslq %r14d, %rax
imulq $0x98, %rax, %r15
movabsq $0x100000012, %rax      # imm = 0x100000012
movq -0x40(%rbp), %r13
leaq (%r15,%r13), %r14
addq $0x34, %r14
movq %rax, -0x34(%r14)
movl %ebx, -0xc(%r14)
movl $0x3, %eax
movl %eax, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq 0x10(%rbp), %rsi
callq 0x2100
movl %r12d, 0x5c(%r14)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x64(%r14)
movl %ebx, 0x8c(%r14)
movl $0x1, 0x94(%r14)
movl %ebx, 0xb8(%r14)
movl $0x3, %eax
movl %eax, 0xc0(%r14)
leaq 0xf8(%r13,%r15), %rbx
movl $0x20, %edx
movq %rbx, %rdi
movq 0x10(%rbp), %rsi
callq 0x2100
movl %r12d, 0x30(%rbx)
movl $0x2, %r13d
jmp 0x4188
testq %r15, %r15
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %r9
movabsq $0x100000002, %rcx      # imm = 0x100000002
movq %rcx, (%rdx,%rax)
xorl %ecx, %ecx
movl %ecx, 0x28(%rdx,%rax)
movl $0x1, 0x30(%rdx,%rax)
movl %ecx, 0x54(%rdx,%rax)
movl $0x2, 0x5c(%rdx,%rax)
movl %ecx, 0x84(%rdx,%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, 0x90(%rdx,%rax)
leaq 0x7d06(%rip), %rdi      # 0xb77d
leaq 0x7c88(%rip), %rdx      # 0xb706
leaq 0x7b86(%rip), %rcx      # 0xb60b
movq %rdx, %rsi
movq 0x28(%rbp), %r8
jmp 0x3f6f
testq %r15, %r15
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %r9
movabsq $0x10000000d, %rcx      # imm = 0x10000000D
movq %rcx, (%rdx,%rax)
xorl %ecx, %ecx
movl %ecx, 0x28(%rdx,%rax)
movl $0x1, %r13d
movl %r13d, 0x30(%rdx,%rax)
movl %r13d, 0x54(%rdx,%rax)
movl $0x2, 0x5c(%rdx,%rax)
movl %ecx, 0x84(%rdx,%rax)
movl -0x2c(%rbp), %ecx
movl %ecx, 0x90(%rdx,%rax)
leaq 0x7aee(%rip), %rdi      # 0xb5de
leaq 0x7c91(%rip), %rdx      # 0xb788
leaq 0x7c87(%rip), %rcx      # 0xb785
movq %rcx, %rsi
movq 0x28(%rbp), %r8
jmp 0x4183
leaq 0x7c7c(%rip), %rsi      # 0xb78d
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3de1
cmpb $0x6d, %bl
jne 0x3b38
cmpb $0x76, 0x1(%r13)
jne 0x3b38
cmpb $0x0, 0x2(%r13)
je 0x419a
leaq 0x7c53(%rip), %rsi      # 0xb792
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3e55
leaq 0x7c41(%rip), %rsi      # 0xb797
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3f7f
movq 0x20(%rbp), %rbx
leaq 0x7c2b(%rip), %rsi      # 0xb79c
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x40be
leaq 0x7c18(%rip), %rsi      # 0xb7a0
movq %r13, %rdi
callq 0x2280
xorl %r13d, %r13d
testl %eax, %eax
jne 0x4188
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
je 0x424b
testq %rbx, %rbx
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %rcx
movq %rcx, -0x38(%rbp)
movabsq $0x100000007, %rcx      # imm = 0x100000007
leaq 0x60(%rdx,%rax), %r14
movq %rcx, -0x60(%r14)
movl $0x1, %r13d
movq %r15, %rdi
movq %r12, %rbx
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, -0xc(%r14)
movl $0x1, -0x30(%r14)
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, -0x38(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq 0x18(%rbp), %rbx
movq %rbx, %rsi
callq 0x2100
movl %r12d, 0x30(%r14)
leaq 0x7976(%rip), %rdi      # 0xb5c4
jmp 0x4171
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
jne 0x424b
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, %r15d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2290
movq %rax, %rbx
testl %r15d, %r15d
js 0x426d
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rbx, %rcx
addq %rax, %rcx
movabsq $-0x180000001, %rax     # imm = 0xFFFFFFFE7FFFFFFF
cmpq %rax, %rcx
jbe 0x426d
leaq 0x7aa7(%rip), %rsi      # 0xb76c
leaq -0x44(%rbp), %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2060
movq %rbx, %r12
shrl $0xc, %ebx
leaq 0x7a92(%rip), %r13      # 0xb772
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2060
movq %r12, %rdx
andl $0xfff, %edx            # imm = 0xFFF
movq %rdx, -0x38(%rbp)
leaq -0x54(%rbp), %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x2060
movslq %r14d, %rax
movl %r15d, %ecx
movl %r15d, -0x48(%rbp)
imulq $0x98, %rax, %r15
movq -0x40(%rbp), %r12
leaq (%r12,%r15), %r14
movabsq $0x100000012, %rax      # imm = 0x100000012
movq %rax, (%r12,%r15)
movl %ecx, 0x28(%r12,%r15)
movl $0x2, %r13d
movl %r13d, 0x30(%r12,%r15)
movl %ebx, 0x58(%r12,%r15)
movl -0x2c(%rbp), %ebx
movl %ebx, 0x90(%r12,%r15)
leaq 0x7890(%rip), %rdi      # 0xb5e9
leaq -0x44(%rbp), %rsi
leaq -0x60(%rbp), %rdx
xorl %ecx, %ecx
movq 0x28(%rbp), %r8
movq %r14, %r9
callq 0x346e
addq $0x98, %r14
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x98(%r12,%r15)
movl -0x48(%rbp), %eax
movl %eax, 0xc0(%r12,%r15)
movl $0x1, 0xc8(%r12,%r15)
movl %eax, 0xec(%r12,%r15)
movl %r13d, 0xf4(%r12,%r15)
movq -0x38(%rbp), %rax
movl %eax, 0x11c(%r12,%r15)
movl %ebx, 0x128(%r12,%r15)
leaq 0x77c5(%rip), %rdi      # 0xb58f
leaq -0x44(%rbp), %rdx
movq %rdx, %rsi
leaq -0x54(%rbp), %rcx
movq 0x28(%rbp), %r8
movq %r14, %r9
jmp 0x4183
testq %r15, %r15
je 0x424b
testq %r12, %r12
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %rbx
movabsq $0x10000000c, %rcx      # imm = 0x10000000C
leaq (%rdx,%rax), %r14
addq $0x34, %r14
movq %rcx, -0x34(%r14)
movl $0x1, -0xc(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
movl -0x2c(%rbp), %eax
movl %eax, 0x5c(%r14)
leaq 0x7791(%rip), %rdi      # 0xb5da
leaq 0x7938(%rip), %rsi      # 0xb788
jmp 0x3f63
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %rcx
movq %rcx, -0x38(%rbp)
movabsq $0x10000000b, %rcx      # imm = 0x10000000B
leaq 0x60(%rdx,%rax), %r14
movq %rcx, -0x60(%r14)
movl $0x1, %r13d
movq %r15, %rdi
movq %r12, %rbx
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, -0x38(%r14)
movl $0x1, -0x30(%r14)
movl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2100
movl %r12d, 0x30(%r14)
leaq 0x76e7(%rip), %rdi      # 0xb5d6
jmp 0x4019
testq %r15, %r15
je 0x424b
testq %r12, %r12
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %rbx
movabsq $0x10000000c, %rcx      # imm = 0x10000000C
leaq (%rdx,%rax), %r14
addq $0x34, %r14
movq %rcx, -0x34(%r14)
movl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
movl -0x2c(%rbp), %eax
movl %eax, 0x5c(%r14)
leaq 0x782f(%rip), %rdi      # 0xb78b
leaq 0x7822(%rip), %rsi      # 0xb785
movq %r15, %rdx
xorl %ecx, %ecx
movq 0x28(%rbp), %r8
movq %rbx, %r9
callq 0x346e
movl $0x1, %r13d
jmp 0x4188
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %rcx
movq %rcx, -0x38(%rbp)
movabsq $0x100000006, %rcx      # imm = 0x100000006
leaq 0x60(%rdx,%rax), %r14
movq %rcx, -0x60(%r14)
movl $0x1, %r13d
movq %r15, %rdi
movq %r12, %rbx
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, -0x38(%r14)
movl $0x1, -0x30(%r14)
movl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2100
movl %r12d, 0x30(%r14)
leaq 0x75a7(%rip), %rdi      # 0xb5c0
leaq 0x7765(%rip), %rsi      # 0xb785
jmp 0x4175
testq %r15, %r15
je 0x424b
testq %r12, %r12
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %r14
movq -0x40(%rbp), %rbx
leaq (%rbx,%r14), %rax
movq %rax, -0x38(%rbp)
movabsq $0x10000000d, %rax      # imm = 0x10000000D
movq %rax, (%rbx,%r14)
xorl %eax, %eax
movl %eax, 0x28(%rbx,%r14)
movl $0x1, 0x30(%rbx,%r14)
movl $0x1, %r13d
movq %r15, %rdi
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, 0x54(%rbx,%r14)
movl $0x2, 0x5c(%rbx,%r14)
xorl %eax, %eax
movl %eax, 0x84(%rbx,%r14)
movl %r12d, 0x90(%rbx,%r14)
leaq 0x7532(%rip), %rdi      # 0xb5de
leaq 0x76d2(%rip), %rcx      # 0xb785
movq %rcx, %rsi
movq %r15, %rdx
jmp 0x417b
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
je 0x424b
testq %rbx, %rbx
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %rax
movq -0x40(%rbp), %rdx
leaq (%rdx,%rax), %rcx
movq %rcx, -0x38(%rbp)
movabsq $0x100000009, %rcx      # imm = 0x100000009
leaq 0x60(%rdx,%rax), %r14
movq %rcx, -0x60(%r14)
movl $0x1, %r13d
movq %r15, %rdi
movq %r12, %rbx
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, -0xc(%r14)
movl $0x1, -0x30(%r14)
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, -0x38(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq 0x18(%rbp), %rbx
movq %rbx, %rsi
callq 0x2100
movl %r12d, 0x30(%r14)
leaq 0x745c(%rip), %rdi      # 0xb5cd
movq 0x10(%rbp), %rsi
movq %r15, %rdx
movq %rbx, %rcx
movq 0x28(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x346e
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
je 0x424b
testq %r12, %r12
je 0x424b
cmpq $0x0, 0x18(%rbp)
jne 0x424b
movslq %r14d, %rax
imulq $0x98, %rax, %r14
movq -0x40(%rbp), %rbx
leaq (%rbx,%r14), %rax
movq %rax, -0x38(%rbp)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, (%rbx,%r14)
movl $0x1, %r13d
movq %r15, %rdi
movl -0x2c(%rbp), %r12d
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, 0x28(%rbx,%r14)
movl $0x1, 0x30(%rbx,%r14)
movq 0x10(%rbp), %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d50
movl %eax, 0x54(%rbx,%r14)
movl $0x2, 0x5c(%rbx,%r14)
movl $0x0, 0x84(%rbx,%r14)
movl %r12d, 0x90(%rbx,%r14)
leaq 0x7352(%rip), %rdi      # 0xb58f
movq %r15, %rsi
movq 0x10(%rbp), %rdx
xorl %ecx, %ecx
jmp 0x417b
leaq 0x72ee(%rip), %rdi      # 0xb540
leaq 0x74e0(%rip), %rdx      # 0xb739
movl -0x2c(%rbp), %esi
xorl %eax, %eax
callq 0x2040
movl $0x1, %edi
callq 0x2210
leaq 0x74d4(%rip), %rdi      # 0xb748
movl -0x2c(%rbp), %esi
movq %rbx, %rdx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %eax, %eax
callq 0x2040
jmp 0x4263