// File: /workspace/github_cpp_makefile_star2_O1/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, -0x30(%rbp)
movq %rdx, %rbx
movq %rsi, %r13
movl %edi, %r12d
movq 0x28(%rbp), %r14
leaq 0x7d14(%rip), %rsi      # 0xb5ab
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3b4a
leaq 0x7f32(%rip), %rsi      # 0xb7e0
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3a73
leaq 0x7f1a(%rip), %rsi      # 0xb7df
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3a73
leaq 0x7f07(%rip), %rsi      # 0xb7e3
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3cea
leaq 0x7ef4(%rip), %rsi      # 0xb7e7
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3d59
leaq 0x7ee7(%rip), %rsi      # 0xb7f1
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3dcc
leaq 0x7ed3(%rip), %rsi      # 0xb7f4
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3e66
leaq 0x7ebe(%rip), %rsi      # 0xb7f6
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3ed5
leaq 0x7eac(%rip), %rsi      # 0xb7fb
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x3f6a
leaq 0x7e98(%rip), %rsi      # 0xb7fe
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x401e
leaq 0x7e86(%rip), %rsi      # 0xb803
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x40b1
movq 0x20(%rbp), %r14
leaq 0x7e70(%rip), %rsi      # 0xb808
movq %r13, %rdi
callq 0x2280
testl %eax, %eax
je 0x415e
leaq 0x7e5d(%rip), %rsi      # 0xb80c
movq %r13, %rdi
callq 0x2280
xorl %r13d, %r13d
testl %eax, %eax
jne 0x3f58
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
je 0x4226
cmpq $0x0, 0x18(%rbp)
je 0x4226
testq %r14, %r14
jne 0x4226
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
leaq (%rbx,%rax), %rcx
movq %rcx, -0x30(%rbp)
movabsq $0x100000007, %rcx      # imm = 0x100000007
leaq (%rbx,%rax), %r14
addq $0x60, %r14
movq %rcx, -0x60(%r14)
movq %r15, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, -0xc(%r14)
movl $0x1, -0x30(%r14)
movq 0x10(%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
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 0x7b68(%rip), %rdi      # 0xb5d6
jmp 0x420a
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
je 0x4226
cmpq $0x0, 0x18(%rbp)
jne 0x4226
movq %rbx, %r14
movq %r15, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, %ebx
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %r15
movabsq $0x100000012, %rax      # imm = 0x100000012
movl %r12d, %r13d
movq %r14, %r12
addq %r15, %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 %r13d, 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(%r12,%r15), %rbx
movl $0x20, %edx
movq %rbx, %rdi
movq 0x10(%rbp), %rsi
callq 0x2100
movl %r13d, 0x30(%rbx)
movl $0x2, %r13d
jmp 0x3f58
movq %rbx, -0x48(%rbp)
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
je 0x4226
cmpq $0x0, 0x18(%rbp)
jne 0x4226
movq %r15, %rdi
movl %r12d, -0x34(%rbp)
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, %ebx
movq 0x10(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2290
movq %rax, %r15
testl %ebx, %ebx
js 0x4240
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %r15, %rcx
addq %rax, %rcx
movabsq $-0x180000001, %rax     # imm = 0xFFFFFFFE7FFFFFFF
cmpq %rax, %rcx
jbe 0x4240
leaq 0x7c0d(%rip), %rsi      # 0xb7d2
leaq -0x38(%rbp), %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2060
movl %r15d, %r14d
shrl $0xc, %r14d
leaq 0x7bf8(%rip), %r13      # 0xb7d8
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2060
andl $0xfff, %r15d           # imm = 0xFFF
leaq -0x54(%rbp), %rdi
movq %r13, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2060
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %r12
movl %ebx, %ecx
movl %ebx, -0x3c(%rbp)
movq -0x48(%rbp), %rbx
leaq (%rbx,%r12), %r13
movabsq $0x100000012, %rax      # imm = 0x100000012
movq %rax, (%rbx,%r12)
movl %ecx, 0x28(%rbx,%r12)
movl $0x2, %eax
movl %eax, 0x30(%rbx,%r12)
movl %r14d, 0x58(%rbx,%r12)
movl -0x34(%rbp), %r14d
movl %r14d, 0x90(%rbx,%r12)
leaq 0x79a5(%rip), %rdi      # 0xb5fb
leaq -0x38(%rbp), %rsi
leaq -0x60(%rbp), %rdx
xorl %ecx, %ecx
movq 0x28(%rbp), %r8
movq %r13, %r9
callq 0x3446
addq $0x98, %r13
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x98(%rbx,%r12)
movl -0x3c(%rbp), %eax
movl %eax, 0xc0(%rbx,%r12)
movl $0x1, 0xc8(%rbx,%r12)
movl %eax, 0xec(%rbx,%r12)
movl $0x2, %eax
movl %eax, 0xf4(%rbx,%r12)
movl %r15d, 0x11c(%rbx,%r12)
movl %r14d, 0x128(%rbx,%r12)
leaq 0x78c7(%rip), %rdi      # 0xb58f
leaq -0x38(%rbp), %rdx
movq %rdx, %rsi
leaq -0x54(%rbp), %rcx
movq 0x28(%rbp), %r8
movq %r13, %r9
movl $0x2, %r13d
callq 0x3446
jmp 0x3f58
testq %r15, %r15
jne 0x4226
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
leaq (%rbx,%rax), %r9
movabsq $0x100000002, %rcx      # imm = 0x100000002
movq %rcx, (%rbx,%rax)
xorl %ecx, %ecx
movl %ecx, 0x28(%rbx,%rax)
movl $0x1, 0x30(%rbx,%rax)
movl %ecx, 0x54(%rbx,%rax)
movl $0x2, 0x5c(%rbx,%rax)
movl %ecx, 0x84(%rbx,%rax)
movl %r12d, 0x90(%rbx,%rax)
leaq 0x7aa3(%rip), %rdi      # 0xb7e3
leaq 0x7a25(%rip), %rdx      # 0xb76c
leaq 0x7917(%rip), %rcx      # 0xb665
movq %rdx, %rsi
movq %r14, %r8
jmp 0x3f4d
testq %r15, %r15
jne 0x4226
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
leaq (%rbx,%rax), %r9
movabsq $0x10000000d, %rcx      # imm = 0x10000000D
movq %rcx, (%rbx,%rax)
xorl %ecx, %ecx
movl %ecx, 0x28(%rbx,%rax)
movl $0x1, %r13d
movl %r13d, 0x30(%rbx,%rax)
movl %r13d, 0x54(%rbx,%rax)
movl $0x2, 0x5c(%rbx,%rax)
movl %ecx, 0x84(%rbx,%rax)
movl %r12d, 0x90(%rbx,%rax)
leaq 0x783d(%rip), %rdi      # 0xb5f0
leaq 0x7a34(%rip), %rdx      # 0xb7ee
leaq 0x7a2a(%rip), %rcx      # 0xb7eb
movq %rcx, %rsi
movq %r14, %r8
jmp 0x3ce0
movl %r12d, %r13d
testq %r15, %r15
je 0x4263
cmpq $0x0, 0x10(%rbp)
jne 0x4263
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %r14
leaq (%rbx,%r14), %r12
movabsq $0x10000000d, %rax      # imm = 0x10000000D
movq %rax, (%rbx,%r14)
xorl %eax, %eax
movl %eax, 0x28(%rbx,%r14)
movl $0x1, 0x30(%rbx,%r14)
movq %r15, %rdi
movl %r13d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, 0x54(%rbx,%r14)
movl $0x2, 0x5c(%rbx,%r14)
xorl %eax, %eax
movl %eax, 0x84(%rbx,%r14)
movl %r13d, 0x90(%rbx,%r14)
movl $0x1, %r13d
leaq 0x77a3(%rip), %rdi      # 0xb5f0
leaq 0x7997(%rip), %rcx      # 0xb7eb
movq %rcx, %rsi
movq %r15, %rdx
movq 0x28(%rbp), %r8
movq %r12, %r9
jmp 0x3ce0
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
jne 0x4226
movq %r14, %r13
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
movq %rbx, %rdx
addq %rax, %rbx
movabsq $0x10000000c, %rcx      # imm = 0x10000000C
leaq 0x34(%rdx,%rax), %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 %r12d, 0x5c(%r14)
leaq 0x7928(%rip), %rdi      # 0xb7f4
leaq 0x7918(%rip), %rsi      # 0xb7eb
jmp 0x3f42
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
jne 0x4226
movq %r14, %r13
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
movq %rbx, %rdx
addq %rax, %rbx
movabsq $0x10000000c, %rcx      # imm = 0x10000000C
leaq 0x34(%rdx,%rax), %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 %r12d, 0x5c(%r14)
leaq 0x76b1(%rip), %rdi      # 0xb5ec
leaq 0x78ac(%rip), %rsi      # 0xb7ee
movq %r15, %rdx
xorl %ecx, %ecx
movq %r13, %r8
movq %rbx, %r9
callq 0x3446
movl $0x1, %r13d
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, %r13d
testq %r15, %r15
je 0x4263
cmpq $0x0, 0x10(%rbp)
je 0x4263
cmpq $0x0, 0x18(%rbp)
jne 0x4263
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %r14
movq %rbx, %r12
leaq (%rbx,%r14), %rax
movq %rax, -0x30(%rbp)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, (%rbx,%r14)
movq %r15, %rdi
movl %r13d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, 0x28(%rbx,%r14)
movl $0x1, 0x30(%rbx,%r14)
movq 0x10(%rbp), %rbx
movq %rbx, %rdi
movl %r13d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, 0x54(%r12,%r14)
movl $0x2, 0x5c(%r12,%r14)
movl $0x0, 0x84(%r12,%r14)
movl %r13d, 0x90(%r12,%r14)
movl $0x1, %r13d
leaq 0x757e(%rip), %rdi      # 0xb58f
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
jmp 0x4219
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
je 0x4226
cmpq $0x0, 0x18(%rbp)
jne 0x4226
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
movq %rbx, %rdx
addq %rax, %rbx
movabsq $0x10000000b, %rcx      # imm = 0x10000000B
leaq 0x60(%rdx,%rax), %r14
movq %rcx, -0x60(%r14)
movq %r15, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, -0x38(%r14)
movl $0x1, -0x30(%r14)
movl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq 0x10(%rbp), %r13
movq %r13, %rsi
callq 0x2100
movl %r12d, 0x30(%r14)
leaq 0x753c(%rip), %rdi      # 0xb5e8
jmp 0x413f
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
je 0x4226
cmpq $0x0, 0x18(%rbp)
jne 0x4226
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
movq %rbx, %rdx
addq %rax, %rbx
movabsq $0x100000006, %rcx      # imm = 0x100000006
leaq 0x60(%rdx,%rax), %r14
movq %rcx, -0x60(%r14)
movq %r15, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, -0x38(%r14)
movl $0x1, -0x30(%r14)
movl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
movl $0x20, %edx
movq %r14, %rdi
movq 0x10(%rbp), %r13
movq %r13, %rsi
callq 0x2100
movl %r12d, 0x30(%r14)
leaq 0x7493(%rip), %rdi      # 0xb5d2
leaq 0x76a5(%rip), %rsi      # 0xb7eb
movq %r15, %rdx
movq %r13, %rcx
movl $0x1, %r13d
movq 0x28(%rbp), %r8
movq %rbx, %r9
jmp 0x3ce0
testq %r15, %r15
je 0x4226
cmpq $0x0, 0x10(%rbp)
je 0x4226
cmpq $0x0, 0x18(%rbp)
je 0x4226
testq %r14, %r14
jne 0x4226
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
leaq (%rbx,%rax), %rcx
movq %rcx, -0x30(%rbp)
movabsq $0x100000009, %rcx      # imm = 0x100000009
leaq (%rbx,%rax), %r14
addq $0x60, %r14
movq %rcx, -0x60(%r14)
movq %r15, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
movl %eax, -0xc(%r14)
movl $0x1, -0x30(%r14)
movq 0x10(%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl $0x1, %edx
callq 0x2d17
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 0x73d5(%rip), %rdi      # 0xb5df
movq %r13, %rsi
movl $0x1, %r13d
movq %r15, %rdx
movq %rbx, %rcx
movq 0x28(%rbp), %r8
movq -0x30(%rbp), %r9
jmp 0x3ce0
leaq 0x7313(%rip), %rdi      # 0xb540
leaq 0x756b(%rip), %rdx      # 0xb79f
movl %r12d, %esi
xorl %eax, %eax
callq 0x2040
jmp 0x4259
leaq 0x7567(%rip), %rdi      # 0xb7ae
movl -0x34(%rbp), %esi
movq %r15, %rdx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %eax, %eax
callq 0x2040
movl $0x1, %edi
callq 0x2210
leaq 0x72d6(%rip), %rdi      # 0xb540
leaq 0x752e(%rip), %rdx      # 0xb79f
movl %r13d, %esi
jmp 0x4237