Function at 0x4a0030
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 [0x00588a9c], 0
mov r14d, dword [rcx]
mov r15, rcx
mov rbx, rdx
mov eax, r14d
jne 0x4a072a
test rbx, rbx
je 0x4a0080
test eax, eax
je 0x4a0080
mov rcx, qword [rbx]
test rcx, rcx
je 0x4a0080
cmp byte [rcx], 0
jne 0x4a08f7
nop word cs:[rax + rax]
call fcn.004a6730
lea rsi, [rsp + 0x50]
call sub.WINMM.dll_timeGetTime
lea rcx, str.GLUT_FPS
mov dword [0x00588abc], eax
call sub.msvcrt.dll_getenv
mov qword [rsp + 0x38], rsi
test rax, rax
je 0x4a00d1
lea rdx, [0x005b772a]
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 [0x00588ab0], eax
lea rcx, [0x005b772d]
call sub.msvcrt.dll_getenv
cmp r14d, 1
mov r10, rax
jle 0x4a092a
mov ebp, 1
mov r8d, r14d
mov rdx, r15
mov qword [rsp + 0x28], 0
jmp 0x4a012f
cmp r8d, r15d
jle 0x4a0415
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 0x4a01af
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 0x4a0100
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 0x4a03d0
cmp r8d, r15d
jle 0x4a0526
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 0x4a012f
mov r15, rdx
mov eax, dword [r15]
cmp eax, 1
jle 0x4a0206
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 0x4a01f1
mov ecx, eax
add rax, 1
mov rdx, qword [rbx + rax*8 - 8]
test rdx, rdx
je 0x4a01e1
cmp ecx, r8d
je 0x4a01fa
mov qword [rbx + r8*8], rdx
add r8, 1
add ecx, 1
cmp r9, r8
jne 0x4a01d0
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 [0x00c89ba0], rax
xor eax, eax
test r10, r10
je 0x4a0231
mov rcx, r10
call sub.msvcrt.dll__strdup
mov qword [0x00c89c48], rax
mov r8, qword [rsp + 0x38]
lea rdx, [0x005b7836]
mov rcx, rbx
call qword [sym.imp.USER32.dll_GetClassInfoA]
test ax, ax
je 0x4a0773
xor ecx, ecx
mov rbx, qword [sym.imp.USER32.dll_GetSystemMetrics]
call rbx
mov ecx, 1
mov dword [0x00c89c50], eax
call rbx
mov dword [0x00c89c54], 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 [0x00c89c58], eax
call rbx
mov rcx, rdi
mov rdx, rsi
mov dword [0x00c89c5c], eax
call qword [sym.imp.USER32.dll_ReleaseDC]
mov rcx, qword [0x00c89c48]
test rcx, rcx
je 0x4a032b
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.GDI32.dll_CreateDCA]
test rax, rax
mov rsi, rax
je 0x4a082c
mov edx, 8
mov rcx, rax
call rbx
mov edx, 0xa
mov rcx, rsi
mov dword [0x00c89c50], eax
call rbx
mov edx, 4
mov rcx, rsi
mov dword [0x00c89c54], eax
call rbx
mov rcx, rsi
mov edx, 6
mov dword [0x00c89c58], eax
call rbx
mov rcx, rsi
mov dword [0x00c89c5c], eax
call qword [sym.imp.GDI32.dll_DeleteDC]
mov ecx, 1
call qword [sym.imp.WINMM.dll_timeBeginPeriod]
mov byte [0x00588a9c], 1
call fcn.004a12b0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x4a0512
movsx eax, byte [rax]
test al, al
je 0x4a0711
cmp al, 0x3d
je 0x4a08e0
lea edx, [rax - 0x2b]
and edx, 0xfd
je 0x4a088b
cmp al, 0x78
je 0x4a088b
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0711
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 0x4a0390
cmp qword [rsp + 0x28], rdx
mov dword [rsp + 0x48], ecx
je 0x4a0711
mov qword [rsp + 0x28], rdx
mov r9d, 4
jmp 0x4a0896
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 0x4a0440
mov eax, dword [0x00588aa0]
test eax, eax
je 0x4a073e
mov dword [0x00588aa0], 3
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x4a0126
lea rcx, str._display_parameter_must_be_followed_by_display_name
mov qword [rsp + 0xf0], rdx
mov dword [rsp + 0x30], r8d
call fcn.004a23c0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x30]
jmp 0x4a0109
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 0x4a055b
cmp dword [0x00588aa0], 3
je 0x4a0856
mov dword [0x00588aa0], 0
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x4a0126
xor edx, edx
xor ecx, ecx
test al, al
jne 0x4a0711
test r9b, 1
jne 0x4a0945
test r9b, 2
je 0x4a04aa
mov dword [0x00588a84], edx
mov eax, dword [rsp + 0x48]
mov dword [0x00588a8c], eax
mov eax, dword [rsp + 0x44]
mov dword [0x00588a90], eax
mov eax, r9d
and eax, 0xc
cmp eax, 0xc
jne 0x4a04d0
mov byte [0x00588a94], 1
mov ecx, r9d
mov edx, r9d
and ecx, 0x20
and edx, 3
and r9d, 0x10
je 0x4a04f2
mov eax, dword [0x00c89c50]
sub eax, dword [rsp + 0x48]
add dword [0x00588a80], eax
test ecx, ecx
je 0x4a0506
mov eax, dword [0x00c89c54]
sub eax, dword [rsp + 0x44]
add dword [0x00588a84], eax
cmp edx, 3
jne 0x4a0512
mov byte [0x00588a88], 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.004a23c0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x30]
mov r10, qword [rsp + 0x28]
jmp 0x4a0188
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 0x4a058f
mov byte [0x00588aa4], 1
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x4a0126
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 0x4a083d
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 0x4a0126
mov byte [0x00588aa7], 1
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x4a0126
mov rax, qword [rsp + 0x28]
lea rdx, [rax + 2]
movsx eax, byte [rax + 2]
lea ecx, [rax - 0x30]
cmp cl, 9
ja 0x4a09f3
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 0x4a0610
cmp r10d, 0xffffffff
jne 0x4a0630
neg ecx
mov dword [rsp + 0x44], ecx
mov qword [rsp + 0x28], rdx
cmp r11, rdx
je 0x4a0711
movzx eax, byte [rdx]
or r9d, 8
lea edx, [rax - 0x2b]
and edx, 0xfd
jne 0x4a0488
mov rdi, qword [rsp + 0x28]
cmp al, 0x2d
lea r10, [rdi + 1]
movsx edx, byte [rdi + 1]
je 0x4a0a05
cmp dl, 0x2b
je 0x4a0a64
cmp dl, 0x2d
jne 0x4a0963
mov rax, qword [rsp + 0x28]
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x4a0a82
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 0x4a069f
mov eax, ecx
neg eax
cmp r11d, 0xffffffff
cmove ecx, eax
cmp r8, r10
je 0x4a0711
movzx edx, byte [r8]
mov ebx, r9d
or ebx, 1
lea eax, [rdx - 0x2b]
test al, 0xfd
jne 0x4a0938
lea r11, [r8 + 1]
cmp dl, 0x2d
movsx eax, byte [r8 + 1]
je 0x4a0ad4
cmp al, 0x2b
je 0x4a0a92
cmp al, 0x2d
je 0x4a097c
lea edx, [rax - 0x30]
mov r10, r11
mov r9d, 1
cmp dl, 9
jbe 0x4a0997
mov eax, dword [rsp + 0x48]
mov dword [0x00588a8c], eax
mov eax, dword [rsp + 0x44]
mov dword [0x00588a90], eax
jmp 0x4a0512
lea rcx, str.illegal_glutInit___reinitialization_attempt
call fcn.004a23c0
mov eax, dword [r15]
jmp 0x4a005c
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.004a23c0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x4c]
mov r10, qword [rsp + 0x30]
jmp 0x4a03f9
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 [0x005d3ab0]
mov rcx, qword [0x00c89ba0]
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 0x4a0950
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, [0x005b7836]
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x90], rax
call qword [sym.imp.USER32.dll_RegisterClassA]
test ax, ax
jne 0x4a0256
lea r8, str.fghInitialize
lea rdx, str.Window_Class_Not_Registered
lea rcx, [0x005b7878]
call fcn.004a23c0
jmp 0x4a0256
lea rcx, str.fghInitialize:_CreateDC_failed__Screen_size_info_may_be_incorrect_nThis_is_quite_likely_caused_by_a_bad__display_parameter
call fcn.004a24b0
jmp 0x4a032b
mov byte [0x00588aa6], 1
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x4a0126
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.004a23c0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x4c]
mov r10, qword [rsp + 0x30]
jmp 0x4a046c
mov dword [rsp + 0x48], 0
xor r9d, r9d
mov edx, eax
and edx, 0xffffffdf
cmp dl, 0x58
jne 0x4a091d
mov rax, qword [rsp + 0x28]
lea r11, [rax + 1]
movsx eax, byte [rax + 1]
cmp al, 0x2b
je 0x4a09d4
cmp al, 0x2d
je 0x4a05e5
lea ecx, [rax - 0x30]
mov rdx, r11
mov r10d, 1
cmp cl, 9
jbe 0x4a0604
jmp 0x4a0711
mov rdi, qword [rsp + 0x28]
movsx eax, byte [rdi + 1]
add rdi, 1
mov qword [rsp + 0x28], rdi
jmp 0x4a0363
call sub.msvcrt.dll__strdup
test rax, rax
mov qword [0x00588b20], rax
jne 0x4a0080
lea rcx, str.Could_not_allocate_space_for_the_programs_name.
call fcn.004a23c0
jmp 0x4a0080
mov dword [rsp + 0x44], 0
jmp 0x4a0649
mov qword [rsp + 0x28], 0
jmp 0x4a01b2
test dl, dl
jne 0x4a0711
mov r9d, ebx
xor edx, edx
mov dword [0x00588a80], ecx
jmp 0x4a049e
mov edx, 0x7f05
xor ecx, ecx
call rbx
mov qword [rsp + 0x70], rax
jmp 0x4a07c0
lea eax, [rdx - 0x30]
mov r8, r10
mov r11d, 1
cmp al, 9
jbe 0x4a069d
jmp 0x4a0711
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0a89
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 0x4a0999
cmp r9d, 0xffffffff
je 0x4a0a8b
cmp r10, r11
je 0x4a0711
or ebx, 2
movzx eax, byte [r10]
mov r9d, ebx
jmp 0x4a048c
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 0x4a0604
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x44], 0
jmp 0x4a0639
cmp dl, 0x2b
je 0x4a0ab4
cmp dl, 0x2d
je 0x4a0b65
lea eax, [rdx - 0x30]
mov r8, r10
mov r11d, 1
cmp al, 9
ja 0x4a0711
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 0x4a0a2d
mov ecx, eax
neg ecx
cmp r11d, 0xffffffff
je 0x4a0b2c
cmp r8, r10
je 0x4a0711
or r9d, 0x10
jmp 0x4a06c5
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 0x4a069d
xor ecx, ecx
jmp 0x4a06c0
xor edx, edx
neg edx
jmp 0x4a09bc
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
mov r9d, 1
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a0997
xor edx, edx
jmp 0x4a09bc
movsx edx, byte [rdi + 2]
lea r8, [rdi + 2]
xor ecx, ecx
mov r11d, 1
lea eax, [rdx - 0x30]
cmp al, 9
jbe 0x4a0a2b
jmp 0x4a0a52
cmp al, 0x2b
je 0x4a0b4b
cmp al, 0x2d
je 0x4a0b33
lea edx, [rax - 0x30]
mov r10, r11
mov ebx, 1
cmp dl, 9
ja 0x4a0711
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 0x4a0af3
mov edx, r8d
neg edx
cmp ebx, 0xffffffff
je 0x4a0b87
cmp r10, r11
je 0x4a0711
mov ebx, r9d
or ebx, 0x21
jmp 0x4a09c5
xor eax, eax
mov ecx, eax
jmp 0x4a0a52
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0b84
mov ebx, 0xffffffff
jmp 0x4a0af0
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
mov ebx, 1
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a0af0
xor edx, edx
jmp 0x4a0b16
mov rax, qword [rsp + 0x28]
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x4a0b2a
mov r11d, 0xffffffff
jmp 0x4a0a2b
xor r8d, r8d
mov edx, r8d
jmp 0x4a0b16
mov qword [0x00c885e0], r8
jmp 0x4a0030