// File: /workspace/github_c_makefile_star2_O2/jsummers[P]deark/modules/corel.c
// Function: de_run_corel_clb
static void de_run_corel_clb(deark *c, de_module_params *mparams)
{
	struct clb_ctx *d = NULL;
	i64 pos = 0;

	d = de_malloc(c, sizeof(struct clb_ctx));
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_ASCII);

	// Refer to the comments in the cdr_wl module.
	d->adjdim_flag = de_get_ext_option_bool(c, "cdr:adjdim", 1);

	while(1) {
		if(pos+18 > c->infile->len) goto done;
		d->bytes_consumed = 0;
		if(!do_clb_item(c, d, pos)) goto done;
		if(d->bytes_consumed<=0) goto done;
		pos += d->bytes_consumed;
	}
done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
pushq $0x10
popq %rsi
callq 0xdecaf
movq %rax, %rbp
pushq $0x1
popq %r14
movq %rbx, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0xe08d2
movl %eax, (%rbp)
leaq 0xc1969(%rip), %rsi     # 0x113844
movq %rbx, %rdi
movl %r14d, %edx
callq 0xdfae5
movl %eax, 0x4(%rbp)
xorl %r15d, %r15d
movq %rbp, 0x28(%rsp)
leaq 0x12(%r15), %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x5224d
andq $0x0, 0x8(%rbp)
movq %r15, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x14(%rsp), %rsi
callq 0xdebae
movq %rbx, %rdi
leaq 0xd19d4(%rip), %rsi     # 0x1238f8
movq %r15, %rdx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe3fc4
movq %rax, %r14
addq $-0x40, %rax
cmpq $-0x3f, %rax
jb 0x521ee
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r13
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movl (%rbp), %r9d
movq %r14, %rdx
movq %rax, %rcx
pushq $0x1
popq %r8
callq 0xe4c9a
movq %r13, 0x20(%rsp)
movq %r13, %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xc3625(%rip), %rsi     # 0x1155bb
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe40bf
movq %rax, %r12
movq %rbx, %rdi
leaq 0xc191b(%rip), %rsi     # 0x1138db
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
addq $0xc, %rsi
callq 0xe409f
testq %rax, %rax
sete %cl
movq 0x8(%rsp), %rdx
leaq 0x10(%rdx), %rsi
cmpq %rsi, %rax
sete %al
movq %rbx, %rdi
orb %cl, %al
je 0x52039
leaq 0xd7306(%rip), %rsi     # 0x129305
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq %rbx, %rdi
callq 0xdfd1a
movq %rax, 0x18(%rsp)
cmpb $0x0, 0xd0(%rbx)
je 0x52058
movq 0x20(%rsp), %r13
movq %r13, %rdi
pushq $0x2e
popq %rsi
callq 0xeada5
jmp 0x52065
leaq 0xc18ac(%rip), %rsi     # 0x1138ec
xorl %eax, %eax
callq 0xdf2a5
movq $0x0, 0x18(%rsp)
xorl %r13d, %r13d
jmp 0x520e7
movq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xeac85
movq %r13, %rdi
leaq 0xb65be(%rip), %rsi     # 0x10862d
pushq $0x5
popq %rdx
callq 0xeae42
movq %rbx, %rdi
movq 0x18(%rsp), %r14
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xdfd55
movq %rbx, %rdi
pushq $0x70
popq %rsi
callq 0xdecaf
movq %rax, %r13
cmpl $0x0, 0x4(%rbp)
leaq 0xc1869(%rip), %rax     # 0x11390e
leaq 0xb4dbb(%rip), %rcx     # 0x106e67
cmoveq %rcx, %rax
movq %rax, (%r13)
movq %r14, 0x28(%r13)
movq 0x18(%rbx), %rcx
movq 0x8(%rsp), %r8
addq $0x2, %r8
leaq -0x2(%r12), %r9
movq %rbx, %rdi
leaq 0xc4139(%rip), %rsi     # 0x11620d
movq %r13, %rdx
callq 0xdf9b8
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
addq %r12, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xe40bf
movq %rax, %rbp
movq 0x8(%rsp), %rax
addq %rbp, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x521f9
movq %rbx, %rdi
callq 0xeac74
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq %r15, 0x30(%rsp)
movq %r13, %r12
movq 0x28(%rsp), %r13
movl (%r13), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %rbp, %rdx
movq %r14, %r8
pushq $0x1
popq %r9
callq 0xe4ced
movq %r14, %rdi
callq 0xeb877
movq %rbx, %rdi
leaq 0xc17b0(%rip), %rsi     # 0x113911
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
addq %rbp, 0x8(%rsp)
movq %r13, %rbp
leaq 0x8(%rsp), %rsi
movq 0x30(%rsp), %r15
movq 0x18(%rbx), %rdi
callq 0xe40bf
movq %rbx, %rdi
leaq 0xc1790(%rip), %rsi     # 0x113920
movq %rax, %rdx
xorl %eax, %eax
callq 0xde896
movq 0x8(%rsp), %rax
subq %r15, %rax
movq %rax, 0x8(%r13)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xded32
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xdfd24
movq 0x20(%rsp), %rdi
callq 0xeaf3c
movq %r14, %rdi
callq 0xeaf3c
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq 0x8(%r13), %rax
addq %rax, %r15
testq %rax, %rax
jg 0x51ef1
jmp 0x5224d
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r13d, %r13d
jmp 0x52208
movq 0x28(%rsp), %rbp
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r12
leaq 0xc1729(%rip), %rsi     # 0x113938
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xdf2a5
movq %rbx, %rdi
movq %r13, %rsi
callq 0xded32
movq %rbx, %rdi
movq %r12, %rsi
callq 0xdfd24
movq %r14, %rdi
callq 0xeaf3c
xorl %edi, %edi
callq 0xeaf3c
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xded32
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq