// File: /workspace/github_c_makefile_star2_O2/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 $0x78, %rsp
movq %rdi, %rbx
callq 0x968d1
movl %eax, %r15d
leal -0x1(%r15), %eax
cmpl $0xa, %eax
ja 0x962b2
leaq 0x8e1fb(%rip), %rcx     # 0x124464
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8e354(%rip), %rsi     # 0x1245cd
jmp 0x96282
leaq 0x8e366(%rip), %rsi     # 0x1245e8
movq %rbx, %rdi
callq 0xe07f7
movl $0xaa0, %eax            # imm = 0xAA0
btl %r15d, %eax
jb 0x962e9
jmp 0x9669b
leaq 0x8e2ea(%rip), %rsi     # 0x12458b
jmp 0x96693
leaq 0x8e2d4(%rip), %rsi     # 0x124581
jmp 0x96693
leaq 0x9c7ad(%rip), %rsi     # 0x132a66
movq %rbx, %rdi
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdf2a5
leaq 0x8e2e3(%rip), %rsi     # 0x1245bb
jmp 0x962e1
leaq 0x8e325(%rip), %rsi     # 0x124606
movq %rbx, %rdi
callq 0xe07f7
leaq 0x18(%rsp), %r15
leaq 0x8e3e3(%rip), %r12     # 0x1246d8
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xdebae
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xe3eb4
movl %eax, %ebp
movq 0x18(%rbx), %rdi
leaq 0x1(%r14), %rsi
callq 0xe3eb4
cmpb $0x42, %bpl
jne 0x964e0
cmpb $0x41, %al
jne 0x964e0
movq 0x18(%rbx), %rdi
leaq 0x6(%r14), %rsi
callq 0xe409f
movq %rbx, %rdi
leaq 0x8e398(%rip), %rsi     # 0x1246fa
movq %rax, 0x8(%rsp)
movl %eax, %edx
xorl %eax, %eax
callq 0xde896
movq 0x18(%rbx), %rdi
leaq 0xe(%r14), %rbp
movq %rbp, %rsi
callq 0xe3eb4
movl %eax, %r12d
movq 0x18(%rbx), %rdi
movq %r14, 0x10(%rsp)
leaq 0xf(%r14), %rsi
callq 0xe3eb4
movzbl %r12b, %edi
movzbl %al, %esi
callq 0x9693e
movl %eax, %r13d
movl %eax, %edi
callq 0x9699c
movq %rax, %r12
leal -0x2(%r13), %eax
cmpl $0x8, %eax
ja 0x964f8
leaq 0x8e0ce(%rip), %rcx     # 0x124490
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
callq 0xdebae
movq %rbx, %rdi
leaq 0x8e35d(%rip), %rsi     # 0x12473f
movq %r12, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0xdeba7
movl $0xa0, %esi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r12
cmpl $0xa, %r13d
leaq 0x7a21c(%rip), %rsi     # 0x110630
leaq 0x7a220(%rip), %rax     # 0x11063b
cmoveq %rax, %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xe4e62
movq %rax, %r13
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x96563
movq %rbx, %rdi
leaq 0x93161(%rip), %rsi     # 0x1295a6
movl %ebp, %edx
xorl %eax, %eax
callq 0xde896
movq %rbx, %rdi
pushq $0x1
popq %r14
movl %r14d, %esi
callq 0xdeba7
movq 0x18(%rbx), %rsi
movq 0x18(%rsi), %r8
subq %rbp, %r8
movq %rbx, %rdi
movq %r12, %rdx
movq %rbp, %rcx
movl %r14d, %r9d
callq 0xebba5
testl %eax, %eax
je 0x965f3
movl 0x38(%r12), %edx
testl %edx, %edx
jne 0x96606
movl 0x68(%r12), %edx
movq %rbx, %rdi
leaq 0x8e2b1(%rip), %rsi     # 0x12474e
xorl %eax, %eax
callq 0xde896
movq %rbp, 0x30(%rsp,%r15,8)
movq 0x88(%r12), %rax
movq %rax, 0x20(%rsp,%r15,8)
movq 0x10(%r12), %rcx
movq %rcx, 0x60(%rsp,%r15,8)
movq 0x68(%r12), %rcx
movq %rcx, 0x40(%rsp,%r15,8)
addq %rax, %rbp
movq %rbx, %rdi
pushq $-0x1
popq %rsi
callq 0xdeba7
incq %r15
jmp 0x96431
movq %rbx, %rdi
leaq 0x8e1ff(%rip), %rsi     # 0x1246e9
xorl %eax, %eax
callq 0xdf2a5
xorl %ebp, %ebp
jmp 0x9664c
movq %rbx, %rdi
leaq 0x8e213(%rip), %rsi     # 0x124715
xorl %eax, %eax
callq 0xdf2a5
jmp 0x9654d
movq %rbx, %rdi
movq %rbp, %rsi
pushq $0x6
popq %rdx
movq %r12, %rcx
leaq 0x7a11d(%rip), %r8      # 0x11063b
jmp 0x96548
movq %rbx, %rdi
movq %rbp, %rsi
pushq $0x2
popq %rdx
movq %r12, %rcx
leaq 0x7db3f(%rip), %r8      # 0x114072
jmp 0x96548
movq %rbx, %rdi
movq %rbp, %rsi
pushq $0x4
popq %rdx
movq %r12, %rcx
leaq 0x7a0e8(%rip), %r8      # 0x110630
callq 0x96e42
leaq 0x8e184(%rip), %r12     # 0x1246d8
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %rbp
jmp 0x9664c
movq 0x28(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
addq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
xorl %r15d, %r15d
cmpq $0x2, %r15
je 0x965ca
movq 0x18(%rbx), %rdi
movq 0x30(%rsp,%r15,8), %rbp
movq %rbp, %rsi
pushq $0xa
popq %rdx
movq %r13, %rcx
callq 0xe45f4
movq 0x50(%rsp,%r15,8), %rsi
movq %r13, %rdi
callq 0xe5f7f
movq 0x18(%rbx), %rdi
addq $0xe, %rbp
movq 0x20(%rsp,%r15,8), %rdx
addq $-0xe, %rdx
movq %rbp, %rsi
movq %r13, %rcx
callq 0xe45f4
incq %r15
jmp 0x9657f
xorl %r15d, %r15d
movq 0x8(%rsp), %rbp
cmpq $0x2, %r15
je 0x9661c
movq 0x18(%rbx), %rdi
movq 0x60(%rsp,%r15,8), %rsi
movq 0x40(%rsp,%r15,8), %rdx
movq %r13, %rcx
callq 0xe45f4
incq %r15
jmp 0x965d2
movq %rbx, %rdi
leaq 0x7408d(%rip), %rsi     # 0x10a68a
xorl %eax, %eax
callq 0xdf2a5
jmp 0x96617
movq %rbx, %rdi
leaq 0x7cff6(%rip), %rsi     # 0x113606
xorl %eax, %eax
callq 0xdf2a5
movq 0x8(%rsp), %rbp
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
movq %r13, %rdi
callq 0xe5591
movq %rbx, %rdi
movq %r12, %rsi
callq 0xded32
leaq 0x18(%rsp), %r15
leaq 0x8e091(%rip), %r12     # 0x1246d8
movq 0x10(%rsp), %r14
movl 0x18(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
testq %rbp, %rbp
je 0x968a3
cmpq %r14, %rbp
movq %rbp, %r14
jg 0x962f8
leaq 0x8e04a(%rip), %rsi     # 0x1246be
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdf2a5
jmp 0x968a3
leaq 0x8df1e(%rip), %rsi     # 0x1245a8
jmp 0x96693
leaq 0x8df05(%rip), %rsi     # 0x124598
movq %rbx, %rdi
callq 0xe07f7
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0xdecaf
movq %rax, %r14
movl %r15d, 0x8(%rax)
movl %r15d, %edi
callq 0x9699c
movq %rax, (%r14)
addl $-0x4, %r15d
cmpl $0x6, %r15d
ja 0x96880
leaq 0x8dde7(%rip), %rax     # 0x1244b4
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xdecaf
movq %rax, 0x18(%r14)
leaq 0x8df35(%rip), %r8      # 0x124623
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x969eb
testl %eax, %eax
je 0x96878
movq 0x18(%r14), %rsi
leaq 0x8df0f(%rip), %rcx     # 0x124623
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x96afd
testl %eax, %eax
je 0x96875
movq 0x18(%r14), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rax
pushq $0x2
popq %rcx
cqto
idivq %rcx
pushq $0x4
popq %rcx
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe7437
movq %rax, %r15
movq 0x18(%r14), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x96bf3
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x96d3f
jmp 0x96878
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0xdebae
movq (%r14), %rdx
leaq 0x8df19(%rip), %rsi     # 0x1246a3
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xde896
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xdeba7
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xdecaf
movq %rax, 0x18(%r14)
leaq 0xa2474(%rip), %r8      # 0x138c2d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x969eb
testl %eax, %eax
je 0x96867
movq 0x18(%r14), %rax
movq 0x90(%rax), %r15
movl $0x4b8, %esi            # imm = 0x4B8
movq %rbx, %rdi
callq 0xdecaf
movq %rax, 0x10(%r14)
leaq 0x8debf(%rip), %r8      # 0x1246b3
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x969eb
testl %eax, %eax
je 0x96867
movq 0x18(%r14), %rsi
leaq 0xa2419(%rip), %rcx     # 0x138c2d
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x96afd
testl %eax, %eax
je 0x96867
movq 0x10(%r14), %rsi
leaq 0x8de85(%rip), %rcx     # 0x1246b3
movq %rbx, %rdi
xorl %edx, %edx
callq 0x96afd
testl %eax, %eax
je 0x96867
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq (%rax), %rsi
movq (%rcx), %rdx
pushq $0x1
popq %rcx
movq %rbx, %rdi
callq 0x96bf3
movq 0x10(%r14), %rax
movq (%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x96d3f
movl 0x30(%rsp), %esi
movq %rbx, %rdi
callq 0xdebb7
jmp 0x96880
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xe7084
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x969bc
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x969bc
movq %rbx, %rdi
movq %r14, %rsi
callq 0xded32
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq