// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/binscii.c
// Function: de_run_binscii
static void de_run_binscii(deark *c, de_module_params *mparams)
{
	struct binscii_ctx *d = NULL;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	d = de_malloc(c, sizeof(struct binscii_ctx));
	d->tmpdbuf = dbuf_create_membuf(c, 128, 0);
	d->crco_segdata = de_crcobj_create(c, DE_CRCOBJ_CRC16_XMODEM);
	d->crco_header = de_crcobj_create(c, DE_CRCOBJ_CRC16_XMODEM);

	while(1) {
		int ret;
		i64 content_len, total_len;

		if(d->errflag) goto done;
		ret = dbuf_find_line(c->infile, d->pos, &content_len, &total_len);
		if(!ret) goto done;

		d->linebuf_used = (content_len<=BINSCII_LINE_MAXLEN) ? content_len : BINSCII_LINE_MAXLEN;
		binscii_read_line_to_linebuf(c, d);
		do_binscii_line(c, d);
		d->pos += total_len;
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
	if(d) {
		binscii_close_cur_file(c, d);
		dbuf_close(d->tmpdbuf);
		de_crcobj_destroy(d->crco_header);
		de_crcobj_destroy(d->crco_segdata);
		if(d->need_errmsg) {
			de_err(c, "Failed to decode file");
		}
		else if(d->seg_count_total==0 && !d->errflag) {
			de_err(c, "No BinSCII data found");
		}
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x24(%rsp), %rsi
callq 0xe958c
movl $0x220, %esi            # imm = 0x220
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movl $0x80, %r12d
movl $0x80, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf0faf
movq %rax, 0x20(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeba56
movq %rax, 0x30(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeba56
movq %rax, 0x28(%r14)
cmpb $0x0, 0xc(%r14)
jne 0x2a64a
leaq 0x40(%r14), %r15
leaq 0x41(%r14), %rax
movq %rax, 0x40(%rsp)
leaq 0x50(%r14), %rax
movq %rax, 0x38(%rsp)
leaq 0xc0(%r14), %rax
movq %rax, 0x30(%rsp)
leaq 0x18(%rsp), %rbp
movq 0x18(%rbx), %rdi
movq 0x18(%r14), %rsi
movq %rbp, %rdx
leaq 0x48(%rsp), %rcx
callq 0xf1c72
testl %eax, %eax
je 0x2a64a
movq 0x18(%rsp), %rcx
cmpq %r12, %rcx
cmovgeq %r12, %rcx
movq %rcx, 0x38(%r14)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x70(%r15)
movdqu %xmm0, 0x60(%r15)
movdqu %xmm0, 0x50(%r15)
movdqu %xmm0, 0x40(%r15)
movdqu %xmm0, 0x30(%r15)
movdqu %xmm0, 0x20(%r15)
movdqu %xmm0, 0x10(%r15)
movdqu %xmm0, (%r15)
movq 0x18(%rbx), %rdi
movq 0x18(%r14), %rdx
movq %r15, %rsi
callq 0xeeee8
movq 0x38(%r14), %r13
xorl %eax, %eax
testq %r13, %r13
jle 0x29f14
cmpb $0x20, (%r15,%rax)
ja 0x29f14
incq %rax
cmpq %rax, %r13
jne 0x29f02
movq %r13, %rax
testl %eax, %eax
je 0x29f2f
movl %eax, %esi
subq %rsi, %r13
addq %r15, %rsi
movq %r15, %rdi
movq %r13, %rdx
callq 0x18270
movq %r13, 0x38(%r14)
movl 0x8(%r14), %eax
cmpq $0x4, %rax
ja 0x2a636
leaq 0xeb19c(%rip), %rcx     # 0x1150e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movdqu (%r15), %xmm0
pcmpeqb 0xeb166(%rip), %xmm0    # 0x1150c0
movzwl 0x10(%r15), %eax
movd %eax, %xmm1
pcmpeqb 0xeb165(%rip), %xmm1    # 0x1150d0
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x2a636
movl $0x160, %edx            # imm = 0x160
movq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x18140
movq 0x18(%r14), %rax
movq 0x30(%r14), %rdi
movq %rax, 0xc0(%r14)
callq 0xebdc3
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0x11ba29(%rip), %rsi    # 0x1459dd
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x1, 0x8(%r14)
incl 0x10(%r14)
jmp 0x2a636
cmpq $0x0, (%r14)
je 0x2a317
movq 0x38(%r14), %rax
addq $-0x40, %rax
cmpq $-0x3d, %rax
ja 0x2a251
cmpb $0x0, 0xc(%r14)
jne 0x2a317
movw $0x101, 0xc(%r14)       # imm = 0x101
jmp 0x2a317
movzbl (%r15), %eax
leal -0x41(%rax), %ecx
cmpb $0xe, %cl
ja 0x2a23b
addq $-0x40, %rax
movq %rax, 0xc8(%r14)
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r13
movq 0xc8(%r14), %rdx
movq %rax, %rdi
movq 0x40(%rsp), %rsi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xf7131
movq %r13, 0x10(%rsp)
movq %r13, %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0x11196f(%rip), %rsi    # 0x13b9d4
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
callq 0xf1a5f
movq 0x20(%r14), %rcx
movl $0x9, %edx
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0x2a7d7
movq $0x0, 0x8(%rsp)
movq 0x20(%r14), %rdi
xorl %esi, %esi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef6f2
movq %rax, 0xd0(%r14)
movq %rbx, %rdi
leaq 0xeb083(%rip), %rsi     # 0x115143
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rsp), %rsi
addq $0x3, %rsi
movq %rsi, 0x8(%rsp)
movq 0x20(%r14), %rdi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef6f2
movq %rax, 0xd8(%r14)
movq %rbx, %rdi
leaq 0xeb052(%rip), %rsi     # 0x115151
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x3, 0x8(%rsp)
movq 0xd8(%r14), %r13
testq %r13, %r13
jne 0x2a147
cmpq $0x0, (%r14)
je 0x2a137
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a773
cmpb $0x0, 0xc(%r14)
jne 0x2a2e7
movl $0x48, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, (%r14)
movq (%r14), %rax
testq %rax, %rax
je 0x2a2d9
testq %r13, %r13
movq %r13, 0x28(%rsp)
je 0x2a331
addq $0x7, 0x8(%rsp)
leaq 0x8(%rsp), %rbp
jmp 0x2a408
movq (%r14), %rax
testq %rax, %rax
je 0x2a636
cmpq $0x0, 0x20(%rax)
je 0x2a636
movq 0x20(%r14), %rdi
callq 0xf1a5f
movq 0x20(%r14), %rcx
movl $0x10, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a7d7
movq 0x20(%r14), %rsi
movq 0x30(%r14), %rdi
movl $0x30, %ecx
xorl %edx, %edx
callq 0xebf09
movq (%r14), %rax
movq 0x8(%rax), %rdi
subq 0x10(%rax), %rdi
movl $0x30, %esi
callq 0xea792
movq %rax, %r13
movq (%r14), %rax
movq 0x20(%r14), %rdi
movq 0x20(%rax), %rcx
xorl %esi, %esi
movq %r13, %rdx
callq 0xefabc
movq 0x118(%r14), %rax
addq $0x30, %rax
movq %rax, 0x118(%r14)
cmpq 0x108(%r14), %rax
jl 0x2a209
movl $0x4, 0x8(%r14)
movq (%r14), %rax
addq %r13, 0x10(%rax)
jmp 0x2a636
xorl %eax, %eax
movzbl 0x40(%r14,%rax), %ecx
movb %al, 0x120(%r14,%rcx)
incq %rax
cmpq $0x40, %rax
jne 0x2a217
movl $0x2, 0x8(%r14)
jmp 0x2a636
cmpb $0x0, 0xc(%r14)
jne 0x2a249
movw $0x101, 0xc(%r14)       # imm = 0x101
xorl %r13d, %r13d
jmp 0x2a626
movq %rbp, %r12
movq 0x20(%r14), %rdi
callq 0xf1a5f
movq 0x20(%r14), %rcx
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a7d7
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0xef1ca
movq %rax, %r13
movq %rbx, %rdi
leaq 0xeaf79(%rip), %rsi     # 0x115202
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x30(%r14), %rdi
callq 0xebe2a
movl %eax, %ebp
movq %rbx, %rdi
leaq 0xeaf7e(%rip), %rsi     # 0x115226
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
cmpl %r13d, %ebp
jne 0x2a2f1
movq (%r14), %rax
movq 0x10(%rax), %rcx
cmpq 0x8(%rax), %rcx
movq %r12, %rbp
movl $0x80, %r12d
jl 0x2a317
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a773
jmp 0x2a317
cmpb $0x0, 0xc(%r14)
jne 0x2a2e7
movw $0x101, 0xc(%r14)       # imm = 0x101
movq 0x10(%rsp), %r13
jmp 0x2a626
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0xeaf4a(%rip), %rsi     # 0x11524c
xorl %eax, %eax
callq 0xe9df7
movb $0x1, 0xc(%r14)
movq %r12, %rbp
movl $0x80, %r12d
movl $0x0, 0x8(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0x2a636
movq 0xd0(%r14), %rcx
movq %rcx, 0x8(%rax)
movq 0x20(%r14), %rdi
leaq 0x8(%rsp), %rbp
movq %rbp, %rsi
callq 0xef14d
movb %al, 0xe0(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xeae00(%rip), %rsi     # 0x115161
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef14d
movb %al, 0xe1(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xeaded(%rip), %rsi     # 0x115175
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movl %eax, 0xe4(%r14)
movq %rbx, %rdi
leaq 0xeaddb(%rip), %rsi     # 0x115187
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef14d
movb %al, 0xe8(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xeadc8(%rip), %rsi     # 0x11519d
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movq %rax, 0xf0(%r14)
movq %rbx, %rdi
leaq 0xeadb9(%rip), %rsi     # 0x1151b2
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x28(%rsp), %r13
testq %r13, %r13
je 0x2a418
addq $0x8, 0x8(%rsp)
jmp 0x2a4f5
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movl %eax, 0xf8(%r14)
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movl %eax, 0xfc(%r14)
movq (%r14), %rdi
addq $0x38, %rdi
movl 0xf8(%r14), %esi
movl %eax, %edx
callq 0xeb11b
movq (%r14), %rdi
addq $0x38, %rdi
movl $0x40, %edx
leaq 0x50(%rsp), %r13
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
movq %rbx, %rdi
leaq 0x11e972(%rip), %rsi    # 0x148dea
leaq 0x104cbe(%rip), %rdx    # 0x12f13d
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movl %eax, 0x100(%r14)
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movl %eax, 0x104(%r14)
movq (%r14), %rdi
addq $0x28, %rdi
movl 0x100(%r14), %esi
movl %eax, %edx
callq 0xeb11b
movq (%r14), %rdi
addq $0x28, %rdi
movl $0x40, %edx
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
movq %rbx, %rdi
leaq 0x11e906(%rip), %rsi    # 0x148dea
leaq 0x103871(%rip), %rdx    # 0x12dd5c
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%rsp), %r13
movq 0x20(%r14), %rdi
movq 0x8(%rsp), %rsi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef6f2
movq %rax, 0x108(%r14)
movq %rbx, %rdi
leaq 0xeaca4(%rip), %rsi     # 0x1151ca
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x3, 0x8(%rsp)
movq 0x20(%r14), %rdi
movq %rbp, %rsi
callq 0xef1ed
movl %eax, 0x110(%r14)
movq %rbx, %rdi
leaq 0x101e22(%rip), %rsi    # 0x12c375
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x28(%r14), %rdi
callq 0xebdc3
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
movl $0x18, %ecx
xorl %edx, %edx
callq 0xebf09
movq 0x28(%r14), %rdi
callq 0xebe2a
movl %eax, %ebp
movq %rbx, %rdi
leaq 0x104d04(%rip), %rsi    # 0x12f292
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
cmpl 0x110(%r14), %ebp
jne 0x2a5ef
movq (%r14), %rax
movq 0xd8(%r14), %rcx
cmpq 0x10(%rax), %rcx
jne 0x2a613
cmpq $0x0, 0x28(%rsp)
leaq 0x18(%rsp), %rbp
jne 0x2a5e8
cmpq $0x0, 0x18(%rax)
jne 0x2a5d3
movq %r13, %rdi
callq 0xf6b5c
movq (%r14), %rcx
movq %rax, 0x18(%rcx)
movq (%r14), %rax
cmpq $0x0, 0x20(%rax)
jne 0x2a5e8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a888
movq (%r14), %rax
incl (%rax)
jmp 0x2a626
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0xeabd7(%rip), %rsi     # 0x1151d7
xorl %eax, %eax
callq 0xe9df7
movb $0x1, 0xc(%r14)
leaq 0x18(%rsp), %rbp
jmp 0x2a626
cmpb $0x0, 0xc(%r14)
leaq 0x18(%rsp), %rbp
jne 0x2a626
movw $0x101, 0xc(%r14)       # imm = 0x101
movq %r13, %rdi
callq 0xf6bb0
movl $0x3, 0x8(%r14)
movq 0x48(%rsp), %rax
addq %rax, 0x18(%r14)
cmpb $0x0, 0xc(%r14)
je 0x29e87
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
testq %r14, %r14
je 0x2a6b4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a773
movq 0x20(%r14), %rdi
callq 0xf0b13
movq 0x28(%r14), %rdi
callq 0xebe1d
movq 0x30(%r14), %rdi
callq 0xebe1d
cmpb $0x0, 0xd(%r14)
je 0x2a69b
leaq 0xeaa75(%rip), %rsi     # 0x115104
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x2a6a9
cmpl $0x0, 0x10(%r14)
jne 0x2a6a9
cmpb $0x0, 0xc(%r14)
je 0x2a6c6
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeaa4d(%rip), %rsi     # 0x11511a
jmp 0x2a68f