// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movq %rdi, %rbx
leaq 0x1c(%rsp), %rsi
callq 0xdebae
movl $0x220, %esi            # imm = 0x220
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r14
movl $0x80, %r13d
movl $0x80, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xe59cd
movq %rax, 0x20(%r14)
pushq $0x20
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe0ae9
movq %rax, 0x30(%r14)
movq %rbx, %rdi
movl %ebp, %esi
callq 0xe0ae9
movq %rax, 0x28(%r14)
leaq 0x40(%r14), %r15
leaq 0xc8(%r14), %rax
movq %rax, 0x28(%rsp)
leaq 0x41(%r14), %rax
movq %rax, 0x38(%rsp)
movq %r14, %rax
addq $0x50, %rax
movq %rax, 0x30(%rsp)
leaq 0x8(%rsp), %r12
cmpb $0x0, 0xc(%r14)
jne 0x29acc
movq 0x18(%rbx), %rdi
movq 0x18(%r14), %rsi
movq %r12, %rdx
leaq 0x40(%rsp), %rcx
callq 0xe6482
testl %eax, %eax
je 0x29acc
movq 0x8(%rsp), %rcx
cmpq %r13, %rcx
cmovgeq %r13, %rcx
movq %rcx, 0x38(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r15)
movups %xmm0, 0x60(%r15)
movups %xmm0, 0x50(%r15)
movups %xmm0, 0x40(%r15)
movups %xmm0, 0x30(%r15)
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
movq 0x18(%rbx), %rdi
movq 0x18(%r14), %rdx
movq %r15, %rsi
callq 0xe3cb7
movq 0x38(%r14), %rbp
testq %rbp, %rbp
movl $0x0, %esi
cmovgq %rbp, %rsi
xorl %eax, %eax
cmpq %rax, %rsi
je 0x293c2
cmpb $0x20, 0x40(%r14,%rax)
ja 0x293bf
incq %rax
jmp 0x293ad
movq %rax, %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rax, %rsi
je 0x293e1
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 0x29abe
leaq 0xded0e(%rip), %rcx     # 0x108104
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
leaq 0xded4b(%rip), %rsi     # 0x108154
pushq $0x12
popq %rdx
callq 0x18230
testl %eax, %eax
jne 0x29abe
movl $0x158, %edx            # imm = 0x158
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x18140
movq 0x18(%r14), %rax
movq 0x30(%r14), %rdi
movq %rax, 0xc0(%r14)
callq 0xe0e44
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0x10f64e(%rip), %rsi    # 0x138a9d
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movl $0x1, 0x8(%r14)
incl 0x10(%r14)
jmp 0x29abe
cmpq $0x0, (%r14)
je 0x29775
addq $-0x40, %rbp
cmpq $-0x3d, %rbp
ja 0x296a4
cmpb $0x0, 0xc(%r14)
jne 0x29775
movw $0x101, 0xc(%r14)       # imm = 0x101
jmp 0x29775
movzbl (%r15), %eax
leal -0x41(%rax), %ecx
cmpb $0xe, %cl
ja 0x2968f
addq $-0x40, %rax
movq %rax, 0xc8(%r14)
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r12
movq 0xc8(%r14), %rdx
movq %rax, %rdi
movq 0x38(%rsp), %rsi
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0xeb4a9
movq %r12, (%rsp)
movq %r12, %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0x105567(%rip), %rsi    # 0x12ea5e
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
callq 0xe62cf
movq 0x20(%r14), %rcx
movq %r14, %rdi
movq 0x30(%rsp), %rsi
pushq $0x9
popq %rdx
callq 0x29c44
movq 0x20(%r14), %rdi
xorl %esi, %esi
pushq $0x3
popq %rbp
movl %ebp, %edx
pushq $0x1
popq %r12
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0xe424b
movq %rax, 0xd0(%r14)
movq %rbx, %rdi
leaq 0xdec1e(%rip), %rsi     # 0x108167
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
pushq $0x3
popq %rsi
movl %ebp, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0xe424b
movq %rax, 0xd8(%r14)
movq %rbx, %rdi
leaq 0xdebfd(%rip), %rsi     # 0x108175
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq $0x6, 0x10(%rsp)
movq (%r14), %rax
movq 0xd8(%r14), %rbp
testq %rbp, %rbp
je 0x2972a
movq %rbp, 0x20(%rsp)
testq %rax, %rax
movq (%rsp), %rbp
leaq 0x8(%rsp), %r12
je 0x29a7c
movq $0x15, 0x10(%rsp)
pushq $0x15
popq %rsi
jmp 0x29923
movq (%r14), %rax
testq %rax, %rax
je 0x29abe
cmpq $0x0, 0x20(%rax)
je 0x29abe
movq 0x20(%r14), %rdi
callq 0xe62cf
movq 0x20(%r14), %rcx
movq %r14, %rdi
movq %r15, %rsi
pushq $0x10
popq %rdx
callq 0x29c44
movq 0x20(%r14), %rsi
movq 0x30(%r14), %rdi
xorl %edx, %edx
pushq $0x30
popq %rbp
movq %rbp, %rcx
callq 0xe0f33
movq (%r14), %rax
movq 0x8(%rax), %rdi
subq 0x10(%rax), %rdi
movq %rbp, %rsi
callq 0xdfb45
movq %rax, %rbp
movq (%r14), %rax
movq 0x20(%r14), %rdi
movq 0x20(%rax), %rcx
xorl %esi, %esi
movq %rbp, %rdx
callq 0xe45f4
movq 0x118(%r14), %rax
addq $0x30, %rax
movq %rax, 0x118(%r14)
cmpq 0x108(%r14), %rax
jl 0x2965b
movl $0x4, 0x8(%r14)
movq (%r14), %rax
addq %rbp, 0x10(%rax)
jmp 0x29abe
xorl %eax, %eax
cmpq $0x40, %rax
je 0x29682
movzbl 0x40(%r14,%rax), %ecx
movb %al, 0x120(%r14,%rcx)
incq %rax
jmp 0x29669
movl $0x2, 0x8(%r14)
jmp 0x29abe
cmpb $0x0, 0xc(%r14)
jne 0x2969d
movw $0x101, 0xc(%r14)       # imm = 0x101
xorl %ebp, %ebp
jmp 0x29aae
movq %r12, %r13
movq 0x20(%r14), %rdi
callq 0xe62cf
movq 0x20(%r14), %rcx
movq %r14, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x29c44
movq 0x20(%r14), %rdi
xorl %esi, %esi
callq 0xe3fa3
movq %rax, %r12
movq %rbx, %rdi
leaq 0xdeb4c(%rip), %rsi     # 0x108226
movl %r12d, %edx
xorl %eax, %eax
callq 0xde896
movq 0x30(%r14), %rdi
callq 0xe0e95
movl %eax, %ebp
movq %rbx, %rdi
leaq 0xdeb51(%rip), %rsi     # 0x10824a
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl %r12d, %ebp
jne 0x2974f
movq (%r14), %rax
movq 0x10(%rax), %rcx
cmpq 0x8(%rax), %rcx
movq %r13, %r12
movl $0x80, %r13d
jl 0x29775
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29be3
jmp 0x29775
testq %rax, %rax
leaq 0x8(%rsp), %r12
je 0x2978a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29be3
cmpb $0x0, 0xc(%r14)
je 0x2978a
movq (%rsp), %rbp
jmp 0x29aae
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0xdeb10(%rip), %rsi     # 0x108270
xorl %eax, %eax
callq 0xdf2a5
movb $0x1, 0xc(%r14)
movq %r13, %r12
movl $0x80, %r13d
andl $0x0, 0x8(%r14)
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
jmp 0x29abe
movq %rbp, 0x20(%rsp)
movq %rbx, %rdi
pushq $0x48
popq %rsi
callq 0xdecaf
movq %rax, (%r14)
testq %rax, %rax
movq (%rsp), %rbp
je 0x29a7c
movq 0xd0(%r14), %rcx
movq %rcx, 0x8(%rax)
movq 0x20(%r14), %rdi
leaq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0xe3f2a
movb %al, 0xe0(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xde9ab(%rip), %rsi     # 0x108185
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3f2a
movb %al, 0xe1(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xde998(%rip), %rsi     # 0x108199
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3fc4
movl %eax, 0xe4(%r14)
movq %rbx, %rdi
leaq 0xde986(%rip), %rsi     # 0x1081ab
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3f2a
movb %al, 0xe8(%r14)
movzbl %al, %edx
movq %rbx, %rdi
leaq 0xde973(%rip), %rsi     # 0x1081c1
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3fc4
movq %rax, 0xf0(%r14)
movq %rbx, %rdi
leaq 0xde964(%rip), %rsi     # 0x1081d6
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3fc4
movl %eax, 0xf8(%r14)
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3fc4
movl %eax, 0xfc(%r14)
movq (%r14), %rdi
addq $0x38, %rdi
movl 0xf8(%r14), %esi
movl %eax, %edx
callq 0xe0377
movq (%r14), %rsi
addq $0x38, %rsi
movq %rbx, %rdi
leaq 0xf88d0(%rip), %rdx     # 0x122198
callq 0x29cf7
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3fc4
movl %eax, 0x100(%r14)
movq 0x20(%r14), %rdi
movq %r12, %rsi
callq 0xe3fc4
movl %eax, 0x104(%r14)
movq (%r14), %rdi
addq $0x28, %rdi
movl 0x100(%r14), %esi
movl %eax, %edx
callq 0xe0377
movq (%r14), %rsi
addq $0x28, %rsi
movq %rbx, %rdi
leaq 0xf74cb(%rip), %rdx     # 0x120de4
callq 0x29cf7
movq 0x10(%rsp), %rsi
movq 0x20(%r14), %rdi
pushq $0x3
popq %rdx
pushq $0x1
popq %rcx
xorl %r8d, %r8d
callq 0xe424b
movq %rax, 0x108(%r14)
movq %rbx, %rdi
leaq 0xde8a8(%rip), %rsi     # 0x1081ee
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq $0x3, 0x10(%rsp)
movq 0x20(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe3fc4
movl %eax, 0x110(%r14)
movq %rbx, %rdi
leaq 0xf5a78(%rip), %rsi     # 0x11f3ed
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x28(%r14), %rdi
callq 0xe0e44
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
xorl %edx, %edx
pushq $0x18
popq %rcx
callq 0xe0f33
movq 0x28(%r14), %rdi
callq 0xe0e95
movl %eax, %r12d
movq %rbx, %rdi
leaq 0xf893e(%rip), %rsi     # 0x1222ed
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
cmpl 0x110(%r14), %r12d
jne 0x29a8c
movq (%r14), %rcx
movq 0xd8(%r14), %rax
cmpq 0x10(%rcx), %rax
leaq 0x8(%rsp), %r12
jne 0x29a7c
cmpq $0x0, 0x20(%rsp)
jne 0x29a78
cmpq $0x0, 0x18(%rcx)
jne 0x29a00
movq %rbp, %rdi
callq 0xeaf0b
movq (%r14), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, 0x20(%rcx)
jne 0x29a78
movq %rbx, %rdi
callq 0xdfd1a
movq (%r14), %rcx
movq 0x18(%rcx), %rdx
testq %rdx, %rdx
movq %rax, (%rsp)
je 0x29a38
movq %rbx, %rdi
movq (%rsp), %rsi
xorl %ecx, %ecx
callq 0xdfd55
movq (%rsp), %rax
movb $0x1, 0x8(%rax)
movq (%r14), %rcx
movups 0x28(%rcx), %xmm0
movups %xmm0, 0x18(%rax)
movq (%r14), %rcx
movups 0x38(%rcx), %xmm0
movups %xmm0, 0x28(%rax)
movq %rbx, %rdi
movq %rax, %rdx
xorl %esi, %esi
xorl %ecx, %ecx
callq 0xe4e62
movq (%r14), %rcx
movq %rax, 0x20(%rcx)
movq %rax, %rdi
callq 0xe589c
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0xdfd24
movq (%r14), %rcx
incl (%rcx)
jmp 0x29aae
cmpb $0x0, 0xc(%r14)
jne 0x29aae
movw $0x101, 0xc(%r14)       # imm = 0x101
jmp 0x29aae
movq 0xc0(%r14), %rdx
movq %rbx, %rdi
leaq 0xde75e(%rip), %rsi     # 0x1081fb
xorl %eax, %eax
callq 0xdf2a5
movb $0x1, 0xc(%r14)
leaq 0x8(%rsp), %r12
movq %rbp, %rdi
callq 0xeaf3c
movl $0x3, 0x8(%r14)
movq 0x40(%rsp), %rax
addq %rax, 0x18(%r14)
jmp 0x29329
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x29be3
movq 0x20(%r14), %rdi
callq 0xe5591
movq 0x28(%r14), %rdi
callq 0xe0e8d
movq 0x30(%r14), %rdi
callq 0xe0e8d
cmpb $0x0, 0xd(%r14)
je 0x29b18
leaq 0xde61c(%rip), %rsi     # 0x108128
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0x29b26
cmpl $0x0, 0x10(%r14)
jne 0x29b26
cmpb $0x0, 0xc(%r14)
je 0x29b40
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xde5f7(%rip), %rsi     # 0x10813e
jmp 0x29b0c