Function at 0x40e650
Capabilities:
Reference sql statements

Disassembly:
push 0xffffffffffffffff
push 0x49daeb
mov eax, dword fs:[0]
push eax
mov eax, 0x3878
mov dword fs:[0], esp
call fcn.0047f090
mov eax, dword [0x4d2084]
xor eax, esp
push ebx
push ebp
mov ebp, dword [esp + 0x3898]
push esi
mov esi, dword [esp + 0x38a0]
mov dword [esp + 0x14], ecx
mov ecx, ebp
mov dword [esp + 0x3880], eax
mov dword [esp + 0x18], esi
call fcn.00403d00
mov ecx, esi
call fcn.00403d00
mov esi, dword [esp + 0x3894]
push esi
mov ecx, 0x4d8ac8
call fcn.0042b870
xor ebx, ebx
cmp eax, ebx
mov dword [esp + 0x1c], eax
je 0x40e8e8
push esi
lea eax, [esp + 0x84]
push str.SELECT_idx__level__type__attribute__UNIX_TIMESTAMP_addTime___UNIX_TIMESTAMP_limitTime___msg_FROM_T_gift_WHERE_charID_d_ORDER_BY_idx_DESC
push eax
mov dword [esp + 0x80], ebx
mov dword [esp + 0x84], ebx
mov dword [esp + 0x88], ebx
mov byte [esp + 0x8c], bl
call fcn.0047f034
add esp, 0xc
push 1
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x88]
push edx
mov ecx, 0x4d8c60
call fcn.00404b50
test al, al
jne 0x40e72b
mov eax, dword [0x52f0ec]
push str._CGiftMgr::GetGifts__Can_NOT_access_Gift_DB__n
push eax
call fcn.0048dda0
add esp, 8
jmp 0x40e8e8
mov ecx, dword [esp + 0xc]
push ecx
call sub.LIBMYSQL.dll_mysql_num_rows
cmp eax, ebx
jle 0x40e8de
mov dword [esp + 0x10], eax
push edi
mov edx, dword [esp + 0x10]
push edx
call sub.LIBMYSQL.dll_mysql_fetch_row
mov esi, eax
mov eax, dword [esi]
push eax
call fcn.0047f135
mov ecx, dword [esp + 0x24]
add esp, 4
mov edi, eax
push edi
push ecx
mov ecx, dword [esp + 0x20]
call fcn.0040dd70
test al, al
jne 0x40e8d3
lea ecx, [esp + 0x24]
call fcn.0040e000
mov eax, dword [esi + 4]
mov edx, dword [esp + 0x3898]
push eax
mov dword [esp + 0x3894], ebx
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edx
call fcn.0047f135
mov ecx, dword [esi + 8]
push ecx
mov dword [esp + 0x34], eax
call fcn.0047f135
mov ecx, dword [esi + 0xc]
add esp, 8
cmp ecx, ebx
mov dword [esp + 0x30], eax
je 0x40e7d4
mov eax, ecx
lea edi, [eax + 1]
lea ebx, [ebx]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x40e7c0
sub eax, edi
push eax
push ecx
lea ecx, [esp + 0x3c]
call fcn.004018c0
mov edx, dword [esi + 0x10]
push edx
call fcn.0047f1bd
mov dword [esp + 0x54], eax
mov eax, dword [esi + 0x14]
push eax
call fcn.0047f1bd
mov esi, dword [esi + 0x18]
add esp, 8
cmp esi, ebx
mov dword [esp + 0x54], eax
je 0x40e814
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40e800
sub eax, edx
push eax
push esi
lea ecx, [esp + 0x60]
call fcn.004018c0
mov ecx, dword [esp + 0x389c]
cmp dword [esp + 0x2c], ecx
jg 0x40e84c
mov eax, dword [ebp + 4]
cmp eax, ebx
je 0x40e843
mov ecx, dword [ebp + 8]
sub ecx, eax
mov eax, 0x66666667
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 1
jae 0x40e87e
lea edx, [esp + 0x24]
push edx
mov ecx, ebp
jmp 0x40e879
mov esi, dword [esp + 0x1c]
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x40e872
mov ecx, dword [esi + 8]
sub ecx, eax
mov eax, 0x66666667
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 1
jae 0x40e87e
lea eax, [esp + 0x24]
push eax
mov ecx, esi
call fcn.0040e5c0
mov eax, dword [esp + 0x70]
mov edi, 0x10
cmp eax, edi
mov dword [esp + 0x3890], 0xffffffff
jb 0x40e8a3
mov ecx, dword [esp + 0x5c]
push ecx
call fcn.0047e60d
add esp, 4
cmp dword [esp + 0x4c], edi
mov esi, 0xf
mov dword [esp + 0x70], esi
mov dword [esp + 0x6c], ebx
mov byte [esp + 0x5c], bl
jb 0x40e8c7
mov edx, dword [esp + 0x38]
push edx
call fcn.0047e60d
add esp, 4
mov dword [esp + 0x4c], esi
mov dword [esp + 0x48], ebx
mov byte [esp + 0x38], bl
dec dword [esp + 0x14]
jne 0x40e742
pop edi
mov eax, dword [esp + 0xc]
push eax
call sub.LIBMYSQL.dll_mysql_free_result
mov ecx, dword [esp + 0x3884]
pop esi
pop ebp
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x3878]
pop ebx
xor ecx, esp
call fcn.0047ece2
add esp, 0x3884
ret 0x10