Function at 0x10015520
Capabilities:
Query environment variable

Disassembly:
sub esp, 0x500
push ebx
push ebp
push esi
mov esi, dword [esp + 0x514]
test esi, esi
push edi
je 0x1001574b
push esi
call dword [sym.alleg40.dll_ugetc]
add esp, 4
test eax, eax
je 0x1001559c
push esi
call sym.alleg40.dll_get_filename
push eax
call dword [sym.alleg40.dll_ugetc]
add esp, 8
test eax, eax
jne 0x1001559c
mov eax, dword [esp + 0x530]
mov ecx, dword [esp + 0x52c]
mov edx, dword [esp + 0x524]
push eax
mov eax, dword [esp + 0x524]
push ecx
mov ecx, dword [esp + 0x51c]
push edx
push eax
push sym.alleg40.dll_empty_string
push esi
push ecx
call fcn.10015aa0
add esp, 0x1c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x500
ret
push 0x80
lea edx, [esp + 0x94]
push 0x6375722e
push edx
push 0x41534338
push 0x10075dc0
call sym.alleg40.dll_uconvert
push eax
push esi
call sym.alleg40.dll_ustrpbrk
add esp, 0x1c
test eax, eax
je 0x10015700
push 0
push 0x21
push esi
call sym.alleg40.dll_file_exists
add esp, 0xc
test eax, eax
je 0x10015a8a
mov ebx, dword [esp + 0x530]
mov edi, dword [esp + 0x514]
push esi
push ebx
push edi
call sym.alleg40.dll_ustrzcpy
push 0x80
lea eax, [esp + 0xa0]
push 0x6375722e
push eax
push 0x41534338
push 0x10075dc4
call sym.alleg40.dll_uconvert
add esp, 0x20
push eax
push edi
call sym.alleg40.dll_get_extension
add esp, 4
push eax
call sym.alleg40.dll_ustricmp
add esp, 8
test eax, eax
jne 0x10015a7d
mov esi, dword [esp + 0x524]
test esi, esi
je 0x10015a7d
push 0x80
lea ecx, [esp + 0x94]
push 0x6375722e
push ecx
push 0x41534338
push 0x10075dc8
call sym.alleg40.dll_uconvert
push eax
push ebx
push edi
call sym.alleg40.dll_ustrzcat
push esi
xor ebx, ebx
call sym.alleg40.dll_ustrlen
add esp, 0x24
test eax, eax
jle 0x100156de
push ebx
push esi
call sym.alleg40.dll_ugetat
mov esi, eax
add esp, 8
cmp esi, 0x2e
jne 0x10015696
mov esi, 0x5f
push edi
call sym.alleg40.dll_ustrsizez
push esi
mov ebp, eax
call dword [sym.alleg40.dll_ucwidth]
add ebp, eax
mov eax, dword [esp + 0x538]
add esp, 8
cmp ebp, eax
jg 0x100156c9
push esi
push edi
call sym.alleg40.dll_ustrlen
add esp, 4
push eax
push edi
call sym.alleg40.dll_uinsert
add esp, 0xc
mov esi, dword [esp + 0x524]
inc ebx
push esi
call sym.alleg40.dll_ustrlen
add esp, 4
cmp ebx, eax
jl 0x10015680
push 0
push 0x21
push edi
call sym.alleg40.dll_file_exists
add esp, 0xc
test eax, eax
je 0x10015a8a
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x500
ret
push esi
lea edx, [esp + 0x14]
push 0x80
push edx
call sym.alleg40.dll_ustrzcpy
mov esi, dword [esp + 0x528]
add esp, 0xc
test esi, esi
je 0x1001575b
lea eax, [esp + 0x10]
push eax
call sym.alleg40.dll_get_extension
push eax
call dword [sym.alleg40.dll_ugetc]
add esp, 8
test eax, eax
jne 0x1001575b
push esi
lea ecx, [esp + 0x14]
push 0x80
push ecx
call sym.alleg40.dll_ustrzcat
add esp, 0xc
jmp 0x1001575b
lea edx, [esp + 0x10]
push 0
push edx
call dword [sym.alleg40.dll_usetc]
add esp, 8
lea eax, [esp + 0x110]
push 0x400
push eax
call sym.alleg40.dll_get_executable_name
add esp, 8
lea ecx, [esp + 0x110]
push 0
push ecx
call sym.alleg40.dll_get_filename
add esp, 4
push eax
call dword [sym.alleg40.dll_usetc]
mov edx, dword [esp + 0x538]
mov edi, dword [esp + 0x534]
mov ebp, dword [esp + 0x52c]
mov ebx, dword [esp + 0x528]
push edx
mov edx, dword [esp + 0x520]
push edi
push ebp
lea eax, [esp + 0x24]
push ebx
lea ecx, [esp + 0x128]
push eax
push ecx
push edx
call fcn.10015aa0
add esp, 0x24
test eax, eax
jne 0x100157d5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x500
ret
push str.ALLEGRO
call dword [sym.imp.MSVCRT.dll_getenv]
mov esi, eax
add esp, 4
test esi, esi
je 0x10015855
push 0x5c
call dword [sym.alleg40.dll_ucwidth]
mov ecx, 0x400
lea edx, [esp + 0x114]
sub ecx, eax
push ecx
push 0x6375722e
push edx
push 0x41534338
push esi
call sym.alleg40.dll_do_uconvert
lea eax, [esp + 0x128]
push eax
call sym.alleg40.dll_put_backslash
mov ecx, dword [esp + 0x54c]
lea edx, [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x534]
push edi
push ebp
push ebx
lea eax, [esp + 0x13c]
push edx
push eax
push ecx
call fcn.10015aa0
add esp, 0x38
test eax, eax
jne 0x10015855
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x500
ret
mov eax, dword [esp + 0x528]
test eax, eax
je 0x100158fd
push 0x80
lea edx, [esp + 0x94]
push 0x41534338
push edx
push 0x6375722e
push eax
call sym.alleg40.dll_uconvert
push eax
call dword [sym.imp.MSVCRT.dll_getenv]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x100158fd
push 0x5c
call dword [sym.alleg40.dll_ucwidth]
mov ecx, 0x400
lea edx, [esp + 0x114]
sub ecx, eax
push ecx
push 0x6375722e
push edx
push 0x41534338
push esi
call sym.alleg40.dll_do_uconvert
lea eax, [esp + 0x128]
push eax
call sym.alleg40.dll_put_backslash
mov ecx, dword [esp + 0x54c]
lea edx, [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x534]
push edi
push ebp
push ebx
lea eax, [esp + 0x13c]
push edx
push eax
push ecx
call fcn.10015aa0
add esp, 0x38
test eax, eax
jne 0x100158fd
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x500
ret
mov eax, dword [sym.alleg40.dll_system_driver]
test eax, eax
je 0x10015a8a
mov esi, dword [eax + 0x1c]
test esi, esi
je 0x10015a8a
lea edx, [esp + 0x10]
push edx
call dword [sym.alleg40.dll_ugetc]
add esp, 4
test eax, eax
je 0x10015950
mov eax, dword [esp + 0x530]
mov edx, dword [esp + 0x514]
lea ecx, [esp + 0x10]
push eax
push ecx
push edx
call esi
add esp, 0xc
test eax, eax
jne 0x10015950
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x500
ret
test ebx, ebx
je 0x10015a8a
lea eax, [esp + 0x10]
push eax
call dword [sym.alleg40.dll_ugetc]
add esp, 4
test eax, eax
jne 0x10015972
test ebp, ebp
je 0x10015a8a
push 0x400
lea ecx, [esp + 0x114]
push ebx
push ecx
call esi
add esp, 0xc
test eax, eax
jne 0x10015a8a
lea edx, [esp + 0x10]
push edx
call dword [sym.alleg40.dll_ugetc]
add esp, 4
test eax, eax
jne 0x100159b2
push ebp
lea eax, [esp + 0x14]
push 0x80
push eax
call sym.alleg40.dll_ustrzcpy
add esp, 0xc
lea ecx, [esp + 0x10]
xor esi, esi
push ecx
call sym.alleg40.dll_ustrlen
add esp, 4
test eax, eax
jle 0x100159fa
lea edx, [esp + 0x10]
push esi
push edx
call sym.alleg40.dll_ugetat
add esp, 8
cmp eax, 0x2e
jne 0x100159e8
push 0x5f
lea eax, [esp + 0x14]
push esi
push eax
call sym.alleg40.dll_usetat
add esp, 0xc
lea ecx, [esp + 0x10]
inc esi
push ecx
call sym.alleg40.dll_ustrlen
add esp, 4
cmp esi, eax
jl 0x100159c5
push 0x80
lea edx, [esp + 0x94]
push 0x6375722e
push edx
push 0x41534338
push 0x10075dd4
call sym.alleg40.dll_uconvert
push eax
lea eax, [esp + 0x128]
push 0x400
push eax
call sym.alleg40.dll_ustrzcat
lea ecx, [esp + 0x30]
lea edx, [esp + 0x130]
push ecx
push 0x400
push edx
call sym.alleg40.dll_ustrzcat
push 0
lea eax, [esp + 0x140]
push 0x21
push eax
call sym.alleg40.dll_file_exists
add esp, 0x38
test eax, eax
je 0x10015a8a
mov edx, dword [esp + 0x530]
mov eax, dword [esp + 0x514]
lea ecx, [esp + 0x110]
push ecx
push edx
push eax
call sym.alleg40.dll_ustrzcpy
add esp, 0xc
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x500
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x500
ret