// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/bmi.c
// Function: de_run_bmi
static void de_run_bmi(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos = 0;

	d = de_malloc(c, sizeof(lctx));

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);

	if(!do_header(c, d, pos)) goto done;
	pos += d->fixed_header_size;

	if(d->globalimg.num_pal_entries>0) {
		read_palette(c, d, &d->globalimg, pos);
		pos += 4*d->globalimg.num_pal_entries;
	}

	if(!do_read_table(c, d, pos)) goto done;
	do_comments(c, d);
	do_bitmaps(c, d);

done:
	if(d) {
		de_free(c, d->table);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rdi, %rbx
movl $0x448, %esi            # imm = 0x448
callq 0xe8b2b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb220
movl %eax, (%r14)
leaq 0x1073dc(%rip), %rsi    # 0x1396ee
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x60(%rsp), %r15
movq $0x9, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, 0x20(%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, 0x28(%r14)
movq 0x20(%r14), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe8f88
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movl %eax, 0x30(%r14)
leaq 0xe52b0(%rip), %rsi     # 0x11762d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movq %rax, 0x38(%r14)
leaq 0x113d8e(%rip), %rsi    # 0x14612e
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
cmpl $0x0, 0x30(%r14)
je 0x323ca
movq 0x38(%r14), %rdi
leaq -0x1(%rdi), %rax
cmpq $0x7, %rax
ja 0x323ca
callq 0xe9c9b
movq %rax, 0x40(%r14)
leaq 0x60(%rsp), %rsi
addq $0x2, (%rsi)
movq 0x18(%rbx), %rdi
callq 0xeebeb
movq %rax, 0x10(%r14)
cmpq $0x65, %rax
jl 0x32409
leaq 0xe5251(%rip), %rsi     # 0x11763e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
jmp 0x329fc
movq 0x60(%rsp), %rax
movq %rax, 0x8(%r14)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x8(%r14), %r15
cmpq $0x0, 0x40(%r14)
jle 0x32441
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x32a4b
movq 0x40(%r14), %rax
leaq (%r15,%rax,4), %r15
movq %r15, 0x60(%rsp)
movl 0x10(%r14), %ecx
leaq 0xe521d(%rip), %rsi     # 0x11766e
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r14), %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0xe96f7
movq %rax, 0x18(%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpq $0x0, 0x10(%r14)
jle 0x324e3
leaq 0x60(%rsp), %r15
leaq 0xe51f1(%rip), %r12     # 0x117684
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeebeb
movq 0x18(%r14), %rcx
movl %eax, (%rcx,%rbp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq 0x18(%r14), %rcx
movq %rax, 0x8(%rcx,%rbp)
movl (%rcx,%rbp), %ecx
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
movq %rax, %r8
xorl %eax, %eax
callq 0xe8617
incq %r13
addq $0x10, %rbp
cmpq 0x10(%r14), %r13
jl 0x32498
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq 0x10(%r14), %rax
testq %rax, %rax
jle 0x329fc
movl $0x8, %r12d
xorl %r13d, %r13d
movq 0x18(%r14), %rcx
cmpl $0x3, -0x8(%rcx,%r12)
jne 0x32591
movq (%rcx,%r12), %rax
addq $0x2, %rax
movq %rax, 0x60(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeed83
movq %rax, %r15
addq $0x2, 0x60(%rsp)
movq %rbx, %rdi
callq 0xf6410
movq %rax, %rbp
movq 0x18(%rbx), %rdi
movq 0x60(%rsp), %rsi
movl (%r14), %eax
movl %eax, (%rsp)
movl $0x1f4, %ecx            # imm = 0x1F4
movq %r15, %rdx
movq %rbp, %r8
movl $0x1, %r9d
callq 0xefc2a
movq %rbp, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xe512b(%rip), %rsi     # 0x1176a3
movl %r13d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbp, %rdi
callq 0xf6753
movq 0x10(%r14), %rax
incq %r13
addq $0x10, %r12
cmpq %rax, %r13
jl 0x32506
testq %rax, %rax
jle 0x329fc
movq %r14, %rcx
addq $0x48, %rcx
movq %rcx, 0x48(%rsp)
leaq 0x10(%rsp), %r12
xorl %ebp, %ebp
movq %r14, 0x28(%rsp)
movq 0x18(%r14), %rcx
movq %rbp, %rdx
shlq $0x4, %rdx
cmpl $0x1, (%rcx,%rdx)
jne 0x329f0
addq %rdx, %rcx
movq 0x8(%rcx), %r15
movq %r15, 0x10(%rsp)
xorl %r14d, %r14d
movl $0x418, %edx            # imm = 0x418
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
callq 0x18140
movq %rbx, %rdi
leaq 0x24(%rsp), %rsi
callq 0xe8a1c
movq %rbx, %rdi
leaq 0x103ff7(%rip), %rsi    # 0x136605
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeebeb
movq %rax, %r15
movq %rax, 0x60(%rsp)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeebeb
movq %rax, 0x68(%rsp)
movq %rbx, %rdi
movq %r15, 0x18(%rsp)
movq %r15, %rsi
movq %rax, 0x58(%rsp)
movq %rax, %rdx
callq 0xe8f88
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeebeb
movq %rax, %r15
movq %rax, 0x78(%rsp)
movq %rbx, %rdi
leaq 0x113aae(%rip), %rsi    # 0x14612e
movl %r15d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xeebeb
movq %rax, %r12
movl %r12d, 0x70(%rsp)
movq %rbx, %rdi
leaq 0xe4f85(%rip), %rsi     # 0x11762d
movl %r12d, %edx
xorl %eax, %eax
callq 0xe8617
testl %r12d, %r12d
sete %al
leaq 0x88(%rsp), %rcx
cmoveq 0x48(%rsp), %rcx
movq %rcx, 0x50(%rsp)
leaq -0x1(%r15), %rcx
cmpq $0x8, %rcx
setae %cl
orb %al, %cl
jne 0x326f1
movq %r15, %rdi
callq 0xe9c9b
movq %rax, 0x80(%rsp)
testq %rax, %rax
setg %r14b
movl %r14d, 0x20(%rsp)
addq $0x2, 0x10(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
callq 0xeed83
movq %rax, %r14
movq %rbx, %rdi
leaq 0xe4fa2(%rip), %rsi     # 0x1176bc
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
imulq 0x18(%rsp), %r15
movl $0x20, %esi
movq %r15, %rdi
callq 0xe9cb4
leaq 0x7(%rax), %r12
testq %rax, %rax
cmovnsq %rax, %r12
sarq $0x3, %r12
movq %r12, 0x30(%rsp)
movq 0x58(%rsp), %r15
imulq %r15, %r12
movq %rbx, %rdi
leaq 0xe4f7f(%rip), %rsi     # 0x1176dd
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %r14, 0x40(%rsp)
cmpq $0x5f5e100, %r14        # imm = 0x5F5E100
jle 0x32786
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x28(%rsp), %r14
jmp 0x329cb
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeebeb
movq %rax, %r14
movq %rbx, %rdi
leaq 0xe4f61(%rip), %rsi     # 0x117700
movl %r14d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq %r12, %r14
cmovgeq %r12, %r14
movq %r14, 0x38(%rsp)
cmpb $0x0, 0x20(%rsp)
movq 0x28(%rsp), %r14
je 0x327f0
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0x32a4b
movq 0x80(%rsp), %rax
shlq $0x2, %rax
addq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %r15
jmp 0x327f5
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xf1db1
testl %eax, %eax
je 0x329c5
movq 0x78(%rsp), %rax
cmpq $0x18, %rax
ja 0x329b4
movl $0x1000112, %ecx        # imm = 0x1000112
btq %rax, %rcx
jae 0x329b4
movq %rbx, %rdi
movq %r12, 0x18(%rsp)
movq %r12, %rsi
movl $0x1, %edx
callq 0xf09c5
movq %rax, %r15
movq 0x40(%rsp), %rax
cmpq %rax, 0x18(%r15)
jge 0x32941
movq 0x10(%rsp), %r13
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r13
jge 0x329c8
movq %rbx, %rdi
leaq 0x10d667(%rip), %rsi    # 0x13fed1
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeebeb
movq %rax, %r13
movq %rbx, %rdi
leaq 0xe4e95(%rip), %rsi     # 0x117731
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%rsp), %rax
leaq 0x1(%rax), %rsi
movq %rsi, 0x10(%rsp)
cmpq 0x38(%rsp), %r13
jg 0x329c8
addq %r13, %rax
incq %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jg 0x329c8
movq 0x18(%r15), %r12
cmpq 0x18(%rsp), %r12
jge 0x3291b
movl $0x3, (%rsp)
movq %r13, %rdx
movq %r15, %rcx
movq 0x38(%rsp), %r8
xorl %r9d, %r9d
callq 0x100594
testl %eax, %eax
je 0x329c8
movq 0x18(%r15), %rcx
movq %rcx, %rdx
subq %r12, %rdx
movq %rbx, %rdi
leaq 0xe4e2b(%rip), %rsi     # 0x11773f
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
addq 0x10(%rsp), %r13
movq %r13, 0x10(%rsp)
movq 0x40(%rsp), %rax
cmpq %rax, 0x18(%r15)
jl 0x32852
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq %rbx, %rdi
movl $0x3, %ecx
callq 0xf266a
movq %rax, %r12
movq 0x78(%rsp), %rdx
cmpq $0x18, %rdx
jne 0x32985
movl $0x3, %ecx
movq %r15, %rdi
xorl %esi, %esi
movq 0x30(%rsp), %rdx
movq %r12, %r8
movl $0x1, %r9d
callq 0xf3279
jmp 0x329a3
movl $0x0, (%rsp)
movq %r15, %rdi
xorl %esi, %esi
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %r8
movq %r12, %r9
callq 0xf2f79
movq %r12, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xf22dc
jmp 0x329cb
movq %rbx, %rdi
leaq 0xe4d5c(%rip), %rsi     # 0x11771a
xorl %eax, %eax
callq 0xe9295
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r12, %rdi
callq 0xf228d
movq %r15, %rdi
callq 0xf052b
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq 0x10(%r14), %rax
leaq 0x10(%rsp), %r12
incq %rbp
cmpq %rax, %rbp
jl 0x325c2
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xe8be2
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq