// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/tekmsc.c
// Function: updatepaletteshifts
void
updatepaletteshifts(void)
{
     int   red,white;

     if (whitecount)
     {
          white = whitecount/WHITETICS +1;
          if (white>NUMWHITESHIFTS)
               white = NUMWHITESHIFTS;
          whitecount -= TICSPERFRAME;
          if (whitecount < 0)
               whitecount = 0;
     }
     else {
          white = 0;
     }

     if (redcount)
     {
          red = redcount/10 +1;
          if (red>NUMREDSHIFTS)
               red = NUMREDSHIFTS;
          redcount -= TICSPERFRAME;
          if (redcount < 0)
               redcount = 0;
     }
     else {
          red = 0;
     }


     if( red ) {
#if USE_POLYMOST && USE_OPENGL
          if (getrendermode() >= 3)
               setpalettefade(64,0,0,64 * red / REDSTEPS);
          else
#endif
               setbrightness(brightness,&redshifts[red-1][0],0);
          palshifted = 1;
     }
     else if( white ) {
#if USE_POLYMOST && USE_OPENGL
          if (getrendermode() >= 3)
               setpalettefade(64,62,0,64 * white / WHITESTEPS);
          else
#endif
               setbrightness(brightness,&whiteshifts[white-1][0],0);
          palshifted = 1;
     }
     else if( palshifted ) {
#if USE_POLYMOST && USE_OPENGL
          if (getrendermode() >= 3)
               setpalettefade(0,0,0,0);
          else
#endif
               setbrightness(brightness,&palette[0],0);  // back to normal
          palshifted = 0;
     }

 return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x160115(%rip)    # 0x179cf4
je 0x19c26
movl 0x16010d(%rip), %eax    # 0x179cf4
movl $0x6, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x3, -0x8(%rbp)
jle 0x19c02
movl $0x3, -0x8(%rbp)
movl 0x1600ec(%rip), %eax    # 0x179cf4
subl $0x3, %eax
movl %eax, 0x1600e3(%rip)    # 0x179cf4
cmpl $0x0, 0x1600dc(%rip)    # 0x179cf4
jge 0x19c24
movl $0x0, 0x1600d0(%rip)    # 0x179cf4
jmp 0x19c2d
movl $0x0, -0x8(%rbp)
cmpl $0x0, 0x1600bc(%rip)    # 0x179cf0
je 0x19c7b
movl 0x1600b4(%rip), %eax    # 0x179cf0
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movl %eax, -0x4(%rbp)
cmpl $0x4, -0x4(%rbp)
jle 0x19c57
movl $0x4, -0x4(%rbp)
movl 0x160093(%rip), %eax    # 0x179cf0
subl $0x3, %eax
movl %eax, 0x16008a(%rip)    # 0x179cf0
cmpl $0x0, 0x160083(%rip)    # 0x179cf0
jge 0x19c79
movl $0x0, 0x160077(%rip)    # 0x179cf0
jmp 0x19c82
movl $0x0, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x19ce9
callq 0x75150
cmpl $0x3, %eax
jl 0x19cb3
movl -0x4(%rbp), %eax
shll $0x6, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x40, %edi
xorl %edx, %edx
movl %edx, %esi
movzbl %al, %ecx
callq 0x72570
jmp 0x19cdd
leaq 0x113b28(%rip), %rax    # 0x12d7e2
movswl (%rax), %edi
movl -0x4(%rbp), %eax
subl $0x1, %eax
cltq
leaq 0x15e824(%rip), %rsi    # 0x1784f0
imulq $0x300, %rax, %rax      # imm = 0x300
addq %rax, %rsi
xorl %edx, %edx
callq 0x67360
movb $0x1, 0x160014(%rip)    # 0x179cf8
jmp 0x19d95
cmpl $0x0, -0x8(%rbp)
je 0x19d50
callq 0x75150
cmpl $0x3, %eax
jl 0x19d1d
movl -0x8(%rbp), %eax
shll $0x6, %eax
movl $0x14, %ecx
cltd
idivl %ecx
movl $0x40, %edi
movl $0x3e, %esi
xorl %edx, %edx
movzbl %al, %ecx
callq 0x72570
jmp 0x19d47
leaq 0x113abe(%rip), %rax    # 0x12d7e2
movswl (%rax), %edi
movl -0x8(%rbp), %eax
subl $0x1, %eax
cltq
leaq 0x15f3ba(%rip), %rsi    # 0x1790f0
imulq $0x300, %rax, %rax      # imm = 0x300
addq %rax, %rsi
xorl %edx, %edx
callq 0x67360
movb $0x1, 0x15ffaa(%rip)    # 0x179cf8
jmp 0x19d93
cmpb $0x0, 0x15ffa1(%rip)    # 0x179cf8
je 0x19d91
callq 0x75150
cmpl $0x3, %eax
jl 0x19d72
xorl %ecx, %ecx
movl %ecx, %edi
movl %ecx, %esi
movl %ecx, %edx
callq 0x72570
jmp 0x19d8a
leaq 0x113a69(%rip), %rax    # 0x12d7e2
movswl (%rax), %edi
leaq 0x45c65d(%rip), %rsi    # 0x4763e0
xorl %edx, %edx
callq 0x67360
movb $0x0, 0x15ff67(%rip)    # 0x179cf8
jmp 0x19d93
jmp 0x19d95
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)