Function at 0x1800401b0
Capabilities:
Allocate thread local storage
Create mailslot
Get file size
Get thread local storage value
Read file on windows
Read from mailslot
Set thread local storage value

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x290]
sub rsp, 0x390
mov rax, qword [0x18006e218]
xor rax, rsp
mov qword [rbp + 0x280], rax
mov ebx, edx
mov dword [rsp + 0x54], edx
mov r10, r8
mov qword [rsp + 0x58], r8
mov rdx, rcx
mov qword [rbp - 0x60], rcx
lea r9, [0x180000000]
lea edi, [rbx - 0xd]
cmp ebx, edi
jbe 0x180040404
mov esi, 0x63
add ebx, 0xffffffba
mov r9d, 0x6f69
mov r11d, 0x206e
mov r14d, 0x756c
lea r15d, [rsi + 0xa]
lea r8d, [rsi + 2]
nop dword [rax]
cmp ebx, 0x2f
ja case.0x180040259.9
lea rcx, [0x180000000]
movzx eax, byte [rcx + rbx + 0x410b8]
mov ecx, dword [rcx + rax*4 + 0x41080]
lea rax, [0x180000000]
add rcx, rax
jmp rcx
mov eax, 0x6f
mov word [rbp + 0xcd], ax
mov word [rbp + 0xce], r15w
jmp case.0x180040259.9
test rdx, rdx
je case.0x180040259.9
mov rcx, rdx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
jmp 0x1800403d1
mov eax, 0x74
mov word [rbp + 0xcc], si
mov word [rbp + 0xc7], ax
mov dword [rbp + 0xc8], 0x206e6f69
jmp case.0x180040259.9
mov eax, 0x20
mov word [rbp + 0xc0], ax
mov dword [rbp + 0xc1], 0x6f736572
jmp case.0x180040259.9
mov eax, 0x70
mov word [rbp + 0xcf], ax
mov eax, 0x6c
mov word [rbp + 0xd0], ax
mov word [rbp + 0xd1], r8w
jmp case.0x180040259.9
mov dword [rbp + 0xbd], 0x746369
jmp case.0x180040259.9
mov word [rbp + 0xb8], si
mov eax, 0x6c
mov dword [rbp + 0xb9], 0x666e6f
mov word [rbp + 0xbc], ax
jmp case.0x180040259.9
movsxd rax, dword [rdx + 0x181c]
cmp eax, 0x1000
jae 0x1800404e0
mov rcx, rax
mov dword [rsp + 0x64], 1
movzx eax, byte [r10]
mov byte [rcx + rdx + 0x81c], al
inc dword [rdx + 0x181c]
jmp case.0x180040259.9
mov word [rbp + 0xc5], r14w
jmp case.0x180040259.9
movzx ecx, word [0x180063bfc]
mov edx, dword [0x180063bf8]
mov eax, dword [0x180063c00]
mov word [rbp + 0x10c], cx
lea rcx, [rbp + 0x100]
sub rcx, 2
mov dword [rbp + 0x100], edx
mov dword [rbp + 0x104], eax
mov dword [rbp + 0x108], edx
cmp word [rcx + 2], 0
lea rcx, [rcx + 2]
jne 0x180040395
movups xmm0, xmmword [str.ScV8ScIi]
movzx eax, word [0x180063c18]
movups xmmword [rcx], xmm0
mov word [rcx + 0x10], ax
jmp 0x1800403e8
mov r8d, 2
lea rdx, [0x180063c1c]
lea rcx, [rbp + 0x11c]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy]
mov r10, qword [rsp + 0x58]
mov r11d, 0x206e
mov r9d, 0x6f69
mov r8d, 0x65
mov rdx, qword [rbp - 0x60]
dec ebx
lea eax, [rbx + 0x46]
cmp eax, edi
ja 0x180040230
mov ebx, dword [rsp + 0x54]
lea r9, [0x180000000]
lea r8d, [rbx + 0xa01]
mov dword [rsp + 0x4c], r8d
cmp ebx, r8d
jae case.0x180040976.0
movzx r8d, byte [rsp + 0x48]
xor r14d, r14d
movzx r15d, byte [rsp + 0x48]
mov esi, dword [rsp + 0x6c]
mov r13d, dword [rsp + 0x6c]
mov r12, qword [rbp - 0x70]
lea ecx, [r14 + 0x64]
mov eax, dword [rsp + 0x4c]
lea r11d, [r14 + 0x25]
mov qword [rbp - 0x20], rsi
mov dword [rsp + 0x44], r8d
mov qword [rbp - 0x38], r13
mov dword [rsp + 0x60], r15d
mov edi, 0x61
cmp ebx, 0x4ec
ja 0x1800408c5
je 0x1800408b4
cmp ebx, 0x29d
ja 0x1800405d1
je 0x18004055d
cmp ebx, 0x4e
je 0x18004053e
cmp ebx, 0x113
je 0x18004051f
cmp ebx, 0x1d8
jne 0x180040ccf
mov eax, 0x20
mov dword [rbp + 0xe4], eax
lea rax, [rbp + 0xd8]
sub rax, 2
cmp word [rax + 2], r14w
lea rax, [rax + 2]
jne 0x1800404b3
movsd xmm0, qword [0x180063c30]
movsd qword [rax], xmm0
movabs rax, 0x72006b0069
mov qword [rbp + 0xec], rax
jmp 0x180040ccb
lea rcx, str.GElf_error:_value_out_of_range
call fcn.18005b050
xor r14d, r14d
mov eax, r14d
jmp 0x18004091e
movsxd rax, dword [rdx]
cmp eax, 0x1f
ja 0x180040515
shl rax, 7
lea rcx, [0x180000000]
cmp qword [rax + rcx + 0x6f950], 0
jne 0x1800404ec
mov eax, 0xb
jmp 0x18004091e
mov r8d, 5
lea rdx, [0x180063c20]
lea rcx, [rbp + 0xdc]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy]
jmp 0x180040cb8
mov dword [rbp + 0xd8], 0x4b
mov dword [rbp + 0xda], edi
mov dword [rbp + 0xd2], 0x646574
jmp 0x180040ccf
lea rcx, [rbp + 0xd8]
sub rcx, 2
nop dword [rax + rax]
cmp word [rcx + 2], r14w
lea rcx, [rcx + 2]
jne 0x180040570
cmp qword [rdx + 0x18], 8
mov eax, dword [0x18006266c]
mov dword [rcx], eax
movabs rax, 0x6e006f0066
mov qword [rbp + 0xf4], rax
mov rcx, rdx
jb 0x1800405a1
mov rcx, qword [rdx]
xor r9d, r9d
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], 0x80
mov edx, 0x80000000
mov dword [rsp + 0x20], 3
lea r8d, [r9 + 3]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rbp - 0x68], rax
jmp 0x180040cb8
cmp ebx, 0x362
je 0x1800408a5
cmp ebx, 0x427
jne 0x180040ccf
cmp qword [rbp - 0x68], 0xffffffffffffffff
jne 0x180040ccf
mov edi, 0xb
nop dword [rax]
cmp edi, 0xb
ja case.default.0x180040616
mov eax, edi
mov ecx, dword [r9 + rax*4 + 0x410e8]
add rcx, r9
jmp rcx
cmp dword [rbp - 0x50], r14d
mov ecx, r14d
movzx eax, byte [rsp + 0x40]
cmovne ecx, eax
cmp dword [rsp + 0x70], 0xffffffff
movzx eax, byte [rsp + 0x49]
mov byte [rsp + 0x40], cl
mov ecx, r14d
cmovne ecx, eax
mov byte [rsp + 0x49], cl
test r8b, r8b
je case.default.0x180040616
mov rcx, qword [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r8d, dword [rsp + 0x44]
jmp case.default.0x180040616
mov r8d, 3
mov byte [rbp + 0xa0], r14b
lea rdx, [0x180063c4a]
lea rcx, [rbp + 0xa0]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncat]
mov r8d, dword [rsp + 0x44]
jmp case.default.0x180040616
mov r8d, 1
lea rdx, [0x180063c81]
lea rcx, [rbp + 0xa3]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
mov r8d, dword [rsp + 0x44]
jmp case.default.0x180040616
mov r8d, 1
lea rdx, [0x180063ca2]
lea rcx, [rbp + 0xa0]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncat]
mov r8d, 3
lea rdx, [0x180063cce]
lea rcx, [rbp + 0xb0]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
mov r8d, dword [rsp + 0x44]
jmp case.default.0x180040616
mov eax, 0x636f
mov byte [rbp + 0xaf], r14b
mov word [rbp + 0xad], ax
jmp case.default.0x180040616
mov dword [rbp + 0xa9], 0x6c6c6165
jmp case.default.0x180040616
mov r8d, 5
mov byte [rbp + 0xa4], r14b
lea rdx, [0x180063ce3]
lea rcx, [rbp + 0xa4]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
mov r8d, dword [rsp + 0x44]
mov byte [rbp + 0xa9], r14b
jmp case.default.0x180040616
mov word [rbp + 0xb3], 0x6e
jmp case.default.0x180040616
xor edx, edx
mov byte [rsp + 0x44], 1
lea r8, [rbp + 0xa0]
mov byte [rsp + 0x40], 1
mov byte [rsp + 0x49], 1
lea ecx, [rdx + 0x7b]
call qword [sym.imp.KERNEL32.dll_OpenEventA]
mov r8d, dword [rsp + 0x44]
mov qword [rbp - 0x30], rax
jmp case.default.0x180040616
movzx edx, byte [rsp + 0x40]
test dl, dl
je 0x180040826
mov r12d, dword [rbp - 0x54]
mov ebx, 0xdb
mov r13, qword [rbp - 8]
nop dword [rax]
mov eax, ebx
sub eax, 0xdb
je 0x180040805
sub eax, 1
je 0x1800407ee
sub eax, 1
je 0x1800407d9
cmp eax, 1
jne 0x18004080c
test dl, dl
je 0x18004080c
mov r8d, 0x104
lea rdx, [rbp + 0x170]
mov ecx, r12d
call qword [sym.imp.WINMM.dll_midiOutGetErrorTextA]
movzx edx, byte [rsp + 0x40]
jmp 0x18004080c
movzx eax, dl
test r12d, r12d
mov ecx, r14d
cmovne ecx, eax
movzx edx, cl
mov byte [rsp + 0x40], cl
jmp 0x18004080c
lea rdx, [rbp - 0x58]
mov rcx, r13
call qword [sym.imp.WINMM.dll_midiOutGetID]
movzx edx, byte [rsp + 0x40]
mov r12d, eax
jmp 0x18004080c
mov r13, r14
mov dword [rbp - 0x58], r14d
inc ebx
cmp ebx, 0xdf
jb 0x1800407a0
mov qword [rbp - 8], r13
mov r13, qword [rbp - 0x38]
mov dword [rbp - 0x54], r12d
mov r12, qword [rbp - 0x70]
cmp byte [rsp + 0x49], r14b
je 0x18004084c
mov ebx, dword [rsp + 0x70]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdx, rax
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsFree]
mov r8d, dword [rsp + 0x44]
mov byte [rsp + 0x64], r14b
jmp case.default.0x180040616
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [rsp + 0x70], eax
call qword [sym.imp.WINMM.dll_midiOutGetNumDevs]
mov r8d, dword [rsp + 0x44]
cmp qword [rbp - 0x30], r14
movzx r8d, r8b
cmove r8d, r14d
mov dword [rbp - 0x50], eax
mov dword [rsp + 0x44], r8d
dec edi
lea r9, [0x180000000]
lea ecx, [rdi + 0x8c]
cmp ecx, 0x8b
ja 0x180040600
mov ebx, dword [rsp + 0x54]
jmp 0x180040cbd
mov byte [rsp + 0x52], 1
mov byte [rsp + 0x48], 1
jmp 0x180040ccf
mov dword [rbp - 0x7c], r14d
mov qword [rbp - 0x18], 0xffffffffffffffff
jmp 0x180040ccf
cmp ebx, 0x5b1
je 0x180040fe7
cmp ebx, 0x73b
je 0x180040f98
cmp ebx, 0x800
je 0x180040cf1
cmp ebx, 0x8c5
je 0x180040948
cmp ebx, 0x98a
jne 0x180040ccf
lea r8d, [rsi + 1]
lea rdx, [rbp + 0xd8]
lea rcx, [rbp + 0x100]
call qword [sym.imp.SHLWAPI.dll_StrNCatW]
mov byte [rsp + 0x64], 1
mov eax, dword [rsp + 0x64]
mov rcx, qword [rbp + 0x280]
xor rcx, rsp
call fcn.18005b930
mov rbx, qword [rsp + 0x3d8]
add rsp, 0x390
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov eax, dword [rsp + 0x68]
cmp eax, dword [rbp - 0x7c]
je 0x180040acb
mov ebx, 0xc
nop word [rax + rax]
cmp ebx, 0xc
ja case.default.0x180040976
mov eax, ebx
mov ecx, dword [r9 + rax*4 + 0x41118]
add rcx, r9
jmp rcx
mov eax, 0x76
mov dword [rbp + 0x3c], 0x6c0061
mov word [rbp + 0x3a], ax
mov eax, 0x3d
mov word [rbp + 0x44], ax
mov dword [rbp + 0x40], 0x650075
jmp case.default.0x180040976
mov eax, 0x69
mov word [rbp + 0x32], ax
jmp case.default.0x180040976
xor r9d, r9d
lea rcx, [rbp + 0x10]
xor edx, edx
mov r8d, 0xffffffff
call qword [sym.imp.KERNEL32.dll_CreateMailslotW]
mov qword [rbp - 0x28], rax
cmp rax, 0xffffffffffffffff
jne case.default.0x180040976
mov byte [rsp + 0x50], r14b
jmp case.default.0x180040976
mov qword [r10 + 0x10], r14
mov rax, r10
cmp qword [r10 + 0x18], 0x10
mov byte [rsp + 0x50], 1
jb 0x1800409ee
mov rax, qword [r10]
mov byte [rax], r14b
jmp case.default.0x180040976
mov byte [rsp + 0x64], r14b
jmp case.default.0x180040976
mov dword [rbp + 0x1a], 0x690061
mov dword [rbp + 0x1e], 0x73006c
jmp case.default.0x180040976
mov eax, 0x74
mov dword [rbp + 0x28], 0x3c005c
mov word [rbp + 0x26], ax
mov word [rbp + 0x30], ax
mov dword [rbp + 0x2c], 0x70006f
jmp case.default.0x180040976
mov eax, 0x2e
mov dword [rbp + 0x10], 0x5c005c
mov word [rbp + 0x14], ax
mov dword [rbp + 0x16], 0x6d005c
jmp case.default.0x180040976
mov dword [rbp + 0x22], 0x6f006c
jmp case.default.0x180040976
mov eax, 0x20
mov dword [rbp + 0x34], 0x6e006f
mov word [rbp + 0x38], ax
jmp case.default.0x180040976
cmp byte [rsp + 0x50], r14b
je case.default.0x180040976
mov rcx, qword [rbp - 0x28]
lea r9, [rbp - 0x10]
lea r8, [rbp - 0xc]
mov qword [rsp + 0x20], r14
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetMailslotInfo]
mov rcx, qword [rbp - 0x28]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, 0x61
jmp case.default.0x180040976
mov dword [rbp + 0x46], 0x350027
mov dword [rbp + 0x4a], 0x27
mov r10, qword [rsp + 0x58]
lea r9, [0x180000000]
dec ebx
lea eax, [rbx + 0x110]
cmp eax, 0x10f
ja 0x180040960
mov ecx, 0x64
lea r11d, [rcx - 0x3f]
cmp byte [rsp + 0x52], r14b
je 0x180040c97
mov r12d, dword [rbp - 0x48]
mov edi, 0x10f
movzx esi, byte [rsp + 0x51]
mov r15d, dword [rbp - 0x80]
mov dword [rsp + 0x78], edi
nop dword [rax]
cmp edi, 0x23659
ja 0x180040b63
je 0x180040b54
cmp edi, 0x10f
je 0x180040b47
cmp edi, 0xbd7d
je 0x180040b2c
cmp edi, 0x179eb
jne 0x180040c66
mov word [rbp + 0x86], cx
mov dword [rbp + 0x87], 0x6c252e
jmp 0x180040c66
mov eax, 0x6c
mov word [rbp + 0x81], ax
mov dword [rbp + 0x82], 0x3c252e64
jmp 0x180040c66
mov word [rbp + 0x80], r11w
jmp 0x180040c66
mov word [rbp + 0x8a], cx
mov sil, 1
jmp 0x180040c66
cmp edi, 0x2f2c7
je 0x180040c3f
cmp edi, 0x3af35
je 0x180040b91
cmp edi, 0x46ba3
jne 0x180040c66
mov ecx, r15d
call qword [sym.imp.WINMM.dll_mciGetCreatorTask]
jmp 0x180040c66
lea r9, [rbp - 0x78]
mov edx, r13d
lea r8, [rsp + 0x74]
lea rcx, [rbp + 0x80]
call sub.RPCRT4.dll_MesEncodeFixedBufferHandleCreate
test eax, eax
je 0x180040bb5
xor sil, sil
jmp 0x180040c66
test sil, sil
je 0x180040c66
mov rcx, qword [rbp - 0x78]
mov ebx, 0x59
mov edi, dword [rbp - 0x4c]
nop word [rax + rax]
cmp ebx, 0x59
je 0x180040c1f
cmp ebx, 0xd8f
je 0x180040c1a
cmp ebx, 0x1ac5
jne 0x180040c24
lea rax, [rsp + 0x74]
mov qword [rbp - 0x48], r14
mov qword [rsp + 0x28], rax
lea r9, [rbp - 0x48]
mov r8d, r12d
mov dword [rsp + 0x20], r13d
mov edx, edi
call sub.RPCRT4.dll_MesBufferHandleReset
mov rcx, qword [rbp - 0x78]
test rcx, rcx
je 0x180040c24
call sub.RPCRT4.dll_MesHandleFree
mov rcx, qword [rbp - 0x78]
jmp 0x180040c24
mov r12d, r14d
jmp 0x180040c24
mov edi, 1
add ebx, 0xd36
cmp ebx, 0x27a2
jbe 0x180040bd0
mov dword [rbp - 0x4c], edi
mov edi, dword [rsp + 0x78]
mov dword [rbp - 0x48], r12d
jmp 0x180040c66
lea rax, [rbp + 0x80]
mov r13, 0xffffffffffffffff
nop dword [rax]
inc r13
cmp byte [rax + r13], r14b
jne 0x180040c50
mov qword [rbp - 0x38], r13
mov dword [rsp + 0x74], r14d
mov qword [rbp - 0x78], r14
add edi, 0xbc6e
mov ecx, 0x64
mov dword [rsp + 0x78], edi
lea r11d, [rcx - 0x3f]
cmp edi, 0x52702
jbe 0x180040af0
mov r15d, dword [rsp + 0x60]
mov r12, qword [rbp - 0x70]
mov byte [rsp + 0x51], sil
mov rsi, qword [rbp - 0x20]
cmp byte [rsp + 0x48], r14b
je 0x180040cb4
mov rcx, qword [rbp - 0x18]
xor edx, edx
call qword [sym.imp.dbghelp.dll_SymGetModuleBase64]
mov rcx, qword [rbp - 0x18]
call qword [sym.imp.dbghelp.dll_SymCleanup]
mov ebx, dword [rsp + 0x54]
mov r8d, dword [rsp + 0x44]
mov r10, qword [rsp + 0x58]
mov ecx, 0x64
lea r11d, [rcx - 0x3f]
mov eax, dword [rsp + 0x4c]
add ebx, 0xc5
mov dword [rsp + 0x54], ebx
cmp ebx, eax
jae case.0x180040976.0
mov rdx, qword [rbp - 0x60]
lea r9, [0x180000000]
jmp 0x180040453
mov rcx, qword [rbp - 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [rbp - 0x80], r14d
jne 0x180040f04
movzx r13d, byte [rsp + 0x41]
mov edi, 0x11d
cmp edi, 0x275
ja 0x180040dba
je 0x180040da2
mov eax, edi
sub eax, 0x11d
je 0x180040d87
sub eax, 0x56
je 0x180040d76
sub eax, 0x56
je 0x180040d5b
cmp eax, 0x56
jne 0x180040ee8
mov eax, 0x70
mov word [rbp + 0x9b], ax
mov eax, 0x2f73
mov word [rbp + 0x9c], ax
jmp 0x180040ee8
mov eax, 0x2f
mov word [rbp + 0x97], ax
mov dword [rbp + 0x98], 0x70612f
jmp 0x180040ee8
mov eax, 0x3a65
mov word [rbp + 0x95], ax
jmp 0x180040ee8
mov eax, 0x3f
mov word [rbp + 0x90], ax
mov dword [rbp + 0x91], 0x6d6f7268
jmp 0x180040ee8
mov r13b, 1
mov byte [rbp + 0x9e], r14b
mov byte [rsp + 0x41], r13b
movzx r15d, r13b
jmp 0x180040ee8
mov eax, edi
sub eax, 0x2cb
je 0x180040f4c
sub eax, 0x56
je 0x180040ddf
cmp eax, 0x56
jne 0x180040ee8
mov byte [rsp + 0x52], r14b
jmp 0x180040ee8
cmp qword [rbp - 0x40], 0xf
mov ecx, r14d
movzx eax, r15b
cmovbe ecx, eax
test r12, r12
movzx r15d, cl
movzx eax, r13b
mov ecx, r14d
cmovne ecx, eax
mov byte [rsp + 0x41], cl
movzx esi, cl
test cl, cl
je 0x180040e79
mov ebx, 0x18
nop
mov eax, ebx
sub eax, 0x17
je 0x180040e22
cmp eax, 1
jne 0x180040e6d
mov qword [rbp], r14
jmp 0x180040e6d
mov r13, qword [rbp]
xor r8d, r8d
mov rdx, r13
mov rcx, r12
call qword [sym.imp.WINMM.dll_mmioRead]
cmp eax, 0xffffffff
jne 0x180040e4b
lea edx, [rax + 0x11]
mov rcx, r12
call qword [sym.imp.WINMM.dll_mmioClose]
xor sil, sil
jmp 0x180040e6d
test sil, sil
je 0x180040e6d
xor r8d, r8d
mov rdx, r13
mov rcx, r12
call qword [sym.imp.WINMM.dll_mmioWrite]
mov edx, 0x10
mov rcx, r12
call qword [sym.imp.WINMM.dll_mmioClose]
dec ebx
cmp ebx, 0x16
ja 0x180040e10
mov byte [rsp + 0x41], sil
test r15b, r15b
je 0x180040ee2
mov r12, qword [rbp - 0x40]
mov ebx, 0x13
cmp ebx, 0x13
je 0x180040ea8
cmp ebx, 0xcf
jne 0x180040ec7
test r15b, r15b
je 0x180040ec7
mov edx, dword [rsp + 0x7c]
mov ecx, r12d
call qword [sym.imp.WINMM.dll_joySetThreshold]
jmp 0x180040ec7
lea rdx, [rsp + 0x7c]
mov dword [rsp + 0x7c], r14d
xor ecx, ecx
mov r12, r14
call qword [sym.imp.WINMM.dll_joyGetThreshold]
test eax, eax
movzx r15d, r15b
cmovne r15d, r14d
add ebx, 0xbc
cmp ebx, 0x18b
jb 0x180040e87
mov qword [rbp - 0x40], r12
mov r12, qword [rbp - 0x70]
mov dword [rsp + 0x60], r15d
movzx r13d, byte [rsp + 0x41]
add edi, 0x56
cmp edi, 0x3cd
jb 0x180040d10
mov r13, qword [rbp - 0x38]
mov ebx, dword [rsp + 0x54]
mov dword [rsp + 0x60], r15d
lea rax, [rbp + 0xd8]
mov rsi, 0xffffffffffffffff
inc rsi
cmp word [rax + rsi*2], r14w
jne 0x180040f12
mov ecx, 0x64
mov r10, qword [rsp + 0x58]
mov r8d, dword [rsp + 0x44]
mov eax, dword [rsp + 0x4c]
mov qword [rbp - 0x20], rsi
lea r11d, [rcx - 0x3f]
cmp dword [rsp + 0x6c], r14d
jne 0x180040ccf
mov byte [rsp + 0x48], r14b
jmp 0x180040ccf
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp + 0x10], xmm0
mov dword [rbp + 0x70], eax
movups xmmword [rbp + 0x20], xmm0
movups xmmword [rbp + 0x30], xmm0
movups xmmword [rbp + 0x40], xmm0
movups xmmword [rbp + 0x50], xmm0
movups xmmword [rbp + 0x60], xmm0
call qword [sym.imp.WINMM.dll_joyGetNumDevs]
mov eax, eax
xor r8d, r8d
lea rdx, [rbp + 0x10]
mov qword [rbp - 0x40], rax
lea rcx, [rbp + 0x90]
call qword [sym.imp.WINMM.dll_mmioOpenA]
mov r12, rax
mov qword [rbp - 0x70], rax
jmp 0x180040ee8
lea rcx, [rbp + 0xb8]
call qword [sym.imp.WINMM.dll_mciGetDeviceIDA]
mov rcx, qword [rbp - 0x18]
xor r8d, r8d
xor edx, edx
mov dword [rbp - 0x80], eax
call qword [sym.imp.dbghelp.dll_SymInitialize]
mov rcx, qword [rsp + 0x58]
xor edx, edx
mov dword [rsp + 0x6c], eax
call fcn.180005650
mov r8d, dword [rsp + 0x68]
lea r9, [rbp - 0x7c]
mov rcx, qword [rbp - 0x68]
mov rdx, rax
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x180040cb8
mov rcx, qword [rbp - 0x68]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov r10, qword [rsp + 0x58]
mov ecx, eax
mov dword [rsp + 0x68], eax
mov r8, qword [r10 + 0x10]
cmp rcx, r8
ja 0x180041026
mov qword [r10 + 0x10], rcx
mov rdx, r10
cmp qword [r10 + 0x18], 0x10
jb 0x180041018
mov rdx, qword [r10]
mov r8d, dword [rsp + 0x44]
mov byte [rdx + rcx], r14b
jmp 0x180040cc2
mov rdx, qword [r10 + 0x18]
mov rdi, rcx
mov rax, rdx
sub rdi, r8
sub rax, r8
cmp rdi, rax
ja 0x180041065
mov qword [r10 + 0x10], rcx
mov rax, r10
cmp rdx, 0x10
jb 0x18004104b
mov rax, qword [r10]
lea rbx, [rax + r8]
xor edx, edx
mov rcx, rbx
mov r8, rdi
call sub.VCRUNTIME140.dll_memset
mov byte [rbx + rdi], r14b
jmp 0x180040cb4
mov r9, rdi
mov byte [rsp + 0x20], r14b
xor r8d, r8d
mov rdx, rdi
mov rcx, r10
call fcn.1800040e0
jmp 0x180040cb8