Function at 0x1010cdf5
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push edi
mov edi, dword [ebp + 0x10]
test edi, edi
jne 0x1010ce1c
push str.We_need_an_image_previously_created._n
push 1
push dword [ebp + 0x14]
call fcn.1010934a
add esp, 0xc
xor eax, eax
jmp 0x1010d0d0
mov ecx, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x74]
imul eax, dword [ebx + 0x70]
cmp ecx, eax
jb 0x1010ce4a
dec eax
push eax
push ecx
push str.Tile_index_provided_by_the_user_is_incorrect__d__max___d___n
push 1
push dword [ebp + 0x14]
call fcn.1010934a
add esp, 0x14
xor eax, eax
jmp 0x1010d0cf
mov eax, ecx
xor edx, edx
div dword [ebx + 0x70]
push esi
mov esi, dword [ebx + 0x64]
mov ecx, edx
imul esi, ecx
mov edx, eax
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebx + 0x5c]
add ecx, esi
mov dword [edi], ecx
mov eax, dword [ebx + 0x50]
mov eax, dword [eax]
cmp ecx, eax
jae 0x1010ce71
mov dword [edi], eax
mov ecx, dword [ebp - 0xc]
inc ecx
imul ecx, dword [ebx + 0x64]
add ecx, dword [ebx + 0x5c]
mov dword [edi + 8], ecx
mov eax, dword [ebx + 0x50]
mov eax, dword [eax + 8]
cmp ecx, eax
jbe 0x1010ce8c
mov dword [edi + 8], eax
mov ecx, dword [ebx + 0x68]
imul ecx, edx
add ecx, dword [ebx + 0x60]
mov dword [edi + 4], ecx
mov eax, dword [ebx + 0x50]
mov eax, dword [eax + 4]
cmp ecx, eax
jae 0x1010cea5
mov dword [edi + 4], eax
lea ecx, [edx + 1]
imul ecx, dword [ebx + 0x68]
add ecx, dword [ebx + 0x60]
mov dword [edi + 0xc], ecx
mov eax, dword [ebx + 0x50]
mov eax, dword [eax + 0xc]
cmp ecx, eax
jbe 0x1010cebf
mov dword [edi + 0xc], eax
and dword [ebp - 8], 0
cmp dword [edi + 0x10], 0
mov ecx, dword [edi + 0x18]
mov dword [ebp - 4], ecx
jbe 0x1010d00c
xor edx, edx
mov dword [ebp - 0xc], edx
mov eax, dword [ebx + 0x50]
mov esi, dword [ecx]
mov ebx, dword [ebp - 4]
mov eax, dword [eax + 0x18]
mov eax, dword [eax + edx + 0x28]
mov dword [ecx + 0x28], eax
mov eax, dword [edi]
dec eax
add eax, esi
cdq
idiv esi
mov dword [ecx + 0x10], eax
mov eax, dword [edi + 4]
mov ecx, dword [ecx + 4]
dec eax
add eax, ecx
cdq
idiv ecx
mov dword [ebx + 0x14], eax
mov eax, dword [edi + 0xc]
dec eax
add eax, ecx
cdq
idiv ecx
mov ecx, dword [ebx + 0x28]
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 8]
xor edi, edi
dec eax
add eax, esi
cdq
idiv esi
xor esi, esi
bts esi, ecx
cdq
cmp ecx, 0x20
cmovae edi, esi
xor esi, edi
cmp ecx, 0x40
cmovae edi, esi
add eax, esi
adc edx, edi
sub eax, 1
sbb edx, 0
call fcn.10127ac0
mov ebx, eax
xor esi, esi
mov eax, dword [ebp - 4]
xor edi, edi
mov ecx, dword [eax + 0x28]
bts esi, ecx
mov eax, dword [eax + 0x10]
cmp ecx, 0x20
cdq
cmovae edi, esi
xor esi, edi
cmp ecx, 0x40
mov ecx, dword [ebp - 4]
cmovae edi, esi
add eax, esi
adc edx, edi
sub eax, 1
mov edi, dword [ecx + 0x28]
mov ecx, edi
sbb edx, 0
call fcn.10127ac0
mov edx, dword [ebp - 4]
sub ebx, eax
xor ecx, ecx
mov eax, edi
bts ecx, eax
xor esi, esi
cmp eax, 0x20
mov dword [edx + 8], ebx
cmovae esi, ecx
xor ecx, esi
cmp eax, 0x40
mov eax, dword [edx + 0x14]
cdq
cmovae esi, ecx
add eax, ecx
adc edx, esi
mov ecx, edi
sub eax, 1
sbb edx, 0
call fcn.10127ac0
mov ecx, edi
xor esi, esi
bts esi, ecx
xor edi, edi
cmp ecx, 0x20
mov ebx, eax
mov eax, dword [ebp - 0x10]
cmovae edi, esi
cdq
xor esi, edi
cmp ecx, 0x40
mov ecx, dword [ebp - 4]
cmovae edi, esi
add eax, esi
adc edx, edi
sub eax, 1
mov ecx, dword [ecx + 0x28]
sbb edx, 0
call fcn.10127ac0
mov ecx, dword [ebp - 4]
sub eax, ebx
mov edi, dword [ebp + 0x10]
mov edx, dword [ebp - 0xc]
mov ebx, dword [ebp + 8]
add edx, 0x34
mov dword [ecx + 0xc], eax
add ecx, 0x34
mov eax, dword [ebp - 8]
inc eax
mov dword [ebp - 4], ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], edx
cmp eax, dword [edi + 0x10]
jb 0x1010ced8
cmp dword [ebx + 0x54], 0
je 0x1010d01b
push dword [ebx + 0x54]
call fcn.1010893c
pop ecx
call fcn.10108930
mov dword [ebx + 0x54], eax
test eax, eax
je 0x1010d06d
push eax
push edi
call fcn.101086b9
push dword [ebp + 0x14]
mov eax, dword [ebp + 0x18]
push 0x1010c2b4
push dword [ebx + 0xc0]
mov dword [ebx + 0x3c], eax
call fcn.10110af4
push dword [ebp + 0x14]
push dword [ebp + 0xc]
push dword [ebx + 0xc0]
push ebx
call fcn.1011035d
add esp, 0x24
test eax, eax
jne 0x1010d071
push dword [ebx + 0x50]
call fcn.1010893c
and dword [ebx + 0x50], 0
pop ecx
xor eax, eax
jmp 0x1010d0ce
xor edx, edx
mov dword [ebp + 0x10], edx
cmp dword [edi + 0x10], edx
jbe 0x1010d0cb
xor esi, esi
mov eax, dword [ebx + 0x54]
mov ecx, dword [edi + 0x18]
mov eax, dword [eax + 0x18]
mov eax, dword [eax + esi + 0x24]
mov dword [esi + ecx + 0x24], eax
mov eax, dword [edi + 0x18]
mov eax, dword [esi + eax + 0x2c]
test eax, eax
je 0x1010d0a3
push eax
call fcn.1012ef4e
mov edx, dword [ebp + 0x10]
pop ecx
mov eax, dword [ebx + 0x54]
mov ecx, dword [edi + 0x18]
mov eax, dword [eax + 0x18]
mov eax, dword [eax + esi + 0x2c]
mov dword [esi + ecx + 0x2c], eax
mov ecx, dword [ebx + 0x54]
mov ecx, dword [ecx + 0x18]
and dword [ecx + esi + 0x2c], 0
inc edx
add esi, 0x34
mov dword [ebp + 0x10], edx
cmp edx, dword [edi + 0x10]
jb 0x1010d07d
xor eax, eax
inc eax
pop esi
pop ebx
pop edi
mov esp, ebp
pop ebp
ret