// File: /workspace/github_c_makefile_star2_O3/jrrk[P]cbzone/c_gpr.c
// Function: writecolormap
int writecolormap(status)
     Bool* status;
{
  int i, j;
  XColor color;
  int ind = 0;
  int num = 0;

  *status = True;
  if (pixels != NULL)
    free(pixels);
  pixels = (Pixel*) calloc(cw, sizeof(Pixel));
  for (i=L_COLOR; *status && i>=0; i--)
    if (opt->cpi[i] == i)
      if (opt->fading_colors < 2 || i<FF_COLOR) {
        XParseColor(d, cmap, bases[i].name, &color);
        if (XAllocColor(d, cmap, &color))
          pixels[num++] = color.pixel;
        else
          *status = False;
      }
      else
        for (j=0; *status && j<opt->fading_colors; j++) {
          XParseColor(d, cmap, fcnames[ind++].name, &color);
          if (XAllocColor(d, cmap, &color))
            pixels[num++] = color.pixel;
          else
            *status = False;
        }
  return num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x1, (%rdi)
movq 0xe47e(%rip), %rdi      # 0x14610
testq %rdi, %rdi
je 0x61a0
callq 0x4250
movl (%rbx), %ebp
jmp 0x61a5
movl $0x1, %ebp
movslq 0xe4a8(%rip), %rdi      # 0x14654
movl $0x8, %esi
callq 0x44d0
movq %rax, 0xe453(%rip)      # 0x14610
xorl %r12d, %r12d
testl %ebp, %ebp
je 0x636f
movl $0x12, %r15d
xorl %r14d, %r14d
movq %rbx, 0x8(%rsp)
leaq 0xe3a3(%rip), %rax      # 0x14580
movq (%rax), %rax
movl 0xf0(%rax,%r15,4), %ecx
cmpq %rcx, %r15
jne 0x6354
cmpl $0x2, 0x148(%rax)
setl %al
cmpq $0xc, %r15
setb %cl
orb %al, %cl
je 0x6270
movq 0xe41b(%rip), %rdi      # 0x14628
movq 0xe42c(%rip), %rsi      # 0x14640
movq %r15, %rdx
shlq $0x4, %rdx
subq %r15, %rdx
subq %r15, %rdx
addq 0xe3f0(%rip), %rdx      # 0x14618
leaq 0x18(%rsp), %r13
movq %r13, %rcx
callq 0x4480
movq 0xe3ec(%rip), %rdi      # 0x14628
movq 0xe3fd(%rip), %rsi      # 0x14640
movq %r13, %rdx
callq 0x44f0
testl %eax, %eax
je 0x6369
movq 0x18(%rsp), %rax
movq 0xe3b1(%rip), %rcx      # 0x14610
movslq %r12d, %rdx
incl %r12d
movq %rax, (%rcx,%rdx,8)
movl (%rbx), %ebp
jmp 0x6354
movslq %r14d, %r14
leaq 0xe306(%rip), %rax      # 0x14580
movq (%rax), %rax
cmpl $0x0, 0x148(%rax)
jle 0x6354
movl %r12d, 0x14(%rsp)
movslq %r12d, %rax
leaq 0x1(%r14), %rcx
leaq (%r14,%r14), %rdx
shlq $0x4, %r14
subq %rdx, %r14
xorl %r12d, %r12d
movq %r14, %r13
movq %rax, %rbx
movq %rcx, %r14
movq 0xe374(%rip), %rdi      # 0x14628
movq 0xe385(%rip), %rsi      # 0x14640
movq 0xe35e(%rip), %rdx      # 0x14620
addq %r13, %rdx
leaq 0x18(%rsp), %rbp
movq %rbp, %rcx
callq 0x4480
movq 0xe34f(%rip), %rdi      # 0x14628
movq 0xe360(%rip), %rsi      # 0x14640
movq %rbp, %rdx
callq 0x44f0
testl %eax, %eax
je 0x632f
movq 0x18(%rsp), %rax
movq 0xe318(%rip), %rcx      # 0x14610
movq %rax, (%rcx,%rbx,8)
movq 0x8(%rsp), %rax
movl (%rax), %ebp
testl %ebp, %ebp
je 0x6348
incl %r12d
leaq 0xe26f(%rip), %rax      # 0x14580
movq (%rax), %rdx
leaq 0x1(%rbx), %rax
leaq 0x1(%r14), %rcx
addq $0xe, %r13
cmpl 0x148(%rdx), %r12d
jl 0x62a7
jmp 0x634a
movq 0x8(%rsp), %rbx
movl $0x0, (%rbx)
movl 0x14(%rsp), %eax
addl %r12d, %eax
movl %eax, %r12d
xorl %ebp, %ebp
jmp 0x6354
xorl %ebp, %ebp
incl %ebx
movl %ebx, %r12d
movq 0x8(%rsp), %rbx
addq $-0x1, %r15
setb %al
testl %ebp, %ebp
je 0x636f
testb %al, %al
jne 0x61d6
jmp 0x636f
movl $0x0, (%rbx)
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq