// File: /workspace/github_c_makefile_star2_O3/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 0xe8b2b
movq %rax, %r12
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xeb220
movl %eax, (%r12)
leaq 0xcbe53(%rip), %rsi     # 0x120934
movq %rbx, %rdi
movl $0x1, %edx
callq 0xe9bd0
movl %eax, 0x4(%r12)
movq 0x18(%rbx), %rax
cmpq $0x12, 0x18(%rax)
jl 0x54e84
leaq 0x8(%rsp), %r15
movq $0x0, 0x20(%rsp)
movq %r12, 0x30(%rsp)
movq $0x0, 0x8(%r12)
movq 0x20(%rsp), %r14
movq %r14, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x14(%rsp), %rsi
callq 0xe8a1c
movq %rbx, %rdi
leaq 0xdc09c(%rip), %rsi     # 0x130bdb
movq %r14, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, %r14
addq $-0x40, %rax
cmpq $-0x3f, %rax
jb 0x54e24
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movl (%r12), %r9d
movq %r14, %rdx
movq %rax, %rcx
movl $0x1, %r8d
callq 0xefbd7
movq %rbp, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xcdbcd(%rip), %rsi     # 0x12277b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, %r14
movq %rbx, %rdi
leaq 0xcbdf5(%rip), %rsi     # 0x1209cb
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
addq $0xc, %rsi
callq 0xeed61
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 0x54c4e
leaq 0xe19f0(%rip), %rsi     # 0x136605
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %rbx, %rdi
callq 0xea504
movq %rax, 0x18(%rsp)
cmpb $0x0, 0xd0(%rbx)
je 0x54c73
movq %rbp, %rdi
movl $0x2e, %esi
callq 0xf6542
jmp 0x54c7b
leaq 0xcbd87(%rip), %rsi     # 0x1209dc
xorl %eax, %eax
callq 0xe9295
movq $0x0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
jmp 0x54d05
movq %rbp, %rdi
callq 0xf6423
movq %rbp, %rdi
leaq 0xc0a38(%rip), %rsi     # 0x1156bd
movl $0x5, %edx
callq 0xf65e3
movq %rbx, %rdi
movq 0x18(%rsp), %r13
movq %r13, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0xea53f
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %rdx
cmpl $0x0, 0x4(%r12)
leaq 0xcbd3d(%rip), %rax     # 0x1209fe
leaq 0xbf1ff(%rip), %rcx     # 0x113ec7
cmoveq %rcx, %rax
movq %rax, (%rdx)
movq %r13, 0x28(%rdx)
movq 0x18(%rbx), %rcx
movq 0x8(%rsp), %r8
addq $0x2, %r8
leaq -0x2(%r14), %r9
movq %rbx, %rdi
leaq 0xce6df(%rip), %rsi     # 0x1233cd
movq %rdx, 0x28(%rsp)
callq 0xe9aa3
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
addq %r14, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, %r12
movq 0x8(%rsp), %rax
addq %r12, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x54e2e
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r14
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %r13
movq 0x30(%rsp), %r15
movl (%r15), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r12, %rdx
movq %r14, %r8
movl $0x1, %r9d
callq 0xefc2a
movq %r14, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xcbc88(%rip), %rsi     # 0x120a01
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
addq %r12, 0x8(%rsp)
movq %r15, %r12
movq %r13, %r15
movq 0x20(%rsp), %r13
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rbx, %rdi
leaq 0xcbc67(%rip), %rsi     # 0x120a10
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x8(%rsp), %rax
subq %r13, %rax
movq %rax, 0x8(%r12)
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0xe8be2
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0xea50e
movq %rbp, %rdi
callq 0xf6753
movq %r14, %rdi
callq 0xf6753
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq 0x8(%r12), %rax
testq %rax, %rax
jle 0x54e84
leaq (%rax,%r13), %rcx
addq $0x12, %rcx
addq %rax, %r13
movq 0x18(%rbx), %rax
movq %r13, 0x20(%rsp)
cmpq 0x18(%rax), %rcx
jle 0x54b15
jmp 0x54e84
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x54e3d
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %r14
movq 0x28(%rsp), %r15
leaq 0xcbbe4(%rip), %rsi     # 0x120a28
movq %rbx, %rdi
movq 0x20(%rsp), %rdx
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe8be2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xea50e
movq %rbp, %rdi
callq 0xf6753
xorl %edi, %edi
callq 0xf6753
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe8be2
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq