// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-zoe/tex-to_image.c
// Function: generatePalettePairs
void generatePalettePairs( unsigned int numPaletteEntries, unsigned char* palette, paletteEntry *paired, unsigned int bpp ) {
	int i, e = 0;
	if( bpp == palMode4bpp ) {
		for( i = 0; i < numPaletteEntries; i++ ) {
			paired[i].red = palette[e];
			e++;
			paired[i].green = palette[e];
			e++;
			paired[i].blue = palette[e];
			e++;
			if( palette[e] >= 0x7F ) paired[i].alpha = 0xFF;
			else if ( palette[e] == 0 ) paired[i].alpha = 0; 
			else paired[i].alpha = (palette[e] + 1)*2;
			e++;
		}
	}
	else if( bpp == palMode8bpp ) {
		for( i = 0; i < numPaletteEntries; i++ ) {
			e = 4 * swizzle(i);
			paired[i].red = palette[e];
			e++;
			paired[i].green = palette[e];
			e++;
			paired[i].blue = palette[e];
			e++;
			if( palette[e] >= 0x7F ) paired[i].alpha = 0xFF;
			else if ( palette[e] == 0 ) paired[i].alpha = 0; 
			else paired[i].alpha = (palette[e] + 1)*2;
			e++;
		}
	}
		return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x11ac6
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0x11ac1
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7f, %eax
jl 0x11a69
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx,4)
jmp 0x11aaa
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x11a89
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx,4)
jmp 0x11aa8
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
addl $0x1, %eax
shll %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, 0x3(%rax,%rcx,4)
jmp 0x11aaa
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x119de
jmp 0x11bcc
cmpl $0x1, -0x1c(%rbp)
jne 0x11bca
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0x11bc8
movl -0x20(%rbp), %edi
callq 0x11950
shll $0x2, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7f, %eax
jl 0x11b70
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx,4)
jmp 0x11bb1
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x11b90
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx,4)
jmp 0x11baf
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
addl $0x1, %eax
shll %eax
movb %al, %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, 0x3(%rax,%rcx,4)
jmp 0x11bb1
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x11ad7
jmp 0x11bca
jmp 0x11bcc
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)