// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/src/deark-data.c
// Function: de_color_to_css
void de_color_to_css(de_color color, char *buf, int buflen)
{
	u8 r, g, b;

	buf[0] = '#';
	r = DE_COLOR_R(color);
	g = DE_COLOR_G(color);
	b = DE_COLOR_B(color);

	if(r%17==0 && g%17==0 && b%17==0) {
		// Can use short form.
		buf[1] = g_hexchars[r/17];
		buf[2] = g_hexchars[g/17];
		buf[3] = g_hexchars[b/17];
		buf[4] = '\0';
		return;
	}

	buf[1] = g_hexchars[r/16];
	buf[2] = g_hexchars[r%16];
	buf[3] = g_hexchars[g/16];
	buf[4] = g_hexchars[g%16];
	buf[5] = g_hexchars[b/16];
	buf[6] = g_hexchars[b%16];
	buf[7] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movb $0x23, (%rax)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, -0x15(%rbp)
movl -0x4(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, -0x16(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
movb %al, -0x17(%rbp)
movzbl -0x15(%rbp), %eax
movl $0x11, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x161576
movzbl -0x16(%rbp), %eax
movl $0x11, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x161576
movzbl -0x17(%rbp), %eax
movl $0x11, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x161576
movq 0xc45f6(%rip), %rax     # 0x225ae8
movq %rax, -0x30(%rbp)
movzbl -0x15(%rbp), %eax
movl $0x11, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1(%rax)
movq 0xc45cc(%rip), %rax     # 0x225ae8
movq %rax, -0x28(%rbp)
movzbl -0x16(%rbp), %eax
movl $0x11, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2(%rax)
movq 0xc45a2(%rip), %rax     # 0x225ae8
movq %rax, -0x20(%rbp)
movzbl -0x17(%rbp), %eax
movl $0x11, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x4(%rax)
jmp 0x161674
movq 0xc456b(%rip), %rax     # 0x225ae8
movq %rax, -0x60(%rbp)
movzbl -0x15(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x60(%rbp), %rax
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1(%rax)
movq 0xc4541(%rip), %rax     # 0x225ae8
movq %rax, -0x58(%rbp)
movzbl -0x15(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movq -0x58(%rbp), %rax
movslq %edx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2(%rax)
movq 0xc4519(%rip), %rax     # 0x225ae8
movq %rax, -0x50(%rbp)
movzbl -0x16(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x3(%rax)
movq 0xc44ef(%rip), %rax     # 0x225ae8
movq %rax, -0x48(%rbp)
movzbl -0x16(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movq -0x48(%rbp), %rax
movslq %edx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
movq 0xc44c7(%rip), %rax     # 0x225ae8
movq %rax, -0x40(%rbp)
movzbl -0x17(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x5(%rax)
movq 0xc449d(%rip), %rax     # 0x225ae8
movq %rax, -0x38(%rbp)
movzbl -0x17(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movq -0x38(%rbp), %rax
movslq %edx, %rcx
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x6(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x7(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)