Function at 0x1400ed390
Capabilities:
Link many functions at runtime

Disassembly:
push rbx
push rdi
sub rsp, 0x138
mov rax, qword [0x1402a83b0]
xor rax, rsp
mov qword [rsp + 0x100], rax
mov qword [rsp + 0x28], rcx
mov rdi, rdx
lea rcx, str.libflif
mov edx, 1
call fcn.14005a660
mov rbx, rax
test rax, rax
jne 0x1400ed3d5
lea eax, [rbx + 2]
jmp 0x1400ed669
mov qword [rsp + 0x130], rsi
mov qword [rsp + 0x128], r12
mov qword [rsp + 0x120], r13
lea rdx, str.flif_create_encoder
mov rcx, rax
mov qword [rsp + 0x118], r14
mov qword [rsp + 0x110], r15
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_destroy_encoder
mov rcx, rbx
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_encoder_encode_file
mov rcx, rbx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_destroy_image
mov rcx, rbx
mov qword [rsp + 0x30], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_encoder_add_image
mov rcx, rbx
mov qword [rsp + 0x38], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_create_image
mov rcx, rbx
mov qword [rsp + 0x40], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_image_write_row_RGBA8
mov rcx, rbx
mov r15, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_encoder_set_lossy
mov rcx, rbx
mov r13, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_encoder_set_learn_repeat
mov rcx, rbx
mov r14, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.flif_encoder_set_split_threshold
mov rcx, rbx
mov r12, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rsi, rsi
jne 0x1400ed4d6
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
lea eax, [rsi + 2]
jmp 0x1400ed641
mov qword [rsp + 0x160], rbp
call rsi
mov rbp, rax
test rax, rax
je 0x1400ed589
movzx eax, word [rdi + 0x13a]
cmp ax, 0x64
je 0x1400ed507
cwde
mov edx, 0x64
mov rcx, rbp
sub edx, eax
call r14
mov edx, 1
mov rcx, rbp
call r12
lea rcx, [rsp + 0x50]
call fcn.140061e90
mov eax, dword [str.FLIF]
xor r14d, r14d
mov dword [rsp + 0x80], eax
movzx eax, byte [0x14020022c]
lea rdx, [rsp + 0x50]
mov byte [rsp + 0x84], al
mov eax, dword [rdi + 0x50]
mov rcx, rdi
shl eax, 2
mov dword [rsp + 0x50], r14d
lea r12d, [r14 + 1]
mov dword [rsp + 0x60], 0x200001
mov word [rsp + 0x70], r14w
mov dword [rsp + 0x6c], eax
call fcn.14005fe70
test ax, ax
jne 0x1400ed639
mov edx, dword [rdi + 0x54]
mov ecx, dword [rdi + 0x50]
call r15
mov rsi, rax
test rax, rax
jne 0x1400ed59c
mov rcx, rbp
call qword [rsp + 0x20]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, 2
jmp 0x1400ed639
mov ebx, r14d
cmp dword [rdi + 0x54], ebx
jle 0x1400ed602
nop dword [rax]
nop dword [rax + rax]
mov r8d, r12d
mov edx, ebx
mov rcx, rdi
call fcn.1400629c0
cmp word [rdi + 0x4c], 0x20
mov ecx, dword [rsp + 0x6c]
je 0x1400ed5eb
mov edx, r14d
mov rax, r14
test ecx, ecx
jle 0x1400ed5eb
mov rcx, qword [rsp + 0x58]
add edx, 4
add rax, 4
mov byte [rax + rcx - 1], 0xff
mov ecx, dword [rsp + 0x6c]
cmp edx, ecx
jl 0x1400ed5d2
mov r8, qword [rsp + 0x58]
movsxd r9, ecx
mov edx, ebx
mov rcx, rsi
call r13
inc ebx
cmp ebx, dword [rdi + 0x54]
jl 0x1400ed5b0
mov rdx, rsi
mov rcx, rbp
call qword [rsp + 0x40]
mov rdx, qword [rsp + 0x28]
mov rcx, rbp
mov rdx, qword [rdx + 0x100]
call qword [rsp + 0x30]
mov rcx, rsi
call qword [rsp + 0x38]
mov rcx, rbp
call qword [rsp + 0x20]
mov rcx, rdi
call fcn.14005dcb0
movzx eax, r14w
mov rbp, qword [rsp + 0x160]
mov r13, qword [rsp + 0x120]
mov r12, qword [rsp + 0x128]
mov rsi, qword [rsp + 0x130]
mov r14, qword [rsp + 0x118]
mov r15, qword [rsp + 0x110]
mov rcx, qword [rsp + 0x100]
xor rcx, rsp
call fcn.1401bd600
add rsp, 0x138
pop rdi
pop rbx
ret