Function at 0x4b1fdd
Capabilities:
Reference sql statements

Disassembly:
push ebp
lea ebp, [esp - 0x570]
sub esp, 0x5f0
mov eax, dword [0x6294a0]
xor eax, ebp
mov dword [ebp + 0x56c], eax
mov eax, dword [ebp + 0x578]
mov ecx, dword [ebp + 0x580]
push ebx
mov ebx, dword [ebp + 0x57c]
push esi
xor esi, esi
cmp eax, esi
push edi
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x24], esi
je 0x4b275e
cmp ebx, esi
je 0x4b275e
push dword [ebx + 0x14]
call fcn.004028ba
xor eax, eax
mov word [ebp - 0x70], si
lea edi, [ebp - 0x6e]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [esp], 0x3ff
lea eax, [ebp - 0x13]
push esi
push eax
mov byte [ebp - 0x14], 0
call fcn.00508d00
push 0x7f
lea eax, [ebp + 0x4ed]
push esi
push eax
mov byte [ebp + 0x4ec], 0
call fcn.00508d00
push 0xff
lea eax, [ebp + 0x3ed]
push esi
push eax
mov byte [ebp + 0x3ec], 0
call fcn.00508d00
xor edi, edi
push esi
inc edi
push edi
mov dword [ebp - 0x2c], esi
call fcn.004af2c7
push edi
call fcn.004af3f4
add esp, 0x30
cmp dword [ebx + 0x2f94], esi
jne 0x4b20ac
push dword [ebx + 0x14]
call fcn.00402860
pop ecx
mov dword [ebx + 0x14], esi
push esi
push esi
call fcn.004b0fbe
test eax, eax
pop ecx
pop ecx
push dword [ebx + 0x14]
je 0x4b20db
call fcn.004028ba
test eax, eax
pop ecx
je 0x4b275e
push dword [ebx + 0x14]
call fcn.0040141f
pop ecx
mov dword [ebx + 0x14], esi
jmp 0x4b275e
call fcn.004028ba
test eax, eax
pop ecx
jne 0x4b20f8
push esi
call fcn.00402527
pop ecx
mov dword [ebx + 0x14], eax
mov dword [ebx + 0x2f94], edi
mov dword [ebp - 0x2c], edi
mov eax, dword [ebx + 0x14]
cmp eax, esi
jne 0x4b210f
push str.:5:Need_to_handle_TAMS_II_SA7_login_failure_
call fcn.004020c2
pop ecx
jmp 0x4b275e
push eax
call fcn.00402928
mov dword [esp], 0xc04
lea eax, [ebp - 0x70]
push str..ServerPAULA.c
push eax
call fcn.0040169a
push ecx
lea esi, [ebp - 0x70]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00401e65
mov dword [ebp - 0x1c], eax
mov byte [ebp - 0x19], 1
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
shr eax, 0x10
add esp, 0x10
inc al
cmp al, 0xc
mov byte [ebp - 0x16], al
jbe 0x4b215d
inc word [ebp - 0x18]
mov byte [ebp - 0x16], 1
push 0x2c
mov edi, str.SALES_YEAR_MONTH_ACCOUNTING_DAY_GROSS_CASH_SALES_GROSS_CHARGE_SALES_NET_SALES_RETURNS_RETURNS_COST_MISCELLANEOUS_ADJUSTMENTS_INVOICE_COUNT_VOID_AMOUNT_VOID_COUNT_RECEIVED_ON_ACCOUNT_ROA_DISCOUNT_TAKEN_JOURNAL_ENTRIES_SALES_COST_FREIGHT_CHARGES
push edi
call fcn.00402bdf
push dword [ebx + 0x14]
inc eax
mov dword [ebp - 0x50], eax
call fcn.004026c1
and dword [ebp - 0x28], 0
add esp, 0xc
cmp dword [0x6293e8], 0
mov dword [ebp - 0x20], eax
je 0x4b21c1
push dword [ebp - 0x20]
movzx ecx, byte [ebp - 0x15]
mov eax, dword [0x6293e8]
push ecx
movzx ecx, byte [ebp - 0x16]
inc dword [0x6293e8]
push ecx
movzx ecx, word [ebp - 0x18]
push ecx
movzx ecx, byte [ebp - 0x1a]
push 1
push ecx
movzx ecx, word [ebp - 0x1c]
push ecx
push edi
push eax
push str.SA7_DBG__d:_SET_ROWCOUNT_1_SELECT__s_FROM_STORE_DAILY_SALES_WHERE__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_ORDER_BY_SALES_YEAR_MONTH_DESC__ACCOUNTING_DAY_DESC
call fcn.00401375
add esp, 0x28
push dword [ebp - 0x20]
movzx esi, byte [ebp - 0x15]
movzx eax, byte [ebp - 0x16]
movzx ecx, word [ebp - 0x18]
movzx edx, word [ebp - 0x1c]
push esi
push eax
movzx eax, byte [ebp - 0x1a]
push ecx
push 1
push eax
push edx
push edi
push str.SET_ROWCOUNT_1_SELECT__s_FROM_STORE_DAILY_SALES_WHERE__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_ORDER_BY_SALES_YEAR_MONTH_DESC__ACCOUNTING_DAY_DESC
push dword [ebx + 0x14]
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x40], edx
call fcn.0040245f
add esp, 0x28
test eax, eax
je 0x4b2585
push dword [ebp - 0x50]
lea eax, [ebp - 0x14]
push 9
push 0x3ff
push eax
push dword [ebx + 0x14]
call fcn.00401ce4
add esp, 0x14
test eax, eax
je 0x4b224b
mov edi, ebx
lea eax, [ebp - 0x14]
call fcn.004aca6c
test eax, eax
mov dword [ebp - 0x18], eax
jne 0x4b2259
lea eax, [ebp - 0x14]
push eax
push str.:5:RefreshSales___EAP:_Sales_line___s__is_invalid.
lea eax, [ebp + 0x3ec]
push pe_nt_image_headers32
push eax
call fcn.00402dbf
add esp, 0x10
jmp 0x4b2259
mov eax, ebx
call fcn.004aca3f
mov dword [ebp - 0x18], 1
cmp dword [0x6293e8], 0
je 0x4b227f
mov eax, dword [0x6293e8]
inc dword [0x6293e8]
lea ecx, [ebp - 0x14]
push ecx
push eax
push str.SA7_DBG__d:__s
call fcn.00401375
add esp, 0xc
cmp dword [ebp - 0x18], 0
jle 0x4b246e
push 0x2c
mov edi, str.EOD_STARTED_DATE_NEW_DAY_STARTED_DATE_SALES_YEAR_MONTH_ACCT_DAY_STARTED_BY_IP_ADDRESS_STARTED_BY_EMPLOYEE_ID
push edi
call fcn.00402bdf
mov esi, eax
pop ecx
inc esi
cmp dword [0x6293e8], 0
pop ecx
je 0x4b22c1
push dword [ebp - 0x20]
mov eax, dword [0x6293e8]
inc dword [0x6293e8]
push edi
push eax
push str.SA7_DBG__d:_SET_ROWCOUNT_1_SELECT__s_FROM_END_OF_DAY_MONITOR_WHERE_LOC_d_AND_EOD_STARTED_DATE_SELECT_MAX_EOD_STARTED_DATE__FROM_END_OF_DAY_MONITOR_
call fcn.00401375
add esp, 0x10
push dword [ebp - 0x20]
push edi
push str.SET_ROWCOUNT_1_SELECT__s_FROM_END_OF_DAY_MONITOR_WHERE_LOC_d_AND_EOD_STARTED_DATE_SELECT_MAX_EOD_STARTED_DATE__FROM_END_OF_DAY_MONITOR_
push dword [ebx + 0x14]
call fcn.0040245f
add esp, 0x10
test eax, eax
je 0x4b2560
xor eax, eax
xor ecx, ecx
mov word [ebp - 0x3c], cx
lea edi, [ebp - 0x3a]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x60], cx
lea edi, [ebp - 0x5e]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push esi
push 9
stosw word es:[edi], ax
push 0x3ff
lea eax, [ebp - 0x14]
push eax
push dword [ebx + 0x14]
mov dword [ebp - 0x20], ecx
call fcn.00401ce4
add esp, 0x14
test eax, eax
je 0x4b23e9
and dword [ebp - 0x1c], 0
push 0x80
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp + 0x4ec]
push eax
call fcn.00402abd
add esp, 0xc
cmp dword [0x6293e8], 0
je 0x4b235f
mov eax, dword [0x6293e8]
inc dword [0x6293e8]
lea ecx, [ebp - 0x14]
push ecx
push eax
push str.SA7_DBG__d:__s
call fcn.00401375
add esp, 0xc
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x14]
push 0x58af30
push eax
call fcn.0040297d
push eax
lea eax, [ebp - 0x80]
push eax
call fcn.00401640
mov esi, eax
lea edi, [ebp - 0x3c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x1c]
push eax
movsd dword es:[edi], dword [esi]
push 0x58af30
push 0
movsd dword es:[edi], dword [esi]
call fcn.0040297d
push eax
lea eax, [ebp - 0x80]
push eax
call fcn.00401640
mov esi, eax
lea edi, [ebp - 0x60]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x1c]
push eax
mov esi, 0x58af30
push esi
xor edi, edi
push edi
call fcn.0040297d
lea eax, [ebp - 0x1c]
push eax
push esi
push edi
call fcn.0040297d
add esp, 0x40
push eax
call fcn.00402e4b
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x1c]
push eax
push esi
push edi
call fcn.0040297d
lea eax, [ebp - 0x1c]
push eax
push esi
push edi
call fcn.0040297d
add esp, 0x1c
push 0
sub esp, 0x10
lea esi, [ebp - 0x3c]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004028a1
add esp, 0x14
test eax, eax
jne 0x4b24a9
push eax
sub esp, 0x10
lea esi, [ebp - 0x60]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.004028a1
add esp, 0x14
test eax, eax
jne 0x4b24a9
lea eax, [ebp + 0x4ec]
push eax
sub esp, 0x10
lea esi, [ebp - 0x60]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00402edc
add esp, 0x10
push eax
sub esp, 0x10
lea esi, [ebp - 0x3c]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00402edc
add esp, 0x10
push eax
push str.:7:RefreshSales___EAP:_Sales_CANNOT_be_posted:_stEODTime___s__stNewDayTime___s:__s
lea eax, [ebp + 0x3ec]
push pe_nt_image_headers32
push eax
call fcn.00402dbf
add esp, 0x18
cmp dword [ebp - 0x2c], 0
jne 0x4b2743
push dword [ebx + 0x14]
call fcn.0040141f
and dword [ebx + 0x14], 0
lea eax, [ebp + 0x4ec]
push eax
push str.:5:RefreshSales___EOP:_The_recycled_connection_failed._Trying_again_with_new_connection...___s
call fcn.004020c2
push dword [ebp - 0x48]
push ebx
push dword [ebp - 0x44]
call fcn.004b1fdd
add esp, 0x18
jmp 0x4b2760
mov eax, dword [ebp - 0x18]
push 0xc7d
mov dword [ebp - 0x28], eax
lea eax, [ebx + 0x4c]
push str..ServerPAULA.c
push eax
call fcn.0040169a
movzx eax, word [ebp - 0x38]
lea edi, [ebx + 0x5c]
lea esi, [ebp - 0x3c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
shl eax, 4
lea edi, [eax + ebx + 0x2f9c]
lea esi, [ebp - 0x3c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
push ecx
lea esi, [ebp - 0x60]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00401ccb
add esp, 0x10
test eax, eax
jne 0x4b2557
sub esp, 0x10
mov edi, esp
lea esi, [ebp - 0x3c]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
sub esp, 0x10
lea esi, [ebp - 0x60]
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00401861
add esp, 0x20
test eax, eax
jne 0x4b2557
and dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x18]
jg 0x4b2539
cmp eax, 1
jne 0x4b25bb
cmp dword [ebp - 0x18], 0x14
jle 0x4b25bb
push str.Yesterday_sales_catch_test.
lea eax, [ebp + 0x3ec]
push pe_nt_image_headers32
push eax
call fcn.00402dbf
add esp, 0xc
jmp 0x4b246e
mov dword [ebp - 0x24], 1
jmp 0x4b25bb
lea eax, [ebp + 0x4ec]
push eax
push dword [ebp - 0x20]
lea eax, [ebp + 0x3ec]
push str.:7:RefreshSales___EAP:_ExecuteODBCFormat_LOC_d__FAILED:_EOD_cannot_be_determined:__s
push pe_nt_image_headers32
push eax
call fcn.00402dbf
add esp, 0x14
jmp 0x4b25bb
lea eax, [ebp + 0x4ec]
push eax
push dword [ebp - 0x20]
movzx eax, byte [ebp - 0x16]
push esi
push eax
push dword [ebp - 0x4c]
movzx eax, byte [ebp - 0x1a]
push 1
push eax
push dword [ebp - 0x40]
lea eax, [ebp + 0x3ec]
push str.:7:RefreshSales___EAP:_OUTER_ExecuteODBCFormat__SALES_YEAR_MONTH_04d__02d__02d_OR_SALES_YEAR_MONTH_04d__02d__02d__AND_LOC_d_FAILED:__s
push pe_nt_image_headers32
push eax
call fcn.00402dbf
add esp, 0x2c
cmp dword [ebp - 0x28], 0
jle 0x4b246e
xor esi, esi
inc esi
xor edi, edi
cmp dword [ebp - 0x24], edi
mov dword [ebx + 0x2f90], esi
je 0x4b2672
cmp dword [ebx + 0x2f98], edi
jne 0x4b2739
cmp dword [ebx + 0x44], edi
je 0x4b264d
cmp dword [ebx + 0x38], edi
je 0x4b264d
mov ecx, ebx
call fcn.004ae482
cmp dword [0x754594], edi
jne 0x4b2639
mov eax, ebx
call fcn.004aca3f
mov ecx, ebx
call fcn.004ae482
test eax, eax
jne 0x4b2623
lea eax, [ebp + 0x4ec]
push eax
push str.:8:RefreshSales___Critical_Exception_:_PostSales___says_EOD_has_NOT_been_encountered__This_will_result_in_EOD_never_being_posted___s
call fcn.004020c2
pop ecx
pop ecx
push str.:0:FYI:_End_Of_Day_process_has_begun.__TAMS_II_
mov dword [ebx + 0x2f98], esi
call fcn.00401375
pop ecx
jmp 0x4b2739
lea eax, [ebp + 0x4ec]
push eax
push str.:5:RefreshSales___EAP:_End_of_Day_process_has_begun__but_the_initial_PostSalesResult___FAILED:_EOD_cannot_be_posted._Another_attempt_will_be_made:__s
call fcn.004020c2
pop ecx
jmp 0x4b2633
lea eax, [ebp + 0x4ec]
push eax
push str.:2:RefreshSales___EAP:_EOD_has_been_detected_from_zero_sales.__This_may_happen_when_the_server_is_started_after_EOD.__EOD_has_been_ignored:__s
call fcn.00401375
pop ecx
pop ecx
mov eax, ebx
call fcn.004aca3f
mov dword [ebx + 0x2f98], esi
jmp 0x4b2739
mov ecx, ebx
mov dword [ebx + 0x2f98], edi
call fcn.004ae482
test eax, eax
je 0x4b2739
lea eax, [ebp + 0x4ec]
push eax
push dword [ebx + 0x38]
call fcn.004032a6
pop ecx
push eax
push str.:9:RefreshSales___Critical_Exception_:_PostSales___says_EOD_has_been_encountered__This_should_never_happen._NetSales___s:__s
call fcn.004020c2
movzx eax, word [0x754494]
add esp, 0xc
push dword [0x754498]
push eax
movzx eax, word [0x751484]
push eax
push dword [0x74e474]
movzx eax, word [0x74e4ca]
push eax
movzx eax, word [0x7514da]
push eax
push dword [0x74e4c0]
push dword [0x7514d0]
push dword [0x74e4bc]
push dword [0x7514cc]
push dword [0x74e4b0]
call fcn.004032a6
pop ecx
push eax
push dword [0x7514c0]
call fcn.004032a6
pop ecx
push eax
push dword [0x751408]
mov esi, 0x74e464
push dword [0x754418]
push edi
sub esp, 0x10
mov edi, esp
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
call fcn.00402108
add esp, 0x14
push eax
push str.:9:RefreshSales___DEBUG:_SnapShot_at__s:_bIsTAMSii_d__d__tNetSales_s__s__iNumInvoices_d__d__iNumVoids_d__d__wDay_d__d:_STATICS:_dwTimeLastParse_d__wLastDayParsed_d__wLastDayEOD_d__iNumTimesInitTried_d
call fcn.004020c2
xor esi, esi
add esp, 0x40
xor edi, edi
inc esi
mov dword [0x6293e8], edi
mov eax, esi
jmp 0x4b2760
lea eax, [ebp + 0x4ec]
push eax
lea eax, [ebp + 0x3ec]
push eax
push str.:5:FYI:_TAMSii_SA7_FAILED:__s:__s
call fcn.004020c2
add esp, 0xc
xor eax, eax
mov ecx, dword [ebp + 0x56c]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00508cf0
add ebp, 0x570
leave
ret