Function at 0x140021d60
Capabilities:
Set environment variable

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x10a0]
mov eax, 0x11a0
call fcn.140042f20
sub rsp, rax
mov rax, qword [0x1400a2078]
xor rax, rsp
mov qword [rbp + 0x1090], rax
mov rbx, rcx
lea rdx, [rsp + 0x40]
xor ecx, ecx
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov eax, eax
mov edx, 0x5c
lea rcx, [rsp + 0x40]
mov byte [rsp + rax + 0x40], 0
call fcn.14004448c
test rax, rax
je 0x140021dcd
mov byte [rax + 1], 0
lea rdx, str.ampl
mov rcx, rbx
call fcn.140044294
test rax, rax
je 0x140021e04
lea rdx, [rsp + 0x40]
lea rcx, str.AMPL_INSTALL_DIR
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea rdx, [rsp + 0x40]
lea rcx, str.AMPL_INSTALL_DIR
call fcn.14005c9f4
xor r14d, r14d
lea rcx, str.AMPL_ENVFILE
mov r15d, r14d
call fcn.14005cdc4
lea rdi, [r14 - 1]
lea r12d, [r14 + 1]
lea rsi, [0x14008e24b]
test rax, rax
je 0x140021e32
mov rcx, rax
jmp 0x14002204d
cmp byte [rsp + 0x40], r14b
je 0x140021eb7
mov rcx, r14
nop dword [rax]
movzx eax, byte [rsp + rcx + 0x40]
mov byte [rbp + rcx + 0x90], al
lea rcx, [rcx + 1]
test al, al
jne 0x140021e40
lea rcx, [rbp + 0x90]
dec rcx
nop
cmp byte [rcx + 1], r14b
lea rcx, [rcx + 1]
jne 0x140021e60
movsd xmm0, qword [str.ampl.env]
lea rdx, [0x14008e640]
movzx eax, byte [0x140093a38]
movsd qword [rcx], xmm0
mov byte [rcx + 8], al
lea rcx, [rbp + 0x90]
call fcn.14004c9b0
test rax, rax
je 0x140021eb7
mov rcx, rax
call fcn.14004d150
lea rcx, [rbp + 0x90]
call fcn.140021250
mov r15d, eax
test eax, eax
jne 0x14002205d
lea rcx, str.Path
call fcn.14005cdc4
test rax, rax
mov rcx, rsi
cmovne rcx, rax
call fcn.140057720
lea r8, [rsp + 0x30]
mov qword [rsp + 0x30], rax
lea rdx, [0x140093a28]
mov rcx, rax
mov rbx, rax
call fcn.140057420
test rax, rax
je 0x140021fcb
nop word [rax + rax]
mov r8d, 0x104
lea rcx, [rbp + 0x90]
mov rdx, rax
call fcn.140056ae4
test rax, rax
je 0x140021fac
lea rcx, [rbp + 0x90]
mov rax, rdi
nop dword [rax + rax]
cmp byte [rcx + rax + 1], r14b
lea rax, [rax + 1]
jne 0x140021f30
cmp byte [rbp + rax + 0x8f], 0x5c
je 0x140021f64
lea rcx, [rbp + 0x90]
dec rcx
nop
cmp byte [rcx + 1], r14b
lea rcx, [rcx + 1]
jne 0x140021f50
movzx eax, word [0x140093a2c]
mov word [rcx], ax
lea rcx, [rbp + 0x90]
dec rcx
nop
cmp byte [rcx + 1], r14b
lea rcx, [rcx + 1]
jne 0x140021f70
movsd xmm0, qword [str.ampl.env]
lea rdx, [0x14008e640]
movzx eax, byte [0x140093a38]
movsd qword [rcx], xmm0
mov byte [rcx + 8], al
lea rcx, [rbp + 0x90]
call fcn.14004c9b0
test rax, rax
jne 0x140022036
mov rcx, qword [rsp + 0x30]
lea r8, [rsp + 0x30]
lea rdx, [0x140093a28]
call fcn.140057420
test rax, rax
jne 0x140021f00
mov rcx, rbx
call fcn.1400543f0
cmp byte [rsp + 0x40], 0
je 0x140022375
lea rcx, str.Path
call fcn.14005cdc4
mov rbx, rax
test rax, rax
je 0x140022375
mov rax, rdi
nop dword [rax]
inc rax
cmp byte [rbx + rax], 0
jne 0x140022000
lea rcx, [rsp + 0x40]
nop
inc rdi
cmp byte [rcx + rdi], 0
jne 0x140022010
add rdi, rax
lea rcx, [rdi + 2]
call fcn.14005608c
mov rsi, rax
test rax, rax
je 0x1400224d5
jmp 0x140022244
mov rcx, rax
call fcn.14004d150
mov rcx, rbx
call fcn.1400543f0
lea rcx, [rbp + 0x90]
call fcn.140021250
mov r15d, eax
test eax, eax
je 0x140021fd3
lea rcx, str.AMPL_LICFILE
call fcn.14005cdc4
test rax, rax
jne 0x140021fd3
cmp byte [rsp + 0x40], r14b
je 0x1400220e5
mov rcx, r14
nop dword [rax]
movzx eax, byte [rsp + rcx + 0x40]
mov byte [rbp + rcx + 0x90], al
lea rcx, [rcx + 1]
test al, al
jne 0x140022080
lea rcx, [rbp + 0x90]
dec rcx
nop
cmp byte [rcx + 1], r14b
lea rcx, [rcx + 1]
jne 0x1400220a0
movsd xmm0, qword [str.ampl.lic]
lea rdx, [0x14008e640]
movzx eax, byte [0x140093470]
movsd qword [rcx], xmm0
mov byte [rcx + 8], al
lea rcx, [rbp + 0x90]
call fcn.14004c9b0
test rax, rax
je 0x1400220e5
mov rcx, rax
call fcn.14004d150
jmp 0x140022218
lea rcx, str.Path
mov ebx, r14d
call fcn.14005cdc4
test rax, rax
cmovne rsi, rax
mov rcx, rsi
call fcn.140057720
lea r8, [rsp + 0x30]
mov qword [rsp + 0x30], rax
lea rdx, [0x140093a28]
mov rcx, rax
mov rsi, rax
call fcn.140057420
test rax, rax
je 0x1400221f3
nop dword [rax + rax]
mov r8d, 0x104
lea rcx, [rbp + 0x90]
mov rdx, rax
call fcn.140056ae4
test rax, rax
je 0x1400221c7
lea rcx, [rbp + 0x90]
mov rax, rdi
cmp byte [rcx + rax + 1], bl
lea rax, [rax + 1]
jne 0x140022154
cmp byte [rbp + rax + 0x8f], 0x5c
je 0x140022185
lea rcx, [rbp + 0x90]
dec rcx
cmp byte [rcx + 1], bl
lea rcx, [rcx + 1]
jne 0x140022172
movzx eax, word [0x140093a2c]
mov word [rcx], ax
lea rcx, [rbp + 0x90]
dec rcx
nop
cmp byte [rcx + 1], bl
lea rcx, [rcx + 1]
jne 0x140022190
movsd xmm0, qword [str.ampl.lic]
lea rdx, [0x14008e640]
movzx eax, byte [0x140093470]
movsd qword [rcx], xmm0
mov byte [rcx + 8], al
lea rcx, [rbp + 0x90]
call fcn.14004c9b0
test rax, rax
jne 0x1400221e8
mov rcx, qword [rsp + 0x30]
lea r8, [rsp + 0x30]
lea rdx, [0x140093a28]
call fcn.140057420
test rax, rax
jne 0x140022130
jmp 0x1400221f3
mov rcx, rax
call fcn.14004d150
mov ebx, r12d
mov rcx, rsi
call fcn.1400543f0
test ebx, ebx
lea rax, [rbp + 0x90]
cmove rax, r14
test rax, rax
setne r14b
test r14d, r14d
je 0x140021fd3
lea rdx, [rbp + 0x90]
lea rcx, str.AMPL_LICFILE
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea rdx, [rbp + 0x90]
lea rcx, str.AMPL_LICFILE
call fcn.14005c9f4
jmp 0x140021fd3
mov rcx, rsi
sub rcx, rbx
nop word [rax + rax]
movzx eax, byte [rbx]
mov byte [rcx + rbx], al
lea rbx, [rbx + 1]
test al, al
jne 0x140022250
lea rcx, [rsi - 1]
cmp byte [rcx + 1], 0
lea rcx, [rcx + 1]
jne 0x140022262
movzx eax, word [0x140093a28]
mov word [rcx], ax
lea rcx, [rsi - 1]
nop word [rax + rax]
cmp byte [rcx + 1], 0
lea rcx, [rcx + 1]
jne 0x140022280
lea r8, [rsp + 0x40]
xor edx, edx
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [r8 + rdx]
mov byte [rcx + rdx], al
lea rdx, [rdx + 1]
test al, al
jne 0x1400222a0
call fcn.140056a7c
mov rdi, qword [rax]
mov rbx, qword [rdi]
test rbx, rbx
je 0x14002230d
mov r8d, 4
lea rdx, str.PATH
mov rcx, rbx
call fcn.140051c70
test eax, eax
jne 0x1400222df
cmp byte [rbx + 4], 0x3d
je 0x1400222ee
mov rbx, qword [rdi + 8]
add rdi, 8
test rbx, rbx
jne 0x1400222c0
jmp 0x14002230d
mov rdx, rsi
lea rcx, str.PATH
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
mov rdx, rsi
lea rcx, str.PATH
call fcn.14005c9f4
call fcn.140056a7c
mov rdi, qword [rax]
mov rbx, qword [rdi]
test rbx, rbx
je 0x14002236d
nop dword [rax]
mov r8d, 4
lea rdx, str.Path
mov rcx, rbx
call fcn.140051c70
test eax, eax
jne 0x14002233f
cmp byte [rbx + 4], 0x3d
je 0x14002234e
mov rbx, qword [rdi + 8]
add rdi, 8
test rbx, rbx
jne 0x140022320
jmp 0x14002236d
mov rdx, rsi
lea rcx, str.Path
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
mov rdx, rsi
lea rcx, str.Path
call fcn.14005c9f4
mov rcx, rsi
call fcn.1400543f0
test r15d, r15d
je 0x1400224a7
lea rcx, str.AMPL_LICFILE
call fcn.14005cdc4
mov rbx, rax
test rax, rax
je 0x1400224a7
lea rdx, [0x14008e640]
mov rcx, rax
call fcn.14004c9b0
test rax, rax
je 0x1400224a7
mov rcx, rax
call fcn.14004d150
lea rdx, [rbp + 0x90]
mov rcx, rbx
call fcn.140020f60
test rax, rax
je 0x1400224a7
lea rdx, str.AMPLKEY
lea rcx, [rbp + 0x90]
call fcn.140044294
mov ecx, dword [0x1400a98f4]
lea rdx, str.AMPLKEY.TAG.COMMUNITY
test rax, rax
cmove ecx, r12d
mov dword [0x1400a98f4], ecx
lea rcx, [rbp + 0x90]
call fcn.140044294
test rax, rax
je 0x14002243a
lea rdx, str.hash
mov dword [0x1400a98f8], r12d
lea rcx, str.AMPLCE_HASH_SUFFIX
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea rdx, str.hash
lea rcx, str.AMPLCE_HASH_SUFFIX
call fcn.14005c9f4
mov eax, dword [0x1400a98f4]
test eax, eax
jne 0x1400224a7
lea rcx, str.AMPLKEY_USAGELOG_ENABLE
call fcn.14005cdc4
mov ecx, dword [0x1400a98f8]
test rax, rax
mov eax, dword [0x1400a98f4]
cmovne ecx, r12d
mov dword [0x1400a98f8], ecx
test eax, eax
jne 0x1400224a7
lea rax, str.Apr_11_2023
mov edx, 0x40
lea r9, str.baron
mov qword [rsp + 0x20], rax
lea r8, str.starting:_s__s_
lea rcx, [rbp + 0x50]
call fcn.140020a90
test eax, eax
jle 0x1400224a7
lea rcx, [rbp + 0x50]
call fcn.140021bd0
call fcn.140021880
mov eax, r15d
mov rcx, qword [rbp + 0x1090]
xor rcx, rsp
call fcn.140042470
lea r11, [rsp + 0x11a0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret
mov ecx, 2
call fcn.14004cadc
mov rcx, rax
lea r8d, [rdi + 2]
lea rdx, str.malloc__lu__failed__n
call fcn.1400209f0
mov ecx, r12d
call fcn.1400563a8
int3