// File: /workspace/github_c_makefile_star2_O3/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 0xe8b2b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xeb220
movl %eax, (%r14)
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2fdca
testl %eax, %eax
je 0x2f8af
movq 0x10(%rsp), %r15
leaq 0x70(%r14), %r12
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
movl $0xff, %esi
callq 0x18140
xorl %eax, %eax
leaq 0xe780c(%rip), %rcx     # 0x116f60
movzbl (%rax,%rcx), %edx
movb %al, (%r12,%rdx)
incq %rax
cmpq $0x40, %rax
jne 0x2f754
leaq 0xe76d6(%rip), %rsi     # 0x116e42
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x8(%r14)
movq %rax, %rdi
callq 0xf0855
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x10(%r14)
movq %rax, %rdi
callq 0xf0855
movq 0x18(%rbx), %rdi
cmpq %r15, 0x18(%rdi)
jle 0x2fca3
movabsq $0x100002600, %rbp      # imm = 0x100002600
movl $0x0, 0x8(%rsp)
movq %r15, %rsi
callq 0xeead3
movzbl %al, %eax
cmpb $0x3a, %al
ja 0x2f803
btq %rax, %rbp
jae 0x2f7f9
incq %r15
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %r15
jl 0x2f7d2
jmp 0x2fca3
cmpq $0x3a, %rax
je 0x2f8c5
movb (%r12,%rax), %dl
cmpb $0x40, %dl
jae 0x2fc8f
cmpl $0x6, %r13d
ja 0x2f7e7
movl %r13d, %eax
leaq 0xe7548(%rip), %rcx     # 0x116d68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x6, %r13d
movl %edx, %eax
jmp 0x2f8a6
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 0xf0bd6
movl %r13d, %eax
andb $0x3, %al
movl $0x2, %r13d
jmp 0x2f8a6
movl 0x8(%rsp), %eax
shlb $0x6, %al
orb %dl, %al
movq 0x8(%r14), %rdi
movl %eax, 0x8(%rsp)
movzbl %al, %esi
callq 0xf0bd6
xorl %r13d, %r13d
jmp 0x2f7e7
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 0xf0bd6
movl %r13d, %eax
andb $0xf, %al
movl $0x4, %r13d
movl %eax, 0x8(%rsp)
jmp 0x2f7e7
leaq 0xe74f5(%rip), %rsi     # 0x116dab
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x2fcd6
movq 0x8(%r14), %rdi
callq 0xf08ba
movq 0x8(%r14), %rax
movl 0x18(%rax), %edx
leaq 0xe75b6(%rip), %rsi     # 0x116e92
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq 0x8(%r14), %rdi
callq 0xf08ba
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 0xfa1dc
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 0xfa8e2
movq (%r12), %rdi
callq 0xf08ba
cmpl $0x0, (%r13)
je 0x2f981
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0xfa1a4
leaq 0xe53f0(%rip), %rsi     # 0x114d5f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9295
jmp 0x2fcac
movq 0x10(%r14), %rax
movl 0x18(%rax), %edx
leaq 0xe74cc(%rip), %rsi     # 0x116e5b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
callq 0xfc498
movq %rax, 0x18(%r14)
movq 0x10(%r14), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0xeead3
movzbl %al, %r13d
leaq 0x115564(%rip), %rsi    # 0x144f22
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
testb %r13b, %r13b
je 0x2fa3e
movl (%r14), %r9d
movl $0x1, %esi
movq %r15, %rdi
movq %r13, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xef87c
movq %rax, %r12
movq 0x18(%r14), %rax
movq 0x68(%rax), %rdi
movq 0x18(%r12), %rsi
callq 0xf6509
movq 0x18(%r14), %rax
movb $0x1, 0x79(%rax)
movq 0x18(%r12), %rdi
callq 0xf70f6
leaq 0xf2d64(%rip), %rsi     # 0x12277b
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rdi
movq 0x8(%r12), %rsi
movq %r12, 0x8(%rsp)
movq 0x10(%r12), %rdx
callq 0xfc530
jmp 0x2fa60
movq 0x18(%r14), %rax
movq 0x68(%rax), %rdi
leaq 0x105d70(%rip), %rsi    # 0x1357bd
movl $0x5, %edx
callq 0xf65e3
movq $0x0, 0x8(%rsp)
leaq 0x2(%r13), %rsi
leaq 0x68(%rsp), %rdx
movq %r15, %rdi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x78(%rsp), %rbp
leaq 0xe4eb6(%rip), %rsi     # 0x11493b
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rax
movl -0x10(%rbp), %ecx
movl %ecx, 0x90(%rax)
movq 0x18(%r14), %rax
movb $0x1, %r12b
movb %r12b, 0x7b(%rax)
leaq 0x6(%r13), %rsi
leaq 0x38(%rsp), %rdx
movq %r15, %rdi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0xf1762
leaq 0x48(%rsp), %rbp
leaq 0x10481c(%rip), %rsi    # 0x1342eb
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r14), %rax
movl -0x10(%rbp), %ecx
movl %ecx, 0x94(%rax)
movq 0x18(%r14), %rax
movb %r12b, 0x7c(%rax)
leaq 0xa(%r13), %rax
leaq 0x18(%rsp), %rbp
movq %rax, (%rbp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0xeeb91
movq 0x18(%r14), %rcx
movw %ax, 0x7e(%rcx)
movb %r12b, 0x7d(%rcx)
movzwl %ax, %edx
leaq 0xf980e(%rip), %rsi     # 0x12932d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %r15, %rdi
movq %rbp, %rsi
callq 0xeed31
leaq 0x20(%r14), %r13
movq %rax, 0x28(%r14)
leaq 0xe7367(%rip), %rsi     # 0x116eaa
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %r15, %rdi
movq %rbp, %rsi
callq 0xeed31
movq %rax, 0x50(%r14)
leaq 0xe7357(%rip), %rsi     # 0x116ebc
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq %r15, %rdi
movq %rbp, %rsi
callq 0xeeb91
leaq 0xfcada(%rip), %rsi     # 0x12c65d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
leaq 0x10a78f(%rip), %rax    # 0x13a325
movq %rax, 0x40(%r14)
leaq 0xed61f(%rip), %rax     # 0x11d1c0
movq %rax, 0x68(%r14)
movq (%rbp), %rax
movq %rax, 0x20(%r14)
movq 0x28(%r14), %rcx
leaq 0x2(%rax,%rcx), %rax
movq %rax, (%rbp)
movq %rax, 0x48(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeb499
movq %rax, 0x38(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeb499
movq %rax, 0x60(%r14)
movq 0x18(%r14), %rcx
addq $0x10, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2ff0e
testl %eax, %eax
je 0x2fc63
movq %r14, %rbp
addq $0x48, %rbp
movq 0x18(%r14), %rcx
addq $0x38, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2ff0e
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 0x35d(%rip), %rax       # 0x2ffa1
movq %rax, 0x60(%rdi)
callq 0xfc5b7
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2ffef
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ffef
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0xefaca
movq 0x38(%r14), %rdi
callq 0xeb858
xorl %r15d, %r15d
movq %r15, 0x38(%r14)
movq 0x60(%r14), %rdi
callq 0xeb858
movq %r15, 0x60(%r14)
jmp 0x2fcac
leaq 0xe71e2(%rip), %rsi     # 0x116e78
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe9295
movq 0x8(%r14), %rdi
callq 0xf08ba
movq 0x18(%r14), %rdi
callq 0xfc4de
xorl %r15d, %r15d
movq %r15, 0x18(%r14)
movq 0x10(%r14), %rdi
callq 0xf052b
movq %r15, 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0xf052b
movq %r15, 0x8(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq