Function at 0x6707d720
Capabilities:
Encrypt data using speck

Disassembly:
sub esp, 0x10
cmp dword [esp + 0x18], 0
je 0x6707d968
push ebx
mov ebx, dword [esp + 0x18]
movzx edx, word [ebx]
push ebp
push esi
lea eax, [esp + 0xc]
push eax
lea ecx, [esp + 0x1c]
push ecx
push edx
call fcn.67083180
mov ecx, dword [esp + 0x18]
add esp, 0xc
cmp ecx, 0x1e
jne 0x6707d785
mov ecx, 0x1f
mov dword [esp + 0xc], ecx
mov al, 1
mov dl, byte [edi]
and al, 1
or al, 2
add al, al
add al, al
and dl, 0xfb
or al, dl
mov byte [edi], al
mov eax, dword [esp + 0x24]
mov esi, 1
mov ebp, ecx
cmp eax, esi
jbe 0x6707d960
jmp 0x6707d797
cmp ecx, 0x1c
je 0x6707d75d
cmp ecx, 0x1f
je 0x6707d75d
xor al, al
jmp 0x6707d75f
mov ebx, dword [esp + 0x20]
movzx eax, byte [esi + edi]
and al, 0xfb
or al, 8
lea ecx, [esp + 0x10]
mov byte [esi + edi], al
movzx eax, word [ebx + esi*2]
push ecx
lea edx, [esp + 0x18]
push edx
push eax
call fcn.67083180
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
lea ecx, [eax + eax*4]
movzx eax, byte [edx + ecx*2 + 0x6719cc58]
mov edx, dword [esp + 0x1c]
add al, al
add al, al
add al, al
xor al, byte [esi + edi]
add esp, 0xc
and al, 8
xor byte [esi + edi], al
cmp edx, 0x1b
jne 0x6707d86e
movzx ecx, word [ebx + esi*2]
mov eax, ecx
and eax, 0xfc00
mov edx, 0xd800
cmp ax, dx
jne 0x6707d820
mov edx, dword [esp + 0x24]
dec edx
cmp esi, edx
jae 0x6707d820
mov dx, word [ebx + esi*2 + 2]
mov ebx, 0xfc00
and dx, bx
mov ebx, 0xdc00
cmp dx, bx
je 0x6707d951
mov edx, 0xdc00
cmp ax, dx
jne 0x6707d889
mov eax, dword [esp + 0x20]
movzx eax, word [eax + esi*2 - 2]
mov edx, eax
and edx, 0xfc00
cmp edx, 0xd800
jne 0x6707d889
lea edx, [esp + 0x10]
push edx
movzx eax, ax
movzx ecx, cx
lea edx, [esp + 0x18]
push edx
shl eax, 0xa
lea edx, [eax + ecx - 0x35fdc00]
push edx
call fcn.67083180
mov edx, dword [esp + 0x1c]
add esp, 0xc
and byte [esi + edi], 0xf7
cmp edx, 0x1c
jl 0x6707d877
or byte [esi + edi], 4
mov ecx, dword [esp + 0xc]
xor eax, eax
cmp ecx, 0x1e
jl 0x6707d894
mov eax, 3
jmp 0x6707d8a5
mov edx, 0xb
mov dword [esp + 0x10], edx
jmp 0x6707d877
cmp ecx, 0x1d
jne 0x6707d8a5
mov eax, edx
sub eax, 0x1e
neg eax
sbb eax, eax
and eax, 3
cmp edx, 0x1c
je 0x6707d93a
cmp edx, 0x1d
jge case.default.0x6707d8e2
cmp edx, 0x1a
mov ebx, edx
jl 0x6707d8c3
mov ebx, 0xb
cmp ecx, 0x1a
jl 0x6707d8d1
mov ecx, 0xb
mov dword [esp + 0xc], ecx
imul ecx, ecx, 0x1a
movzx ecx, byte [ecx + ebx + 0x6719c9a8]
dec ecx
cmp ecx, 3
ja case.default.0x6707d8e2
jmp dword [ecx*4 + 0x6707d96c]
mov ebx, dword [esp + 0x20]
mov ecx, 0xad
mov eax, 2
cmp word [ebx + esi*2 - 2], cx
jne case.default.0x6707d8e2
mov eax, 1
jmp case.default.0x6707d8e2
xor eax, eax
cmp ebp, 0x1c
setne al
dec eax
and eax, 2
jmp case.default.0x6707d8e2
xor eax, eax
cmp ebp, 0x1c
jne 0x6707d93a
cmp esi, 1
jbe case.default.0x6707d8e2
mov cl, byte [esi + edi - 2]
and cl, 0xfe
or cl, 2
mov byte [esi + edi - 2], cl
jmp case.default.0x6707d8e2
xor eax, eax
cmp ebp, 0x1c
jne 0x6707d93a
mov dword [esp + 0xc], edx
mov cl, byte [esi + edi - 1]
xor cl, al
mov ebp, edx
mov edx, dword [esp + 0x14]
and cl, 3
xor byte [esi + edi - 1], cl
mov dword [esp + 0x18], edx
inc esi
cmp esi, dword [esp + 0x24]
jb 0x6707d793
mov eax, dword [esp + 0x24]
or byte [eax + edi - 1], 3
pop esi
pop ebp
pop ebx
add esp, 0x10
ret