Function at 0x100012d5
Capabilities:
Check for time delay via gettickcount

Disassembly:
jmp 0x1002b730
mov eax, dword [0x10269b3c]
sub esp, 0x50
push ebx
mov ebx, dword [esp + 0x58]
and ebx, 0xff
push ebp
push esi
cmp ebx, eax
push edi
jge 0x1002bcea
shl ebx, 5
mov dword [esp + 0x14], ebx
test byte [ebx + 0x102a2650], 1
jne 0x1002bcea
mov dword [esp + 0x10], 0
mov eax, 4
test byte [ebx + 0x102a2650], al
je 0x1002b785
mov esi, dword [esp + 0x18]
mov dword [esp + 0x10], 2
jmp 0x1002b7a7
mov si, word [ebx + 0x102a2652]
and esi, 0xffff
imul esi, dword [esp + 0x70]
cmp esi, 0x40000
mov dword [esp + 0x18], esi
jbe 0x1002b7a7
mov dword [esp + 0x10], eax
call fcn.1000129e
test eax, eax
je 0x1002bba0
push esi
call fcn.101d175d
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x1002bba0
mov ecx, esi
mov esi, dword [esp + 0x68]
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov dl, byte [esp + 0x64]
and ecx, 3
mov ebx, dword [esp + 0x6c]
rep movsb byte es:[edi], byte [esi]
xor ecx, ecx
mov byte [esp + 0x30], dl
mov dword [esp + 0x34], ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], ecx
mov eax, dword [0x1077f6f0]
mov dword [esp + 0x3c], ecx
xor edi, edi
mov dword [esp + 0x40], ecx
or esi, 0xffffffff
mov dword [esp + 0x44], ecx
mov ecx, dword [esp + 0x70]
cmp eax, edi
mov dword [esp + 0x38], ebx
lea edx, [ebx + ecx - 1]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x6c], esi
mov dword [esp + 0x10], edi
je 0x1002b850
mov eax, dword [0x102a2624]
push eax
push edx
push ebx
push str._FATFS___Test__FWcache_write____________d___d___d_
push str.diskiocache
push 0xffffffffffffffff
push 0x1077ee5c
call fcn.1005bc20
add esp, 0x1c
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [0x102a2624]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
lea ebp, [ecx - 1]
cmp ebp, edi
jl 0x1002b93c
lea edx, [ebp + ebp*2]
shl edx, 3
mov dword [esp + 0x1c], edx
mov eax, dword [0x102a2620]
mov ecx, 6
lea edi, [esp + 0x48]
lea esi, [edx + eax]
rep movsd dword es:[edi], dword [esi]
mov cl, byte [esp + 0x64]
mov al, byte [esp + 0x48]
cmp al, cl
jne 0x1002b90c
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
cmp eax, ebx
ja 0x1002b8ad
cmp ebx, ecx
jbe 0x1002b91e
mov esi, dword [esp + 0x3c]
cmp eax, esi
ja 0x1002b8b9
cmp esi, ecx
jbe 0x1002b922
cmp ebx, eax
ja 0x1002b8c1
cmp eax, esi
jbe 0x1002b922
cmp ebx, ecx
ja 0x1002b8c9
cmp ecx, esi
jbe 0x1002b922
mov esi, dword [esp + 0x58]
mov edi, dword [esp + 0x28]
add edi, esi
mov esi, dword [0x1077f6f0]
mov dword [esp + 0x28], edi
mov edi, dword [esp + 0x2c]
adc edi, 0
test esi, esi
mov dword [esp + 0x2c], edi
je 0x1002b90c
push ecx
push eax
push ebp
push str._FATFS___Test__FWcache_write__i_d__cache__d__d_
push str.diskiocacheAll
push 0xffffffffffffffff
push 0x1077ee5c
call fcn.1005bc20
mov edx, dword [esp + 0x38]
add esp, 0x1c
dec ebp
sub edx, 0x18
test ebp, ebp
mov dword [esp + 0x1c], edx
jge 0x1002b87e
jmp 0x1002b938
mov esi, dword [esp + 0x3c]
cmp eax, ebx
ja 0x1002b930
cmp esi, ecx
ja 0x1002b930
mov dword [esp + 0x6c], ebp
jmp 0x1002b938
mov dword [esp + 0x10], 1
mov esi, dword [esp + 0x6c]
mov eax, dword [0x1077f6f0]
test eax, eax
je 0x1002b964
mov edx, dword [esp + 0x10]
push esi
push edx
push str._FATFS___Test__FWcache_write______d___d_
push str.diskiocache
push 0xffffffffffffffff
push 0x1077ee5c
call fcn.1005bc20
add esp, 0x18
mov eax, dword [esp + 0x10]
mov dword [esp + 0x6c], 0
test eax, eax
jne 0x1002ba1d
test esi, esi
jl 0x1002b9ea
mov ecx, dword [0x102a2620]
lea eax, [esi + esi*2]
lea edi, [esp + 0x48]
lea esi, [ecx + eax*8]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x1002b9de
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x68]
mov di, word [edx + 0x102a2652]
mov ebp, dword [esp + 0x50]
mov edx, ebx
and edi, 0xffff
sub edx, ebp
imul edi, edx
add edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
push ecx
call fcn.101d1786
add esp, 4
jmp 0x1002ba56
mov esi, dword [0x102a2624]
cmp esi, esi
jl 0x1002ba37
jmp 0x1002ba27
mov esi, dword [0x102a2624]
cmp esi, esi
jl 0x1002ba04
lea edx, [esi + 1]
push 0xffffffffffffffff
push edx
mov ecx, 0x102a2620
call fcn.10001848
mov ecx, dword [0x102a2620]
lea eax, [esi + esi*2]
lea esi, [esp + 0x30]
lea edi, [ecx + eax*8]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
jmp 0x1002ba56
mov esi, dword [0x102a2624]
cmp esi, esi
jl 0x1002ba37
lea edx, [esi + 1]
push 0xffffffffffffffff
push edx
mov ecx, 0x102a2620
call fcn.10001848
mov ecx, dword [0x102a2620]
lea eax, [esi + esi*2]
lea esi, [esp + 0x30]
mov dword [esp + 0x6c], 1
lea edi, [ecx + eax*8]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
mov ebp, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebp
mov ecx, dword [0x1077f6f0]
test ecx, ecx
je 0x1002babc
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x70]
mov edx, dword [esp + 0x14]
mov ecx, dword [0x102a2624]
sub eax, esi
push eax
push edi
mov eax, dword [edx + 0x102a2658]
mov esi, dword [0x102a2638]
add eax, ebx
push eax
mov eax, ebx
sub eax, esi
mov edx, dword [edx + 0x102a2658]
add eax, edx
cdq
xor eax, edx
sub eax, edx
push eax
push esi
push ecx
push str._FATFS___Test__write_cache__i_d___Last_sector:_d___PostCount:_d__sector:_d___count:_d___disk_write_:__d__r_n
push str.diskiocache
push 0xffffffffffffffff
push 0x1077ee5c
call fcn.1005bc20
add esp, 0x28
jmp 0x1002bac0
mov edi, dword [esp + 0x70]
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 0x102a2658]
mov esi, dword [0x102a2648]
mov edx, dword [0x102a264c]
add ecx, ebx
add esi, edi
mov dword [0x102a2638], ecx
mov dword [0x102a2648], esi
mov esi, 0
adc edx, esi
mov dword [0x102a264c], edx
call fcn.10001258
test eax, eax
je 0x1002bb0f
mov edx, dword [esp + 0x68]
mov eax, dword [esp + 0x64]
push edx
push ebx
push eax
call fcn.10001672
add esp, 0xc
cmp edi, 1
jne 0x1002bb2a
mov eax, dword [0x102a263c]
inc eax
cmp eax, edi
mov dword [0x102a263c], eax
jne 0x1002bb2a
call ebp
mov dword [0x102a2640], eax
mov eax, dword [0x102a264c]
xor ebx, ebx
cmp eax, ebx
ja 0x1002bb41
cmp dword [0x102a2648], 0x10000
jb 0x1002bb48
mov eax, 1
jmp 0x1002bb4a
xor eax, eax
mov edi, dword [esp + 0x6c]
or edi, eax
mov eax, dword [0x102a263c]
cmp eax, ebx
jbe 0x1002bb7f
cmp dword [0x102a2640], ebx
je 0x1002bb7f
cmp eax, 0x32
jae 0x1002bb83
call ebp
cmp dword [0x102a2640], eax
ja 0x1002bb83
call ebp
sub eax, dword [0x102a2640]
cmp eax, 0xbb8
jae 0x1002bb83
cmp edi, ebx
je 0x1002bb96
call fcn.100018fc
mov esi, eax
mov dword [0x102a2648], ebx
mov dword [0x102a264c], ebx
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x6c]
test eax, eax
jne 0x1002bcc2
mov edi, dword [0x102a260c]
mov ecx, esi
mov esi, dword [esp + 0x68]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov edi, eax
lea eax, [ebx + 0x102a265c]
push 0x10
push eax
mov ecx, dword [ebx + 0x102a266c]
mov edx, dword [esp + 0x20]
mov eax, dword [0x102a260c]
push ecx
mov ecx, dword [esp + 0x70]
push edx
push eax
push ecx
mov dx, word [ebx + 0x102a2652]
mov eax, dword [esp + 0x88]
and edx, 0xffff
push edx
push eax
mov ecx, dword [ebx + 0x102a2658]
add ecx, ebp
push ecx
call fcn.100013c0
add esp, 0x24
test eax, eax
jne 0x1002bc27
mov dword [esp + 0x10], 1
call esi
mov esi, eax
mov eax, dword [0x1077f6f0]
test eax, eax
je 0x1002bc79
mov eax, dword [esp + 0x70]
mov edx, esi
sub edx, edi
push edx
push eax
mov ecx, dword [ebx + 0x102a2658]
add ecx, ebp
push ecx
mov ecx, dword [0x102a2634]
mov eax, ebp
sub eax, ecx
cdq
xor eax, edx
sub eax, edx
push eax
mov edx, dword [ebx + 0x102a2658]
add edx, ecx
push edx
push str._FATFS___Test___Last_sector:_d___PostCount:_d__sector:_d___count:_d___disk_write_:__d__r_n
push str.diskio
push 0xffffffffffffffff
push 0x1077ee5c
call fcn.1005bc20
add esp, 0x24
mov ecx, dword [0x102a2630]
sub esi, edi
add ecx, esi
mov esi, dword [esp + 0x70]
cmp esi, 1
mov dword [0x102a2630], ecx
je 0x1002bc97
cmp esi, 8
jne 0x1002bcba
mov eax, dword [0x1077f6f0]
test eax, eax
je 0x1002bcba
push ebp
push str._FATFS___Test__CITEuHelperMgr::WriteHiddenArea_1__d_
push str.diskio1
push 0xffffffffffffffff
push 0x1077ee5c
call fcn.1005bc20
add esp, 0x14
lea eax, [esi + ebp]
mov dword [0x102a2634], eax
call fcn.10001258
test eax, eax
je 0x1002bcde
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x64]
push ecx
push ebp
push edx
call fcn.10001672
add esp, 0xc
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x50
ret