Function at 0x4f2970
Capabilities:
Query environment variable
Read file on windows
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
lea r12, [0x0050ebcf]
mov dword [rsp + 0x90], ecx
mov qword [rsp + 0x98], rdx
call fcn.004e3bf0
call fcn.004e0e20
mov rdx, r12
mov ecx, 2
mov ebp, eax
call sub.msvcrt.dll_setlocale
mov rax, qword [rsp + 0x98]
mov rcx, qword [rax]
mov qword [0x00577968], rcx
call fcn.004e38b0
lea rdx, [rsp + 0x98]
lea rcx, [rsp + 0x90]
call fcn.004dc230
call fcn.0043db20
cmp eax, 0x118
je 0x4f29f3
lea rcx, str._F_P:_fatal_error:_libbfd_ABI_mismatch_n
call fcn.0041bb50
mov rcx, qword [0x00577968]
call fcn.00438c30
lea rcx, [0x00415b10]
call fcn.00438c40
lea rcx, [0x00415b30]
mov qword [0x005779a8], rax
call fcn.00438c20
lea rcx, [0x004161d0]
mov qword [0x005779a0], rax
call fcn.004e37d0
mov eax, dword [rsp + 0x90]
mov rdx, qword [rsp + 0x98]
cmp eax, 1
jle 0x4f3337
lea rsi, [rdx + 8]
sub eax, 2
xor edi, edi
lea r14, [rdx + rax*8 + 0x10]
lea r13, str.__sysroot
nop
mov rbx, qword [rsi]
mov r8d, 0xa
mov rdx, r13
mov rcx, rbx
add rbx, 0xa
call sub.msvcrt.dll_strncmp
test eax, eax
cmove rdi, rbx
add rsi, 8
cmp rsi, r14
jne 0x4f2a60
test rdi, rdi
je 0x4f3337
movzx eax, byte [rdi]
cmp al, 0x2f
je 0x4f2a9b
cmp al, 0x5c
jne 0x4f2b18
cmp byte [rdi + 1], 0
jne 0x4f2b18
mov qword [0x00577960], r12
mov rbx, qword [0x00577958]
test rbx, rbx
je 0x4f2f11
mov rcx, rbx
call sub.msvcrt.dll_strlen
test eax, eax
mov dword [0x00577950], eax
jle 0x4f2ae7
movsxd rdx, eax
lea rcx, [rbx + rdx - 1]
movzx edx, byte [rcx]
cmp dl, 0x2f
je 0x4f2eef
cmp dl, 0x5c
je 0x4f2eef
lea rbx, str.x86_64_w64_mingw32
mov rcx, rbx
call fcn.004471a0
test eax, eax
jne 0x4f2b38
lea rcx, str._X_P:_cant_set_BFD_default_target_to___s:__E_n
mov rdx, rbx
call fcn.0041bb50
mov ecx, 1
call fcn.004e3860
nop dword [rax + rax]
mov qword [0x00577960], rdi
cmp byte [rdi], 0
je 0x4f2aa8
mov rcx, rdi
call fcn.004e1f90
mov qword [0x00577958], rax
jmp 0x4f2aa8
mov rax, qword [0x0050f240]
lea rcx, str.COLLECT_NO_DEMANGLE
mov dword [0x0057782c], 1
mov byte [0x00577868], 0x3a
lea rdi, str._init
mov dword [0x00577880], 0xffffffff
mov qword [0x00577888], 0xffffffffffffffff
mov qword [0x00577820], rax
mov dword [0x00577850], 1
mov dword [0x00577738], 0xffffffff
mov qword [0x005778d0], rax
mov byte [0x005778d8], 0xff
call sub.msvcrt.dll_getenv
mov rcx, r12
movabs rdx, 0x204404000400
movq xmm0, rdi
test rax, rax
mov dword [0x005777b8], 1
sete al
mov qword [0x005777c0], 0xffffffffffffffff
movzx eax, al
mov byte [0x0057772a], 0x3a
mov dword [0x00577940], eax
lea rax, [0x004f4080]
mov qword [0x00577740], rax
lea rax, [0x00577780]
mov qword [0x00577788], rax
lea rax, str._fini
mov dword [0x005777c8], 0xffffffff
movq xmm1, rax
movabs rax, 0xffffceb3fbfffbff
and rax, qword [0x00577720]
mov dword [0x005777d0], 5
punpcklqdq xmm0, xmm1
movups xmmword [0x005777a8], xmm0
or rax, rdx
mov qword [0x00577720], rax
call fcn.0041c950
lea rcx, str.LDEMULATION
mov rdi, qword [rsp + 0x98]
mov esi, dword [rsp + 0x90]
call sub.msvcrt.dll_getenv
test rax, rax
mov r12, rax
je 0x4f311b
lea r14, str._mips1
cmp esi, 1
mov ebx, 1
lea r13d, [rsi - 1]
jg 0x4f2dc3
mov rcx, r12
call fcn.0041aa00
mov rdx, qword [rsp + 0x98]
mov ecx, dword [rsp + 0x90]
call fcn.0041a7f0
mov qword [0x00577970], rax
call fcn.0040db40
call fcn.0041a500
call fcn.0041a5d0
mov rsi, qword [0x005686b0]
xor ecx, ecx
mov rdx, qword [rsp + 0x98]
mov dword [rsi], ecx
mov ecx, dword [rsp + 0x90]
call fcn.00406a50
mov ecx, dword [0x00577890]
test ecx, ecx
jne 0x4f306c
call fcn.0041ebb0
call fcn.0041a640
cmp qword [0x00577988], 0
je 0x4f3076
cmp dword [0x00577948], 0
jne 0x4f3298
cmp dword [0x005778f0], 0
mov eax, 1
jne 0x4f2d26
movzx eax, byte [0x00577720]
and eax, 3
cmp al, 2
setne al
shl eax, 4
mov edx, eax
movzx eax, byte [0x00577721]
and eax, 0xffffffef
or eax, edx
cmp dword [0x005778e8], 0
mov byte [0x00577721], al
jne 0x4f338c
call fcn.00410600
cmp dword [rsp + 0x90], 2
je 0x4f337a
test byte [0x00577727], 0x40
je 0x4f2d77
movzx eax, byte [0x00577720]
not eax
test al, 3
jne 0x4f3127
cmp dword [rsi], 0
jne 0x4f2f2c
mov eax, dword [0x00577944]
or eax, dword [0x005778e8]
je 0x4f2f20
xor ecx, ecx
call fcn.004e3860
nop dword [rax]
cmp r13d, ebx
jle 0x4f2f00
mov r12, qword [rdi + rdx + 8]
add ebx, 1
nop dword [rax]
add ebx, 1
cmp esi, ebx
jle 0x4f2c85
movsxd rax, ebx
mov r15, qword [rdi + rax*8]
lea rdx, [rax*8]
cmp byte [r15], 0x2d
jne 0x4f2db8
cmp byte [r15 + 1], 0x6d
jne 0x4f2db8
cmp byte [r15 + 2], 0
je 0x4f2da0
mov rdx, r14
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips2
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips3
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips4
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips5
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips32
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips32r2
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips32r6
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips64
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips64r2
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._mips64r6
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea rdx, str._m486
mov rcx, r15
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4f2db8
lea r12, [r15 + 2]
jmp 0x4f2db8
sub eax, 1
mov dword [0x00577950], eax
mov byte [rcx], 0
jmp 0x4f2ae7
lea rcx, str._F_P:_missing_argument_to__m_n
call fcn.0041bb50
jmp 0x4f2db8
mov dword [0x00577950], 0xffffffff
jmp 0x4f2ae7
lea rcx, str._F_P:_no_input_files_n
call fcn.0041bb50
cmp dword [0x00577948], 0
jne 0x4f3141
call fcn.0041a5c0
mov rbx, qword [0x00577870]
test rbx, rbx
je 0x4f2f7a
lea rdx, [0x0050ee2d]
mov rcx, rbx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4f33c5
mov ecx, 1
call qword [fcn.004f2040]
mov qword [0x00577878], rax
or byte [0x00577727], 0x80
call fcn.00412a40
movzx eax, byte [0x00577720]
and eax, 3
cmp al, 2
mov rax, qword [0x00577770]
je 0x4f3138
or dword [rax + 0x40], 0x40
mov r8d, dword [0x0057772c]
test r8b, 1
je 0x4f2fe4
mov r9, qword [0x00577770]
mov eax, dword [r9 + 0x40]
mov edx, eax
and eax, 0xfe00001f
shr edx, 5
and edx, 0xfffff
mov ecx, edx
or dh, 0x40
or ecx, 0x24000
shl edx, 5
shl ecx, 5
or ecx, eax
or eax, edx
cmp r8d, 5
cmove eax, ecx
mov dword [r9 + 0x40], eax
call fcn.00417720
cmp qword [0x00577878], 0
je 0x4f33a5
call fcn.0040e330
cmp dword [0x005778cc], 0
je 0x4f301a
mov rcx, qword [0x00577878]
test rcx, rcx
je 0x4f33b2
call fcn.0041d5b0
mov rax, qword [0x005687a0]
cmp qword [rax], 0
je 0x4f302c
call fcn.0041d930
cmp dword [0x005778ec], 0
jne 0x4f3406
call fcn.0041a560
call fcn.0040c8e0
mov eax, dword [0x00577824]
or eax, dword [0x00577978]
jne 0x4f3155
cmp dword [0x00577948], 0
jne 0x4f3519
mov ecx, 1
call fcn.004e3860
call fcn.0043d840
jmp 0x4f2ce4
mov rcx, qword [0x00577938]
test rcx, rcx
je 0x4f3427
call fcn.0041c930
mov rdi, qword [0x00568810]
mov dword [rdi], 1
call fcn.00401720
cmp qword [0x00577988], 0
jne 0x4f2cfc
lea rcx, [rsp + 0x3c]
call fcn.0041a690
cmp dword [rsp + 0x3c], 0
mov rcx, rax
jne 0x4f34b1
mov rbx, qword [0x00568750]
mov r8d, 1
lea rdx, str.built_in_linker_script
mov qword [rbx], rax
call fcn.00406610
mov dword [rdi], 1
call fcn.00401720
xor edx, edx
cmp dword [0x00577948], 0
mov qword [rbx], rdx
je 0x4f2d09
cmp qword [0x00577988], 0
jne 0x4f3298
lea rcx, str.using_internal_linker_script:
call fcn.0041bb00
jmp 0x4f32a4
lea r12, [0x0050ebc7]
jmp 0x4f2c6c
lea rcx, str._F_P:___no_define_common_may_not_be_used_without__shared_n
call fcn.0041bb50
jmp 0x4f2d77
and dword [rax + 0x40], 0xffffffbf
jmp 0x4f2f9c
lea rcx, str._P:_mode__s_n
mov rdx, r12
call fcn.0041bb00
jmp 0x4f2f39
mov rcx, qword [0x00577770]
call fcn.004431d0
test eax, eax
je 0x4f3433
movzx eax, byte [0x00577720]
and eax, 3
cmp al, 2
je 0x4f327d
cmp dword [0x005778c8], 0
je 0x4f327d
mov rsi, qword [0x004f4100]
mov rcx, rsi
call sub.msvcrt.dll_strlen
cmp eax, 3
mov rbx, rax
jg 0x4f34c2
mov ecx, 0x1000
call fcn.004e3920
lea ecx, [rbx + 5]
movsxd rcx, ecx
mov rsi, rax
call fcn.004e3920
mov rbx, qword [0x004f4100]
mov r13, rax
mov rcx, rax
mov rdx, rbx
call sub.msvcrt.dll_strcpy
mov rcx, r13
call sub.msvcrt.dll_strlen
lea rdx, [0x0050eebb]
mov rcx, rbx
add rax, r13
mov dword [rax], 0x6578652e
mov byte [rax + 4], 0
call sub.msvcrt.dll_fopen
lea rdx, [0x0050eebe]
mov rcx, r13
mov rdi, rax
call sub.msvcrt.dll_fopen
test rdi, rdi
mov r12, rax
je 0x4f3559
test r12, r12
jne 0x4f3237
jmp 0x4f3545
mov r9, r12
movsxd r8, ebx
mov edx, 1
mov rcx, rsi
call sub.msvcrt.dll_fwrite
cmp ebx, eax
jne 0x4f3505
mov r9, rdi
mov r8d, 0x1000
mov edx, 1
mov rcx, rsi
call sub.msvcrt.dll_fread
test eax, eax
mov rbx, rax
jg 0x4f321c
mov rcx, rdi
call fcn.004f26e0
mov rcx, r12
call fcn.004f26e0
add eax, 1
je 0x4f3531
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, rsi
call sub.msvcrt.dll_free
cmp dword [0x00577854], 0
jne 0x4f344b
xor eax, eax
mov qword [0x004f4100], rax
jmp 0x4f2d92
lea rcx, str.using_external_linker_script:
call fcn.0041bb00
lea rdi, str._n_n
mov rcx, rdi
call fcn.0041bb00
cmp qword [0x00577988], 0
je 0x4f3410
lea r13, [0x0050e6a0]
mov ecx, 0x2001
call fcn.004e3920
mov rcx, qword [0x00577988]
mov rbx, rax
call sub.msvcrt.dll_rewind
jmp 0x4f32f7
mov byte [rbx + rax], 0
mov rdx, rbx
mov rcx, r13
call fcn.0041bb00
mov r9, qword [0x00577988]
mov r8d, 0x2000
mov edx, 1
mov rcx, rbx
call sub.msvcrt.dll_fread
test rax, rax
jne 0x4f32e8
mov rcx, qword [0x00577988]
call sub.msvcrt.dll_rewind
mov rcx, rbx
call sub.msvcrt.dll_free
mov rcx, rdi
call fcn.0041bb00
jmp 0x4f2d09
lea rcx, [0x0050ec03]
call fcn.00416210
test rax, rax
mov rdi, rax
jne 0x4f2a90
lea rcx, [0x0050ec20]
call fcn.00416210
test rax, rax
mov rdi, rax
jne 0x4f2a90
lea rdi, str.E:_msys_mingw64_64
mov qword [0x00577960], rdi
jmp 0x4f2b24
cmp dword [0x00577944], 0
je 0x4f2d5d
jmp 0x4f2d92
call fcn.0040ec50
lea rcx, [0x0050edc5]
mov rdx, rax
call fcn.0041bb00
jmp 0x4f2d4a
cmp dword [0x005778cc], 0
je 0x4f301a
mov ecx, 1
call qword [fcn.004f2040]
mov rcx, rax
jmp 0x4f3015
lea rdx, [0x0050ee2f]
mov rcx, rbx
call sub.msvcrt.dll_fopen
test rax, rax
mov qword [0x00577878], rax
jne 0x4f2f73
mov ecx, 1
call fcn.00438da0
mov rdx, qword [0x00577870]
lea rcx, str._F_P:_cannot_open_map_file__s:__E_n
call fcn.0041bb50
jmp 0x4f2f73
call fcn.00414c10
jmp 0x4f3039
lea rcx, [rsp + 0x3c]
call fcn.0041a690
mov rcx, rax
call fcn.0041bb00
jmp 0x4f332a
mov rdi, qword [0x00568810]
jmp 0x4f30ab
mov rdx, qword [0x00577770]
lea rcx, str._F_P:__pB:_final_close_failed:__E_n
call fcn.0041bb50
jmp 0x4f3169
call fcn.004e0e20
mov rsi, qword [fcn.004f2040]
mov ecx, 1
sub eax, ebp
mov ebx, eax
call rsi
mov rcx, rax
call sub.msvcrt.dll_fflush
mov rdi, qword [0x00577968]
mov ecx, 2
call rsi
mov r9d, 0xf4240
mov rcx, rax
mov eax, ebx
cdq
idiv r9d
mov r8, rdi
mov r9d, eax
mov dword [rsp + 0x20], edx
lea rdx, str._s:_total_time_in_link:__ld._06ld_n
call fcn.004169a0
mov ecx, 2
call rsi
mov rcx, rax
call sub.msvcrt.dll_fflush
jmp 0x4f328a
call fcn.0041c940
mov rbx, qword [0x00568750]
jmp 0x4f30df
lea rdx, [0x0050eec1]
movsxd rdi, eax
sub rdi, 4
lea rcx, [rsi + rdi]
mov rsi, qword [sym.imp.msvcrt.dll__stricmp]
call rsi
test eax, eax
je 0x4f327d
add rdi, qword [0x004f4100]
lea rdx, [0x0050eec6]
mov rcx, rdi
call rsi
test eax, eax
jne 0x4f31a3
jmp 0x4f327d
lea rcx, str._P:_error_writing_file___s_n
mov rdx, r13
call fcn.0041bb50
jmp 0x4f3237
mov rdx, qword [0x004f4100]
lea rcx, str._P:_link_errors_found__deleting_executable___s_n
call fcn.0041bb50
jmp 0x4f3062
lea rcx, [0x0050ef50]
mov rdx, r13
call fcn.0041bb50
jmp 0x4f326d
lea rcx, str._F_P:_unable_to_open_for_destination_of_copy___s_n
mov rdx, r13
call fcn.0041bb50
jmp 0x4f3237
mov rdx, qword [0x004f4100]
lea rcx, str._F_P:_unable_to_open_for_source_of_copy___s_n
call fcn.0041bb50
jmp 0x4f3212