// File: /workspace/github_c_makefile_star2_O0/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_parse_config_file
uint8_t *rtk_parse_config_file(RT_U8 *config_buf, size_t *plen,
			       uint8_t bt_addr[6], uint32_t *result)
{

	struct rtk_bt_vendor_config *config =
	    (struct rtk_bt_vendor_config *)config_buf;
	RT_U16 config_len = 0, temp = 0;
	struct rtk_bt_vendor_config_entry *entry = NULL;
	RT_U16 i;
	RT_U32 baudrate = 0;
	uint32_t flags = 0;
	uint32_t add_flags;
#ifdef USE_CUSTOMER_ADDRESS
	uint8_t j = 0;
	struct patch_info *pent = rtk_hw_cfg.patch_ent;
#endif
#ifdef EXTRA_CONFIG_OPTION
	uint8_t *head = config_buf;

	add_flags = config_flags;
#endif

	if (!config || !plen)
		return NULL;

	RS_INFO("Original Cfg len %u", (uint16_t)*plen);
	config_len = le16_to_cpu(config->data_len);
	entry = config->entry;

	if (le32_to_cpu(config->signature) != RTK_VENDOR_CONFIG_MAGIC) {
		RS_ERR("signature magic number(%x) is incorrect",
		     (unsigned int)config->signature);
		return NULL;
	}

	if (config_len != *plen - sizeof(struct rtk_bt_vendor_config)) {
		RS_ERR("config len(%d) is incorrect(%zd)", config_len,
		       *plen - sizeof(struct rtk_bt_vendor_config));
		return NULL;
	}

	for (i = 0; i < config_len;) {

		switch (le16_to_cpu(entry->offset)) {
#ifdef USE_CUSTOMER_ADDRESS
		case 0x003c:
		case 0x0044:
			if (!customer_bdaddr)
				break;
			if (pent->chip_type > CHIP_BEFORE &&
			    le16_to_cpu(entry->offset) != 0x44)
				break;
			if (pent->chip_type <= CHIP_BEFORE &&
			    le16_to_cpu(entry->offset) != 0x3c)
				break;
			for (j = 0; j < entry->entry_len; j++)
				entry->entry_data[j] = bt_addr[j];
			flags |= CONFIG_BTMAC;
			RS_INFO("BT MAC found %02x:%02x:%02x:%02x:%02x:%02x",
				entry->entry_data[5],
				entry->entry_data[4],
				entry->entry_data[3],
				entry->entry_data[2],
				entry->entry_data[1],
				entry->entry_data[0]);
			break;
#endif
		case 0xc:
			{
#ifdef BAUDRATE_4BYTES
				baudrate =
				    get_unaligned_le32(entry->entry_data);
#else
				baudrate =
				    get_unaligned_le16(entry->entry_data);
#endif
				RS_INFO("Config baud : %08x", baudrate);

				/* offset 0x0c - 0x18 */
				if (entry->entry_len >= 12) {
					rtk_hw_cfg.hw_flow_control = (entry->entry_data[12] & 0x4) ? 1 : 0;	//0x18 byte bit2
					RS_INFO("hw flow control: %u",
						rtk_hw_cfg.hw_flow_control);
				}
				break;
			}
#ifdef EXTRA_CONFIG_OPTION
		case 0x015b:
			if (!(add_flags & CONFIG_TXPOWER))
				break;
			add_flags &= ~CONFIG_TXPOWER;
			if (txpower_len != entry->entry_len) {
				RS_ERR("invalid tx power cfg len %u, %u",
				       txpower_len, entry->entry_len);
				break;
			}
			memcpy(entry->entry_data, txpower_cfg, txpower_len);
			RS_INFO("Replace Tx power Cfg %02x %02x %02x %02x",
				txpower_cfg[0], txpower_cfg[1], txpower_cfg[2],
				txpower_cfg[3]);
			break;
		case 0x01e6:
			if (!(add_flags & CONFIG_XTAL))
				break;
			add_flags &= ~CONFIG_XTAL;
			RS_INFO("Replace XTAL Cfg 0x%02x", xtal_cfg);
			entry->entry_data[0] = xtal_cfg;
			break;
#endif
		case 0x0018:
			if (pent->chip_type == CHIP_8723DS &&
			    rtk_hw_cfg.proto == HCI_UART_H4) {
				if (entry->entry_data[0] & (1 << 2))
					rtk_hw_cfg.hw_flow_control = 1;
				RS_INFO("8723DSH4: hw flow control %u",
					rtk_hw_cfg.hw_flow_control);
				if (entry->entry_data[0] & 0x01) {
					rtk_hw_cfg.parity_en = 1;
					if (entry->entry_data[0] & 0x02)
						rtk_hw_cfg.parity_even = 1;
					else
						rtk_hw_cfg.parity_even = 0;
				}
				RS_INFO("8723DSH4: parity %u, even %u",
					rtk_hw_cfg.parity_en,
					rtk_hw_cfg.parity_even);
			}
			break;
		default:
			RS_DBG("cfg offset (%04x),length (%02x)", entry->offset,
			       entry->entry_len);
			break;
		}
		temp = entry->entry_len +
		       sizeof(struct rtk_bt_vendor_config_entry);
		i += temp;
		entry = (struct rtk_bt_vendor_config_entry *)((RT_U8 *)entry +
							      temp);
	}

#ifdef USE_CUSTOMER_ADDRESS
	if (!(flags & CONFIG_BTMAC) && customer_bdaddr) {
		uint8_t *b;

		b = config_buf + *plen;
		if (pent->chip_type > CHIP_BEFORE) {
			b[0] = 0x44;
			b[1] = 0x00;
		} else {
			b[0] = 0x3c;
			b[1] = 0x00;
		}
		RS_INFO("add bdaddr sec, offset %02x%02x", b[1], b[0]);
		b[2] = 6;
		for (j = 0; j < 6; j++)
			b[3 + j] = bt_addr[j];

		*plen += 9;
		config_len += 9;
		temp = *plen - 6;

		config_buf[4] = (temp & 0xff);
		config_buf[5] = ((temp >> 8) & 0xff);
	}
#endif

#ifdef EXTRA_CONFIG_OPTION
	temp = *plen;
	if (add_flags & CONFIG_TXPOWER)
		temp += (2 + 1 + txpower_len);
	if ((add_flags & CONFIG_XTAL))
		temp += (2 + 1 + 1);

	if (add_flags) {
		RS_INFO("Add extra configs");
		config_buf = head;
		temp -= sizeof(struct rtk_bt_vendor_config);
		config_buf[4] = (temp & 0xff);
		config_buf[5] = ((temp >> 8) & 0xff);
		config_buf += *plen;
		if (add_flags & CONFIG_TXPOWER) {
			RS_INFO("Add Tx power Cfg");
			*config_buf++ = 0x5b;
			*config_buf++ = 0x01;
			*config_buf++ = txpower_len;
			memcpy(config_buf, txpower_cfg, txpower_len);
			config_buf += txpower_len;
		}
		if ((add_flags & CONFIG_XTAL)) {
			RS_INFO("Add XTAL Cfg");
			*config_buf++ = 0xe6;
			*config_buf++ = 0x01;
			*config_buf++ = 1;
			*config_buf++ = xtal_cfg;
		}
		*plen = config_buf - head;
		config_buf = head;
	}
#endif

done:
	*result = baudrate;
	return config_buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movw $0x0, -0x32(%rbp)
movw $0x0, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movb $0x0, -0x51(%rbp)
movq 0xc540(%rip), %rax      # 0x10760
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl 0xc53e(%rip), %eax      # 0x10770
movl %eax, -0x50(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x4243
cmpq $0x0, -0x18(%rbp)
jne 0x4250
movq $0x0, -0x8(%rbp)
jmp 0x4a99
jmp 0x4252
movq 0xbd9f(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movzwl %ax, %ecx
leaq 0x74d8(%rip), %rsi      # 0xb745
leaq 0x7315(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x30(%rbp), %rax
movw 0x4(%rax), %ax
movw %ax, -0x32(%rbp)
movq -0x30(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x8723ab55, (%rax)     # imm = 0x8723AB55
je 0x42d3
jmp 0x42a1
movq 0xbd50(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl (%rax), %ecx
leaq 0x74a6(%rip), %rsi      # 0xb75e
leaq 0x72ca(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq $0x0, -0x8(%rbp)
jmp 0x4a99
movzwl -0x32(%rbp), %eax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
subq $0x6, %rcx
cmpq %rcx, %rax
je 0x4324
jmp 0x42e9
movq 0xbd08(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzwl -0x32(%rbp), %ecx
movq -0x18(%rbp), %rax
movq (%rax), %r8
subq $0x6, %r8
leaq 0x7488(%rip), %rsi      # 0xb791
leaq 0x7279(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq $0x0, -0x8(%rbp)
jmp 0x4a99
movw $0x0, -0x42(%rbp)
movzwl -0x42(%rbp), %eax
movzwl -0x32(%rbp), %ecx
cmpl %ecx, %eax
jge 0x478f
movq -0x40(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x74(%rbp)
subl $0xc, %eax
je 0x4481
jmp 0x434f
movl -0x74(%rbp), %eax
subl $0x18, %eax
je 0x461f
jmp 0x435d
movl -0x74(%rbp), %eax
subl $0x3c, %eax
je 0x4394
jmp 0x4367
movl -0x74(%rbp), %eax
subl $0x44, %eax
je 0x4394
jmp 0x4371
movl -0x74(%rbp), %eax
subl $0x15b, %eax            # imm = 0x15B
je 0x450a
jmp 0x4381
movl -0x74(%rbp), %eax
subl $0x1e6, %eax            # imm = 0x1E6
je 0x45ce
jmp 0x471c
cmpb $0x0, 0xc3d9(%rip)      # 0x10774
jne 0x43a2
jmp 0x475a
movq -0x60(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x6f, %eax
jle 0x43c0
movq -0x40(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x44, %eax
je 0x43c0
jmp 0x475a
movq -0x60(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x6f, %eax
jg 0x43de
movq -0x40(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x3c, %eax
je 0x43de
jmp 0x475a
movb $0x0, -0x51(%rbp)
movzbl -0x51(%rbp), %eax
movq -0x40(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jge 0x4413
movq -0x20(%rbp), %rax
movzbl -0x51(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x40(%rbp), %rax
movzbl -0x51(%rbp), %ecx
movb %dl, 0x3(%rax,%rcx)
movb -0x51(%rbp), %al
addb $0x1, %al
movb %al, -0x51(%rbp)
jmp 0x43e2
movl -0x4c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x4c(%rbp)
movq 0xbbd5(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movzbl 0x8(%rax), %ecx
movq -0x40(%rbp), %rax
movzbl 0x7(%rax), %r8d
movq -0x40(%rbp), %rax
movzbl 0x6(%rax), %r9d
movq -0x40(%rbp), %rax
movzbl 0x5(%rax), %r11d
movq -0x40(%rbp), %rax
movzbl 0x4(%rax), %r10d
movq -0x40(%rbp), %rax
movzbl 0x3(%rax), %eax
leaq 0x735c(%rip), %rsi      # 0xb7bd
leaq 0x7121(%rip), %rdx      # 0xb589
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x2150
jmp 0x475a
movq -0x40(%rbp), %rdi
addq $0x3, %rdi
callq 0x4ab0
movl %eax, -0x48(%rbp)
movq 0xbb60(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl -0x48(%rbp), %ecx
leaq 0x7348(%rip), %rsi      # 0xb7ed
leaq 0x70dd(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x40(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0xc, %eax
jl 0x4505
movq -0x40(%rbp), %rax
movzbl 0xf(%rax), %edx
andl $0x4, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0xc236(%rip)      # 0x10714
movq 0xbb13(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xc226(%rip), %ecx      # 0x10714
leaq 0x7310(%rip), %rsi      # 0xb805
leaq 0x708d(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x4505
jmp 0x475a
movl -0x50(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x451a
jmp 0x475a
movl -0x50(%rbp), %eax
andl $-0x2, %eax
movl %eax, -0x50(%rbp)
movzbl 0xc24b(%rip), %eax      # 0x10775
movq -0x40(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
cmpl %ecx, %eax
je 0x456c
jmp 0x4538
movq 0xbab9(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl 0xc22c(%rip), %ecx      # 0x10775
movq -0x40(%rbp), %rax
movzbl 0x2(%rax), %r8d
leaq 0x72c5(%rip), %rsi      # 0xb81e
leaq 0x7029(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x475a
movq -0x40(%rbp), %rdi
addq $0x3, %rdi
movzbl 0xc1fa(%rip), %eax      # 0x10775
movl %eax, %edx
leaq 0xc1f2(%rip), %rsi      # 0x10776
callq 0x2180
movq 0xba68(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl 0xc1dc(%rip), %ecx      # 0x10776
movzbl 0xc1d5(%rip), %r8d      # 0x10777
movzbl 0xc1ce(%rip), %r9d      # 0x10778
movzbl 0xc1c8(%rip), %eax      # 0x10779
leaq 0x7291(%rip), %rsi      # 0xb849
leaq 0x6fca(%rip), %rdx      # 0xb589
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2150
jmp 0x475a
movl -0x50(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x45de
jmp 0x475a
movl -0x50(%rbp), %eax
andl $-0x3, %eax
movl %eax, -0x50(%rbp)
movq 0xba0a(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movzbl 0xc182(%rip), %ecx      # 0x1077a
leaq 0x7278(%rip), %rsi      # 0xb877
leaq 0x6f83(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movb 0xc167(%rip), %cl       # 0x1077a
movq -0x40(%rbp), %rax
movb %cl, 0x3(%rax)
jmp 0x475a
movq -0x60(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x71, %eax
jne 0x471a
cmpl $0x0, 0xc131(%rip)      # 0x10768
jne 0x471a
movq -0x40(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4657
movl $0x1, 0xc0bd(%rip)      # 0x10714
jmp 0x4659
movq 0xb998(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xc0ab(%rip), %ecx      # 0x10714
leaq 0x7224(%rip), %rsi      # 0xb894
leaq 0x6f12(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x40(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x46e0
movl 0xc084(%rip), %eax      # 0x10718
andl $0xffff0000, %eax       # imm = 0xFFFF0000
orl $0x1, %eax
movl %eax, 0xc076(%rip)      # 0x10718
movq -0x40(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x46ca
movl 0xc060(%rip), %eax      # 0x10718
andl $0xffff, %eax           # imm = 0xFFFF
orl $0x10000, %eax          # imm = 0x10000
movl %eax, 0xc050(%rip)      # 0x10718
jmp 0x46de
movl 0xc048(%rip), %eax      # 0x10718
andl $0xffff, %eax           # imm = 0xFFFF
orl $0x0, %eax
movl %eax, 0xc03a(%rip)      # 0x10718
jmp 0x46e0
jmp 0x46e2
movq 0xb90f(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movl 0xc026(%rip), %ecx      # 0x10718
andl $0xffff, %ecx           # imm = 0xFFFF
movl 0xc019(%rip), %r8d      # 0x10718
shrl $0x10, %r8d
leaq 0x71ac(%rip), %rsi      # 0xb8b6
leaq 0x6e78(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x471a
jmp 0x475a
jmp 0x471e
cmpb $0x0, 0xbbab(%rip)      # 0x102d0
je 0x4756
movq 0xb8ca(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x40(%rbp), %rax
movzwl (%rax), %ecx
movq -0x40(%rbp), %rax
movzbl 0x2(%rax), %r8d
leaq 0x7190(%rip), %rsi      # 0xb8d8
leaq 0x6e3a(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
jmp 0x4758
jmp 0x475a
movq -0x40(%rbp), %rax
movzbl 0x2(%rax), %eax
addq $0x3, %rax
movw %ax, -0x34(%rbp)
movzwl -0x34(%rbp), %ecx
movzwl -0x42(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x42(%rbp)
movq -0x40(%rbp), %rax
movzwl -0x34(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
jmp 0x432a
movl -0x4c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x48a5
movzbl 0xbfcf(%rip), %eax      # 0x10774
cmpl $0x0, %eax
je 0x48a5
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x6f, %eax
jle 0x47db
movq -0x70(%rbp), %rax
movb $0x44, (%rax)
movq -0x70(%rbp), %rax
movb $0x0, 0x1(%rax)
jmp 0x47ea
movq -0x70(%rbp), %rax
movb $0x3c, (%rax)
movq -0x70(%rbp), %rax
movb $0x0, 0x1(%rax)
jmp 0x47ec
movq 0xb805(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x70(%rbp), %rax
movzbl 0x1(%rax), %ecx
movq -0x70(%rbp), %rax
movzbl (%rax), %r8d
leaq 0x70f0(%rip), %rsi      # 0xb8fd
leaq 0x6d75(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x70(%rbp), %rax
movb $0x6, 0x2(%rax)
movb $0x0, -0x51(%rbp)
movzbl -0x51(%rbp), %eax
cmpl $0x6, %eax
jge 0x4856
movq -0x20(%rbp), %rax
movzbl -0x51(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x70(%rbp), %rax
movzbl -0x51(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movb -0x51(%rbp), %al
addb $0x1, %al
movb %al, -0x51(%rbp)
jmp 0x4827
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x9, %rcx
movq %rcx, (%rax)
movzwl -0x32(%rbp), %eax
addl $0x9, %eax
movw %ax, -0x32(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
subq $0x6, %rax
movw %ax, -0x34(%rbp)
movzwl -0x34(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
movzwl -0x34(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movw %ax, -0x34(%rbp)
movl -0x50(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x48cf
movzbl 0xbeb3(%rip), %ecx      # 0x10775
addl $0x3, %ecx
movzwl -0x34(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x34(%rbp)
movl -0x50(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x48e5
movzwl -0x34(%rbp), %eax
addl $0x4, %eax
movw %ax, -0x34(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x4a86
jmp 0x48f1
movq 0xb700(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x7020(%rip), %rsi      # 0xb922
leaq 0x6c80(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x68(%rbp), %rax
movq %rax, -0x10(%rbp)
movzwl -0x34(%rbp), %eax
subq $0x6, %rax
movw %ax, -0x34(%rbp)
movzwl -0x34(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
movzwl -0x34(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x50(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x49f3
jmp 0x496b
movq 0xb686(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x6fbd(%rip), %rsi      # 0xb939
leaq 0x6c06(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x5b, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x1, (%rax)
movb 0xbdc1(%rip), %cl       # 0x10775
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movzbl 0xbda5(%rip), %eax      # 0x10775
movl %eax, %edx
leaq 0xbd9d(%rip), %rsi      # 0x10776
callq 0x2180
movzbl 0xbd90(%rip), %ecx      # 0x10775
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x50(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4a6c
jmp 0x4a00
movq 0xb5f1(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x6f3e(%rip), %rsi      # 0xb94f
leaq 0x6b71(%rip), %rdx      # 0xb589
movb $0x0, %al
callq 0x2150
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $-0x1a, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x1, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x1, (%rax)
movb 0xbd1f(%rip), %cl       # 0x1077a
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rcx
movq -0x68(%rbp), %rax
subq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x4a88
movl -0x48(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)