Function at 0x4158a7
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0x1c
mov eax, 0x515870
call fcn.004f8b17
mov esi, ecx
mov edi, dword [sym.imp.USER32.dll_GetSysColor]
push 0x16
call edi
xor ebx, ebx
cmp eax, 0xffffff
jne 0x4158d3
push 0xf
call edi
test eax, eax
jne 0x4158d3
inc eax
jmp 0x4158d5
xor eax, eax
push 0x15
mov dword [esi + 0x17c], eax
call edi
test eax, eax
jne 0x4158f3
push 0xf
call edi
cmp eax, 0xffffff
jne 0x4158f3
xor eax, eax
inc eax
jmp 0x4158f5
xor eax, eax
push ebx
lea ecx, [ebp - 0x28]
mov dword [esi + 0x180], eax
call fcn.00412077
push 0xc
push dword [ebp - 0x20]
mov dword [ebp - 4], ebx
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push 0xf
mov dword [esi + 0x198], eax
call edi
push 0x10
mov dword [esi + 0x10], eax
mov dword [esi + 0x48], eax
call edi
push 0x15
mov dword [esi + 0x14], eax
mov dword [esi + 0x4c], eax
call edi
push 0x16
mov dword [esi + 0x24], eax
mov dword [esi + 0x54], eax
call edi
push 0x14
mov dword [esi + 0x28], eax
mov dword [esi + 0x58], eax
call edi
push 0x12
mov dword [esi + 0x18], eax
mov dword [esi + 0x50], eax
call edi
push 0x11
mov dword [esi + 0x1c], eax
mov dword [esi + 0x5c], eax
call edi
push 6
mov dword [esi + 0x2c], eax
call edi
push 0xd
mov dword [esi + 0x20], eax
call edi
push 0xe
mov dword [esi + 0x30], eax
call edi
push 5
mov dword [esi + 0x34], eax
call edi
push 8
mov dword [esi + 0x60], eax
mov dword [esi + 0x44], eax
call edi
push 9
mov dword [esi + 0x64], eax
call edi
push 7
mov dword [esi + 0x68], eax
call edi
push 2
mov dword [esi + 0x6c], eax
call edi
push 3
mov dword [esi + 0x70], eax
call edi
push 0xa
mov dword [esi + 0x74], eax
call edi
push 0xb
mov dword [esi + 0x7c], eax
call edi
push 0x13
mov dword [esi + 0x80], eax
call edi
mov dword [esi + 0x78], eax
cmp dword [esi + 0x17c], ebx
je 0x4159c8
mov eax, dword [esi + 0x64]
mov dword [esi + 0x3c], eax
mov dword [esi + 0x40], eax
jmp 0x4159da
push 0x1a
call edi
mov dword [esi + 0x3c], 0xff0000
mov dword [esi + 0x40], 0x800080
mov edi, dword [sym.imp.USER32.dll_GetSysColorBrush]
push 0x10
mov dword [esi + 0x38], eax
call edi
xor ecx, ecx
cmp eax, ebx
setne cl
mov dword [esi + 8], eax
mov eax, ecx
cmp eax, ebx
jne 0x4159fc
call fcn.00409dd4
push 0x14
call edi
xor ecx, ecx
cmp eax, ebx
setne cl
mov dword [esi + 4], eax
mov eax, ecx
cmp eax, ebx
je 0x4159f7
push 5
call edi
xor ecx, ecx
cmp eax, ebx
setne cl
mov dword [esi + 0xc], eax
mov eax, ecx
cmp eax, ebx
je 0x4159f7
lea edi, [esi + 0x84]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x10]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0xbc]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x48]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0xa4]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x70]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0xac]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x74]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0x8c]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x30]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0x9c]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x24]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0xb4]
mov ecx, edi
call fcn.0041227a
push dword [esi + 0x60]
mov ecx, edi
call fcn.00414c3c
lea edi, [esi + 0xc4]
mov ecx, edi
call fcn.0041227a
push dword [0x5717e0]
mov ecx, edi
push 1
push ebx
call fcn.00414c18
lea edi, [esi + 0xcc]
mov ecx, edi
call fcn.0041227a
push dword [0x5717f8]
mov ecx, edi
push 1
push ebx
call fcn.00414c18
lea edi, [esi + 0xd4]
mov ecx, edi
call fcn.0041227a
push dword [0x5717fc]
mov ecx, edi
push 1
push ebx
call fcn.00414c18
lea edi, [esi + 0x94]
cmp edi, ebx
je 0x415b32
cmp dword [edi + 4], ebx
je 0x415b32
mov ecx, edi
call fcn.0041227a
cmp dword [esi + 0x198], 8
jle 0x415b93
mov cl, byte [esi + 0x12]
movzx eax, byte [esi + 0x1a]
movzx bx, byte [esi + 0x11]
movzx edx, cl
sub eax, edx
cdq
sub eax, edx
sar eax, 1
add al, cl
movzx ecx, al
movzx eax, byte [esi + 0x19]
movzx edx, bl
sub eax, edx
cdq
sub eax, edx
sar eax, 1
add al, bl
mov bl, byte [esi + 0x10]
movzx eax, al
shl ecx, 8
or ecx, eax
movzx eax, byte [esi + 0x18]
movzx edx, bl
sub eax, edx
cdq
sub eax, edx
sar eax, 1
add al, bl
movzx eax, al
shl ecx, 8
or ecx, eax
push ecx
mov ecx, edi
call fcn.00414c3c
jmp 0x415bdd
push dword [ebp - 0x24]
mov ecx, esi
call fcn.004148aa
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x4159f7
mov esi, vtable.CBitmap.0
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], esi
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.00412222
lea eax, [ebp - 0x14]
push eax
mov ecx, edi
call fcn.00412290
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], bl
mov dword [ebp - 0x14], esi
call fcn.00412473
call fcn.0045b4f0
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x28]
mov dword [0x5724a4], 1
call fcn.004120cb
call fcn.004f8bef
ret