Function at 0x403540
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x574
mov eax, dword [0x474004]
xor eax, esp
mov dword [esp + 0x570], eax
push ebx
push esi
push edi
push 0x476540
push 0x476140
push str._s_s.qc
lea eax, [esp + 0x184]
push 0x400
push eax
call fcn.00407220
add esp, 0x14
cmp eax, 0xffffffff
jne 0x4035b8
push 0x476540
push str.ERROR:_Destination_path_is_too_long._Couldnt_write__s.qc_n
push 2
call fcn.00417c5b
add esp, 4
push eax
call fcn.00401040
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x570]
xor ecx, esp
call fcn.0040c2d8
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x178]
push 0x46e478
push eax
call fcn.004344e7
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4035e2
lea eax, [esp + 0x178]
push eax
push str.ERROR:_Couldnt_write__s_n
jmp 0x403590
push ebx
push 0x46e498
call fcn.00433985
push ebx
push str._n_n
call fcn.00433985
push ebx
push str.QC_script_generated_by_Half_Life_Studio_Model_Decompiler_1.1_n
call fcn.00433985
lea eax, [esp + 0x38]
push eax
call fcn.0043835b
add esp, 0x1c
lea eax, [esp + 0x20]
push eax
call fcn.00438999
add esp, 4
push eax
push 0x46ea10
lea eax, [esp + 0x80]
push 0x100
push eax
call fcn.00437fce
lea ecx, [esp + 0x88]
add esp, 0x10
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x403642
sub ecx, edx
inc ecx
cmp ecx, 0x100
jbe 0x40366e
mov ecx, 0x3f
lea esi, [esp + 0x78]
mov edi, 0x476010
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov byte [0x47610f], al
jmp 0x403681
push ecx
lea eax, [esp + 0x7c]
push eax
push 0x476010
call fcn.00415e70
add esp, 0xc
push 0x476010
push str.Copyright_Flying_With_Gauss__s__c___n_n
push ebx
call fcn.00401040
add esp, 0xc
push 0x476540
push str._s.mdl_n_n
push ebx
call fcn.00401040
add esp, 0xc
push ebx
push str.Original_internal_name:_n
call fcn.00433985
mov eax, dword [0x476940]
add eax, 8
push eax
push str.__s__n_n
push ebx
call fcn.00401040
add esp, 0x14
push ebx
push str._n
call fcn.00433985
push ebx
push str.__n_n
call fcn.00433985
push 0x476540
push str._modelname___s.mdl__n
push ebx
call fcn.00401040
add esp, 0x1c
push ebx
push str._cd__.__n
call fcn.00433985
push ebx
push str._cdtexture__._textures___n
call fcn.00433985
push ebx
push str._cliptotextures_n
call fcn.00433985
push ebx
push str._scale_1.0_n
call fcn.00433985
push ebx
push 0x46e138
call fcn.00433985
mov eax, dword [0x476940]
mov edx, 0x46e18a
mov esi, dword [eax + 0xd0]
mov ecx, dword [eax + 0xcc]
add esi, eax
cmp ecx, 1
mov eax, 0x46e1c0
cmovle eax, edx
push eax
push ecx
push str.____i_reference_mesh_s_n
push ebx
call fcn.00401040
mov ecx, dword [0x476940]
add esp, 0x38
mov dword [esp + 0x1c], 0
cmp dword [ecx + 0xcc], 0
jle 0x40383d
lea eax, [esi + 0x40]
mov dword [esp + 0x18], eax
nop
mov esi, dword [eax + 8]
add esi, ecx
cmp dword [eax], 1
lea ecx, [eax - 0x40]
jne 0x40379f
push esi
push ecx
push str._body___s____s__n
push ebx
call fcn.00401040
add esp, 0x10
jmp 0x403817
push ecx
push str._bodygroup___s__n
push ebx
call fcn.00401040
add esp, 0xc
push ebx
push 0x46e204
call fcn.00433985
mov eax, dword [esp + 0x20]
xor edi, edi
add esp, 8
cmp dword [eax], edi
jle 0x403809
test esi, esi
je 0x4037ee
push 5
push str.blank
push esi
call fcn.004336d0
add esp, 0xc
test eax, eax
jne 0x4037ee
push ebx
push str._tblank_n
call fcn.00433985
add esp, 8
jmp 0x4037fd
push esi
push str._tstudio___s__n
push ebx
call fcn.00401040
add esp, 0xc
mov eax, dword [esp + 0x18]
inc edi
add esi, 0x70
cmp edi, dword [eax]
jl 0x4037c6
push ebx
push 0x46e228
call fcn.00433985
add esp, 8
mov edx, dword [esp + 0x1c]
mov ecx, dword [0x476940]
inc edx
mov eax, dword [esp + 0x18]
add eax, 0x4c
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
cmp edx, dword [ecx + 0xcc]
jl 0x403780
push ebx
push 0x46e138
call fcn.00433985
mov eax, dword [0x476940]
mov eax, dword [eax + 0x88]
and eax, 0x3fffffff
push eax
push str._flags__u_n_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
push ecx
movss xmm0, dword [eax + 0x54]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [eax + 0x50]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [eax + 0x4c]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push str._eyeposition__f__f__f_n_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
add esp, 0x20
cmp dword [eax + 0xb4], 0
jne 0x4038bd
push ebx
push str._externaltextures_n_n
call fcn.00433985
add esp, 8
mov eax, dword [0x476124]
mov eax, dword [eax + 0xc4]
cmp eax, 2
jl 0x403a08
push eax
push str.____i_skin_families_n
push ebx
call fcn.00401040
add esp, 0xc
push ebx
push str._texturegroup__skinfamilies__n_n
call fcn.00433985
mov eax, dword [0x476124]
xor esi, esi
add esp, 8
mov dword [esp + 0x30], esi
mov edi, dword [eax + 0xc8]
mov ecx, dword [eax + 0xb8]
add edi, eax
add ecx, eax
mov dword [esp + 0x34], edi
mov dword [esp + 0x20], ecx
cmp dword [eax + 0xc4], esi
jle 0x4039fa
nop dword [eax]
push ebx
push 0x46e174
call fcn.00433985
mov edx, dword [0x476124]
add esp, 8
mov dword [esp + 0x2c], 0
mov ecx, dword [edx + 0xc0]
mov eax, ecx
imul eax, esi
lea edi, [edi + eax*2]
mov dword [esp + 0x1c], edi
test ecx, ecx
jle 0x4039d2
mov eax, dword [esp + 0x34]
mov dword [esp + 0x18], eax
nop
mov esi, dword [edx + 0xc4]
xor ecx, ecx
test esi, esi
jle 0x4039af
mov edx, dword [edx + 0xc0]
movzx edi, word [edi]
add edx, edx
cmp di, word [eax]
jne 0x403985
inc ecx
add eax, edx
cmp ecx, esi
jl 0x403977
jmp 0x4039a1
movsx eax, di
lea eax, [eax + eax*4]
shl eax, 4
add eax, dword [esp + 0x20]
push eax
push str._t_t__s__n
push ebx
call fcn.00401040
add esp, 0xc
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov edx, dword [0x476124]
mov ecx, dword [esp + 0x2c]
add eax, 2
inc ecx
mov dword [esp + 0x18], eax
add edi, 2
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x1c], edi
cmp ecx, dword [edx + 0xc0]
jl 0x403960
mov esi, dword [esp + 0x30]
push ebx
push 0x46e180
call fcn.00433985
mov eax, dword [0x476124]
inc esi
mov edi, dword [esp + 0x3c]
add esp, 8
mov dword [esp + 0x30], esi
cmp esi, dword [eax + 0xc4]
jl 0x403920
push ebx
push 0x46e184
call fcn.00433985
add esp, 8
mov ecx, ebx
call fcn.00402ac0
mov eax, dword [0x476940]
test dword [eax + 0x88], 0xc0000000
je 0x403a33
push ebx
push str._boneweights_n_n
call fcn.00433985
mov eax, dword [0x476940]
add esp, 8
mov edx, dword [eax + 0xd4]
test edx, edx
je 0x403af7
mov ecx, dword [eax + 0x90]
mov esi, dword [eax + 0xd8]
add ecx, eax
add esi, eax
mov dword [esp + 0x20], ecx
cmp edx, 1
mov ecx, 0x46e18a
mov eax, 0x46e188
cmovle eax, ecx
push eax
push edx
push str.____i_attachment_s_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
xor edi, edi
add esp, 0x10
cmp dword [eax + 0xd4], edi
jle 0x403ae4
add esi, 0x2c
nop word [eax + eax]
movss xmm0, dword [esi + 4]
sub esp, 0x18
imul eax, dword [esi - 8], 0x70
cvtps2pd xmm0, xmm0
add eax, dword [esp + 0x38]
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [esi]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [esi - 4]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push eax
push edi
push str._attachment__i___s___f__f__f_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
lea esi, [esi + 0x58]
inc edi
add esp, 0x28
cmp edi, dword [eax + 0xd4]
jl 0x403a90
push ebx
push 0x46e138
call fcn.00433985
mov eax, dword [0x476940]
add esp, 8
movss xmm0, dword [eax + 0x60]
sub esp, 0x18
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [eax + 0x5c]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [eax + 0x58]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push str._bbox__f__f__f
push ebx
call fcn.00401040
mov eax, dword [0x476940]
add esp, 8
movss xmm0, dword [eax + 0x6c]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [eax + 0x68]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [eax + 0x64]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push str.__f__f__f_n_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
add esp, 8
movss xmm0, dword [eax + 0x78]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [eax + 0x74]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [eax + 0x70]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push str._cbox__f__f__f
push ebx
call fcn.00401040
mov eax, dword [0x476940]
add esp, 8
movss xmm0, dword [eax + 0x84]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [eax + 0x80]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [eax + 0x7c]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push str.__f__f__f_n_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
add esp, 0x20
mov edx, dword [eax + 0x9c]
test edx, edx
je 0x403ce3
mov ecx, dword [eax + 0x90]
mov esi, dword [eax + 0xa0]
add ecx, eax
add esi, eax
mov dword [esp + 0x20], ecx
cmp edx, 1
mov ecx, 0x46e18a
mov eax, 0x46e1c0
cmovle eax, ecx
push eax
push edx
push str.____i_hit_box_s_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
xor edi, edi
add esp, 0x10
cmp dword [eax + 0x9c], edi
jle 0x403cd0
add esi, 0x18
nop dword [eax + eax]
movss xmm0, dword [esi + 4]
sub esp, 0x30
cvtps2pd xmm0, xmm0
imul eax, dword [esi - 0x18], 0x70
movsd qword [esp + 0x28], xmm0
movss xmm0, dword [esi]
cvtps2pd xmm0, xmm0
add eax, dword [esp + 0x50]
movsd qword [esp + 0x20], xmm0
movss xmm0, dword [esi - 4]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x18], xmm0
movss xmm0, dword [esi - 8]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [esi - 0xc]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [esi - 0x10]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push eax
push dword [esi - 0x14]
push str._hbox__i___s___f__f__f__f__f__f_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
lea esi, [esi + 0x20]
inc edi
add esp, 0x40
cmp edi, dword [eax + 0x9c]
jl 0x403c50
push ebx
push 0x46e138
call fcn.00433985
mov eax, dword [0x476940]
add esp, 8
mov edx, dword [eax + 0x94]
test edx, edx
je 0x403de7
mov ecx, dword [eax + 0x90]
mov esi, dword [eax + 0x98]
add ecx, eax
add esi, eax
mov dword [esp + 0x20], ecx
cmp edx, 1
mov ecx, 0x46e18a
mov eax, 0x46e188
cmovle eax, ecx
push eax
push edx
push str.____i_bone_controller_s_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
xor edi, edi
add esp, 0x10
cmp dword [eax + 0x94], edi
jle 0x403dd9
add esi, 0x14
nop dword [eax + eax]
mov ecx, dword [esi - 0x10]
lea edx, [esp + 0x38]
push 0
push 0x40
and ecx, 0xffff7fff
call fcn.004025b0
push ebx
push str._controller
call fcn.00433985
mov eax, dword [esi]
add esp, 0x10
cmp eax, 4
jne 0x403d7b
push ebx
push str.Mouth
call fcn.00433985
add esp, 8
jmp 0x403d8a
push eax
push 0x46e260
push ebx
call fcn.00401040
add esp, 0xc
movss xmm0, dword [esi - 8]
lea eax, [esp + 0x38]
cvtps2pd xmm0, xmm0
sub esp, 0x10
movsd qword [esp + 8], xmm0
movss xmm0, dword [esi - 0xc]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push eax
imul eax, dword [esi - 0x14], 0x70
add eax, dword [esp + 0x34]
push eax
push str.___s___s__f__f_n
push ebx
call fcn.00401040
mov eax, dword [0x476940]
inc edi
add esp, 0x20
add esi, 0x18
cmp edi, dword [eax + 0x94]
jl 0x403d40
push ebx
push 0x46e138
call fcn.00433985
add esp, 8
mov ecx, ebx
call fcn.00403210
push ebx
push str.___End_of_QC_script._n
call fcn.00433985
push ebx
call fcn.004346a6
add esp, 0xc
lea eax, [esp + 0x178]
push eax
push str.QC_Script:__s_n
call fcn.00401070
mov ecx, dword [esp + 0x584]
add esp, 8
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040c2d8
mov esp, ebp
pop ebp
ret