// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: initpaletteshifts
int
initpaletteshifts(void)
{
     unsigned char *workptr,*baseptr;
     int       i,j,delta;

     for( i=1; i<=NUMREDSHIFTS; i++ ) {
          workptr=&redshifts[i-1][0];
          baseptr=&palette[0];
          for( j=0; j<=255; j++) {
               delta=64-*baseptr;
               *workptr++=*baseptr++ + delta * i / REDSTEPS;
               delta=-*baseptr;
               *workptr++=*baseptr++ + delta * i / REDSTEPS;
               delta=-*baseptr;
               *workptr++=*baseptr++ + delta * i / REDSTEPS;
          }
     }

     for( i=1; i<=NUMWHITESHIFTS; i++ ) {
          workptr=&whiteshifts[i-1][0];
          baseptr=&palette[0];
          for( j=0; j<=255; j++ ) {
               delta = 64-*baseptr;
               *workptr++ = *baseptr++ + delta * i / WHITESTEPS;
               delta = 62-*baseptr;
               *workptr++ = *baseptr++ + delta * i / WHITESTEPS;
               delta = 0-*baseptr;
               *workptr++ = *baseptr++ + delta * i / WHITESTEPS;
          }
     }

     return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jg 0x19987
movl -0x14(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x15ec9b(%rip), %rax    # 0x1784f0
imulq $0x300, %rcx, %rcx      # imm = 0x300
addq %rcx, %rax
movq %rax, -0x8(%rbp)
leaq 0x45cb76(%rip), %rax    # 0x4763e0
movq %rax, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0xff, -0x18(%rbp)
jg 0x19977
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
movl $0x40, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
imull -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x28(%rbp), %eax
addl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
imull -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x24(%rbp), %eax
addl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
imull -0x14(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x20(%rbp), %eax
addl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x19875
jmp 0x19979
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1983b
movl $0x1, -0x14(%rbp)
cmpl $0x3, -0x14(%rbp)
jg 0x19add
movl -0x14(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x15f748(%rip), %rax    # 0x1790f0
imulq $0x300, %rcx, %rcx      # imm = 0x300
addq %rcx, %rax
movq %rax, -0x8(%rbp)
leaq 0x45ca23(%rip), %rax    # 0x4763e0
movq %rax, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0xff, -0x18(%rbp)
jg 0x19acd
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
movl $0x40, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %eax
imull -0x14(%rbp), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
movl $0x3e, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
imull -0x14(%rbp), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x30(%rbp), %eax
addl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
imull -0x14(%rbp), %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x199c8
jmp 0x19acf
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1998e
xorl %eax, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)