Function at 0x4bec30
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x20
mov edi, dword [esp + 0x34]
xor ebp, ebp
test edi, edi
jne 0x4bec62
push 0x14
call sym.fastboot.exe_OPENSSL_malloc
add esp, 4
test eax, eax
je 0x4beccc
mov edi, eax
pxor xmm0, xmm0
movdqu xmmword [eax], xmm0
mov dword [eax + 0x10], 1
mov ebp, eax
mov ebx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
cmp dword [esi + 0xc], 0
jne 0x4befed
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov eax, dword [ebx]
mov dword [esp], eax
mov eax, dword [ebx + 4]
cmp edx, eax
mov esi, eax
mov dword [esp + 0x14], edx
cmovb esi, edx
test esi, esi
mov dword [esp + 4], edi
mov dword [esp + 0xc], ebp
mov dword [esp + 0x18], eax
je 0x4bed00
xor eax, eax
xor edi, edi
mov edx, dword [ecx + edi*4]
mov ebx, dword [esp]
mov ebx, dword [ebx + edi*4]
mov ebp, edx
sub ebp, ebx
xor ebx, edx
xor ebp, edx
or ebp, ebx
xor ebp, edx
sar ebp, 0x1f
or ebp, 1
test ebx, ebx
mov ebx, dword [esp]
cmovne eax, ebp
add edi, 1
cmp esi, edi
jne 0x4beca0
jmp 0x4bed05
push 0x49
push str.external_boringssl_src_crypto_fipsmodule_bn_bn.c
push 0x41
push 0
push 3
call sym.fastboot.exe_ERR_put_error
add esp, 0x14
push 0x121
push str.external_boringssl_src_crypto_fipsmodule_bn_gcd.c
push 0x41
push 0
push 3
call sym.fastboot.exe_ERR_put_error
add esp, 0x14
xor edi, edi
jmp 0x4bf0e8
xor eax, eax
mov ebx, dword [esp]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x14]
mov ebp, ecx
mov edx, dword [esp + 0x18]
sub ebp, edx
jae 0x4bed2f
mov edi, edx
sub edi, ecx
xor esi, esi
cmp edi, 8
jae 0x4bed45
mov edi, dword [esp + 4]
mov ebx, dword [esp + 0x3c]
jmp 0x4bee9e
jbe 0x4bed7a
xor esi, esi
cmp ebp, 8
jae 0x4bed87
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0xc]
jmp 0x4befb5
mov esi, edi
and esi, 0xfffffff8
mov dword [esp + 0x10], esi
add esi, 0xfffffff8
mov edx, esi
shr edx, 3
add edx, 1
mov ebp, edx
and ebp, 3
cmp esi, 0x18
mov dword [esp + 8], edi
jae 0x4bedbf
pxor xmm0, xmm0
xor esi, esi
pxor xmm1, xmm1
mov ebx, dword [esp + 0x3c]
jmp 0x4bee37
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0xc]
jmp 0x4befdd
mov ecx, ebp
and ecx, 0xfffffff8
mov esi, edx
mov dword [esp], ecx
lea edx, [ecx - 8]
mov edi, edx
shr edi, 3
add edi, 1
mov ecx, edi
and ecx, 3
mov dword [esp + 0x10], ecx
cmp edx, 0x18
mov edx, esi
jae 0x4beee4
pxor xmm0, xmm0
xor esi, esi
pxor xmm1, xmm1
jmp 0x4bef57
and edx, 0xfffffffc
lea edi, [ebx + ecx*4]
add edi, 0x70
pxor xmm0, xmm0
xor esi, esi
pxor xmm1, xmm1
mov ebx, dword [esp + 0x3c]
nop word cs:[eax + eax]
movdqu xmm2, xmmword [edi + esi*4 - 0x70]
por xmm2, xmm0
movdqu xmm0, xmmword [edi + esi*4 - 0x60]
por xmm0, xmm1
movdqu xmm1, xmmword [edi + esi*4 - 0x50]
movdqu xmm3, xmmword [edi + esi*4 - 0x40]
movdqu xmm4, xmmword [edi + esi*4 - 0x30]
por xmm4, xmm1
por xmm4, xmm2
movdqu xmm2, xmmword [edi + esi*4 - 0x20]
por xmm2, xmm3
por xmm2, xmm0
movdqu xmm0, xmmword [edi + esi*4 - 0x10]
por xmm0, xmm4
movdqu xmm1, xmmword [edi + esi*4]
por xmm1, xmm2
add esi, 0x20
add edx, 0xfffffffc
jne 0x4bede0
test ebp, ebp
je 0x4bee6a
add esi, ecx
mov edi, dword [esp]
lea esi, [edi + esi*4]
add esi, 0x10
shl ebp, 5
xor edi, edi
nop dword [eax + eax]
movdqu xmm2, xmmword [esi + edi - 0x10]
por xmm0, xmm2
movdqu xmm2, xmmword [esi + edi]
por xmm1, xmm2
add edi, 0x20
cmp ebp, edi
jne 0x4bee50
por xmm0, xmm1
pshufd xmm1, xmm0, 0xee
por xmm1, xmm0
pshufd xmm0, xmm1, 0x55
por xmm0, xmm1
movd esi, xmm0
mov ebp, dword [esp + 0x10]
cmp dword [esp + 8], ebp
mov edx, dword [esp + 0x18]
jne 0x4bee98
mov edi, dword [esp + 4]
jmp 0x4beebb
add ecx, ebp
mov edi, dword [esp + 4]
mov ebp, dword [esp]
nop word cs:[eax + eax]
nop dword [eax + eax]
or esi, dword [ebp + ecx*4]
add ecx, 1
cmp edx, ecx
jne 0x4beeb0
mov ecx, esi
not ecx
add esi, 0xffffffff
and esi, ecx
sar esi, 0x1f
not esi
or eax, esi
mov esi, dword [esp + 0x38]
mov ebp, dword [esp + 0xc]
test eax, eax
jns 0x4befed
mov ecx, ebx
xor ebx, ebx
jmp 0x4bf046
and edi, 0xfffffffc
mov ecx, dword [esp + 8]
lea ebx, [ecx + edx*4]
add ebx, 0x70
pxor xmm0, xmm0
xor esi, esi
pxor xmm1, xmm1
nop dword [eax + eax]
movdqu xmm2, xmmword [ebx + esi*4 - 0x70]
por xmm2, xmm0
movdqu xmm0, xmmword [ebx + esi*4 - 0x60]
por xmm0, xmm1
movdqu xmm1, xmmword [ebx + esi*4 - 0x50]
movdqu xmm3, xmmword [ebx + esi*4 - 0x40]
movdqu xmm4, xmmword [ebx + esi*4 - 0x30]
por xmm4, xmm1
por xmm4, xmm2
movdqu xmm2, xmmword [ebx + esi*4 - 0x20]
por xmm2, xmm3
por xmm2, xmm0
movdqu xmm0, xmmword [ebx + esi*4 - 0x10]
por xmm0, xmm4
movdqu xmm1, xmmword [ebx + esi*4]
por xmm1, xmm2
add esi, 0x20
add edi, 0xfffffffc
jne 0x4bef00
mov ebx, dword [esp + 0x10]
test ebx, ebx
je 0x4bef8a
add esi, edx
mov ecx, dword [esp + 8]
lea esi, [ecx + esi*4]
add esi, 0x10
shl ebx, 5
xor edi, edi
movdqu xmm2, xmmword [esi + edi - 0x10]
por xmm0, xmm2
movdqu xmm2, xmmword [esi + edi]
por xmm1, xmm2
add edi, 0x20
cmp ebx, edi
jne 0x4bef70
por xmm0, xmm1
pshufd xmm1, xmm0, 0xee
por xmm1, xmm0
pshufd xmm0, xmm1, 0x55
por xmm0, xmm1
movd esi, xmm0
mov ecx, dword [esp]
cmp ebp, ecx
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0xc]
je 0x4befca
add edx, ecx
mov ecx, dword [esp + 8]
mov ebx, dword [esp + 0x14]
nop dword [eax]
or esi, dword [ecx + edx*4]
add edx, 1
cmp ebx, edx
jne 0x4befc0
mov ecx, esi
not ecx
add esi, 0xffffffff
and esi, ecx
sar esi, 0x1f
and eax, esi
add eax, esi
add eax, 1
mov esi, dword [esp + 0x38]
mov ebx, dword [esp + 0x3c]
test eax, eax
js 0x4beedb
push esi
call sym.fastboot.exe_BN_dup
add esp, 4
test eax, eax
je 0x4bf03a
mov esi, eax
push dword [esp + 0x40]
push ebx
push eax
push eax
push 0
call sym.fastboot.exe_BN_div
add esp, 0x14
test eax, eax
je 0x4bf03e
cmp dword [esi + 0xc], 0
je 0x4bf042
cmp dword [ebx + 0xc], 0
mov eax, sym.fastboot.exe_BN_add
mov ecx, sym.fastboot.exe_BN_sub
cmove ecx, eax
push ebx
push esi
push esi
call ecx
add esp, 0xc
mov ecx, ebx
mov ebx, esi
test eax, eax
jne 0x4bf046
jmp 0x4bf086
xor ebx, ebx
jmp 0x4bf086
mov ebx, esi
jmp 0x4bf086
mov ecx, ebx
mov ebx, esi
mov dword [esp + 0x1c], 0
cmp dword [ecx + 4], 0
jle 0x4bf05b
mov eax, dword [ecx]
test byte [eax], 1
jne 0x4bf06e
lea eax, [esp + 0x1c]
push dword [esp + 0x40]
push ecx
push esi
push eax
push edi
call sym.fastboot.exe_bn_mod_inverse_consttime
jmp 0x4bf07f
lea eax, [esp + 0x1c]
push dword [esp + 0x40]
push ecx
push esi
push eax
push edi
call fcn.004be2d0
add esp, 0x14
test eax, eax
jne 0x4bf0ac
xor edi, edi
test ebp, ebp
je 0x4bf0ac
mov eax, dword [ebp + 0x10]
test al, 2
jne 0x4bf0a1
push dword [ebp]
call sym.fastboot.exe_OPENSSL_free
add esp, 4
mov eax, dword [ebp + 0x10]
test al, 1
jne 0x4bf0db
mov dword [ebp], 0
test ebx, ebx
je 0x4bf0e8
mov eax, dword [ebx + 0x10]
test al, 2
jne 0x4bf0c4
push dword [ebx]
call sym.fastboot.exe_OPENSSL_free
add esp, 4
mov eax, dword [ebx + 0x10]
test al, 1
jne 0x4bf0d0
mov dword [ebx], 0
jmp 0x4bf0e8
push ebx
call sym.fastboot.exe_OPENSSL_free
add esp, 4
jmp 0x4bf0e8
push ebp
call sym.fastboot.exe_OPENSSL_free
add esp, 4
test ebx, ebx
jne 0x4bf0b0
mov eax, edi
add esp, 0x20
pop esi
pop edi
pop ebx
pop ebp
ret