Function at 0x14001b540
Capabilities:
Query environment variable

Disassembly:
mov qword [rsp + 0x10], rbx
push rdi
sub rsp, 0x20
mov rbx, rdx
mov qword [rsp + 0x30], rsi
mov rdx, rcx
mov rdi, rcx
mov rcx, rbx
mov r8d, 0x20
call fcn.140039560
cmp dword [rdi], 0
jne 0x14001b5f0
mov r8d, dword [0x140185710]
lea rcx, str.SDL_AUDIO_FREQUENCY
mov rdx, qword [0x140185718]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov esi, eax
test eax, eax
je 0x14001b5ea
cmp rsi, qword [0x140185710]
jbe 0x14001b5cd
mov rcx, qword [0x140185718]
mov edx, esi
call fcn.140061da0
test rax, rax
je 0x14001b5ea
mov r8d, esi
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rsi
lea rcx, str.SDL_AUDIO_FREQUENCY
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
test rcx, rcx
je 0x14001b5ea
xor edx, edx
lea r8d, [rdx + 0xa]
call fcn.14003a200
mov dword [rbx], eax
test eax, eax
jne 0x14001b5f0
mov dword [rbx], 0x5622
cmp word [rdi + 4], 0
jne 0x14001b67c
mov r8d, dword [0x140185710]
lea rcx, str.SDL_AUDIO_FORMAT
mov rdx, qword [0x140185718]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov esi, eax
test eax, eax
je 0x14001b673
cmp rsi, qword [0x140185710]
jbe 0x14001b659
mov rcx, qword [0x140185718]
mov edx, esi
call fcn.140061da0
test rax, rax
je 0x14001b673
mov r8d, esi
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rsi
lea rcx, str.SDL_AUDIO_FORMAT
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
test rcx, rcx
je 0x14001b673
call fcn.14001a5c0
mov word [rbx + 4], ax
test ax, ax
jne 0x14001b67c
mov eax, 0x8010
mov word [rbx + 4], ax
movzx eax, byte [rdi + 6]
mov rsi, qword [rsp + 0x30]
cmp eax, 8
ja case.0x14001b69f.3
lea rdx, [0x140000000]
mov ecx, dword [rdx + rax*4 + 0x1b7dc]
add rcx, rdx
jmp rcx
lea rcx, str.SDL_AUDIO_CHANNELS
call fcn.140056020
test rax, rax
je 0x14001b6c7
xor edx, edx
mov rcx, rax
lea r8d, [rdx + 0xa]
call fcn.14003a200
mov byte [rbx + 6], al
test al, al
jne case.0x14001b69f.1
mov byte [rbx + 6], 2
cmp word [rdi + 8], 0
jne 0x14001b77b
mov r8d, dword [0x140185710]
lea rcx, str.SDL_AUDIO_SAMPLES
mov rdx, qword [0x140185718]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edi, eax
test eax, eax
je 0x14001b754
cmp rdi, qword [0x140185710]
jbe 0x14001b734
mov rcx, qword [0x140185718]
mov edx, edi
call fcn.140061da0
test rax, rax
je 0x14001b754
mov r8d, edi
mov qword [0x140185718], rax
mov rdx, rax
mov qword [0x140185710], rdi
lea rcx, str.SDL_AUDIO_SAMPLES
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov rcx, qword [0x140185718]
test rcx, rcx
je 0x14001b754
xor edx, edx
lea r8d, [rdx + 0xa]
call fcn.14003a200
mov word [rbx + 8], ax
test ax, ax
jne 0x14001b77b
mov eax, 0x10624dd3
imul dword [rbx]
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 1
imul ecx, edx, 0x2e
cmp ecx, eax
jle 0x14001b777
add eax, eax
cmp eax, ecx
jl 0x14001b771
mov word [rbx + 8], ax
movzx eax, word [rbx + 4]
cmp eax, 8
je 0x14001b797
cmp eax, 0x10
je 0x14001b797
mov ecx, 0x1010
cmp ax, cx
je 0x14001b797
xor cl, cl
jmp 0x14001b799
mov cl, 0x80
shr eax, 3
and eax, 0x1f
mov byte [rbx + 7], cl
movzx ecx, word [rbx + 8]
imul eax, ecx
movzx ecx, byte [rbx + 6]
imul eax, ecx
mov dword [rbx + 0xc], eax
mov eax, 1
mov rbx, qword [rsp + 0x38]
add rsp, 0x20
pop rdi
ret
lea rcx, str.Unsupported_number_of_audio_channels.
call fcn.14005ec50
mov rbx, qword [rsp + 0x38]
xor eax, eax
add rsp, 0x20
pop rdi
ret