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

Disassembly:
sub esp, 0x188
push ebx
push ebp
push esi
push edi
xor ebp, ebp
push str.Beginning_AutoCropDocument__
mov esi, ecx
push 8
mov dword [esp + 0x18], ebp
call dword [0x7c8725a0]
mov eax, dword [esi + 0xf8]
mov ecx, dword [esi + 0xf4]
add esp, 8
mov dword [esi + 0x10c], ebp
push eax
push ecx
push str.AutoCropDocument__m_OffsetInBytes__d___m_WidthInBytes__d
push 0xa
call dword [0x7c8725a0]
add esp, 0x10
mov ecx, esi
call fcn.7c858c30
mov di, word [esi + 8]
lea ebx, [esi + 0x90]
add di, 3
push ebx
and edi, 0xfffc
mov dword [esi + 0x12c], ebp
mov dword [esp + 0x4c], edi
mov dword [esi + 0x114], edi
call fcn.7c854160
mov eax, dword [ebx]
add esp, 4
cmp eax, 2
jne 0x7c8510a7
push str.Cannot_Scan__in_autocrop__if_Scan_failed.
push ebp
call dword [0x7c8725a0]
add esp, 8
lea edx, [esp + 0x1c]
mov dword [esp + 0x1c], 0x15
push 0x7c86d980
push edx
call fcn.7c85fe70
lea eax, [esp + 0x6c]
push 5
push eax
push str.EstMmDocTop
push str.AutoCrop
push 5
mov dword [esp + 0x7c], 5
call fcn.7c85b0e0
add esp, 4
push eax
call fcn.7c85b260
mov eax, dword [esi + 0xcc]
mov edx, dword [esi + 0xe8]
mov dword [esp + 0x94], eax
mov dword [esp + 0xa0], edx
lea eax, [eax + eax*4]
mov ecx, dword [esi + 0xd4]
shl eax, 2
cdq
idiv dword [esi + 0xfc]
add esp, 0x14
mov dword [esp + 0x84], ecx
mov ecx, dword [esi + 0xdc]
lea ebx, [esi + 0x60]
mov dword [esp + 0x74], 1
mov dword [esp + 0x78], ebx
mov dword [esp + 0x70], 0x14
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x88], edi
mov dword [esp + 0x90], ecx
mov dword [esp + 0x30], ebp
mov dword [esp + 0x34], ebp
mov dword [esp + 0x38], ebp
mov dword [esp + 0x3c], ebp
lea edx, [eax*8 + 0x10]
push edx
call fcn.7c85fe60
mov dword [esi + 0x64], eax
mov dword [ebx], ebp
add esp, 4
mov dword [0x7c87868c], ebp
mov eax, dword [esi + 0xcc]
mov ecx, esi
push eax
call fcn.7c858eb0
push eax
push str.Just_before_FindDoc__GetFIFOlineCounter___d
push 0xa
call dword [0x7c8725a0]
add esp, 0xc
lea ecx, [esp + 0x30]
lea edx, [esp + 0x7c]
lea eax, [esp + 0x68]
push ecx
push 0x7c851e10
push edx
push eax
push esi
push 1
call fcn.7c85a430
lea ecx, [esp + 0x94]
push str.Buffer_Lengths:
push ecx
mov dword [esp + 0x24], eax
call fcn.7c85fdf0
mov eax, dword [ebx]
add esp, 8
xor edi, edi
cmp eax, ebp
jle 0x7c8511f4
mov edx, dword [esi + 0x64]
lea ecx, [esp + 0x94]
mov eax, dword [edx + edi*4]
mov edx, dword [esp + 0x10]
mov eax, dword [eax]
add edx, eax
push eax
lea eax, [esp + 0x98]
mov dword [esp + 0x14], edx
push eax
push str._s__d
push ecx
call fcn.7c85fdf0
mov eax, dword [ebx]
add esp, 0x10
inc edi
cmp edi, eax
jl 0x7c8511bd
lea edx, [esp + 0x94]
push edx
push str.AutoCrop__s
push 6
call dword [0x7c8725a0]
mov edi, dword [esp + 0x1c]
add esp, 0xc
push edi
push str.AutoCropScan:_scanned__d_lines_before_emptying_fifo.
push 6
call dword [0x7c8725a0]
add esp, 0xc
mov ecx, esi
call fcn.7c859550
cmp eax, 0x5f
jbe 0x7c851239
mov ecx, esi
call fcn.7c859550
cmp eax, 0x5f
ja 0x7c85122d
mov ecx, dword [esi + 0x68]
lea eax, [esp + 0x64]
push eax
push 0x1c
push ecx
mov ecx, esi
call fcn.7c859dd0
mov eax, dword [esi + 0x68]
lea edx, [esp + 0x60]
push edx
push 0x1d
push eax
mov ecx, esi
call fcn.7c859dd0
mov edx, dword [esi + 0x68]
lea ecx, [esp + 0x50]
push ecx
push 0x1e
push edx
mov ecx, esi
call fcn.7c859dd0
mov ebx, 1
mov ecx, esi
push ebx
push ebp
call fcn.7c8594b0
mov ecx, dword [esi + 0x68]
lea eax, [esp + 0x5c]
push eax
push 0x52
push ecx
mov ecx, esi
call fcn.7c859dd0
mov eax, dword [esp + 0x5c]
and eax, 0xff
mov edx, eax
shl edx, 9
push edx
push eax
push str.Motor_Stop:_wrDiff__0x_X__bytes___d
push 0xa
call dword [0x7c8725a0]
mov eax, dword [esp + 0x44]
add esp, 0x10
cmp eax, ebp
je 0x7c8512bd
cmp dword [esp + 0x3c], ebp
jne 0x7c8512d5
mov eax, dword [esi + 0x108]
add eax, 2
imul eax, dword [esi + 0xcc]
mov dword [esp + 0x34], eax
mov dword [esp + 0x3c], eax
cmp dword [esi + 0xd8], ebx
jne 0x7c851309
mov eax, dword [esp + 0x30]
mov dword [esi + 0xd4], ebx
cdq
and edx, 7
add eax, edx
mov ecx, eax
mov eax, dword [esp + 0x38]
cdq
and edx, 7
add eax, edx
sar ecx, 3
sar eax, 3
mov dword [esp + 0x30], ecx
mov dword [esp + 0x38], eax
jmp 0x7c851311
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x40]
push edx
push eax
push ecx
push str.AutoCrop_points:__x1:__d___x2:__d___Confidence:__d
push 6
call dword [0x7c8725a0]
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x48]
add esp, 0x14
push eax
push ecx
push str.AutoCrop_points:__y1:__d___y2:__d
push 6
call dword [0x7c8725a0]
mov eax, dword [esp + 0x2c]
add esp, 0x10
cmp eax, ebp
je 0x7c8513ee
mov ecx, dword [esp + 0x3c]
mov eax, edi
cmp edi, ecx
jl 0x7c85135a
mov eax, ecx
push ecx
push edi
push eax
push str.m_TopCrop:__d__min_lLineXfered:_d__DocPosition.y2_d_
push 6
mov dword [esi + 0x10c], eax
call dword [0x7c8725a0]
mov edi, dword [esi + 0xcc]
mov ebx, dword [esp + 0x44]
add esp, 0x14
cmp edi, 8
jne 0x7c851397
mov eax, 0x2aaaaaab
imul ebx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea ecx, [edx + edx*2]
shl ecx, 1
jmp 0x7c8513a8
mov eax, 0x55555556
imul ebx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea ecx, [edx + edx*2]
mov dword [esi + 0xf4], ecx
mov ecx, dword [esp + 0x38]
sub ecx, ebx
mov eax, 0x55555556
imul ecx
mov eax, edx
mov ecx, dword [esi + 0xd4]
shr eax, 0x1f
add edx, eax
lea eax, [edx + edx*2]
mov dword [esi + 0xf8], eax
shl eax, 3
cdq
idiv ecx
cdq
idiv edi
mov edx, dword [0x7c86c1bc]
cmp eax, edx
jge 0x7c85142c
mov eax, edx
imul eax, ecx
imul eax, edi
jmp 0x7c85141d
mov dword [esi + 0x10c], ebp
mov dword [esi + 0xf4], ebp
mov eax, dword [0x7c86c1c0]
cdq
idiv dword [0x7c86c1c4]
mov ecx, eax
mov eax, dword [0x7c86c1b8]
sub eax, ecx
imul eax, dword [esi + 0xd4]
imul eax, dword [esi + 0xcc]
cdq
and edx, 7
add eax, edx
sar eax, 3
mov dword [esi + 0xf8], eax
mov edx, dword [esi + 0xf8]
mov eax, dword [esi + 0xf4]
push edx
push eax
push str.AutoCrop_sets_width:__m_OffsetInBytes__d__m_WidthInBytes__d
push 0xa
call dword [0x7c8725a0]
add esp, 0x10
mov ebx, 1
mov dword [esp + 0x24], ebp
mov dword [esp + 0x1c], ebp
push 8
call fcn.7c85fe60
add esp, 4
mov dword [esi + 0x28], eax
lea ecx, [esp + 0x54]
mov dword [eax + 4], ebp
mov eax, dword [esi + 0xf8]
lea edx, [esp + 0x58]
push ecx
mov ecx, dword [esi + 0xf4]
push edx
push eax
push ecx
mov ecx, esi
mov dword [esp + 0x68], ebp
mov dword [esp + 0x64], ebp
call fcn.7c858af0
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
lea edx, [esp + 0x24]
push edx
push eax
push ecx
mov ecx, esi
call fcn.7c858a30
mov eax, dword [esp + 0x24]
mov ecx, dword [esi + 0xbc]
cdq
idiv dword [esi + 0xc]
push ecx
mov edi, eax
imul eax, dword [esi + 0xcc]
cdq
idiv ecx
mov dword [esp + 0x50], edi
mov ebp, eax
mov dword [esp + 0x1c], ebp
call fcn.7c85e1a0
add esp, 4
push eax
push edi
push str.AutoCrop_sees__d_Wide_lines_left_in_FIFO_at__s_vertical
push 0xa
call dword [0x7c8725a0]
mov edx, dword [esi + 0xcc]
add esp, 0x10
push edx
call fcn.7c85e1a0
add esp, 4
push eax
push ebp
push str._d_Wide_lines_left_in_FIFO_at__s_vertical
push 0xa
call dword [0x7c8725a0]
mov eax, dword [esi + 0xc]
add esp, 0x10
push eax
push str.WidthHW___d
push 0xa
call dword [0x7c8725a0]
add esp, 0xc
push str.Start_the_motor_again
push 0xa
call dword [0x7c8725a0]
mov ecx, dword [esp + 0x6c]
mov edx, dword [esi + 0x68]
add esp, 8
push ecx
push 0x1c
push edx
mov ecx, esi
call fcn.7c859e20
mov eax, dword [esp + 0x60]
mov ecx, dword [esi + 0x68]
push eax
push 0x1d
push ecx
mov ecx, esi
call fcn.7c859e20
mov edx, dword [esp + 0x50]
mov eax, dword [esi + 0x68]
push edx
push 0x1e
push eax
mov ecx, esi
call fcn.7c859e20
mov edx, dword [esi + 0x68]
lea ecx, [esp + 0x44]
push ecx
push 0x41
push edx
mov ecx, esi
call fcn.7c859dd0
mov dl, byte [esp + 0x44]
mov ecx, dword [esi + 0x68]
or dl, 0x10
mov byte [esp + 0x44], dl
mov eax, dword [esp + 0x44]
push eax
push 0x41
push ecx
mov ecx, esi
call fcn.7c859e20
mov eax, dword [esi + 0xd4]
xor ecx, ecx
cmp eax, 0x18
mov ebp, ebx
mov dword [esp + 0x20], ecx
jne 0x7c8515e2
cmp dword [esi + 0xc8], 8
jne 0x7c8515d8
mov edx, dword [esi + 0xc]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, dword [esi + 0xc]
mov dword [esp + 0x2c], edx
lea edx, [eax + eax]
mov eax, 0x55555556
imul edx
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [esp + 0x28], edx
jmp 0x7c8515ed
mov eax, dword [esi + 0xc]
cdq
sub eax, edx
sar eax, 1
jmp 0x7c8515e5
mov eax, dword [esi + 0xc]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x28], eax
cmp dword [esi + 0xd4], 0x18
jne 0x7c851663
mov edx, dword [esp + 0x24]
test ebp, ebp
je 0x7c851608
mov eax, dword [esp + 0x2c]
add ecx, eax
xor ebp, ebp
jmp 0x7c851613
mov eax, dword [esp + 0x28]
mov ebp, 1
add ecx, eax
lea eax, [ecx - 0x240]
cmp edx, eax
jle 0x7c851627
lea eax, [ecx + 0x240]
cmp edx, eax
jl 0x7c851631
cmp ecx, 0x18000
jl 0x7c8515fa
jmp 0x7c851663
test ebp, ebp
je 0x7c851643
mov eax, dword [esp + 0x28]
mov dword [esp + 0x20], 0
jmp 0x7c85164f
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x20], 1
sub edx, ecx
push edx
push eax
push str.nLastLine__d__nBytesInFifo_nCount__d
push 0xa
call dword [0x7c8725a0]
add esp, 0x10
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x7c851715
mov ecx, dword [esi + 0x28]
mov edx, edi
mov dword [ecx + 4], 0
imul edx, dword [esi + 0xc]
mov eax, dword [esp + 0x24]
add edx, 0x240
cmp eax, edx
jle 0x7c851694
inc edi
mov dword [esp + 0x4c], edi
jmp 0x7c8516a4
push str.nBytesInFifo_is_not____lNLinesInFIFOm_GetData.widthHwInByte__FIFO_ERR_
push 0xa
call dword [0x7c8725a0]
add esp, 8
mov eax, edi
mov ecx, dword [esi + 0xbc]
imul eax, dword [esi + 0xcc]
cdq
idiv ecx
push ecx
mov ebp, eax
mov dword [esp + 0x1c], ebp
call fcn.7c85e1a0
add esp, 4
push eax
push edi
push str.AutoCrop_sees__d_Wide_lines_left_in_FIFO_at__s_vertical
push 0xa
call dword [0x7c8725a0]
mov eax, dword [esi + 0xcc]
add esp, 0x10
push eax
call fcn.7c85e1a0
add esp, 4
push eax
push ebp
push str._d_Wide_lines_left_in_FIFO_at__s_vertical
push 0xa
call dword [0x7c8725a0]
imul edi, dword [esi + 0xc]
mov ecx, dword [esp + 0x34]
add esp, 0x10
sub ecx, edi
push ecx
push str.nBytesInFifo___lNLinesInFIFOm_GetData.widthHwInByte___d
push 0xa
call dword [0x7c8725a0]
add esp, 0xc
jmp 0x7c85172d
push str.Gonna_do_the_funky_line
push 0xa
mov dword [esp + 0x24], 1
call dword [0x7c8725a0]
add esp, 8
mov edx, dword [esi + 0x28]
xor ebp, ebp
lea eax, [esp + 0x14]
push str.Scan_the_remaining_lines_in_the_FIFO
mov dword [esp + 0x18], ebp
push 0xa
mov dword [edx], eax
call dword [0x7c8725a0]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x58]
add esp, 8
test eax, eax
jle 0x7c85183c
test ebx, ebx
je 0x7c85179e
push 8
call fcn.7c85fe60
mov ecx, dword [esp + 0x1c]
add esp, 4
imul ecx, dword [esp + 0x48]
push ecx
mov edi, eax
call fcn.7c85fe60
add esp, 4
mov dword [edi + 4], eax
test eax, eax
jne 0x7c8517be
lea edx, [esp + 0x20]
push 0x7c86d980
push edx
mov dword [esp + 0x28], 0x16
call fcn.7c85fe70
jmp 0x7c8517be
mov eax, dword [esi + 0xcc]
push eax
call fcn.7c85e1a0
add esp, 4
push eax
push str._s_no_lines_xfered_in_emptying_wide_lines_from_fifo
push 0xa
call dword [0x7c8725a0]
add esp, 0xc
mov ecx, dword [esp + 0x18]
mov dword [edi], ecx
mov edx, dword [esi + 0xcc]
push edx
push edi
mov ecx, esi
call fcn.7c858860
mov edx, dword [esp + 0x18]
mov ebx, eax
mov eax, dword [esp + 0x10]
sub edx, ebx
add eax, ebx
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0xbc]
push eax
call fcn.7c85e1a0
mov ecx, dword [esp + 0x18]
add esp, 4
push eax
push ecx
push str.Scanned__d_lines___s_vertical
push 0xa
call dword [0x7c8725a0]
mov ecx, dword [esp + 0x24]
add esp, 0x10
add ebp, ecx
mov dword [esp + 0x14], 0
test ebx, ebx
je 0x7c851830
mov edx, dword [esi + 0x60]
mov eax, dword [esi + 0x64]
mov dword [eax + edx*4], edi
mov eax, dword [esi + 0x60]
inc eax
mov dword [esi + 0x60], eax
mov eax, dword [esp + 0x18]
test eax, eax
jg 0x7c85175c
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x14], 0
cmp ebp, eax
jge 0x7c851924
test ebx, ebx
je 0x7c851892
push 8
call fcn.7c85fe60
mov ecx, dword [esp + 0x1c]
add esp, 4
imul ecx, dword [esp + 0x48]
push ecx
mov edi, eax
call fcn.7c85fe60
add esp, 4
mov dword [edi + 4], eax
test eax, eax
jne 0x7c8518b2
lea edx, [esp + 0x20]
push 0x7c86d980
push edx
mov dword [esp + 0x28], 0x16
call fcn.7c85fe70
jmp 0x7c8518b2
mov eax, dword [esi + 0xcc]
push eax
call fcn.7c85e1a0
add esp, 4
push eax
push str._s__no_lines_xfered__normal_here_
push 0xa
call dword [0x7c8725a0]
add esp, 0xc
mov dword [edi], 1
mov ecx, dword [esi + 0xcc]
push ecx
push edi
mov ecx, esi
call fcn.7c858860
mov ecx, dword [esp + 0x10]
mov edx, dword [esi + 0xbc]
mov ebx, eax
push edx
add ecx, ebx
mov dword [esp + 0x14], ecx
call fcn.7c85e1a0
add esp, 4
push eax
mov eax, dword [esp + 0x18]
push eax
push str.Scanned__d_lines___s_vertical___2_
push 0xa
call dword [0x7c8725a0]
mov ecx, dword [esp + 0x24]
add esp, 0x10
add ebp, ecx
mov dword [esp + 0x14], 0
test ebx, ebx
je 0x7c85191a
mov ecx, dword [esi + 0x60]
mov edx, dword [esi + 0x64]
mov dword [edx + ecx*4], edi
mov eax, dword [esi + 0x60]
inc eax
mov dword [esi + 0x60], eax
cmp ebp, dword [esp + 0x4c]
jl 0x7c851850
mov edi, dword [esi + 0xc]
mov ecx, esi
call fcn.7c858c30
mov eax, dword [esp + 0x1c]
mov ebp, dword [esi + 0xc]
test eax, eax
je 0x7c851a77
mov eax, dword [esi + 0x28]
mov dword [eax + 4], 1
mov ecx, dword [esi + 0xc8]
cmp ecx, 7
jne 0x7c851968
lea eax, [ebp + 1]
cdq
sub eax, edx
mov ebx, eax
mov eax, edi
cdq
sub eax, edx
sar ebx, 1
sar eax, 1
add ebx, eax
mov dword [esi + 0xc], ebx
cmp ecx, 8
jne 0x7c851992
mov eax, 0x55555556
imul edi
mov ecx, edx
mov eax, 0x55555556
shr edx, 0x1f
add ecx, edx
lea edx, [ebp + ebp + 2]
imul edx
mov eax, edx
add edx, ecx
shr eax, 0x1f
add eax, edx
mov dword [esi + 0xc], eax
mov ecx, dword [esi + 0xc]
push ecx
push str.Now_we_grab_the_Ry_line.__Width___d
push 0xa
call dword [0x7c8725a0]
add esp, 0xc
push edi
push ebp
push str.nNewHwWidthInByte___d_______nOldHwWidthInByte___d
push 0xa
call dword [0x7c8725a0]
mov edx, dword [esi + 0xf0]
mov eax, dword [esi + 0xec]
add esp, 0x10
push edx
push eax
push str.Offset_CIS___d___Width_CIS___d
push 0xa
call dword [0x7c8725a0]
add esp, 0x10
push 8
call fcn.7c85fe60
mov edi, dword [esp + 0x4c]
add esp, 4
mov ebx, eax
push edi
mov dword [ebx], 1
call fcn.7c85fe60
add esp, 4
mov dword [ebx + 4], eax
test eax, eax
jne 0x7c851a13
lea ecx, [esp + 0x1c]
push 0x7c86d980
push ecx
mov dword [esp + 0x24], 0x16
call fcn.7c85fe70
mov ecx, edi
mov edi, dword [ebx + 4]
mov edx, ecx
mov eax, 0x7f7f7f7f
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esi + 0xcc]
mov ecx, esi
push eax
push ebx
call fcn.7c858860
mov edx, dword [esp + 0x10]
add edx, eax
test eax, eax
mov dword [esp + 0x10], edx
je 0x7c851a5a
mov ecx, dword [esi + 0x60]
mov edx, dword [esi + 0x64]
mov dword [edx + ecx*4], ebx
mov eax, dword [esi + 0x60]
inc eax
mov dword [esi + 0x60], eax
jmp 0x7c851a6a
push str.Wide_R_B_line_did_not_produce_a_line
push 0xa
call dword [0x7c8725a0]
add esp, 8
mov eax, dword [esi + 0x28]
mov dword [eax + 4], 0
mov dword [esi + 0xc], ebp
mov eax, dword [esi + 0x28]
test eax, eax
je 0x7c851a8e
push eax
call fcn.7c85fde0
add esp, 4
mov dword [esi + 0x28], 0
mov ecx, dword [esp + 0x10]
push ecx
push str.AutoCropScan:_scanned__d_lines_after_emptying_fifo.
push 6
call dword [0x7c8725a0]
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x188
ret 8