// File: /workspace/github_cpp_makefile_star2_O2/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 0x6f5d(%rip), %rsi      # 0xa5ab
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x37f4
testq %r15, %r15
movq 0x10(%rbp), %r14
je 0x3f72
testq %r14, %r14
je 0x3f72
cmpq $0x0, 0x18(%rbp)
jne 0x3f72
movq %rbx, -0x48(%rbp)
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %r12d, -0x34(%rbp)
movl %r12d, %esi
callq 0x2c37
movl %eax, %ebx
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22b0
movq %rax, %r15
testl %ebx, %ebx
js 0x3f81
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %r15, %rcx
addq %rax, %rcx
movabsq $-0x180000001, %rax     # imm = 0xFFFFFFFE7FFFFFFF
cmpq %rax, %rcx
jbe 0x3f81
leaq 0x70fa(%rip), %rsi      # 0xa7d2
leaq -0x3c(%rbp), %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2060
movl %ebx, -0x38(%rbp)
movl %r15d, %ebx
shrl $0xc, %ebx
leaq 0x70e3(%rip), %r13      # 0xa7d8
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
movl %ebx, %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
movq -0x48(%rbp), %r14
leaq (%r14,%r12), %r13
movabsq $0x100000012, %rax      # imm = 0x100000012
movq %rax, (%r14,%r12)
movl -0x38(%rbp), %eax
movl %eax, 0x28(%r14,%r12)
pushq $0x2
popq %rax
movl %eax, 0x30(%r14,%r12)
movl %ebx, 0x58(%r14,%r12)
movl -0x34(%rbp), %ebx
movl %ebx, 0x90(%r14,%r12)
leaq 0x6e96(%rip), %rdi      # 0xa5fb
leaq -0x3c(%rbp), %rsi
leaq -0x60(%rbp), %rdx
xorl %ecx, %ecx
movq 0x28(%rbp), %r8
movq %r13, %r9
callq 0x3280
addq $0x98, %r13
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x98(%r14,%r12)
movl -0x38(%rbp), %eax
movl %eax, 0xc0(%r14,%r12)
movl $0x1, 0xc8(%r14,%r12)
movl %eax, 0xec(%r14,%r12)
pushq $0x2
popq %rax
movl %eax, 0xf4(%r14,%r12)
movl %r15d, 0x11c(%r14,%r12)
movl %ebx, 0x128(%r14,%r12)
leaq 0x6dba(%rip), %rdi      # 0xa58f
leaq -0x3c(%rbp), %rdx
movq %rdx, %rsi
leaq -0x54(%rbp), %rcx
movq 0x28(%rbp), %r8
movq %r13, %r9
movl %eax, %r13d
callq 0x3280
jmp 0x38e2
leaq 0x6fe5(%rip), %rsi      # 0xa7e0
movq %r13, %rdi
callq 0x27c0
testb %al, %al
jne 0x381e
leaq 0x6fd1(%rip), %rsi      # 0xa7df
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x38f4
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
je 0x3f72
cmpq $0x0, 0x18(%rbp)
jne 0x3f72
movq %rbx, %r13
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
callq 0x2c37
movl %eax, %ebx
movslq -0x30(%rbp), %rax
movl %r12d, %r15d
imulq $0x98, %rax, %r12
movabsq $0x100000012, %rax      # imm = 0x100000012
leaq (%r12,%r13), %r14
addq $0x34, %r14
movq %rax, -0x34(%r14)
movl %ebx, -0xc(%r14)
pushq $0x3
popq %rax
movl %eax, -0x4(%r14)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq 0x10(%rbp), %rsi
callq 0x2110
movl %r15d, 0x5c(%r14)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x64(%r14)
movl %ebx, 0x8c(%r14)
movl $0x1, 0x94(%r14)
movl %ebx, 0xb8(%r14)
pushq $0x3
popq %rax
movl %eax, 0xc0(%r14)
leaq 0xf8(%r13,%r12), %rbx
movq %rbx, %rdi
movq 0x10(%rbp), %rsi
pushq $0x20
popq %rdx
callq 0x2110
movl %r15d, 0x30(%rbx)
pushq $0x2
popq %r13
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6ee8(%rip), %rsi      # 0xa7e3
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x397e
testq %r15, %r15
jne 0x3f72
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
leaq (%rbx,%rax), %r9
movabsq $0x100000002, %rcx      # imm = 0x100000002
movq %rcx, (%rbx,%rax)
andl $0x0, 0x28(%rbx,%rax)
movl $0x1, 0x30(%rbx,%rax)
andl $0x0, 0x54(%rbx,%rax)
movl $0x2, 0x5c(%rbx,%rax)
andl $0x0, 0x84(%rbx,%rax)
movl %r12d, 0x90(%rbx,%rax)
leaq 0x6e85(%rip), %rdi      # 0xa7e3
leaq 0x6e07(%rip), %rdx      # 0xa76c
leaq 0x6cf9(%rip), %rcx      # 0xa665
movq %rdx, %rsi
movq %r14, %r8
callq 0x3280
pushq $0x1
jmp 0x38e0
leaq 0x6e62(%rip), %rsi      # 0xa7e7
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3a02
testq %r15, %r15
jne 0x3f72
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
leaq (%rbx,%rax), %r9
movabsq $0x10000000d, %rcx      # imm = 0x10000000D
movq %rcx, (%rbx,%rax)
andl $0x0, 0x28(%rbx,%rax)
pushq $0x1
popq %r13
movl %r13d, 0x30(%rbx,%rax)
movl %r13d, 0x54(%rbx,%rax)
movl $0x2, 0x5c(%rbx,%rax)
andl $0x0, 0x84(%rbx,%rax)
movl %r12d, 0x90(%rbx,%rax)
leaq 0x6c07(%rip), %rdi      # 0xa5f0
leaq 0x6dfe(%rip), %rdx      # 0xa7ee
leaq 0x6df4(%rip), %rcx      # 0xa7eb
movq %rcx, %rsi
movq %r14, %r8
jmp 0x37ea
leaq 0x6de8(%rip), %rsi      # 0xa7f1
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3aaa
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
jne 0x3f72
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %r14
leaq (%rbx,%r14), %r13
movabsq $0x10000000d, %rax      # imm = 0x10000000D
movq %rax, (%rbx,%r14)
andl $0x0, 0x28(%rbx,%r14)
movl $0x1, 0x30(%rbx,%r14)
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
callq 0x2c37
movl %eax, 0x54(%rbx,%r14)
movl $0x2, 0x5c(%rbx,%r14)
andl $0x0, 0x84(%rbx,%r14)
movl %r12d, 0x90(%rbx,%r14)
leaq 0x6b63(%rip), %rdi      # 0xa5f0
leaq 0x6d57(%rip), %rcx      # 0xa7eb
movq %rcx, %rsi
movq %r15, %rdx
movq 0x28(%rbp), %r8
movq %r13, %r9
pushq $0x1
popq %r13
jmp 0x37ea
leaq 0x6d43(%rip), %rsi      # 0xa7f4
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3b2a
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
jne 0x3f72
movq %r14, %r13
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %rax
movq %rbx, %rdx
addq %rax, %rbx
movabsq $0x10000000c, %rcx      # imm = 0x10000000C
leaq (%rdx,%rax), %r14
addq $0x34, %r14
movq %rcx, -0x34(%r14)
andl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2110
movl %r12d, 0x5c(%r14)
leaq 0x6cd3(%rip), %rdi      # 0xa7f4
leaq 0x6cc3(%rip), %rsi      # 0xa7eb
jmp 0x3ba8
leaq 0x6cc5(%rip), %rsi      # 0xa7f6
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3bb8
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
jne 0x3f72
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)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2110
movl %r12d, 0x5c(%r14)
leaq 0x6a4b(%rip), %rdi      # 0xa5ec
leaq 0x6c46(%rip), %rsi      # 0xa7ee
movq %r15, %rdx
xorl %ecx, %ecx
movq %r13, %r8
movq %rbx, %r9
jmp 0x3972
leaq 0x6c3c(%rip), %rsi      # 0xa7fb
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3c7a
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
je 0x3f72
cmpq $0x0, 0x18(%rbp)
jne 0x3f72
movslq -0x30(%rbp), %rax
imulq $0x98, %rax, %r14
leaq (%rbx,%r14), %rax
movq %rax, -0x30(%rbp)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, (%rbx,%r14)
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
callq 0x2c37
movl %eax, 0x28(%rbx,%r14)
movl $0x1, 0x30(%rbx,%r14)
movq 0x10(%rbp), %rdi
movl %r12d, %esi
pushq $0x1
popq %r13
movl %r13d, %edx
callq 0x2c37
movl %eax, 0x54(%rbx,%r14)
movl $0x2, 0x5c(%rbx,%r14)
andl $0x0, 0x84(%rbx,%r14)
movl %r12d, 0x90(%rbx,%r14)
leaq 0x692b(%rip), %rdi      # 0xa58f
movq %r15, %rsi
movq 0x10(%rbp), %rdx
xorl %ecx, %ecx
movq 0x28(%rbp), %r8
movq -0x30(%rbp), %r9
jmp 0x37ea
leaq 0x6b7d(%rip), %rsi      # 0xa7fe
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3d1d
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
je 0x3f72
cmpq $0x0, 0x18(%rbp)
jne 0x3f72
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)
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
callq 0x2c37
movl %eax, -0x38(%r14)
movl $0x1, -0x30(%r14)
andl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq 0x10(%rbp), %r13
movq %r13, %rsi
callq 0x2110
movl %r12d, 0x30(%r14)
leaq 0x68d0(%rip), %rdi      # 0xa5e8
jmp 0x3dbb
leaq 0x6adf(%rip), %rsi      # 0xa803
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3dd8
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
je 0x3f72
cmpq $0x0, 0x18(%rbp)
jne 0x3f72
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)
pushq $0x1
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
callq 0x2c37
movl %eax, -0x38(%r14)
movl $0x1, -0x30(%r14)
andl $0x0, -0xc(%r14)
movl $0x3, -0x4(%r14)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq 0x10(%rbp), %r13
movq %r13, %rsi
callq 0x2110
movl %r12d, 0x30(%r14)
leaq 0x6817(%rip), %rdi      # 0xa5d2
leaq 0x6a29(%rip), %rsi      # 0xa7eb
movq %r15, %rdx
movq %r13, %rcx
pushq $0x1
popq %r13
movq 0x28(%rbp), %r8
movq %rbx, %r9
jmp 0x37ea
movq 0x20(%rbp), %r14
leaq 0x6a25(%rip), %rsi      # 0xa808
movq %r13, %rdi
callq 0x27c0
testb %al, %al
je 0x3e9f
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
je 0x3f72
cmpq $0x0, 0x18(%rbp)
je 0x3f72
testq %r14, %r14
jne 0x3f72
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)
pushq $0x1
popq %rbx
movq %r15, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x2c37
movl %eax, -0xc(%r14)
movl $0x1, -0x30(%r14)
movq 0x10(%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x2c37
movl %eax, -0x38(%r14)
movl $0x3, -0x4(%r14)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq 0x18(%rbp), %rbx
movq %rbx, %rsi
callq 0x2110
movl %r12d, 0x30(%r14)
leaq 0x6745(%rip), %rdi      # 0xa5df
jmp 0x3f60
leaq 0x6966(%rip), %rsi      # 0xa80c
movq %r13, %rdi
callq 0x27c0
xorl %r13d, %r13d
testb %al, %al
je 0x38e2
testq %r15, %r15
je 0x3f72
cmpq $0x0, 0x10(%rbp)
je 0x3f72
cmpq $0x0, 0x18(%rbp)
je 0x3f72
testq %r14, %r14
jne 0x3f72
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)
pushq $0x1
popq %rbx
movq %r15, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x2c37
movl %eax, -0xc(%r14)
movl $0x1, -0x30(%r14)
movq 0x10(%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0x2c37
movl %eax, -0x38(%r14)
movl $0x3, -0x4(%r14)
pushq $0x20
popq %rdx
movq %r14, %rdi
movq 0x18(%rbp), %rbx
movq %rbx, %rsi
callq 0x2110
movl %r12d, 0x30(%r14)
leaq 0x6676(%rip), %rdi      # 0xa5d6
movq %r13, %rsi
pushq $0x1
popq %r13
movq %r15, %rdx
movq %rbx, %rcx
jmp 0x3c6d
leaq 0x6826(%rip), %rsi      # 0xa79f
movl %r12d, %edi
callq 0x27ef
leaq 0x6826(%rip), %rdi      # 0xa7ae
movl -0x34(%rbp), %esi
movq %r15, %rdx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %eax, %eax
callq 0x2040
pushq $0x1
popq %rdi
callq 0x2200