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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2ac
mov eax, dword [esp + 0x2c8]
mov ecx, dword [esp + 0x2d0]
mov edx, dword [esp + 0x2cc]
mov ebx, dword [esp + 0x2c0]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x2d4]
mov dword [esp + 0x38], edx
mov edi, dword [esp + 0x2c4]
mov dword [esp + 0x4c], eax
mov eax, dword [0x5398d0]
mov dword [esp + 0x29c], eax
mov eax, ecx
mov dword [esp + 0x3c], ecx
or eax, edx
je 0x40ab39
lea eax, [esp + 0x9c]
mov dword [esp + 8], 9
mov dword [esp + 0xc], eax
mov dword [esp + 4], 9
mov dword [esp], ebx
call fcn.00408860
mov dword [esp + 0x40], eax
test eax, eax
jne 0x40ab0f
lea eax, [esp + 0x9c]
lea ebp, [esp + 0x29c]
xor edx, edx
mov dword [esp + 0x64], eax
lea esi, [esi]
add dl, byte [eax]
add eax, 1
cmp eax, ebp
jne 0x40a3d0
test dl, dl
jne 0x40a99c
movzx eax, word [esp + 0x290]
mov esi, 1
mov word [esp + 0x9c], si
sub eax, 1
cmp ax, 4
jbe 0x40a810
mov edx, dword [esp + 0x38]
lea esi, [esp + 0x9c]
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x48], esi
mov eax, dword [edi + 0x78]
xor esi, esi
add edx, 0xffffffff
adc ecx, 0xffffffff
mov dword [esp + 0x50], edx
mov dword [esp + 0x54], ecx
test eax, eax
jle 0x40a6ca
mov dword [esp + 0x68], ebp
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x44], edi
mov eax, dword [esp + 0x44]
mov edi, dword [eax + esi + 8]
mov ebp, dword [eax + esi + 0xc]
mov ebx, dword [eax + esi + 0x10]
mov edx, dword [eax + esi]
mov dword [esp + 0x30], edi
mov ecx, dword [eax + esi + 4]
mov dword [esp + 0x34], ebp
cmp ebx, 3
je 0x40a4c8
lea eax, [ebx - 1]
cmp eax, 1
ja 0x40a475
mov eax, dword [esp + 0x4c]
test eax, eax
jne 0x40a840
cmp ebx, 1
je 0x40a56b
cmp ebx, 2
je 0x40a65c
test ebx, ebx
je 0x40a59e
mov dword [esp + 4], ebx
mov dword [esp], str.ataWriteSelectiveSelfTestLog:_Invalid_mode__d_n
call fcn.004026d0
mov eax, 0xffffffff
mov edx, dword [esp + 0x29c]
sub edx, dword [0x5398d0]
jne 0x40ab4a
add esp, 0x2ac
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x60]
movzx eax, byte [eax + 0x16b]
mov byte [esp + 0x58], al
shr al, 4
movzx eax, al
sub eax, 1
cmp eax, 1
jbe 0x40a920
mov dword [esp], str.Continue_Selective_Self_Test:_Start_next_span_n
call fcn.004026d0
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x40a65c
mov ecx, dword [esp + 0x40]
cmp ecx, dword [eax + 0x78]
jge 0x40a65c
mov eax, dword [esp + 0x48]
mov ecx, dword [eax + 2]
mov dword [esp + 0x58], ecx
mov ecx, dword [eax + 6]
mov dword [esp + 0x70], ecx
or ecx, dword [esp + 0x58]
jne 0x40a65c
mov ecx, dword [eax + 0xe]
mov edx, dword [eax + 0xa]
mov eax, ecx
or eax, edx
jne 0x40a882
mov ebx, 2
mov ecx, dword [esp + 0x4c]
mov edi, dword [esp + 0x48]
mov eax, dword [ecx + esi]
mov edx, dword [ecx + esi + 4]
mov dword [edi + 2], eax
mov eax, dword [ecx + esi + 8]
mov dword [edi + 6], edx
mov edx, dword [ecx + esi + 0xc]
mov dword [edi + 0xa], eax
mov dword [edi + 0xe], edx
cmp ebx, 1
jne 0x40a65c
mov eax, dword [esp + 0x48]
mov edx, dword [eax + 2]
mov ecx, dword [eax + 6]
mov ebp, dword [esp + 0x34]
mov edi, dword [esp + 0x30]
mov eax, ebp
or eax, edi
je 0x40a980
add edi, 0xffffffff
mov ebx, 1
adc ebp, 0xffffffff
add edi, edx
adc ebp, ecx
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebp
mov eax, dword [esp + 0x34]
mov ebp, dword [esp + 0x3c]
mov edi, dword [esp + 0x38]
cmp dword [esp + 0x30], edi
sbb eax, ebp
setae al
cmp edx, edi
mov edi, ecx
sbb edi, dword [esp + 0x3c]
jae 0x40a60b
test al, al
je 0x40a60b
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
mov eax, edi
mov edi, ebp
not eax
not edi
or eax, edi
je 0x40a5f9
mov eax, dword [esp + 0x40]
mov dword [esp], str.Size_of_self_test_span__d_decreased_according_to_disk_size_n
mov dword [esp + 0x30], edx
mov dword [esp + 4], eax
mov dword [esp + 0x34], ecx
call fcn.004026d0
mov edx, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edi, dword [esp + 0x50]
mov ebp, dword [esp + 0x54]
xor eax, eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebp
mov edi, dword [esp + 0x30]
mov ebp, dword [esp + 0x34]
cmp edi, edx
mov edi, ebp
sbb edi, ecx
jae 0x40a67f
mov edi, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
mov dword [esp + 8], edx
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x1c], edi
mov edi, dword [esp + 0x30]
mov dword [esp + 0x18], esi
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], ebp
mov dword [esp + 4], eax
mov dword [esp], str.Invalid_selective_self_test_span__d:__llu__llu___llu_sectors__n
call fcn.004026d0
jmp 0x40a49f
mov eax, dword [esp + 0x48]
mov ecx, dword [eax + 0xe]
mov edx, dword [eax + 0xa]
mov eax, ecx
or eax, edx
jne 0x40a882
mov dword [esp + 0x30], edx
mov ebx, 2
mov dword [esp + 0x34], ecx
jmp 0x40a683
test al, al
jne 0x40a61b
mov eax, dword [esp + 0x44]
add dword [esp + 0x40], 1
mov edi, dword [esp + 0x40]
add dword [esp + 0x48], 0x10
mov dword [eax + esi + 0x10], ebx
mov ebx, dword [esp + 0x34]
mov dword [eax + esi + 4], ecx
mov ecx, dword [esp + 0x30]
mov dword [eax + esi], edx
mov dword [eax + esi + 8], ecx
mov dword [eax + esi + 0xc], ebx
mov eax, dword [eax + 0x78]
add esi, 0x18
cmp eax, edi
jg 0x40a43d
mov ebp, dword [esp + 0x68]
mov ebx, dword [esp + 0x6c]
mov edi, dword [esp + 0x44]
lea edx, [esp + 0x9e]
lea ecx, [esp + 0xee]
mov dword [edx], 0
add edx, 0x10
mov dword [edx - 0xc], 0
mov dword [edx - 8], 0
mov dword [edx - 4], 0
cmp ecx, edx
jne 0x40a6d8
test eax, eax
jle 0x40a739
mov dword [esp + 0x30], ebx
lea esi, [esp + 0x9c]
shl eax, 4
lea edx, [edi + 8]
add eax, esi
mov ecx, esi
mov ebx, dword [edx - 8]
mov esi, dword [edx - 4]
add ecx, 0x10
add edx, 0x18
mov dword [ecx - 0xe], ebx
mov ebx, dword [edx - 0x18]
mov dword [ecx - 0xa], esi
mov esi, dword [edx - 0x14]
mov dword [ecx - 6], ebx
mov dword [ecx - 2], esi
cmp eax, ecx
jne 0x40a713
mov ebx, dword [esp + 0x30]
mov edx, dword [edi + 0x80]
xor eax, eax
mov dword [esp + 0x288], 0
mov word [esp + 0x290], ax
movzx eax, word [esp + 0x292]
mov dword [esp + 0x28c], 0
cmp edx, 1
je 0x40ab07
mov ecx, eax
or ecx, 2
cmp edx, 2
cmove eax, ecx
and eax, 0xffffffe7
mov word [esp + 0x292], ax
mov eax, dword [edi + 0x7c]
test eax, eax
je 0x40a798
sub eax, 1
mov word [esp + 0x298], ax
mov byte [esp + 0x29b], 0
mov edx, dword [esp + 0x64]
xor eax, eax
lea esi, [esi]
lea esi, [esi]
add al, byte [edx]
add edx, 1
cmp ebp, edx
jne 0x40a7b0
neg eax
mov dword [esp + 8], 9
mov byte [esp + 0x29b], al
lea eax, [esp + 0x9c]
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0xd
mov dword [esp], ebx
call fcn.00408860
test eax, eax
je 0x40a4a4
mov eax, dword [ebx]
mov eax, dword [eax - 0xc]
mov eax, dword [ebx + eax + 0x6c]
mov dword [esp], str.Write_Selective_Self_test_Log_failed:__s_n
mov dword [esp + 4], eax
call fcn.004026d0
mov eax, 0xfffffffd
jmp 0x40a4a4
mov eax, dword [esp + 0x60]
movzx eax, byte [eax + 0x16b]
mov byte [esp + 0x30], al
shr al, 4
cmp al, 0xf
jne 0x40a403
mov dword [esp], str.SMART_Selective_or_other_Self_test_in_progress_n
call fcn.004026d0
mov eax, 0xfffffffc
jmp 0x40a4a4
mov ecx, dword [esp + 0x40]
cmp ecx, dword [eax + 0x78]
jge 0x40a562
mov eax, dword [esp + 0x48]
mov ecx, dword [eax + 2]
mov dword [esp + 0x58], ecx
mov ecx, dword [eax + 6]
mov dword [esp + 0x70], ecx
or ecx, dword [esp + 0x58]
jne 0x40a562
mov ecx, dword [eax + 0xe]
mov edx, dword [eax + 0xa]
mov eax, ecx
or eax, edx
je 0x40a53f
cmp ebx, 1
je 0x40a56b
mov edi, edx
mov eax, dword [esp + 0x38]
mov ebp, ecx
add edi, 1
adc ebp, 0
cmp edi, eax
mov dword [esp + 0x58], edi
mov eax, ebp
sbb eax, dword [esp + 0x3c]
mov dword [esp + 0x5c], ebp
jb 0x40a8b2
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], 0
mov ebp, dword [esp + 0x34]
mov edi, dword [esp + 0x30]
mov eax, ebp
or eax, edi
jne 0x40a9ad
mov ebx, dword [esp + 0x48]
mov eax, edx
mov edx, ecx
sub eax, dword [ebx + 2]
sbb edx, dword [ebx + 6]
mov ecx, eax
mov ebx, edx
add ecx, 1
adc ebx, 0
add eax, dword [esp + 0x58]
adc edx, dword [esp + 0x5c]
mov dword [esp + 0x70], ecx
mov edi, eax
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x38]
mov ebp, edx
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x3c]
mov ecx, ebp
cmp edi, eax
mov dword [esp + 0x74], ebx
sbb ecx, edx
jae 0x40a9d1
mov edx, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
xor eax, eax
mov ebx, 2
jmp 0x40a60b
mov dword [esp], str.Continue_Selective_Self_Test:_Redo_last_span_n
call fcn.004026d0
mov eax, dword [esp + 0x48]
mov ebx, dword [esp + 0x4c]
mov edx, dword [eax + 2]
mov ecx, dword [eax + 6]
test ebx, ebx
je 0x40a575
mov ebx, dword [esp + 0x4c]
mov edi, dword [esp + 0x40]
cmp edi, dword [ebx + 0x78]
jge 0x40a575
mov ebx, ecx
or ebx, edx
jne 0x40a575
mov ecx, dword [eax + 0xa]
mov eax, dword [eax + 0xe]
mov dword [esp + 0x70], eax
or eax, ecx
mov dword [esp + 0x58], ecx
jne 0x40a56b
mov ebx, 1
jmp 0x40a53f
mov eax, dword [esp + 0x48]
mov ebx, 1
mov edi, dword [eax + 0xa]
mov ebp, dword [eax + 0xe]
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebp
jmp 0x40a59e
mov dword [esp], str.SMART_Selective_Self_Test_Log_Structure
call fcn.00402b90
jmp 0x40a3e1
mov edx, dword [esp + 0x58]
add edi, 0xffffffff
mov ecx, dword [esp + 0x5c]
mov ebx, 2
adc ebp, 0xffffffff
add edi, edx
adc ebp, ecx
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebp
jmp 0x40a59e
mov ecx, dword [esp + 0x70]
mov ebx, dword [esp + 0x74]
add eax, 0xffffffff
mov edi, eax
adc edx, 0xffffffff
add eax, ecx
mov ebp, edx
mov dword [esp + 8], ecx
adc edx, ebx
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.004869a0
mov ecx, eax
mov eax, edi
mov ebx, edx
mov edx, ebp
add eax, ecx
mov dword [esp + 8], ecx
adc edx, ebx
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
mov dword [esp + 0x80], ecx
mov dword [esp + 0x84], ebx
call fcn.004869a0
mov ecx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x74]
mov dword [esp], str.Span__d_changed_from__llu__llu___llu_sectors__n
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x7c], edx
mov edx, dword [esp + 0x38]
sub edx, dword [esp + 0x78]
sbb ecx, dword [esp + 0x7c]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x88], edx
mov edx, dword [esp + 0x34]
mov dword [esp + 0x8c], ecx
mov ecx, dword [esp + 0x70]
mov ebx, dword [esp + 0x40]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
mov dword [esp + 0x10], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 4], ebx
call fcn.004026d0
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x7c]
mov dword [esp + 0xc], edi
mov ebx, dword [esp + 0x84]
mov eax, dword [esp + 0x78]
mov dword [esp + 0x10], ebp
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x8c]
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x88]
mov dword [esp + 0x20], ebx
mov ebx, 2
mov dword [esp + 0x14], eax
mov dword [esp + 4], edx
mov dword [esp + 8], ecx
mov dword [esp], str._________________to__llu__llu___llu_sectors____llu_spans__n
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], ecx
call fcn.004026d0
mov dword [esp + 0x30], edi
mov edx, dword [esp + 0x58]
xor eax, eax
mov dword [esp + 0x34], ebp
mov ecx, dword [esp + 0x5c]
jmp 0x40a60b
and eax, 0xfffffffd
jmp 0x40a77b
mov eax, dword [ebx]
mov eax, dword [eax - 0xc]
mov eax, dword [ebx + eax + 0x6c]
mov dword [esp], str.SMART_Read_Selective_Self_test_Log_failed:__s_n
mov dword [esp + 4], eax
call fcn.004026d0
mov dword [esp], str.Since_Read_failed__will_not_attempt_to_WRITE_Selective_Self_test_Log_n
call fcn.004026d0
jmp 0x40a49f
mov dword [esp], str.Disk_size_is_unknown__unable_to_check_selective_self_test_spans_n
call fcn.004026d0
jmp 0x40a49f
call fcn.00485600
nop