// File: /workspace/github_c_makefile_star2_O0/koendv[P]stm32duino-raspberrypi/Arduino_Tools/src/stm32flash/stm32.c
// Function: stm32_init
stm32_t *stm32_init(struct port_interface *port, const char init)
{
	uint8_t len, val, buf[257];
	stm32_t *stm;
	int i, new_cmds;

	stm      = calloc(sizeof(stm32_t), 1);
	stm->cmd = malloc(sizeof(stm32_cmd_t));
	memset(stm->cmd, STM32_CMD_ERR, sizeof(stm32_cmd_t));
	stm->port = port;

	if ((port->flags & PORT_CMD_INIT) && init)
		if (stm32_send_init_seq(stm) != STM32_ERR_OK)
			return NULL;

	/* get the version and read protection status  */
	if (stm32_send_command(stm, STM32_CMD_GVR) != STM32_ERR_OK) {
		stm32_close(stm);
		return NULL;
	}

	/* From AN, only UART bootloader returns 3 bytes */
	len = (port->flags & PORT_GVR_ETX) ? 3 : 1;
	if (port->read(port, buf, len) != PORT_ERR_OK)
		return NULL;
	stm->version = buf[0];
	stm->option1 = (port->flags & PORT_GVR_ETX) ? buf[1] : 0;
	stm->option2 = (port->flags & PORT_GVR_ETX) ? buf[2] : 0;
	if (stm32_get_ack(stm) != STM32_ERR_OK) {
		stm32_close(stm);
		return NULL;
	}

	/* get the bootloader information */
	len = STM32_CMD_GET_LENGTH;
	if (port->cmd_get_reply)
		for (i = 0; port->cmd_get_reply[i].length; i++)
			if (stm->version == port->cmd_get_reply[i].version) {
				len = port->cmd_get_reply[i].length;
				break;
			}
	if (stm32_guess_len_cmd(stm, STM32_CMD_GET, buf, len) != STM32_ERR_OK)
		return NULL;
	len = buf[0] + 1;
	stm->bl_version = buf[1];
	new_cmds = 0;
	for (i = 1; i < len; i++) {
		val = buf[i + 1];
		switch (val) {
		case STM32_CMD_GET:
			stm->cmd->get = val; break;
		case STM32_CMD_GVR:
			stm->cmd->gvr = val; break;
		case STM32_CMD_GID:
			stm->cmd->gid = val; break;
		case STM32_CMD_RM:
			stm->cmd->rm = val; break;
		case STM32_CMD_GO:
			stm->cmd->go = val; break;
		case STM32_CMD_WM:
		case STM32_CMD_WM_NS:
			stm->cmd->wm = newer(stm->cmd->wm, val);
			break;
		case STM32_CMD_ER:
		case STM32_CMD_EE:
		case STM32_CMD_EE_NS:
			stm->cmd->er = newer(stm->cmd->er, val);
			break;
		case STM32_CMD_WP:
		case STM32_CMD_WP_NS:
			stm->cmd->wp = newer(stm->cmd->wp, val);
			break;
		case STM32_CMD_UW:
		case STM32_CMD_UW_NS:
			stm->cmd->uw = newer(stm->cmd->uw, val);
			break;
		case STM32_CMD_RP:
		case STM32_CMD_RP_NS:
			stm->cmd->rp = newer(stm->cmd->rp, val);
			break;
		case STM32_CMD_UR:
		case STM32_CMD_UR_NS:
			stm->cmd->ur = newer(stm->cmd->ur, val);
			break;
		case STM32_CMD_CRC:
			stm->cmd->crc = newer(stm->cmd->crc, val);
			break;
		default:
			if (new_cmds++ == 0)
				fprintf(stderr,
					"GET returns unknown commands (0x%2x",
					val);
			else
				fprintf(stderr, ", 0x%2x", val);
		}
	}
	if (new_cmds)
		fprintf(stderr, ")\n");
	if (stm32_get_ack(stm) != STM32_ERR_OK) {
		stm32_close(stm);
		return NULL;
	}

	if (stm->cmd->get == STM32_CMD_ERR
	    || stm->cmd->gvr == STM32_CMD_ERR
	    || stm->cmd->gid == STM32_CMD_ERR) {
		fprintf(stderr, "Error: bootloader did not returned correct information from GET command\n");
		return NULL;
	}

	/* get the device ID */
	if (stm32_guess_len_cmd(stm, stm->cmd->gid, buf, 1) != STM32_ERR_OK) {
		stm32_close(stm);
		return NULL;
	}
	len = buf[0] + 1;
	if (len < 2) {
		stm32_close(stm);
		fprintf(stderr, "Only %d bytes sent in the PID, unknown/unsupported device\n", len);
		return NULL;
	}
	stm->pid = (buf[1] << 8) | buf[2];
	if (len > 2) {
		fprintf(stderr, "This bootloader returns %d extra bytes in PID:", len);
		for (i = 2; i <= len ; i++)
			fprintf(stderr, " %02x", buf[i]);
		fprintf(stderr, "\n");
	}
	if (stm32_get_ack(stm) != STM32_ERR_OK) {
		stm32_close(stm);
		return NULL;
	}

	stm->dev = devices;
	while (stm->dev->id != 0x00 && stm->dev->id != stm->pid)
		++stm->dev;

	if (!stm->dev->id) {
		fprintf(stderr, "Unknown/unsupported device (Device ID: 0x%03x)\n", stm->pid);
		stm32_close(stm);
		return NULL;
	}

	return stm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl $0x28, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, -0x128(%rbp)
movl $0xc, %edi
callq 0x21b0
movq %rax, %rcx
movq -0x128(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0xff, %esi
movl $0xc, %edx
callq 0x2100
movq -0x10(%rbp), %rcx
movq -0x128(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x6654
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x6654
movq -0x128(%rbp), %rdi
callq 0x7000
cmpl $0x0, %eax
je 0x6652
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
jmp 0x6654
movq -0x128(%rbp), %rdi
movl $0x1, %esi
callq 0x7190
cmpl $0x0, %eax
je 0x6683
movq -0x128(%rbp), %rdi
callq 0x71c0
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
andl $0x2, %edx
movl $0x1, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movzbl -0x12(%rbp), %ecx
movl %ecx, %edx
callq *%rax
cmpl $0x0, %eax
je 0x66cd
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movb -0x120(%rbp), %cl
movq -0x128(%rbp), %rax
movb %cl, 0x11(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x66fb
movzbl -0x11f(%rbp), %eax
movl %eax, -0x134(%rbp)
jmp 0x6705
xorl %eax, %eax
movl %eax, -0x134(%rbp)
jmp 0x6705
movl -0x134(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movb %cl, 0x12(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x6735
movzbl -0x11e(%rbp), %eax
movl %eax, -0x138(%rbp)
jmp 0x673f
xorl %eax, %eax
movl %eax, -0x138(%rbp)
jmp 0x673f
movl -0x138(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movb %cl, 0x13(%rax)
movq -0x128(%rbp), %rdi
callq 0x71f0
cmpl $0x0, %eax
je 0x677b
movq -0x128(%rbp), %rdi
callq 0x71c0
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movb $0x11, -0x12(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x67f9
movl $0x0, -0x12c(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x12c(%rbp), %rcx
cmpb $0x0, 0x1(%rax,%rcx,2)
je 0x67f7
movq -0x128(%rbp), %rax
movzbl 0x11(%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x48(%rcx), %rcx
movslq -0x12c(%rbp), %rdx
movzbl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jne 0x67e4
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x12c(%rbp), %rcx
movb 0x1(%rax,%rcx,2), %al
movb %al, -0x12(%rbp)
jmp 0x67f7
jmp 0x67e6
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x6794
jmp 0x67f9
movq -0x128(%rbp), %rdi
leaq -0x120(%rbp), %rdx
movzbl -0x12(%rbp), %ecx
xorl %esi, %esi
callq 0x7210
cmpl $0x0, %eax
je 0x6824
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movzbl -0x120(%rbp), %eax
addl $0x1, %eax
movb %al, -0x12(%rbp)
movb -0x11f(%rbp), %cl
movq -0x128(%rbp), %rax
movb %cl, 0x10(%rax)
movl $0x0, -0x130(%rbp)
movl $0x1, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movzbl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jge 0x6d03
movslq -0x12c(%rbp), %rax
leaq -0x120(%rbp), %rcx
movb 0x1(%rax,%rcx), %al
movb %al, -0x13(%rbp)
movzbl -0x13(%rbp), %eax
movq %rax, -0x140(%rbp)
subq $0xa1, %rax
ja 0x6c9b
movq -0x140(%rbp), %rax
leaq 0x51ff(%rip), %rcx      # 0xbaa0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb -0x13(%rbp), %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, (%rax)
jmp 0x6ced
movb -0x13(%rbp), %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x1(%rax)
jmp 0x6ced
movb -0x13(%rbp), %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x2(%rax)
jmp 0x6ced
movb -0x13(%rbp), %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x3(%rax)
jmp 0x6ced
movb -0x13(%rbp), %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x4(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x5(%rax), %eax
cmpl $0xff, %eax
jne 0x6939
movzbl -0x13(%rbp), %eax
movl %eax, -0x144(%rbp)
jmp 0x697d
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x5(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x6967
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x5(%rax), %eax
movl %eax, -0x148(%rbp)
jmp 0x6971
movzbl -0x13(%rbp), %eax
movl %eax, -0x148(%rbp)
movl -0x148(%rbp), %eax
movl %eax, -0x144(%rbp)
movl -0x144(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x5(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x6(%rax), %eax
cmpl $0xff, %eax
jne 0x69ba
movzbl -0x13(%rbp), %eax
movl %eax, -0x14c(%rbp)
jmp 0x69fe
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x6(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x69e8
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x6(%rax), %eax
movl %eax, -0x150(%rbp)
jmp 0x69f2
movzbl -0x13(%rbp), %eax
movl %eax, -0x150(%rbp)
movl -0x150(%rbp), %eax
movl %eax, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x6(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x7(%rax), %eax
cmpl $0xff, %eax
jne 0x6a3b
movzbl -0x13(%rbp), %eax
movl %eax, -0x154(%rbp)
jmp 0x6a7f
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x7(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x6a69
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x7(%rax), %eax
movl %eax, -0x158(%rbp)
jmp 0x6a73
movzbl -0x13(%rbp), %eax
movl %eax, -0x158(%rbp)
movl -0x158(%rbp), %eax
movl %eax, -0x154(%rbp)
movl -0x154(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x7(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x8(%rax), %eax
cmpl $0xff, %eax
jne 0x6abc
movzbl -0x13(%rbp), %eax
movl %eax, -0x15c(%rbp)
jmp 0x6b00
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x8(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x6aea
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0x160(%rbp)
jmp 0x6af4
movzbl -0x13(%rbp), %eax
movl %eax, -0x160(%rbp)
movl -0x160(%rbp), %eax
movl %eax, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x8(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x9(%rax), %eax
cmpl $0xff, %eax
jne 0x6b3d
movzbl -0x13(%rbp), %eax
movl %eax, -0x164(%rbp)
jmp 0x6b81
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x9(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x6b6b
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x9(%rax), %eax
movl %eax, -0x168(%rbp)
jmp 0x6b75
movzbl -0x13(%rbp), %eax
movl %eax, -0x168(%rbp)
movl -0x168(%rbp), %eax
movl %eax, -0x164(%rbp)
movl -0x164(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x9(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0xa(%rax), %eax
cmpl $0xff, %eax
jne 0x6bbe
movzbl -0x13(%rbp), %eax
movl %eax, -0x16c(%rbp)
jmp 0x6c02
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0xa(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x6bec
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0xa(%rax), %eax
movl %eax, -0x170(%rbp)
jmp 0x6bf6
movzbl -0x13(%rbp), %eax
movl %eax, -0x170(%rbp)
movl -0x170(%rbp), %eax
movl %eax, -0x16c(%rbp)
movl -0x16c(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0xa(%rax)
jmp 0x6ced
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0xb(%rax), %eax
cmpl $0xff, %eax
jne 0x6c3f
movzbl -0x13(%rbp), %eax
movl %eax, -0x174(%rbp)
jmp 0x6c83
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0xb(%rax), %eax
movzbl -0x13(%rbp), %ecx
cmpl %ecx, %eax
jle 0x6c6d
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0xb(%rax), %eax
movl %eax, -0x178(%rbp)
jmp 0x6c77
movzbl -0x13(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x178(%rbp), %eax
movl %eax, -0x174(%rbp)
movl -0x174(%rbp), %eax
movb %al, %cl
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0xb(%rax)
jmp 0x6ced
movl -0x130(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x130(%rbp)
cmpl $0x0, %eax
jne 0x6ccf
movq 0x9338(%rip), %rax      # 0xfff0
movq (%rax), %rdi
movzbl -0x13(%rbp), %edx
leaq 0x50ca(%rip), %rsi      # 0xbd90
movb $0x0, %al
callq 0x2160
jmp 0x6ceb
movq 0x931a(%rip), %rax      # 0xfff0
movq (%rax), %rdi
movzbl -0x13(%rbp), %edx
leaq 0x50d0(%rip), %rsi      # 0xbdb4
movb $0x0, %al
callq 0x2160
jmp 0x6ced
jmp 0x6cef
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x6855
cmpl $0x0, -0x130(%rbp)
je 0x6d24
movq 0x92dd(%rip), %rax      # 0xfff0
movq (%rax), %rdi
leaq 0x5605(%rip), %rsi      # 0xc322
movb $0x0, %al
callq 0x2160
movq -0x128(%rbp), %rdi
callq 0x71f0
cmpl $0x0, %eax
je 0x6d4e
movq -0x128(%rbp), %rdi
callq 0x71c0
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0x6d8f
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x1(%rax), %eax
cmpl $0xff, %eax
je 0x6d8f
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movzbl 0x2(%rax), %eax
cmpl $0xff, %eax
jne 0x6db4
movq 0x925a(%rip), %rax      # 0xfff0
movq (%rax), %rdi
leaq 0x501c(%rip), %rsi      # 0xbdbc
movb $0x0, %al
callq 0x2160
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movq -0x128(%rbp), %rdi
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rax
movb 0x2(%rax), %al
leaq -0x120(%rbp), %rdx
movl $0x1, %ecx
movzbl %al, %esi
callq 0x7210
cmpl $0x0, %eax
je 0x6dfb
movq -0x128(%rbp), %rdi
callq 0x71c0
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movzbl -0x120(%rbp), %eax
addl $0x1, %eax
movb %al, -0x12(%rbp)
movzbl -0x12(%rbp), %eax
cmpl $0x2, %eax
jge 0x6e46
movq -0x128(%rbp), %rdi
callq 0x71c0
movq 0x91cc(%rip), %rax      # 0xfff0
movq (%rax), %rdi
movzbl -0x12(%rbp), %edx
leaq 0x4fd3(%rip), %rsi      # 0xbe05
movb $0x0, %al
callq 0x2160
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movzbl -0x11f(%rbp), %eax
shll $0x8, %eax
movzbl -0x11e(%rbp), %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x128(%rbp), %rax
movw %cx, 0x14(%rax)
movzbl -0x12(%rbp), %eax
cmpl $0x2, %eax
jle 0x6ef8
movq 0x9175(%rip), %rax      # 0xfff0
movq (%rax), %rdi
movzbl -0x12(%rbp), %edx
leaq 0x4fb7(%rip), %rsi      # 0xbe40
movb $0x0, %al
callq 0x2160
movl $0x2, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movzbl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jg 0x6ee0
movq 0x9141(%rip), %rax      # 0xfff0
movq (%rax), %rdi
movslq -0x12c(%rbp), %rax
movzbl -0x120(%rbp,%rax), %edx
leaq 0x4fa7(%rip), %rsi      # 0xbe6f
movb $0x0, %al
callq 0x2160
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x6e9a
movq 0x9109(%rip), %rax      # 0xfff0
movq (%rax), %rdi
leaq 0x389a(%rip), %rsi      # 0xa78b
movb $0x0, %al
callq 0x2160
movq -0x128(%rbp), %rdi
callq 0x71f0
cmpl $0x0, %eax
je 0x6f22
movq -0x128(%rbp), %rdi
callq 0x71c0
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movq -0x128(%rbp), %rax
leaq 0x8090(%rip), %rcx      # 0xefc0
movq %rcx, 0x20(%rax)
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movzwl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x179(%rbp)
je 0x6f73
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
movzwl (%rax), %eax
movq -0x128(%rbp), %rcx
movzwl 0x14(%rcx), %ecx
cmpl %ecx, %eax
setne %al
movb %al, -0x179(%rbp)
movb -0x179(%rbp), %al
testb $0x1, %al
jne 0x6f7f
jmp 0x6f94
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x48, %rcx
movq %rcx, 0x20(%rax)
jmp 0x6f34
movq -0x128(%rbp), %rax
movq 0x20(%rax), %rax
cmpw $0x0, (%rax)
jne 0x6fde
movq 0x9044(%rip), %rax      # 0xfff0
movq (%rax), %rdi
movq -0x128(%rbp), %rax
movzwl 0x14(%rax), %edx
leaq 0x4eb4(%rip), %rsi      # 0xbe75
movb $0x0, %al
callq 0x2160
movq -0x128(%rbp), %rdi
callq 0x71c0
movq $0x0, -0x8(%rbp)
jmp 0x6fe9
movq -0x128(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)