// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/polymosttexcompress.cc
// Function: ptcompress_compress
int ptcompress_compress(void * bgra, int width, int height, unsigned char * output, int format)
{
	switch (format) {
		case PTCOMPRESS_DXT1:
		case PTCOMPRESS_DXT5:
			squish::CompressImage( (squish::u8 const *) bgra, width, height, output, getsquishflags(format));
			return 0;
		case PTCOMPRESS_ETC1:
			compressetc1((uint8_t *)bgra, width, height, output);
			return 0;
	}
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rdi, %r15
leal -0x1(%r8), %eax
cmpl $0x2, %eax
jae 0x5e310
movl %r8d, %edi
movq %rsi, %r13
callq 0x5e28c
xorl %r12d, %r12d
movq %r15, %rdi
movl %r13d, %esi
movl %r14d, %edx
movq %rbx, %rcx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x61ab0
jmp 0x5e4f4
cmpl $0x3, %r8d
jne 0x5e356
movb $0x0, 0x8(%rsp)
cmpb $0x0, 0x65fe7e(%rip)    # 0x6be1a0
jne 0x5e336
movq %rsi, %r12
callq 0x600a5
movq %r12, %rsi
movb $0x1, 0x65fe6a(%rip)    # 0x6be1a0
leaq 0x59564b(%rip), %rax    # 0x5f3988
movl (%rax), %eax
movq %rbx, %r12
cmpl $0x1, %eax
je 0x5e35f
cmpl $0x2, %eax
jne 0x5e369
movl $0x2, 0x4(%rsp)
jmp 0x5e36e
pushq $-0x1
popq %r12
jmp 0x5e4f4
movl $0x1, 0x4(%rsp)
jmp 0x5e36e
andl $0x0, 0x4(%rsp)
movslq %r14d, %rax
movq %rax, 0x20(%rsp)
movl %esi, %eax
shll $0x4, %eax
movl %eax, 0xc(%rsp)
leal (,%rsi,4), %ebp
leaq 0x40(%rsp), %r11
xorl %ecx, %ecx
xorl %edx, %edx
movq %rsi, 0x30(%rsp)
cmpl $0x4, %r14d
pushq $0x4
popq %rax
movl %eax, %r13d
cmovll %r14d, %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
cmpq 0x20(%rsp), %rdx
jge 0x5e4f1
movq %rdx, 0x28(%rsp)
movl %r14d, 0x14(%rsp)
movq %r13, %rax
shlq $0x4, %rax
addq %rsp, %rax
addq $0x40, %rax
movq %rax, 0x38(%rsp)
xorl %edx, %edx
movl %ecx, 0x10(%rsp)
movl %ecx, %edi
movl %esi, %ebx
cmpl $0x4, %ebx
pushq $0x4
popq %rax
cmovll %ebx, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
cmpl %esi, %edx
jge 0x5e4d2
movl %edx, 0x1c(%rsp)
movq %r11, %rcx
movl %edi, 0x18(%rsp)
movl %edi, %edx
leaq 0x43(%rsp), %rsi
xorl %edi, %edi
cmpq %r13, %rdi
je 0x5e47f
movl %edx, %r8d
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x5e459
leal 0x2(%r8), %r10d
movslq %r10d, %r10
movb (%r15,%r10), %r10b
movb %r10b, -0x3(%rsi,%r9,4)
leal 0x1(%r8), %r10d
movslq %r10d, %r10
movb (%r15,%r10), %r10b
movb %r10b, -0x2(%rsi,%r9,4)
movslq %r8d, %r8
movb (%r15,%r8), %r10b
movb %r10b, -0x1(%rsi,%r9,4)
movb $-0x1, (%rsi,%r9,4)
incq %r9
addl $0x4, %r8d
jmp 0x5e41a
movq %rax, %r8
cmpq $0x3, %r8
ja 0x5e470
movl -0x4(%rcx,%r8,4), %r9d
movl %r9d, (%rcx,%r8,4)
incq %r8
jmp 0x5e45c
incq %rdi
addq $0x10, %rsi
addl %ebp, %edx
addq $0x10, %rcx
jmp 0x5e40f
movq 0x38(%rsp), %rax
movq %r13, %rcx
cmpq $0x3, %rcx
ja 0x5e49d
movaps -0x10(%rax), %xmm0
movaps %xmm0, (%rax)
incq %rcx
addq $0x10, %rax
jmp 0x5e487
movq %r12, %rdi
movq %r11, %rsi
leaq 0x4(%rsp), %rdx
movq %r11, %r14
callq 0x60292
movq %r14, %r11
addq $0x8, %r12
movl 0x1c(%rsp), %edx
addl $0x4, %edx
addl $-0x4, %ebx
movl 0x18(%rsp), %edi
addl $0x10, %edi
movq 0x30(%rsp), %rsi
jmp 0x5e3e0
movq 0x28(%rsp), %rdx
addq $0x4, %rdx
movl 0x14(%rsp), %r14d
addl $-0x4, %r14d
movl 0x10(%rsp), %ecx
addl 0xc(%rsp), %ecx
jmp 0x5e394
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)