// File: /workspace/github_c_makefile_star2_O3/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 $0x88, %rsp
movq %rdi, %rbx
leaq 0x14(%rsp), %rsi
callq 0xe8a1c
movl $0x220, %esi            # imm = 0x220
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
movl $0x80, %r13d
movl $0x80, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf09c5
movq %rax, 0x20(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeb499
movq %rax, 0x30(%r14)
movq %rbx, %rdi
movl $0x20, %esi
callq 0xeb499
movq %rax, 0x28(%r14)
cmpb $0x0, 0xc(%r14)
jne 0x2a59f
leaq 0x40(%r14), %r15
leaq 0xc8(%r14), %rax
movq %rax, 0x20(%rsp)
leaq 0x41(%r14), %rax
movq %rax, 0x30(%rsp)
movq %r14, %rax
addq $0x50, %rax
movq %rax, 0x28(%rsp)
movq 0x18(%r14), %rsi
leaq 0x8(%rsp), %r12
movq 0x18(%rbx), %rdi
movq %r12, %rdx
leaq 0x38(%rsp), %rcx
callq 0xf166d
testl %eax, %eax
je 0x2a59f
movq 0x8(%rsp), %rcx
cmpq %r13, %rcx
cmovgeq %r13, %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 0xee8d4
movq 0x38(%r14), %rbp
testq %rbp, %rbp
jle 0x29ebe
xorl %esi, %esi
cmpb $0x20, (%r15,%rsi)
ja 0x29e9f
incq %rsi
cmpq %rsi, %rbp
jne 0x29e8d
movq %rbp, %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %rsi
je 0x29ebe
subq %rsi, %rbp
addq %r15, %rsi
movq %r15, %rdi
movq %rbp, %rdx
callq 0x18270
movq %rbp, 0x38(%r14)
movl 0x8(%r14), %eax
cmpq $0x4, %rax
ja 0x2a587
leaq 0xeb2bd(%rip), %rcx     # 0x115190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movdqu (%r15), %xmm0
pcmpeqb 0xeb287(%rip), %xmm0    # 0x115170
movzwl 0x10(%r15), %eax
movd %eax, %xmm1
pcmpeqb 0xeb286(%rip), %xmm1    # 0x115180
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0x2a587
movl $0x158, %edx            # imm = 0x158
movq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x18140
movq 0x18(%r14), %rax
movq 0x30(%r14), %rdi
movq %rax, 0xc0(%r14)
callq 0xeb7fe
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0x11bfaa(%rip), %rsi    # 0x145eed
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x1, 0x8(%r14)
incl 0x10(%r14)
jmp 0x2a587
cmpq $0x0, (%r14)
je 0x2a53e
addq $-0x40, %rbp
cmpq $-0x3d, %rbp
ja 0x2a197
cmpb $0x0, 0xc(%r14)
jne 0x2a53e
movw $0x101, 0xc(%r14)       # imm = 0x101
jmp 0x2a53e
movzbl (%r15), %eax
leal -0x41(%rax), %ecx
cmpb $0xe, %cl
ja 0x2a182
addq $-0x40, %rax
movq %rax, 0xc8(%r14)
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rbp
movq 0xc8(%r14), %rdx
movq %rax, %rdi
movq 0x30(%rsp), %rsi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xf6cdd
movq %rbp, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0x111d63(%rip), %rsi    # 0x13bd4e
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
callq 0xf145f
movq 0x20(%r14), %rcx
movl $0x9, %edx
movq %r14, %rdi
movq 0x28(%rsp), %rsi
callq 0x2a73f
movq 0x20(%r14), %rdi
xorl %esi, %esi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef0f6
movq %rax, 0xd0(%r14)
movq %rbx, %rdi
leaq 0xeb1b6(%rip), %rsi     # 0x1151f3
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movl $0x3, %esi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef0f6
movq %rax, 0xd8(%r14)
movq %rbx, %rdi
leaq 0xeb18e(%rip), %rsi     # 0x115201
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq $0x6, (%rsp)
movq (%r14), %rax
movq 0xd8(%r14), %rcx
movq %rcx, 0x18(%rsp)
testq %rcx, %rcx
je 0x2a22a
testq %rax, %rax
je 0x2a508
movq $0x15, (%rsp)
movl $0x15, %esi
jmp 0x2a417
movq (%r14), %rax
testq %rax, %rax
je 0x2a587
cmpq $0x0, 0x20(%rax)
je 0x2a587
movq 0x20(%r14), %rdi
callq 0xf145f
movq 0x20(%r14), %rcx
movl $0x10, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a73f
movq 0x20(%r14), %rsi
movq 0x30(%r14), %rdi
movl $0x30, %ecx
xorl %edx, %edx
callq 0xeb944
movq (%r14), %rax
movq 0x8(%rax), %rdi
subq 0x10(%rax), %rdi
movl $0x30, %esi
callq 0xe9c3b
movq %rax, %rbp
movq (%r14), %rax
movq 0x20(%r14), %rdi
movq 0x20(%rax), %rcx
xorl %esi, %esi
movq %rbp, %rdx
callq 0xef481
movq 0x118(%r14), %rax
addq $0x30, %rax
movq %rax, 0x118(%r14)
cmpq 0x108(%r14), %rax
jl 0x2a150
movl $0x4, 0x8(%r14)
movq (%r14), %rax
addq %rbp, 0x10(%rax)
jmp 0x2a587
xorl %eax, %eax
movzbl 0x40(%r14,%rax), %ecx
movb %al, 0x120(%r14,%rcx)
incq %rax
cmpq $0x40, %rax
jne 0x2a15e
movl $0x2, 0x8(%r14)
jmp 0x2a587
cmpb $0x0, 0xc(%r14)
jne 0x2a190
movw $0x101, 0xc(%r14)       # imm = 0x101
xorl %ebp, %ebp
jmp 0x2a577
movq %r12, %r13
movq 0x20(%r14), %rdi
callq 0xf145f
movq 0x20(%r14), %rcx
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a73f
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0xeebc8
movq %rax, %r12
movq %rbx, %rdi
leaq 0xeb0e3(%rip), %rsi     # 0x1152b2
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x30(%r14), %rdi
callq 0xeb865
movl %eax, %ebp
movq %rbx, %rdi
leaq 0xeb0e8(%rip), %rsi     # 0x1152d6
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpl %r12d, %ebp
jne 0x2a518
movq (%r14), %rax
movq 0x10(%rax), %rcx
cmpq 0x8(%rax), %rcx
movq %r13, %r12
movl $0x80, %r13d
jl 0x2a53e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a6db
jmp 0x2a53e
testq %rax, %rax
je 0x2a245
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a6db
cmpb $0x0, 0xc(%r14)
jne 0x2a577
movl $0x48, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, (%r14)
testq %rax, %rax
je 0x2a508
movq 0xd0(%r14), %rcx
movq %rcx, 0x8(%rax)
movq 0x20(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xeeb4b
movb %al, 0xe0(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xeaf85(%rip), %rsi     # 0x115211
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeeb4b
movb %al, 0xe1(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xeaf72(%rip), %rsi     # 0x115225
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeebeb
movl %eax, 0xe4(%r14)
movq %rbx, %rdi
leaq 0xeaf60(%rip), %rsi     # 0x115237
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeeb4b
movb %al, 0xe8(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xeaf4d(%rip), %rsi     # 0x11524d
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeebeb
movq %rax, 0xf0(%r14)
movq %rbx, %rdi
leaq 0xeaf3e(%rip), %rsi     # 0x115262
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeebeb
movl %eax, 0xf8(%r14)
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeebeb
movl %eax, 0xfc(%r14)
movq (%r14), %rdi
addq $0x38, %rdi
movl 0xf8(%r14), %esi
movl %eax, %edx
callq 0xeabc0
movq (%r14), %rdi
addq $0x38, %rdi
movl $0x40, %edx
leaq 0x40(%rsp), %r12
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xeaf46
movq %rbx, %rdi
leaq 0x11eff4(%rip), %rsi    # 0x149382
leaq 0x10508b(%rip), %rdx    # 0x12f420
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
movq 0x20(%r14), %rdi
movq %rsp, %r12
movq %r12, %rsi
callq 0xeebeb
movl %eax, 0x100(%r14)
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xeebeb
movl %eax, 0x104(%r14)
movq (%r14), %rdi
addq $0x28, %rdi
movl 0x100(%r14), %esi
movl %eax, %edx
callq 0xeabc0
movq (%r14), %rdi
addq $0x28, %rdi
movl $0x40, %edx
leaq 0x40(%rsp), %r12
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xeaf46
movq %rbx, %rdi
leaq 0x11ef80(%rip), %rsi    # 0x149382
leaq 0x103c4b(%rip), %rdx    # 0x12e054
movq %r12, %rcx
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rsi
movq 0x20(%r14), %rdi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xef0f6
movq %rax, 0x108(%r14)
movq %rbx, %rdi
leaq 0xeae3c(%rip), %rsi     # 0x11527a
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq $0x3, (%rsp)
movq 0x20(%r14), %rdi
movq %rsp, %rsi
callq 0xeebeb
movl %eax, 0x110(%r14)
movq %rbx, %rdi
leaq 0x1021f3(%rip), %rsi    # 0x12c65d
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x28(%r14), %rdi
callq 0xeb7fe
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
movl $0x18, %ecx
xorl %edx, %edx
callq 0xeb944
movq 0x28(%r14), %rdi
callq 0xeb865
movl %eax, %r12d
movq %rbx, %rdi
leaq 0x1050cf(%rip), %rsi    # 0x12f575
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpl 0x110(%r14), %r12d
jne 0x2a555
movq (%r14), %rcx
movq 0xd8(%r14), %rax
cmpq 0x10(%rcx), %rax
leaq 0x8(%rsp), %r12
jne 0x2a508
cmpq $0x0, 0x18(%rsp)
jne 0x2a504
cmpq $0x0, 0x18(%rcx)
jne 0x2a4ef
movq %rbp, %rdi
callq 0xf66ff
movq (%r14), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, 0x20(%rcx)
jne 0x2a504
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a7f0
movq (%r14), %rcx
incl (%rcx)
jmp 0x2a577
cmpb $0x0, 0xc(%r14)
jne 0x2a577
movw $0x101, 0xc(%r14)       # imm = 0x101
jmp 0x2a577
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0xeadd3(%rip), %rsi     # 0x1152fc
xorl %eax, %eax
callq 0xe9295
movb $0x1, 0xc(%r14)
movq %r13, %r12
movl $0x80, %r13d
movl $0x0, 0x8(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
jmp 0x2a587
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0xead21(%rip), %rsi     # 0x115287
xorl %eax, %eax
callq 0xe9295
movb $0x1, 0xc(%r14)
leaq 0x8(%rsp), %r12
movq %rbp, %rdi
callq 0xf6753
movl $0x3, 0x8(%r14)
movq 0x18(%r14), %rsi
addq 0x38(%rsp), %rsi
movq %rsi, 0x18(%r14)
cmpb $0x0, 0xc(%r14)
je 0x29e16
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a6db
movq 0x20(%r14), %rdi
callq 0xf052b
movq 0x28(%r14), %rdi
callq 0xeb858
movq 0x30(%r14), %rdi
callq 0xeb858
cmpb $0x0, 0xd(%r14)
je 0x2a5eb
leaq 0xeabd5(%rip), %rsi     # 0x1151b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x2a5f9
cmpl $0x0, 0x10(%r14)
jne 0x2a5f9
cmpb $0x0, 0xc(%r14)
je 0x2a616
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeabad(%rip), %rsi     # 0x1151ca
jmp 0x2a5df