// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %rdi, %rbx
callq 0x9cc40
movl %eax, %r15d
leal -0x1(%r15), %r12d
cmpl $0xa, %r12d
ja 0x9c5db
leaq 0x94e4a(%rip), %rax     # 0x1313f8
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x94f77(%rip), %rsi     # 0x131535
jmp 0x9c603
leaq 0x94f89(%rip), %rsi     # 0x131550
jmp 0x9c603
leaq 0x94f23(%rip), %rsi     # 0x1314f3
jmp 0x9c603
leaq 0x94f10(%rip), %rsi     # 0x1314e9
jmp 0x9c603
movb $0x1, %al
xorl %esi, %esi
jmp 0x9c605
leaq 0x94f3b(%rip), %rsi     # 0x131523
jmp 0x9c603
leaq 0x94f7d(%rip), %rsi     # 0x13156e
jmp 0x9c603
leaq 0x94f16(%rip), %rsi     # 0x131510
jmp 0x9c603
leaq 0x94efd(%rip), %rsi     # 0x131500
xorl %eax, %eax
testb %al, %al
jne 0x9c611
movq %rbx, %rdi
callq 0xeb6d6
cmpl $0xb, %r15d
ja 0x9cbc5
movl $0xaaa, %eax            # imm = 0xAAA
btl %r15d, %eax
jae 0x9c9b9
leaq 0x8(%rsp), %r14
leaq 0x9500a(%rip), %r15     # 0x131640
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe958c
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef0d5
movl %eax, %ebp
movq 0x18(%rbx), %rdi
leaq 0x1(%r13), %rsi
callq 0xef0d5
cmpb $0x42, %bpl
jne 0x9c8b6
cmpb $0x41, %al
jne 0x9c8b6
movq 0x18(%rbx), %rdi
leaq 0x6(%r13), %rsi
callq 0xef37e
movq %rbx, %rdi
leaq 0x94fbd(%rip), %rsi     # 0x131662
movq %rax, (%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0xe(%r13), %r12
movq %r12, %rsi
callq 0xef0d5
movl %eax, %ebp
movq 0x18(%rbx), %rdi
leaq 0xf(%r13), %rsi
callq 0xef0d5
movzbl %bpl, %edi
movzbl %al, %esi
callq 0x9ccb1
movl %eax, %ebp
leal -0x1(%rbp), %eax
leaq 0x8e1a8(%rip), %r15     # 0x12a891
cmpl $0xa, %eax
ja 0x9c6fb
movl %eax, %eax
leaq 0xe8cf9(%rip), %rcx     # 0x1853f0
movq (%rcx,%rax,8), %r15
leal -0x2(%rbp), %eax
cmpl $0x8, %eax
ja 0x9c8cf
leaq 0x94d16(%rip), %rcx     # 0x131424
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0xe958c
movq %rbx, %rdi
leaq 0x94f79(%rip), %rsi     # 0x1316a7
movq %r15, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0xa0, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
cmpl $0xa, %ebp
leaq 0x80eae(%rip), %rsi     # 0x11d610
leaq 0x80eb2(%rip), %rax     # 0x11d61b
cmoveq %rax, %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %rbp
xorl %r14d, %r14d
movq %rbx, %rdi
leaq 0x99d53(%rip), %rsi     # 0x1364dc
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rsi
movq 0x18(%rsi), %r8
subq %r12, %r8
movq %rbx, %rdi
movq %r15, %rdx
movq %r12, %rcx
movl $0x1, %r9d
callq 0xf7881
testl %eax, %eax
je 0x9c92f
movl 0x38(%r15), %edx
testl %edx, %edx
jne 0x9c942
movl 0x68(%r15), %edx
movq %rbx, %rdi
leaq 0x94ed5(%rip), %rsi     # 0x1316b6
xorl %eax, %eax
callq 0xe9226
movq %r12, 0x20(%rsp,%r14,8)
movq 0x88(%r15), %rax
movq %rax, 0x10(%rsp,%r14,8)
movq 0x10(%r15), %rcx
movq %rcx, 0x50(%rsp,%r14,8)
movq 0x68(%r15), %rcx
movq %rcx, 0x30(%rsp,%r14,8)
addq %rax, %r12
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
incq %r14
cmpq $0x1, %r14
je 0x9c77f
movq 0x18(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
addq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
xorl %r14d, %r14d
movq 0x18(%rbx), %rdi
movq 0x20(%rsp,%r14,8), %r12
movl $0xa, %edx
movq %r12, %rsi
movq %rbp, %rcx
callq 0xefabc
movq 0x40(%rsp,%r14,8), %rsi
movq %rbp, %rdi
callq 0xf1645
movq 0x18(%rbx), %rdi
addq $0xe, %r12
movq 0x10(%rsp,%r14,8), %rdx
addq $-0xe, %rdx
movq %r12, %rsi
movq %rbp, %rcx
callq 0xefabc
incq %r14
cmpq $0x1, %r14
je 0x9c844
xorl %r14d, %r14d
movq 0x18(%rbx), %rdi
movq 0x50(%rsp,%r14,8), %rsi
movq 0x30(%rsp,%r14,8), %rdx
movq %rbp, %rcx
callq 0xefabc
incq %r14
cmpq $0x1, %r14
je 0x9c892
jmp 0x9c953
movq %rbx, %rdi
leaq 0x94d91(%rip), %rsi     # 0x131651
xorl %eax, %eax
callq 0xe9df7
xorl %r12d, %r12d
jmp 0x9c982
movq %rbx, %rdi
leaq 0x94da4(%rip), %rsi     # 0x13167d
xorl %eax, %eax
callq 0xe9df7
jmp 0x9c977
movq %rbx, %rdi
movq %r12, %rsi
movl $0x6, %edx
movq %r15, %rcx
leaq 0x80d21(%rip), %r8      # 0x11d61b
jmp 0x9c928
movq %rbx, %rdi
movq %r12, %rsi
movl $0x2, %edx
movq %r15, %rcx
leaq 0x84741(%rip), %r8      # 0x121052
jmp 0x9c928
movq %rbx, %rdi
movq %r12, %rsi
movl $0x4, %edx
movq %r15, %rcx
leaq 0x80ce8(%rip), %r8      # 0x11d610
callq 0x9d1d4
jmp 0x9c977
movq %rbx, %rdi
leaq 0x7ad41(%rip), %rsi     # 0x11767a
xorl %eax, %eax
callq 0xe9df7
jmp 0x9c953
movq %rbx, %rdi
leaq 0x83c84(%rip), %rsi     # 0x1205d0
xorl %eax, %eax
callq 0xe9df7
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq %rbp, %rdi
callq 0xf0b13
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe9752
leaq 0x8(%rsp), %r14
leaq 0x94cc2(%rip), %r15     # 0x131640
movq (%rsp), %r12
movl 0x8(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
testq %r12, %r12
je 0x9cc12
cmpq %r13, %r12
movq %r12, %r13
jg 0x9c639
leaq 0x94c7c(%rip), %rsi     # 0x131626
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x9cc12
movl $0x550, %eax            # imm = 0x550
btl %r15d, %eax
jae 0x9cbc5
movl $0x20, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r14
movl %r15d, 0x8(%rax)
cmpl $0xa, %r12d
ja 0x9c9f2
movl %r12d, %eax
leaq 0xe8a04(%rip), %rcx     # 0x1853f0
movq (%rcx,%rax,8), %rax
jmp 0x9c9f9
leaq 0x8de98(%rip), %rax     # 0x12a891
movq %rax, (%r14)
addl $-0x4, %r15d
cmpl $0x6, %r15d
ja 0x9cbef
leaq 0x94a37(%rip), %rax     # 0x131448
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xe969b
movq %rax, 0x18(%r14)
leaq 0x94b59(%rip), %r8      # 0x13158b
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x9cd47
testl %eax, %eax
je 0x9cbe7
movq 0x18(%r14), %rsi
leaq 0x94b33(%rip), %rcx     # 0x13158b
movq %rbx, %rdi
movl $0x1, %edx
callq 0x9ce5b
testl %eax, %eax
je 0x9cbe4
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 0xf2cab
movq %rax, %r15
movq 0x18(%r14), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x9cf59
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9d0c9
jmp 0x9cbe7
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
movq (%r14), %rdx
leaq 0x94b37(%rip), %rsi     # 0x13160b
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xe969b
movq %rax, 0x18(%r14)
leaq 0xa908e(%rip), %r8      # 0x145b93
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x9cd47
testl %eax, %eax
je 0x9cbb7
movq 0x18(%r14), %rax
movq 0x90(%rax), %r15
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xe969b
movq %rax, 0x10(%r14)
leaq 0x94adb(%rip), %r8      # 0x13161b
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x9cd47
testl %eax, %eax
je 0x9cbb7
movq 0x18(%r14), %rsi
leaq 0xa9033(%rip), %rcx     # 0x145b93
movq %rbx, %rdi
movl $0x1, %edx
callq 0x9ce5b
testl %eax, %eax
je 0x9cbb7
movq 0x10(%r14), %rsi
leaq 0x94a9f(%rip), %rcx     # 0x13161b
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9ce5b
testl %eax, %eax
je 0x9cbb7
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq (%rax), %rsi
movq (%rcx), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x9cf59
movq 0x10(%r14), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9d0c9
movl 0x20(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
jmp 0x9cbef
leaq 0xa2dc2(%rip), %rsi     # 0x13f98e
movq %rbx, %rdi
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe9df7
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf28d4
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x9cd18
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x9cd18
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq