Function at 0x699940
Capabilities:
Encrypt data using speck

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
test eax, eax
je 0x699f46
mov eax, edx
shr eax, 0x1f
lea ebx, [eax + edx]
mov eax, ebx
sar eax, 1
mov dword [ebp - 0x64], eax
jne 0x699972
add esp, 0x6c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebp + 8]
mov dword [esp], edx
call fcn.00699440
cmp eax, 2
je 0x699f39
cmp eax, 1
mov eax, dword [ebp + 8]
sbb esi, esi
mov edi, dword [ebp + 8]
and esi, 0xff4c0000
add esi, 0x5a0000
mov dword [ebp - 0x54], esi
movsx esi, word [eax]
mov edi, dword [edi + 4]
test esi, esi
mov dword [ebp - 0x58], edi
jle 0x699968
mov eax, dword [ebp - 0x64]
mov edx, ebx
xor ebx, ebx
sar edx, 0x1f
mov dword [ebp - 0x4c], 0
xor eax, edx
sub eax, edx
mov edx, eax
sar edx, 0x10
shl eax, 0x10
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x70], eax
mov ecx, dword [ebp + 8]
mov edi, dword [ebp - 0x4c]
mov eax, dword [ecx + 0xc]
movsx eax, word [eax + edi*2]
mov dword [ebp - 0x44], eax
lea eax, [ebx*8]
mov ecx, eax
add ecx, dword [ebp - 0x58]
cmp dword [ebp - 0x44], ebx
mov dword [ebp - 0x24], eax
mov edx, dword [ecx + 4]
mov edi, dword [ecx]
mov dword [ebp - 0x38], edx
mov edx, dword [ebp - 0x44]
mov dword [ebp - 0x3c], edi
mov edi, dword [ebp - 0x58]
lea eax, [edi + edx*8]
mov edx, dword [eax + 4]
mov eax, dword [eax]
jl 0x699eff
mov esi, dword [ebp - 0x3c]
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x28], esi
mov esi, ebx
mov dword [ebp - 0x2c], ecx
mov edi, ecx
mov ecx, dword [ebp - 0x3c]
cmp dword [ebp - 0x44], esi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], ecx
jle 0x699a47
mov edi, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x20]
mov edi, dword [edi + 0xc]
mov ecx, dword [ecx + 8]
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], ecx
mov ebx, dword [ebp - 0x28]
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x30]
sub esi, dword [ebp - 0x28]
sub ebx, eax
mov eax, dword [ebp - 0x34]
sub edi, edx
sub eax, dword [ebp - 0x2c]
mov edx, edi
or edx, ebx
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x50], 0
je 0x699b5d
mov eax, edi
mov edx, ebx
sar eax, 0x1f
mov ecx, eax
sar edx, 0x1f
xor ecx, edi
sub ecx, eax
mov eax, edx
xor eax, ebx
sub eax, edx
xor edx, edx
or ecx, eax
cmp ecx, 0xffff
jle 0x699a9b
sar ecx, 0x10
mov dl, 0x10
cmp ecx, 0xff
jle 0x699aa9
sar ecx, 8
add edx, 8
cmp ecx, 0xf
jle 0x699ab4
sar ecx, 4
add edx, 4
cmp ecx, 3
jle 0x699abf
sar ecx, 2
add edx, 2
xor eax, eax
cmp ecx, 2
setge al
add edx, eax
cmp edx, 0x1b
jg 0x699e5c
mov ecx, 0x1b
mov esi, ebx
sub ecx, edx
mov edx, edi
shl esi, cl
xor edi, edi
shl edx, cl
test esi, esi
js 0x699e71
mov eax, edi
neg eax
cmp edx, 1
cmovge edi, eax
test edx, edx
js 0x699e8c
lea eax, [esi + esi]
mov ebx, edx
sub ebx, eax
add edi, 0x3f6f59
lea esi, [esi + edx*2]
xor ecx, ecx
jmp 0x699b2c
mov edx, esi
mov eax, ebx
sar edx, cl
sar eax, cl
sub ebx, edx
add edi, dword [ecx*4 + 0xb09004]
add ecx, 1
add esi, eax
cmp ecx, 0x17
je 0x699b4c
test ebx, ebx
jns 0x699b11
mov edx, esi
mov eax, ebx
sar edx, cl
sar eax, cl
sub edi, dword [ecx*4 + 0xb09004]
add ecx, 1
sub esi, eax
cmp ecx, 0x17
lea ebx, [edx + ebx]
jne 0x699b2c
test edi, edi
js 0x699f28
lea eax, [edi + 0x10]
and eax, 0xffffffe0
mov dword [ebp - 0x50], eax
mov ecx, dword [ebp - 0x5c]
xor eax, eax
or ecx, dword [ebp - 0x60]
je 0x699c59
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x60]
sar eax, 0x1f
xor ecx, eax
sub ecx, eax
mov eax, dword [ebp - 0x60]
sar edx, 0x1f
xor eax, edx
sub eax, edx
xor edx, edx
or ecx, eax
cmp ecx, 0xffff
jle 0x699b96
sar ecx, 0x10
mov dl, 0x10
cmp ecx, 0xff
jle 0x699ba4
sar ecx, 8
add edx, 8
cmp ecx, 0xf
jle 0x699baf
sar ecx, 4
add edx, 4
cmp ecx, 3
jle 0x699bba
sar ecx, 2
add edx, 2
xor eax, eax
cmp ecx, 2
setge al
add edx, eax
cmp edx, 0x1b
jg 0x699dfe
mov ecx, 0x1b
mov esi, dword [ebp - 0x60]
xor edi, edi
sub ecx, edx
mov edx, dword [ebp - 0x5c]
shl esi, cl
shl edx, cl
test esi, esi
js 0x699e15
mov eax, edi
neg eax
cmp edx, 1
cmovge edi, eax
test edx, edx
js 0x699e30
lea eax, [esi + esi]
mov ebx, edx
sub ebx, eax
add edi, 0x3f6f59
lea esi, [esi + edx*2]
xor ecx, ecx
jmp 0x699c2b
mov edx, esi
mov eax, ebx
sar edx, cl
sar eax, cl
sub ebx, edx
add edi, dword [ecx*4 + 0xb09004]
add ecx, 1
add esi, eax
cmp ecx, 0x17
je 0x699c4b
test ebx, ebx
jns 0x699c10
mov edx, esi
mov eax, ebx
sar edx, cl
sar eax, cl
sub edi, dword [ecx*4 + 0xb09004]
add ecx, 1
sub esi, eax
cmp ecx, 0x17
lea ebx, [edx + ebx]
jne 0x699c2b
test edi, edi
js 0x699f17
lea eax, [edi + 0x10]
and eax, 0xffffffe0
mov ebx, eax
mov edx, 0xb60b60b7
sub ebx, dword [ebp - 0x50]
mov edi, 0x4585ba3
mov eax, ebx
mov ecx, ebx
imul edx
mov eax, ebx
sar ecx, 0x1f
add edx, ebx
sar edx, 0x18
sub edx, ecx
imul edx, edx, 0x1680000
sub eax, edx
lea edx, [eax + 0x1680000]
cmp eax, 0xffffffff
cmovle eax, edx
cmp eax, 0xb40001
lea edx, [eax - 0x1680000]
cmovge eax, edx
mov edx, eax
shr edx, 0x1f
add edx, eax
sar edx, 1
cmp edx, 0xffa60000
mov eax, edx
mov dword [ebp - 0x68], edx
jg 0x699cce
add eax, 0xb40000
neg edi
cmp eax, 0xffa60000
jle 0x699cb2
cmp eax, 0x5a0000
jle 0x699cd5
neg edi
sub eax, 0xb40000
cmp eax, 0x5a0000
jg 0x699cc7
test eax, eax
js 0x699e9f
lea ebx, [edi + edi]
lea esi, [eax - 0x3f6f59]
xor ecx, ecx
jmp 0x699d0b
mov edx, ebx
mov eax, edi
sar edx, cl
sar eax, cl
sub edi, edx
sub esi, dword [ecx*4 + 0xb09004]
add ecx, 1
add ebx, eax
cmp ecx, 0x17
je 0x699d2b
test esi, esi
jns 0x699cf0
mov edx, ebx
mov eax, edi
sar edx, cl
sar eax, cl
add esi, dword [ecx*4 + 0xb09004]
add ecx, 1
sub ebx, eax
cmp ecx, 0x17
lea edi, [edx + edi]
jne 0x699d0b
test edi, edi
mov edx, edi
lea eax, [edi + 0xfff]
cmovs edx, eax
mov ecx, edx
sar ecx, 0xc
mov eax, ecx
add eax, 0x3fff
cmp eax, 0x7ffe
mov dword [ebp - 0x6c], ecx
ja 0x699db1
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov edi, dword [ebp + 8]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x14]
add eax, dword [edi + 4]
add edx, dword [ebp - 0x28]
add dword [ebp - 0x48], 1
mov ecx, dword [ebp - 0x48]
mov dword [eax], edx
mov edx, dword [ebp - 0x64]
add edx, dword [ebp - 0x10]
add dword [ebp - 0x24], 8
add edx, dword [ebp - 0x2c]
add dword [ebp - 0x20], 8
cmp dword [ebp - 0x44], ecx
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0x2c]
jl 0x699efc
mov esi, dword [ebp - 0x34]
mov edi, dword [ebp - 0x30]
mov dword [ebp - 0x2c], esi
mov esi, dword [ebp - 0x48]
mov dword [ebp - 0x28], edi
mov edi, dword [ebp - 0x38]
jmp 0x699a27
mov eax, edx
mov ebx, ecx
sar eax, 0x1f
xor ebx, eax
sub ebx, eax
jne 0x699e43
mov esi, 0x7fffffff
mov edx, dword [ebp - 0x6c]
mov eax, esi
neg eax
mov ecx, dword [ebp - 0x54]
xor edx, dword [ebp - 0x64]
mov dword [ebp - 0x10], 0
cmovs esi, eax
sub dword [ebp - 0x50], ecx
mov eax, dword [ebp - 0x50]
add eax, dword [ebp - 0x68]
mov dword [ebp - 0x14], esi
lea esi, [ebp - 0x14]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.00691490
jmp 0x699d5c
mov esi, dword [ebp - 0x60]
lea ecx, [edx - 0x1b]
xor edi, edi
mov edx, dword [ebp - 0x5c]
sar esi, cl
sar edx, cl
test esi, esi
jns 0x699be8
mov edi, 0xb40000
neg edx
mov eax, edi
neg esi
neg eax
cmp edx, 1
cmovge edi, eax
test edx, edx
jns 0x699bfa
lea eax, [edx + edx]
sub edi, 0x3f6f59
lea ebx, [edx + esi*2]
sub esi, eax
jmp 0x699c0a
mov eax, dword [ebp - 0x40]
test eax, eax
jne 0x699eaf
mov eax, ebx
xor edx, edx
sar eax, 1
add eax, dword [ebp - 0x70]
div ebx
mov esi, eax
jmp 0x699dc7
lea ecx, [edx - 0x1b]
mov esi, ebx
mov edx, edi
xor edi, edi
sar esi, cl
sar edx, cl
test esi, esi
jns 0x699aeb
mov edi, 0xb40000
neg edx
mov eax, edi
neg esi
neg eax
cmp edx, 1
cmovge edi, eax
test edx, edx
jns 0x699afd
lea eax, [edx + edx]
sub edi, 0x3f6f59
lea ebx, [edx + esi*2]
sub esi, eax
jmp 0x699b0d
lea ebx, [edi + edi]
neg ebx
lea esi, [eax + 0x3f6f59]
jmp 0x699ce6
mov esi, dword [ebp - 0x70]
mov eax, ebx
sar eax, 1
mov edi, dword [ebp - 0x40]
lea ecx, [eax + esi]
xor eax, eax
cmp esi, ecx
mov esi, 0x7fffffff
seta al
lea edx, [eax + edi]
cmp edx, ebx
jae 0x699dc7
xor esi, esi
mov edi, 0x20
jmp 0x699ede
add ecx, ecx
mov eax, ecx
add edx, edx
shr eax, 0x1f
add esi, esi
or edx, eax
cmp ebx, edx
ja 0x699ef2
sub edx, ebx
or esi, 1
sub edi, 1
jne 0x699edc
jmp 0x699dc7
movsx esi, word [edi]
add dword [ebp - 0x4c], 1
cmp esi, dword [ebp - 0x4c]
jle 0x699968
mov ebx, dword [ebp - 0x44]
add ebx, 1
jmp 0x6999d0
mov eax, 0x10
sub eax, edi
and eax, 0xffffffe0
neg eax
jmp 0x699c59
mov eax, 0x10
sub eax, edi
and eax, 0xffffffe0
neg eax
jmp 0x699b5a
mov ecx, dword [ebp + 8]
cmp word [ecx], 0
je 0x699968
add esp, 0x6c
mov eax, 6
pop ebx
pop esi
pop edi
pop ebp
ret