// File: /workspace/github_c_makefile_star2_O1/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
movl $0x10, %esi
callq 0xe969b
movq %rax, %r13
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xeb7d1
movl %eax, (%r13)
leaq 0xcbc33(%rip), %rsi     # 0x12080c
movq %rbx, %rdi
movl $0x1, %edx
callq 0xea727
movl %eax, 0x4(%r13)
movq 0x18(%rbx), %rax
cmpq $0x12, 0x18(%rax)
jl 0x54f5d
xorl %ebp, %ebp
movq %r13, 0x28(%rsp)
movq $0x0, 0x8(%r13)
movq %rbp, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x34(%rsp), %rsi
callq 0xe958c
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xdbc79(%rip), %rsi     # 0x1308a0
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xef1ed
movq %rax, %r14
addq $-0x40, %rax
movb $0x1, %cl
movl %ecx, 0x14(%rsp)
cmpq $-0x3f, %rax
jae 0x54c79
xorl %r15d, %r15d
xorl %r14d, %r14d
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
jmp 0x54ee2
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movl (%r13), %r9d
movq %r14, %rdx
movq %rax, %rcx
movl $0x1, %r8d
callq 0xf01b0
movq %r12, 0x18(%rsp)
movq %r12, %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0xcd8ba(%rip), %rsi     # 0x122573
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, %r14
movq %rbx, %rdi
leaq 0xcbbc2(%rip), %rsi     # 0x1208a3
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
addq $0xc, %rsi
callq 0xef37e
testq %rax, %rax
je 0x54d10
movq 0x8(%rsp), %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x54d5d
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
leaq 0xe14a3(%rip), %rsi     # 0x1361c2
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
callq 0xea9a9
movq %rax, 0x20(%rsp)
cmpb $0x0, 0xd0(%rbx)
je 0x54d7f
movq 0x18(%rsp), %r15
movq %r15, %rdi
movl $0x2e, %esi
callq 0xf69a2
jmp 0x54d8c
movq %rbx, %rdi
leaq 0xcbb4d(%rip), %rsi     # 0x1208b4
xorl %eax, %eax
callq 0xe9df7
movq $0x0, 0x20(%rsp)
xorl %r13d, %r13d
jmp 0x54e1d
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0xf6883
movq %r15, %rdi
leaq 0xc0877(%rip), %rsi     # 0x11560d
movl $0x5, %edx
callq 0xf6a40
movq %rbx, %rdi
movq 0x20(%rsp), %r12
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xea9e4
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r13
movq 0x28(%rsp), %rax
cmpl $0x0, 0x4(%rax)
leaq 0xcbb01(%rip), %rax     # 0x1208d6
leaq 0xbf03b(%rip), %rcx     # 0x113e17
cmoveq %rcx, %rax
movq %rax, (%r13)
movq %r12, 0x28(%r13)
movq 0x18(%rbx), %rcx
movq 0x8(%rsp), %r8
addq $0x2, %r8
leaq -0x2(%r14), %r9
movq %rbx, %rdi
leaq 0xce3ea(%rip), %rsi     # 0x1231ed
movq %r13, %rdx
callq 0xea5fa
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
leaq 0x8(%rsp), %r15
addq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef3a0
movq %rax, %r12
movq 0x8(%rsp), %rax
addq %r12, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jle 0x54e4e
xorl %r14d, %r14d
xorl %r12d, %r12d
jmp 0x54edd
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq 0x28(%rsp), %r15
movl (%r15), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r12, %rdx
movq %r14, %r8
movl $0x1, %r9d
callq 0xf0203
movq %r14, %rdi
callq 0xf7557
movl $0x0, 0x14(%rsp)
movq %rbx, %rdi
leaq 0xcba3c(%rip), %rsi     # 0x1208d9
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r12, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef3a0
movq %rbx, %rdi
leaq 0xcba24(%rip), %rsi     # 0x1208e8
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rsp), %rax
subq %rbp, %rax
movq %rax, 0x8(%r15)
movb $0x1, %r12b
movq 0x18(%rsp), %r15
testb %r12b, %r12b
jne 0x54efb
movq %rbx, %rdi
leaq 0xcba0f(%rip), %rsi     # 0x120900
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe9752
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0xea9b3
movq %r15, %rdi
callq 0xf6bb0
movq %r14, %rdi
callq 0xf6bb0
movl 0x34(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
cmpb $0x0, 0x14(%rsp)
movq 0x28(%rsp), %r13
jne 0x54f5d
movq 0x8(%r13), %rax
testq %rax, %rax
jle 0x54f5d
leaq (%rax,%rbp), %rcx
addq $0x12, %rcx
addq %rax, %rbp
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rcx
jle 0x54c00
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe9752
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq