// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/binhex.c
// Function: de_run_binhex
static void de_run_binhex(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;
	int ret;

	d = de_malloc(c, sizeof(lctx));
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_MACROMAN);

	ret = find_start(c, &pos);
	if(!ret) {
		de_err(c, "Not a BinHex file, or not a supported type");
		goto done;
	}

	do_binhex(c, d, pos);

done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
movl $0x170, %esi            # imm = 0x170
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xeb7d1
movl %eax, (%r14)
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2ff10
testl %eax, %eax
je 0x2f9df
movq 0x18(%rsp), %r15
leaq 0x70(%r14), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
movl $0xff, %esi
callq 0x18140
xorl %eax, %eax
leaq 0xe762c(%rip), %rcx     # 0x116eb0
movzbl (%rax,%rcx), %edx
movb %al, (%r12,%rdx)
incq %rax
cmpq $0x40, %rax
jne 0x2f884
leaq 0xe74f6(%rip), %rsi     # 0x116d92
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9226
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf0faf
movq %rax, 0x8(%r14)
movq %rax, %rdi
callq 0xf0e3f
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf0faf
movq %rax, 0x10(%r14)
movq %rax, %rdi
callq 0xf0e3f
movq 0x18(%rbx), %rdi
cmpq %r15, 0x18(%rdi)
jle 0x2fdef
movabsq $0x100002600, %rbp      # imm = 0x100002600
movl $0x0, 0x8(%rsp)
movq %r15, %rsi
callq 0xef0d5
movzbl %al, %eax
cmpb $0x3a, %al
ja 0x2f933
btq %rax, %rbp
jae 0x2f929
incq %r15
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r15
jl 0x2f902
jmp 0x2fdef
cmpq $0x3a, %rax
je 0x2f9f5
movb (%r12,%rax), %dl
cmpb $0x40, %dl
jae 0x2fddb
cmpl $0x6, %r13d
ja 0x2f917
movl %r13d, %eax
leaq 0xe7368(%rip), %rcx     # 0x116cb8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x6, %r13d
movl %edx, %eax
jmp 0x2f9d6
movl 0x8(%rsp), %ecx
shlb $0x4, %cl
movl %edx, %eax
shrb $0x2, %al
orb %cl, %al
movq 0x8(%r14), %rdi
movzbl %al, %esi
movl %edx, %r13d
callq 0xf11be
movl %r13d, %eax
andb $0x3, %al
movl $0x2, %r13d
jmp 0x2f9d6
movl 0x8(%rsp), %eax
shlb $0x6, %al
orb %dl, %al
movq 0x8(%r14), %rdi
movl %eax, 0x8(%rsp)
movzbl %al, %esi
callq 0xf11be
xorl %r13d, %r13d
jmp 0x2f917
movl 0x8(%rsp), %ecx
shlb $0x2, %cl
movl %edx, %eax
shrb $0x4, %al
orb %cl, %al
movq 0x8(%r14), %rdi
movzbl %al, %esi
movl %edx, %r13d
callq 0xf11be
movl %r13d, %eax
andb $0xf, %al
movl $0x4, %r13d
movl %eax, 0x8(%rsp)
jmp 0x2f917
leaq 0xe7315(%rip), %rsi     # 0x116cfb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x2fe22
movq 0x8(%r14), %rdi
callq 0xf0ea4
movq 0x8(%r14), %rax
movl 0x18(%rax), %edx
leaq 0xe73d6(%rip), %rsi     # 0x116de2
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq 0x8(%r14), %rdi
callq 0xf0ea4
leaq 0x98(%rsp), %r15
leaq 0x20(%rsp), %r12
leaq 0xb8(%rsp), %r13
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0xfa6e0
movq 0x8(%r14), %rax
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
movq 0x18(%rax), %rax
movq %rax, 0x10(%r15)
movq 0x10(%r14), %rax
movq %rax, (%r12)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xfade6
movq (%r12), %rdi
callq 0xf0ea4
cmpl $0x0, (%r13)
je 0x2fab1
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa6a8
leaq 0xe5210(%rip), %rsi     # 0x114caf
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0x2fdf8
movq 0x10(%r14), %rax
movl 0x18(%rax), %edx
leaq 0xe72ec(%rip), %rsi     # 0x116dab
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
callq 0xfca54
movq %rax, 0x18(%r14)
movq 0x10(%r14), %r15
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
xorl %esi, %esi
callq 0xef0d5
movzbl %al, %ebp
incq 0x10(%rsp)
leaq 0x114f47(%rip), %rsi    # 0x144a42
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
testb %bpl, %bpl
je 0x2fb7a
movq 0x10(%rsp), %rsi
movl (%r14), %r9d
movq %r15, %rdi
movq %rbp, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0xefe67
movq %rax, %r12
movq 0x18(%r14), %rax
movq 0x68(%rax), %rdi
movq 0x18(%r12), %rsi
callq 0xf6969
movq 0x18(%r14), %rax
movb $0x1, 0x79(%rax)
movq 0x18(%r12), %rdi
callq 0xf7557
leaq 0xf2a20(%rip), %rsi     # 0x122573
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rdi
movq 0x8(%r12), %rsi
movq %r12, 0x8(%rsp)
movq 0x10(%r12), %rdx
callq 0xfcaec
jmp 0x2fb9c
movq 0x18(%r14), %rax
movq 0x68(%rax), %rdi
leaq 0x1058a8(%rip), %rsi    # 0x135431
movl $0x5, %edx
callq 0xf6a40
movq $0x0, 0x8(%rsp)
leaq 0x10(%rsp), %r13
movq (%r13), %rax
leaq (%rax,%rbp), %rsi
incq %rsi
movq %rsi, (%r13)
leaq 0x68(%rsp), %rdx
movq %r15, %rdi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
leaq 0x78(%rsp), %rbp
leaq 0xe4c8f(%rip), %rsi     # 0x114860
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rax
movl -0x10(%rbp), %ecx
movl %ecx, 0x90(%rax)
movq 0x18(%r14), %rax
movb $0x1, %r12b
movb %r12b, 0x7b(%rax)
movq (%r13), %rsi
addq $0x4, %rsi
movq %rsi, (%r13)
leaq 0x38(%rsp), %rdx
movq %r15, %rdi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1d74
leaq 0x48(%rsp), %rbp
leaq 0x1042d0(%rip), %rsi    # 0x133ef3
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r14), %rax
movl -0x10(%rbp), %ecx
movl %ecx, 0x94(%rax)
movq 0x18(%r14), %rax
movb %r12b, 0x7c(%rax)
addq $0x4, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0xef193
movq 0x18(%r14), %rcx
movw %ax, 0x7e(%rcx)
movb %r12b, 0x7d(%rcx)
movzwl %ax, %edx
leaq 0xf9492(%rip), %rsi     # 0x1290fd
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
movq %r13, %rsi
callq 0xef34e
leaq 0x20(%r14), %rbp
movq %rax, 0x28(%r14)
leaq 0xe716b(%rip), %rsi     # 0x116dfa
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
movq %r13, %rsi
callq 0xef34e
movq %rax, 0x50(%r14)
leaq 0xe715b(%rip), %rsi     # 0x116e0c
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
movq %r13, %rsi
callq 0xef193
leaq 0xfc6a6(%rip), %rsi     # 0x12c375
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
leaq 0x10a2bf(%rip), %rax    # 0x139fa1
movq %rax, 0x40(%r14)
leaq 0xed3c3(%rip), %rax     # 0x11d0b0
movq %rax, 0x68(%r14)
movq (%r13), %rax
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rcx
leaq 0x2(%rax,%rcx), %rax
movq %rax, (%r13)
movq %rax, 0x48(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeba56
movq %rax, 0x38(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeba56
movq %rax, 0x60(%r14)
movq 0x18(%r14), %rcx
addq $0x10, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x30067
testl %eax, %eax
je 0x2fdaf
movq %r14, %r13
addq $0x48, %r13
movq 0x18(%r14), %rcx
addq $0x38, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x30067
movq 0x18(%r14), %rdi
movq 0x28(%r14), %rax
testq %rax, %rax
setg 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq 0x50(%r14), %rax
testq %rax, %rax
setg 0x38(%rdi)
movq %rax, 0x40(%rdi)
movq %r14, 0x8(%rdi)
leaq 0x36a(%rip), %rax       # 0x300fa
movq %rax, 0x60(%rdi)
callq 0xfcb73
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x30148
movq %rbx, %rdi
movq %r13, %rsi
callq 0x30148
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0xf00aa
movq 0x38(%r14), %rdi
callq 0xebe1d
xorl %r15d, %r15d
movq %r15, 0x38(%r14)
movq 0x60(%r14), %rdi
callq 0xebe1d
movq %r15, 0x60(%r14)
jmp 0x2fdf8
leaq 0xe6fe6(%rip), %rsi     # 0x116dc8
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9df7
movq 0x8(%r14), %rdi
callq 0xf0ea4
movq 0x18(%r14), %rdi
callq 0xfca9a
xorl %r15d, %r15d
movq %r15, 0x18(%r14)
movq 0x10(%r14), %rdi
callq 0xf0b13
movq %r15, 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0xf0b13
movq %r15, 0x8(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq