Function at 0x4a0380
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xa8
cmp byte [0x00587a9c], 0
mov r14d, dword [rcx]
mov r15, rcx
mov rbx, rdx
mov eax, r14d
jne 0x49ff1a
test rbx, rbx
je 0x49f870
test eax, eax
je 0x49f870
mov rcx, qword [rbx]
test rcx, rcx
je 0x49f870
cmp byte [rcx], 0
jne 0x4a00e7
nop word cs:[rax + rax]
call fcn.004a5f20
lea rsi, [rsp + 0x50]
call sub.WINMM.dll_timeGetTime
lea rcx, str.GLUT_FPS
mov dword [0x00587abc], eax
call sub.msvcrt.dll_getenv
mov qword [rsp + 0x38], rsi
test rax, rax
je 0x49f8c1
lea rdx, [0x005b664a]
mov r8, rsi
mov rcx, rax
call sub.msvcrt.dll_sscanf
mov eax, dword [rsp + 0x50]
mov edx, 0x1388
test eax, eax
cmovle eax, edx
mov dword [0x00587ab0], eax
lea rcx, [0x005b664d]
call sub.msvcrt.dll_getenv
cmp r14d, 1
mov r10, rax
jle 0x4a011a
mov ebp, 1
mov r8d, r14d
mov rdx, r15
mov qword [rsp + 0x28], 0
jmp 0x49f91f
cmp r8d, r15d
jle 0x49fc05
lea rax, [rbx + r13 + 8]
add ebp, 2
mov r10, qword [rax]
mov qword [rbx + r12*8], 0
mov qword [rax], 0
sub dword [rdx], 2
cmp r8d, ebp
jle 0x49f99f
lea rdi, str._display
movsxd r12, ebp
mov ecx, 9
lea r13, [r12*8]
lea r14, [rbx + r13]
mov rax, qword [r14]
lea r15d, [rbp + 1]
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta cl
sbb cl, 0
test cl, cl
je 0x49f8f0
lea rdi, str._geometry
mov ecx, 0xa
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta cl
sbb cl, 0
test cl, cl
jne 0x49fbc0
cmp r8d, r15d
jle 0x49fd16
lea rax, [rbx + r13 + 8]
add ebp, 2
mov rdi, qword [rax]
mov qword [rsp + 0x28], rdi
mov qword [rbx + r12*8], 0
mov qword [rax], 0
sub dword [rdx], 2
cmp r8d, ebp
jg 0x49f91f
mov r15, rdx
mov eax, dword [r15]
cmp eax, 1
jle 0x49f9f6
lea r9d, [rax - 2]
mov r8d, 1
mov ecx, 1
add r9, 2
nop dword [rax]
movsxd rax, ecx
mov rdx, qword [rbx + rax*8]
lea eax, [rcx + 1]
cdqe
test rdx, rdx
jne 0x49f9e1
mov ecx, eax
add rax, 1
mov rdx, qword [rbx + rax*8 - 8]
test rdx, rdx
je 0x49f9d1
cmp ecx, r8d
je 0x49f9ea
mov qword [rbx + r8*8], rdx
add r8, 1
add ecx, 1
cmp r9, r8
jne 0x49f9c0
mov qword [rsp + 0x30], r10
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov r10, qword [rsp + 0x30]
mov rbx, rax
mov qword [0x00c88ba0], rax
xor eax, eax
test r10, r10
je 0x49fa21
mov rcx, r10
call sub.msvcrt.dll__strdup
mov qword [0x00c88c48], rax
mov r8, qword [rsp + 0x38]
lea rdx, [0x005b6756]
mov rcx, rbx
call qword [sym.imp.USER32.dll_GetClassInfoA]
test ax, ax
je 0x49ff63
xor ecx, ecx
mov rbx, qword [sym.imp.USER32.dll_GetSystemMetrics]
call rbx
mov ecx, 1
mov dword [0x00c88c50], eax
call rbx
mov dword [0x00c88c54], eax
call qword [sym.imp.USER32.dll_GetDesktopWindow]
mov rdi, rax
mov rcx, rax
call qword [sym.imp.USER32.dll_GetDC]
mov edx, 4
mov rbx, qword [sym.imp.GDI32.dll_GetDeviceCaps]
mov rsi, rax
mov rcx, rax
call rbx
mov edx, 6
mov rcx, rsi
mov dword [0x00c88c58], eax
call rbx
mov rcx, rdi
mov rdx, rsi
mov dword [0x00c88c5c], eax
call qword [sym.imp.USER32.dll_ReleaseDC]
mov rcx, qword [0x00c88c48]
test rcx, rcx
je 0x49fb1b
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.GDI32.dll_CreateDCA]
test rax, rax
mov rsi, rax
je 0x4a001c
mov edx, 8
mov rcx, rax
call rbx
mov edx, 0xa
mov rcx, rsi
mov dword [0x00c88c50], eax
call rbx
mov edx, 4
mov rcx, rsi
mov dword [0x00c88c54], eax
call rbx
mov rcx, rsi
mov edx, 6
mov dword [0x00c88c58], eax
call rbx
mov rcx, rsi
mov dword [0x00c88c5c], eax
call qword [sym.imp.GDI32.dll_DeleteDC]
mov ecx, 1
call qword [sym.imp.WINMM.dll_timeBeginPeriod]
mov byte [0x00587a9c], 1
call fcn.004a0aa0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x49fd02
movsx eax, byte [rax]
test al, al
je 0x49ff01
cmp al, 0x3d
je 0x4a00d0
lea edx, [rax - 0x2b]
and edx, 0xfd
je 0x4a007b
cmp al, 0x78
je 0x4a007b
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x49ff01
mov rdx, qword [rsp + 0x28]
xor ecx, ecx
nop dword [rax]
lea ecx, [rcx + rcx*4]
add rdx, 1
lea ecx, [rax + rcx*2 - 0x30]
movsx eax, byte [rdx]
lea r8d, [rax - 0x30]
cmp r8b, 9
jbe 0x49fb80
cmp qword [rsp + 0x28], rdx
mov dword [rsp + 0x48], ecx
je 0x49ff01
mov qword [rsp + 0x28], rdx
mov r9d, 4
jmp 0x4a0086
lea rdi, str._direct
mov ecx, 8
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta cl
sbb cl, 0
test cl, cl
jne 0x49fc30
mov eax, dword [0x00587aa0]
test eax, eax
je 0x49ff2e
mov dword [0x00587aa0], 3
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f916
lea rcx, str._display_parameter_must_be_followed_by_display_name
mov qword [rsp + 0xf0], rdx
mov dword [rsp + 0x30], r8d
call fcn.004a1bb0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x30]
jmp 0x49f8f9
lea rdi, str._indirect
mov ecx, 0xa
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta cl
sbb cl, 0
test cl, cl
jne 0x49fd4b
cmp dword [0x00587aa0], 3
je 0x4a0046
mov dword [0x00587aa0], 0
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f916
xor edx, edx
xor ecx, ecx
test al, al
jne 0x49ff01
test r9b, 1
jne 0x4a0135
test r9b, 2
je 0x49fc9a
mov dword [0x00587a84], edx
mov eax, dword [rsp + 0x48]
mov dword [0x00587a8c], eax
mov eax, dword [rsp + 0x44]
mov dword [0x00587a90], eax
mov eax, r9d
and eax, 0xc
cmp eax, 0xc
jne 0x49fcc0
mov byte [0x00587a94], 1
mov ecx, r9d
mov edx, r9d
and ecx, 0x20
and edx, 3
and r9d, 0x10
je 0x49fce2
mov eax, dword [0x00c88c50]
sub eax, dword [rsp + 0x48]
add dword [0x00587a80], eax
test ecx, ecx
je 0x49fcf6
mov eax, dword [0x00c88c54]
sub eax, dword [rsp + 0x44]
add dword [0x00587a84], eax
cmp edx, 3
jne 0x49fd02
mov byte [0x00587a88], 1
add rsp, 0xa8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rcx, str._geometry_parameter_must_be_followed_by_window_geometry_settings
mov qword [rsp + 0xf0], rdx
mov dword [rsp + 0x30], r8d
mov qword [rsp + 0x28], r10
call fcn.004a1bb0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x30]
mov r10, qword [rsp + 0x28]
jmp 0x49f978
lea rdi, str._iconic
mov ecx, 8
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta cl
sbb cl, 0
test cl, cl
jne 0x49fd7f
mov byte [0x00587aa4], 1
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f916
lea rdi, str._gldebug
mov ecx, 9
mov rsi, rax
repe cmpsb byte [rsi], byte [rdi]
seta cl
sbb cl, 0
test cl, cl
je 0x4a002d
mov rsi, rax
mov ecx, 6
mov ebp, r15d
lea rdi, str._sync
repe cmpsb byte [rsi], byte [rdi]
seta al
sbb al, 0
test al, al
jne 0x49f916
mov byte [0x00587aa7], 1
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f916
mov rax, qword [rsp + 0x28]
lea rdx, [rax + 2]
movsx eax, byte [rax + 2]
lea ecx, [rax - 0x30]
cmp cl, 9
ja 0x4a01e3
mov r10d, 0xffffffff
xor ecx, ecx
nop word cs:[rax + rax]
lea ecx, [rcx + rcx*4]
add rdx, 1
lea ecx, [rax + rcx*2 - 0x30]
movsx eax, byte [rdx]
lea r8d, [rax - 0x30]
cmp r8b, 9
jbe 0x49fe00
cmp r10d, 0xffffffff
jne 0x49fe20
neg ecx
mov dword [rsp + 0x44], ecx
mov qword [rsp + 0x28], rdx
cmp r11, rdx
je 0x49ff01
movzx eax, byte [rdx]
or r9d, 8
lea edx, [rax - 0x2b]
and edx, 0xfd
jne 0x49fc78
mov rdi, qword [rsp + 0x28]
cmp al, 0x2d
lea r10, [rdi + 1]
movsx edx, byte [rdi + 1]
je 0x4a01f5
cmp dl, 0x2b
je 0x4a0254
cmp dl, 0x2d
jne 0x4a0153
mov rax, qword [rsp + 0x28]
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x4a0272
mov r11d, 0xffffffff
xor ecx, ecx
lea eax, [rcx + rcx*4]
add r8, 1
lea ecx, [rdx + rax*2 - 0x30]
movsx edx, byte [r8]
lea eax, [rdx - 0x30]
cmp al, 9
jbe 0x49fe8f
mov eax, ecx
neg eax
cmp r11d, 0xffffffff
cmove ecx, eax
cmp r8, r10
je 0x49ff01
movzx edx, byte [r8]
mov ebx, r9d
or ebx, 1
lea eax, [rdx - 0x2b]
test al, 0xfd
jne 0x4a0128
lea r11, [r8 + 1]
cmp dl, 0x2d
movsx eax, byte [r8 + 1]
je 0x4a02c4
cmp al, 0x2b
je 0x4a0282
cmp al, 0x2d
je 0x4a016c
lea edx, [rax - 0x30]
mov r10, r11
mov r9d, 1
cmp dl, 9
jbe 0x4a0187
mov eax, dword [rsp + 0x48]
mov dword [0x00587a8c], eax
mov eax, dword [rsp + 0x44]
mov dword [0x00587a90], eax
jmp 0x49fd02
lea rcx, str.illegal_glutInit___reinitialization_attempt
call fcn.004a1bb0
mov eax, dword [r15]
jmp 0x49f84c
lea rcx, str.parameters_ambiguity___direct_and__indirect_cannot_be_both_specified
mov qword [rsp + 0xf0], rdx
mov dword [rsp + 0x4c], r8d
mov qword [rsp + 0x30], r10
call fcn.004a1bb0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x4c]
mov r10, qword [rsp + 0x30]
jmp 0x49fbe9
mov rdi, qword [rsp + 0x38]
xor eax, eax
mov ecx, 9
lea rdx, str.GLUT_ICON
mov rbx, qword [sym.imp.USER32.dll_LoadIconA]
rep stosq qword [rdi], rax
mov rax, qword [0x005d29d0]
mov rcx, qword [0x00c88ba0]
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x68], rcx
call rbx
mov dword [rsp + 0x50], 0x23
test rax, rax
mov qword [rsp + 0x70], rax
je 0x4a0140
xor ecx, ecx
mov edx, 0x7f00
call qword [sym.imp.USER32.dll_LoadCursorA]
mov rcx, qword [rsp + 0x38]
mov qword [rsp + 0x80], 0
mov qword [rsp + 0x78], rax
lea rax, [0x005b6756]
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x90], rax
call qword [sym.imp.USER32.dll_RegisterClassA]
test ax, ax
jne 0x49fa46
lea r8, str.fghInitialize
lea rdx, str.Window_Class_Not_Registered
lea rcx, [0x005b6798]
call fcn.004a1bb0
jmp 0x49fa46
lea rcx, str.fghInitialize:_CreateDC_failed__Screen_size_info_may_be_incorrect_nThis_is_quite_likely_caused_by_a_bad__display_parameter
call fcn.004a1ca0
jmp 0x49fb1b
mov byte [0x00587aa6], 1
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f916
lea rcx, str.parameters_ambiguity___direct_and__indirect_cannot_be_both_specified
mov qword [rsp + 0xf0], rdx
mov dword [rsp + 0x4c], r8d
mov qword [rsp + 0x30], r10
call fcn.004a1bb0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x4c]
mov r10, qword [rsp + 0x30]
jmp 0x49fc5c
mov dword [rsp + 0x48], 0
xor r9d, r9d
mov edx, eax
and edx, 0xffffffdf
cmp dl, 0x58
jne 0x4a010d
mov rax, qword [rsp + 0x28]
lea r11, [rax + 1]
movsx eax, byte [rax + 1]
cmp al, 0x2b
je 0x4a01c4
cmp al, 0x2d
je 0x49fdd5
lea ecx, [rax - 0x30]
mov rdx, r11
mov r10d, 1
cmp cl, 9
jbe 0x49fdf4
jmp 0x49ff01
mov rdi, qword [rsp + 0x28]
movsx eax, byte [rdi + 1]
add rdi, 1
mov qword [rsp + 0x28], rdi
jmp 0x49fb53
call sub.msvcrt.dll__strdup
test rax, rax
mov qword [0x00587b20], rax
jne 0x49f870
lea rcx, str.Could_not_allocate_space_for_the_programs_name.
call fcn.004a1bb0
jmp 0x49f870
mov dword [rsp + 0x44], 0
jmp 0x49fe39
mov qword [rsp + 0x28], 0
jmp 0x49f9a2
test dl, dl
jne 0x49ff01
mov r9d, ebx
xor edx, edx
mov dword [0x00587a80], ecx
jmp 0x49fc8e
mov edx, 0x7f05
xor ecx, ecx
call rbx
mov qword [rsp + 0x70], rax
jmp 0x49ffb0
lea eax, [rdx - 0x30]
mov r8, r10
mov r11d, 1
cmp al, 9
jbe 0x49fe8d
jmp 0x49ff01
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0279
mov r9d, 0xffffffff
xor edx, edx
lea edx, [rdx + rdx*4]
add r10, 1
lea edx, [rax + rdx*2 - 0x30]
movsx eax, byte [r10]
lea r8d, [rax - 0x30]
cmp r8b, 9
jbe 0x4a0189
cmp r9d, 0xffffffff
je 0x4a027b
cmp r10, r11
je 0x49ff01
or ebx, 2
movzx eax, byte [r10]
mov r9d, ebx
jmp 0x49fc7c
mov rax, qword [rsp + 0x28]
mov r10d, 1
lea rdx, [rax + 2]
movsx eax, byte [rax + 2]
lea ecx, [rax - 0x30]
cmp cl, 9
jbe 0x49fdf4
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x44], 0
jmp 0x49fe29
cmp dl, 0x2b
je 0x4a02a4
cmp dl, 0x2d
je 0x4a0355
lea eax, [rdx - 0x30]
mov r8, r10
mov r11d, 1
cmp al, 9
ja 0x49ff01
xor eax, eax
lea eax, [rax + rax*4]
add r8, 1
lea eax, [rdx + rax*2 - 0x30]
movsx edx, byte [r8]
lea ecx, [rdx - 0x30]
cmp cl, 9
jbe 0x4a021d
mov ecx, eax
neg ecx
cmp r11d, 0xffffffff
je 0x4a031c
cmp r8, r10
je 0x49ff01
or r9d, 0x10
jmp 0x49feb5
mov rax, qword [rsp + 0x28]
mov r11d, 1
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
jbe 0x49fe8d
xor ecx, ecx
jmp 0x49feb0
xor edx, edx
neg edx
jmp 0x4a01ac
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
mov r9d, 1
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a0187
xor edx, edx
jmp 0x4a01ac
movsx edx, byte [rdi + 2]
lea r8, [rdi + 2]
xor ecx, ecx
mov r11d, 1
lea eax, [rdx - 0x30]
cmp al, 9
jbe 0x4a021b
jmp 0x4a0242
cmp al, 0x2b
je 0x4a033b
cmp al, 0x2d
je 0x4a0323
lea edx, [rax - 0x30]
mov r10, r11
mov ebx, 1
cmp dl, 9
ja 0x49ff01
xor r8d, r8d
lea edx, [r8 + r8*4]
add r10, 1
lea r8d, [rax + rdx*2 - 0x30]
movsx eax, byte [r10]
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a02e3
mov edx, r8d
neg edx
cmp ebx, 0xffffffff
je 0x4a0377
cmp r10, r11
je 0x49ff01
mov ebx, r9d
or ebx, 0x21
jmp 0x4a01b5
xor eax, eax
mov ecx, eax
jmp 0x4a0242
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0374
mov ebx, 0xffffffff
jmp 0x4a02e0
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
mov ebx, 1
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a02e0
xor edx, edx
jmp 0x4a0306
mov rax, qword [rsp + 0x28]
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x4a031a
mov r11d, 0xffffffff
jmp 0x4a021b
xor r8d, r8d
mov edx, r8d
jmp 0x4a0306
mov qword [0x00c875e0], r8
jmp 0x49f820