Function at 0x4a02a0
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 0x49fe3a
test rbx, rbx
je 0x49f790
test eax, eax
je 0x49f790
mov rcx, qword [rbx]
test rcx, rcx
je 0x49f790
cmp byte [rcx], 0
jne 0x4a0007
nop word cs:[rax + rax]
call fcn.004a5e40
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 0x49f7e1
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 0x4a003a
mov ebp, 1
mov r8d, r14d
mov rdx, r15
mov qword [rsp + 0x28], 0
jmp 0x49f83f
cmp r8d, r15d
jle 0x49fb25
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 0x49f8bf
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 0x49f810
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 0x49fae0
cmp r8d, r15d
jle 0x49fc36
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 0x49f83f
mov r15, rdx
mov eax, dword [r15]
cmp eax, 1
jle 0x49f916
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 0x49f901
mov ecx, eax
add rax, 1
mov rdx, qword [rbx + rax*8 - 8]
test rdx, rdx
je 0x49f8f1
cmp ecx, r8d
je 0x49f90a
mov qword [rbx + r8*8], rdx
add r8, 1
add ecx, 1
cmp r9, r8
jne 0x49f8e0
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 [0x00c88b80], rax
xor eax, eax
test r10, r10
je 0x49f941
mov rcx, r10
call sub.msvcrt.dll__strdup
mov qword [0x00c88c28], rax
mov r8, qword [rsp + 0x38]
lea rdx, [0x005b6756]
mov rcx, rbx
call qword [sym.imp.USER32.dll_GetClassInfoA]
test ax, ax
je 0x49fe83
xor ecx, ecx
mov rbx, qword [sym.imp.USER32.dll_GetSystemMetrics]
call rbx
mov ecx, 1
mov dword [0x00c88c30], eax
call rbx
mov dword [0x00c88c34], 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 [0x00c88c38], eax
call rbx
mov rcx, rdi
mov rdx, rsi
mov dword [0x00c88c3c], eax
call qword [sym.imp.USER32.dll_ReleaseDC]
mov rcx, qword [0x00c88c28]
test rcx, rcx
je 0x49fa3b
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.GDI32.dll_CreateDCA]
test rax, rax
mov rsi, rax
je 0x49ff3c
mov edx, 8
mov rcx, rax
call rbx
mov edx, 0xa
mov rcx, rsi
mov dword [0x00c88c30], eax
call rbx
mov edx, 4
mov rcx, rsi
mov dword [0x00c88c34], eax
call rbx
mov rcx, rsi
mov edx, 6
mov dword [0x00c88c38], eax
call rbx
mov rcx, rsi
mov dword [0x00c88c3c], eax
call qword [sym.imp.GDI32.dll_DeleteDC]
mov ecx, 1
call qword [sym.imp.WINMM.dll_timeBeginPeriod]
mov byte [0x00587a9c], 1
call fcn.004a09c0
mov rax, qword [rsp + 0x28]
test rax, rax
je 0x49fc22
movsx eax, byte [rax]
test al, al
je 0x49fe21
cmp al, 0x3d
je 0x49fff0
lea edx, [rax - 0x2b]
and edx, 0xfd
je 0x49ff9b
cmp al, 0x78
je 0x49ff9b
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x49fe21
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 0x49faa0
cmp qword [rsp + 0x28], rdx
mov dword [rsp + 0x48], ecx
je 0x49fe21
mov qword [rsp + 0x28], rdx
mov r9d, 4
jmp 0x49ffa6
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 0x49fb50
mov eax, dword [0x00587aa0]
test eax, eax
je 0x49fe4e
mov dword [0x00587aa0], 3
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f836
lea rcx, str._display_parameter_must_be_followed_by_display_name
mov qword [rsp + 0xf0], rdx
mov dword [rsp + 0x30], r8d
call fcn.004a1ad0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x30]
jmp 0x49f819
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 0x49fc6b
cmp dword [0x00587aa0], 3
je 0x49ff66
mov dword [0x00587aa0], 0
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f836
xor edx, edx
xor ecx, ecx
test al, al
jne 0x49fe21
test r9b, 1
jne 0x4a0055
test r9b, 2
je 0x49fbba
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 0x49fbe0
mov byte [0x00587a94], 1
mov ecx, r9d
mov edx, r9d
and ecx, 0x20
and edx, 3
and r9d, 0x10
je 0x49fc02
mov eax, dword [0x00c88c30]
sub eax, dword [rsp + 0x48]
add dword [0x00587a80], eax
test ecx, ecx
je 0x49fc16
mov eax, dword [0x00c88c34]
sub eax, dword [rsp + 0x44]
add dword [0x00587a84], eax
cmp edx, 3
jne 0x49fc22
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.004a1ad0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x30]
mov r10, qword [rsp + 0x28]
jmp 0x49f898
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 0x49fc9f
mov byte [0x00587aa4], 1
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f836
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 0x49ff4d
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 0x49f836
mov byte [0x00587aa7], 1
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f836
mov rax, qword [rsp + 0x28]
lea rdx, [rax + 2]
movsx eax, byte [rax + 2]
lea ecx, [rax - 0x30]
cmp cl, 9
ja 0x4a0103
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 0x49fd20
cmp r10d, 0xffffffff
jne 0x49fd40
neg ecx
mov dword [rsp + 0x44], ecx
mov qword [rsp + 0x28], rdx
cmp r11, rdx
je 0x49fe21
movzx eax, byte [rdx]
or r9d, 8
lea edx, [rax - 0x2b]
and edx, 0xfd
jne 0x49fb98
mov rdi, qword [rsp + 0x28]
cmp al, 0x2d
lea r10, [rdi + 1]
movsx edx, byte [rdi + 1]
je 0x4a0115
cmp dl, 0x2b
je 0x4a0174
cmp dl, 0x2d
jne 0x4a0073
mov rax, qword [rsp + 0x28]
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x4a0192
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 0x49fdaf
mov eax, ecx
neg eax
cmp r11d, 0xffffffff
cmove ecx, eax
cmp r8, r10
je 0x49fe21
movzx edx, byte [r8]
mov ebx, r9d
or ebx, 1
lea eax, [rdx - 0x2b]
test al, 0xfd
jne 0x4a0048
lea r11, [r8 + 1]
cmp dl, 0x2d
movsx eax, byte [r8 + 1]
je 0x4a01e4
cmp al, 0x2b
je 0x4a01a2
cmp al, 0x2d
je 0x4a008c
lea edx, [rax - 0x30]
mov r10, r11
mov r9d, 1
cmp dl, 9
jbe 0x4a00a7
mov eax, dword [rsp + 0x48]
mov dword [0x00587a8c], eax
mov eax, dword [rsp + 0x44]
mov dword [0x00587a90], eax
jmp 0x49fc22
lea rcx, str.illegal_glutInit___reinitialization_attempt
call fcn.004a1ad0
mov eax, dword [r15]
jmp 0x49f76c
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.004a1ad0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x4c]
mov r10, qword [rsp + 0x30]
jmp 0x49fb09
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 [0x00c88b80]
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 0x4a0060
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 0x49f966
lea r8, str.fghInitialize
lea rdx, str.Window_Class_Not_Registered
lea rcx, [0x005b6798]
call fcn.004a1ad0
jmp 0x49f966
lea rcx, str.fghInitialize:_CreateDC_failed__Screen_size_info_may_be_incorrect_nThis_is_quite_likely_caused_by_a_bad__display_parameter
call fcn.004a1bc0
jmp 0x49fa3b
mov byte [0x00587aa6], 1
mov ebp, r15d
mov qword [r14], 0
sub dword [rdx], 1
jmp 0x49f836
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.004a1ad0
mov rdx, qword [rsp + 0xf0]
mov r8d, dword [rsp + 0x4c]
mov r10, qword [rsp + 0x30]
jmp 0x49fb7c
mov dword [rsp + 0x48], 0
xor r9d, r9d
mov edx, eax
and edx, 0xffffffdf
cmp dl, 0x58
jne 0x4a002d
mov rax, qword [rsp + 0x28]
lea r11, [rax + 1]
movsx eax, byte [rax + 1]
cmp al, 0x2b
je 0x4a00e4
cmp al, 0x2d
je 0x49fcf5
lea ecx, [rax - 0x30]
mov rdx, r11
mov r10d, 1
cmp cl, 9
jbe 0x49fd14
jmp 0x49fe21
mov rdi, qword [rsp + 0x28]
movsx eax, byte [rdi + 1]
add rdi, 1
mov qword [rsp + 0x28], rdi
jmp 0x49fa73
call sub.msvcrt.dll__strdup
test rax, rax
mov qword [0x00587b20], rax
jne 0x49f790
lea rcx, str.Could_not_allocate_space_for_the_programs_name.
call fcn.004a1ad0
jmp 0x49f790
mov dword [rsp + 0x44], 0
jmp 0x49fd59
mov qword [rsp + 0x28], 0
jmp 0x49f8c2
test dl, dl
jne 0x49fe21
mov r9d, ebx
xor edx, edx
mov dword [0x00587a80], ecx
jmp 0x49fbae
mov edx, 0x7f05
xor ecx, ecx
call rbx
mov qword [rsp + 0x70], rax
jmp 0x49fed0
lea eax, [rdx - 0x30]
mov r8, r10
mov r11d, 1
cmp al, 9
jbe 0x49fdad
jmp 0x49fe21
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0199
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 0x4a00a9
cmp r9d, 0xffffffff
je 0x4a019b
cmp r10, r11
je 0x49fe21
or ebx, 2
movzx eax, byte [r10]
mov r9d, ebx
jmp 0x49fb9c
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 0x49fd14
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x44], 0
jmp 0x49fd49
cmp dl, 0x2b
je 0x4a01c4
cmp dl, 0x2d
je 0x4a0275
lea eax, [rdx - 0x30]
mov r8, r10
mov r11d, 1
cmp al, 9
ja 0x49fe21
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 0x4a013d
mov ecx, eax
neg ecx
cmp r11d, 0xffffffff
je 0x4a023c
cmp r8, r10
je 0x49fe21
or r9d, 0x10
jmp 0x49fdd5
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 0x49fdad
xor ecx, ecx
jmp 0x49fdd0
xor edx, edx
neg edx
jmp 0x4a00cc
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
mov r9d, 1
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a00a7
xor edx, edx
jmp 0x4a00cc
movsx edx, byte [rdi + 2]
lea r8, [rdi + 2]
xor ecx, ecx
mov r11d, 1
lea eax, [rdx - 0x30]
cmp al, 9
jbe 0x4a013b
jmp 0x4a0162
cmp al, 0x2b
je 0x4a025b
cmp al, 0x2d
je 0x4a0243
lea edx, [rax - 0x30]
mov r10, r11
mov ebx, 1
cmp dl, 9
ja 0x49fe21
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 0x4a0203
mov edx, r8d
neg edx
cmp ebx, 0xffffffff
je 0x4a0297
cmp r10, r11
je 0x49fe21
mov ebx, r9d
or ebx, 0x21
jmp 0x4a00d5
xor eax, eax
mov ecx, eax
jmp 0x4a0162
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
lea edx, [rax - 0x30]
cmp dl, 9
ja 0x4a0294
mov ebx, 0xffffffff
jmp 0x4a0200
movsx eax, byte [r8 + 2]
lea r10, [r8 + 2]
mov ebx, 1
lea edx, [rax - 0x30]
cmp dl, 9
jbe 0x4a0200
xor edx, edx
jmp 0x4a0226
mov rax, qword [rsp + 0x28]
movsx edx, byte [rax + 2]
lea r8, [rax + 2]
lea eax, [rdx - 0x30]
cmp al, 9
ja 0x4a023a
mov r11d, 0xffffffff
jmp 0x4a013b
xor r8d, r8d
mov edx, r8d
jmp 0x4a0226
mov qword [0x00c875c0], r8
jmp 0x49f740