// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/os2bmp.c
// Function: de_run_os2bmp
static void de_run_os2bmp(deark *c, de_module_params *mparams)
{
	enum fmtcode fmt;
	const char *name;

	fmt = de_identify_os2bmp_internal(c);

	name = get_fmt_longname_from_code(fmt);
	if(name) {
		de_declare_fmt(c, name);
	}

	switch(fmt) {
	case DE_OS2FMT_IC:
	case DE_OS2FMT_PT:
	case DE_OS2FMT_CI:
	case DE_OS2FMT_CP:
		do_decode_icon_or_cursor(c, fmt);
		break;
	case DE_OS2FMT_BA:
	case DE_OS2FMT_BA_IC:
	case DE_OS2FMT_BA_PT:
	case DE_OS2FMT_BA_CI:
	case DE_OS2FMT_BA_CP:
	case DE_OS2FMT_BA_BM:
		do_BA_file(c);
		break;
	default:
		de_err(c, "Format not supported");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x9c426
movl %eax, %r15d
leal -0x1(%r15), %eax
cmpl $0xa, %eax
ja 0x9bccd
leaq 0x95ad0(%rip), %rcx     # 0x131754
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x95c25(%rip), %rsi     # 0x1318b9
jmp 0x9bc9d
leaq 0x95c37(%rip), %rsi     # 0x1318d4
movq %rbx, %rdi
callq 0xeb125
movl $0xaa0, %eax            # imm = 0xAA0
btl %r15d, %eax
jb 0x9bd07
jmp 0x9c1b0
leaq 0x95bbb(%rip), %rsi     # 0x131877
jmp 0x9c1a8
leaq 0x95ba5(%rip), %rsi     # 0x13186d
jmp 0x9c1a8
leaq 0xa40c2(%rip), %rsi     # 0x13fd96
movq %rbx, %rdi
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9295
leaq 0x95bb1(%rip), %rsi     # 0x1318a7
jmp 0x9bcff
leaq 0x95bf3(%rip), %rsi     # 0x1318f2
movq %rbx, %rdi
callq 0xeb125
leaq 0xc(%rsp), %r14
leaq 0x95cb1(%rip), %r12     # 0x1319c4
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8a1c
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xeead3
movl %eax, %ebp
movq 0x18(%rbx), %rdi
leaq 0x1(%r13), %rsi
callq 0xeead3
cmpb $0x42, %bpl
jne 0x9c160
cmpb $0x41, %al
jne 0x9c160
movq 0x18(%rbx), %rdi
leaq 0x6(%r13), %rsi
callq 0xeed61
movq %rbx, %rdi
leaq 0x95c64(%rip), %rsi     # 0x1319e6
movq %rax, 0x10(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
leaq 0xe(%r13), %rsi
movq %rsi, %rbp
callq 0xeead3
movl %eax, %r15d
movq 0x18(%rbx), %rdi
movq %r13, 0x18(%rsp)
leaq 0xf(%r13), %rsi
callq 0xeead3
movzbl %r15b, %edi
movzbl %al, %esi
callq 0x9c493
movl %eax, %r13d
leal -0x1(%r13), %eax
cmpl $0x9, %eax
ja 0x9c154
leaq 0x959a8(%rip), %rcx     # 0x131780
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x8f232(%rip), %rdx     # 0x12b018
leaq 0x8192d(%rip), %r15     # 0x11d71a
leaq 0x8031a(%rip), %rcx     # 0x11c10e
leaq 0x7fbcc(%rip), %rax     # 0x11b9c7
leaq 0x99008(%rip), %r8      # 0x134e0a
jmpq *%rsi
leal -0x2(%r13), %eax
cmpl $0x8, %eax
ja 0x9c141
movq %rdx, %r15
leaq 0x9598d(%rip), %rcx     # 0x1317a8
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
movq %r15, %rcx
movq %r15, %rax
movq %r15, %r8
jmpq *%rdx
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x2, %edx
leaq 0x85323(%rip), %r8      # 0x121162
jmp 0x9be6d
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x6, %edx
movq %r8, %rcx
leaq 0x818d5(%rip), %r8      # 0x11d72b
jmp 0x9be6d
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x4, %edx
movq %rax, %rcx
leaq 0x818b3(%rip), %r8      # 0x11d720
callq 0x9c9cb
jmp 0x9c117
leaq 0x8fbd4(%rip), %r15     # 0x12ba52
movq %rbx, %rdi
leaq 0x44(%rsp), %rsi
callq 0xe8a1c
movq %rbx, %rdi
leaq 0x95b96(%rip), %rsi     # 0x131a2b
movq %r15, %rdx
movq %rbp, %r14
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0xa0, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x48(%rsp)
cmpl $0xa, %r13d
leaq 0x81852(%rip), %rsi     # 0x11d720
leaq 0x81856(%rip), %rax     # 0x11d72b
cmoveq %rax, %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xefda1
movq %rax, 0x28(%rsp)
movb $0x1, %cl
leaq 0x50(%rsp), %rax
leaq 0x60(%rsp), %r12
movq %rbx, %rbp
movq %r14, %rbx
leaq 0x70(%rsp), %r13
leaq 0x20(%rsp), %r15
movq %rax, 0x30(%rsp)
movl %ecx, 0x38(%rsp)
movq %rbp, %rdi
leaq 0x9a98d(%rip), %rsi     # 0x1368a6
movl %ebx, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbp, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbp), %rsi
movq 0x18(%rsi), %r8
subq %rbx, %r8
movq %rbx, %rcx
movq %rbp, %rdi
movq 0x48(%rsp), %r14
movq %r14, %rdx
movl $0x1, %r9d
callq 0xf7425
testl %eax, %eax
je 0x9c0bd
movl 0x38(%r14), %edx
testl %edx, %edx
jne 0x9c0d3
movl 0x68(%r14), %edx
movq %rbp, %rdi
leaq 0x95ac5(%rip), %rsi     # 0x131a3a
xorl %eax, %eax
callq 0xe8617
movq %rbx, (%r15)
movq 0x88(%r14), %rax
movq %rax, (%r13)
movq 0x10(%r14), %rcx
movq %rcx, (%r12)
movq 0x68(%r14), %rcx
movq 0x30(%rsp), %rdx
movq %rcx, (%rdx)
addq %rax, %rbx
movq %rbp, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
leaq 0x78(%rsp), %rax
leaq 0x80(%rsp), %r12
leaq 0x88(%rsp), %r13
leaq 0x90(%rsp), %r15
testb $0x1, 0x38(%rsp)
movl $0x0, %ecx
jne 0x9bf06
movq 0x70(%rsp), %rbx
movq 0x88(%rsp), %r12
leaq (%r12,%rbx), %r14
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
addq %r14, %rax
movq %rax, 0x38(%rsp)
movq 0x18(%rbp), %rdi
movq 0x20(%rsp), %r13
movl $0xa, %edx
movq %r13, %rsi
movq 0x28(%rsp), %r15
movq %r15, %rcx
callq 0xef481
movq %r15, %rdi
movq %r14, %rsi
callq 0xf1042
movq 0x18(%rbp), %rdi
addq $0xe, %r13
addq $-0xe, %rbx
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0xef481
movq 0x18(%rbp), %rdi
movq 0x90(%rsp), %r13
movl $0xa, %edx
movq %r13, %rsi
movq %r15, %rcx
callq 0xef481
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0xf1042
movq 0x18(%rbp), %rdi
addq $0xe, %r13
addq $-0xe, %r12
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0xef481
movq 0x18(%rbp), %rdi
movq 0x60(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r15, %rcx
callq 0xef481
movq 0x18(%rbp), %rdi
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r15, %rcx
callq 0xef481
movq %rbp, %rbx
movq 0x48(%rsp), %r14
jmp 0x9c0ec
movq %rbp, %rbx
movq %rbp, %rdi
leaq 0x7b650(%rip), %rsi     # 0x11771a
xorl %eax, %eax
callq 0xe9295
jmp 0x9c0e7
movq %rbp, %rbx
movq %rbp, %rdi
leaq 0x84618(%rip), %rsi     # 0x1206f8
xorl %eax, %eax
callq 0xe9295
movq 0x28(%rsp), %r15
movl 0x44(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %r15, %rdi
callq 0xf052b
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
leaq 0xc(%rsp), %r14
leaq 0x958ad(%rip), %r12     # 0x1319c4
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r13
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
testq %r13, %r13
je 0x9c3f1
cmpq %r15, %r13
jg 0x9bd16
jmp 0x9c182
movq %rbx, %rdi
leaq 0x958b6(%rip), %rsi     # 0x131a01
xorl %eax, %eax
callq 0xe9295
jmp 0x9c117
leaq 0x8ea06(%rip), %rdx     # 0x12ab61
jmp 0x9be04
leaq 0x9586e(%rip), %rsi     # 0x1319d5
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
jmp 0x9c3f1
leaq 0x95821(%rip), %rsi     # 0x1319aa
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
jmp 0x9c3f1
leaq 0x956f5(%rip), %rsi     # 0x131894
jmp 0x9c1a8
leaq 0x956dc(%rip), %rsi     # 0x131884
movq %rbx, %rdi
callq 0xeb125
movl $0x20, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r14
movl %r15d, 0x8(%rax)
leal -0x4(%r15), %eax
leaq 0x955fd(%rip), %rcx     # 0x1317cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8ee39(%rip), %rax     # 0x12b018
movq %rax, (%r14)
cmpl $0x8, %r15d
je 0x9c216
cmpl $0x6, %r15d
je 0x9c32b
jmp 0x9c3ce
leaq 0x7f7c9(%rip), %rax     # 0x11b9c7
jmp 0x9c328
leaq 0x81510(%rip), %rax     # 0x11d71a
jmp 0x9c213
leaq 0x8f83f(%rip), %rax     # 0x12ba52
movq %rax, (%r14)
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0xe8a1c
movq (%r14), %rdx
leaq 0x95762(%rip), %rsi     # 0x13198f
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x18(%r14)
leaq 0xa9e1f(%rip), %r8      # 0x14607d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x9c529
testl %eax, %eax
je 0x9c310
movq 0x18(%r14), %rax
movq 0x90(%rax), %r15
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x10(%r14)
leaq 0x95706(%rip), %r8      # 0x13199f
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x9c529
testl %eax, %eax
je 0x9c310
movq 0x18(%r14), %rsi
leaq 0xa9dc4(%rip), %rcx     # 0x14607d
movq %rbx, %rdi
movl $0x1, %edx
callq 0x9c63d
testl %eax, %eax
je 0x9c310
movq 0x10(%r14), %rsi
leaq 0x956ca(%rip), %rcx     # 0x13199f
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9c63d
testl %eax, %eax
je 0x9c310
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq (%rax), %rsi
movq (%rcx), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x9c741
movq 0x10(%r14), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c8c0
movl 0x20(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
jmp 0x9c3ce
leaq 0x98ae2(%rip), %rax     # 0x134e0a
movq %rax, (%r14)
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x18(%r14)
leaq 0x955cc(%rip), %r8      # 0x13190f
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x9c529
testl %eax, %eax
je 0x9c3c6
movq 0x18(%r14), %rsi
leaq 0x955aa(%rip), %rcx     # 0x13190f
movq %rbx, %rdi
movl $0x1, %edx
callq 0x9c63d
testl %eax, %eax
je 0x9c3c3
movq 0x18(%r14), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rax
movq %rax, %rdx
shrq $0x3f, %rdx
addq %rax, %rdx
sarq %rdx
movq %rbx, %rdi
movl $0x4, %ecx
callq 0xf266a
movq %rax, %r15
movq 0x18(%r14), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x9c741
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9c8c0
jmp 0x9c3c6
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf228d
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x9c4fa
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x9c4fa
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq