// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/racer/racer.c
// Function: draw_horizon
static void draw_horizon(int curve, int speed, bool draw_blank)
{
  int row;
  int col;
  static float direction = 0.0;
  char c;

  const char horizon[5][361] = {
    "........................................................................................................................................................................................................................................................................................................................................................................",
    ".............................................***.............................................................................................................................................................MMM........................................................................................................................................................",
    "....MMM.....................................*****...................................................MMMMMMMMM.......................................................................MMMM......MMMMMM......MMMMMMMMMM.................MMMM...................................................................MMM.........................................................",
    "...MMMMM...MMMMMM....MMMMM...................***..................................................MMMMMMMMMMMMM..........MMMM....................................MMMMMM..........MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM........MMMMMMMMMMMMMM....MMMMMMMMM...............MMMMMM...........................MMMMMMM.......................................................",
    "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM................................................................MMMMMMMMMMMMMMMMM........MMMMMMM........MMMMMMMM............MMMMMMMMMMMMMM.....MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...MMMMMMMMMMMM...MMMMMMMMMMMM...MMMMMMMMMMMMMMM...........MMMM..MMMMMMM.......................MMMMMM",
  };

  /* Calculate current direction: */
  direction += (((speed / (double)SPEED_MAX) * curve) / 20.0);
  if (direction < 0) direction = 360;
  if (direction > 360) direction = 0;

  /* Sky: */
  for (row = 0; row < 5; row++) {
    for (col = 0; col < 80; col++) {
      c = horizon[row][(col + (int)direction) % 360];
      if (has_colors()) {
        switch (c) {
        case '*':
          attron(COLOR_PAIR(COL_YELLOW));
          break;
        case 'M':
          attron(COLOR_PAIR(COL_GREEN));
          break;
        default:
          attron(COLOR_PAIR(COL_RED));
          break;
        }
      }

      if (draw_blank) {
        mvaddch(row, col, ' ');
      } else {
        mvaddch(row, col, c);
      }

      if (has_colors()) {
        switch (c) {
        case '*':
          attroff(COLOR_PAIR(COL_YELLOW));
          break;
        case 'M':
          attroff(COLOR_PAIR(COL_GREEN));
          break;
        default:
          attroff(COLOR_PAIR(COL_RED));
          break;
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x740, %rsp            # imm = 0x740
movb %dl, %al
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
leaq -0x730(%rbp), %rdi
leaq 0x135a(%rip), %rsi      # 0x30a0
movl $0x70d, %edx            # imm = 0x70D
callq 0x10e0
cvtsi2sdl -0x8(%rbp), %xmm1
movsd 0x130b(%rip), %xmm0     # 0x3068
divsd %xmm0, %xmm1
cvtsi2sdl -0x4(%rbp), %xmm0
mulsd %xmm0, %xmm1
movsd 0x12ee(%rip), %xmm0     # 0x3060
divsd %xmm0, %xmm1
movss 0x336e(%rip), %xmm0     # 0x50ec
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x335a(%rip)     # 0x50ec
xorps %xmm0, %xmm0
ucomiss 0x3350(%rip), %xmm0     # 0x50ec
jbe 0x1dae
movss 0x12b2(%rip), %xmm0     # 0x3058
movss %xmm0, 0x333e(%rip)     # 0x50ec
movss 0x3336(%rip), %xmm0     # 0x50ec
movss 0x129a(%rip), %xmm1     # 0x3058
ucomiss %xmm1, %xmm0
jbe 0x1dce
xorps %xmm0, %xmm0
movss %xmm0, 0x331e(%rip)     # 0x50ec
movl $0x0, -0x10(%rbp)
cmpl $0x5, -0x10(%rbp)
jge 0x1fa6
movl $0x0, -0x14(%rbp)
cmpl $0x50, -0x14(%rbp)
jge 0x1f96
movslq -0x10(%rbp), %rcx
leaq -0x730(%rbp), %rax
imulq $0x169, %rcx, %rcx      # imm = 0x169
addq %rcx, %rax
movq %rax, -0x738(%rbp)
movl -0x14(%rbp), %eax
cvttss2si 0x32d5(%rip), %ecx # 0x50ec
addl %ecx, %eax
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
movq -0x738(%rbp), %rax
movslq %edx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x15(%rbp)
callq 0x1030
testb $0x1, %al
jne 0x1e3c
jmp 0x1ea8
movsbl -0x15(%rbp), %eax
movl %eax, -0x73c(%rbp)
subl $0x2a, %eax
je 0x1e5a
jmp 0x1e4d
movl -0x73c(%rbp), %eax
subl $0x4d, %eax
je 0x1e74
jmp 0x1e8e
movq 0x317f(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
jmp 0x1ea6
movq 0x3165(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
jmp 0x1ea6
movq 0x314b(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
jmp 0x1ea8
testb $0x1, -0x9(%rbp)
je 0x1ee0
movq 0x312b(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x1eca
jmp 0x1ede
movq 0x310f(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x20, %esi
callq 0x1160
jmp 0x1f0f
movq 0x30f9(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x1efc
jmp 0x1f0f
movq 0x30dd(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movsbl -0x15(%rbp), %esi
callq 0x1160
callq 0x1030
testb $0x1, %al
jne 0x1f1a
jmp 0x1f86
movsbl -0x15(%rbp), %eax
movl %eax, -0x740(%rbp)
subl $0x2a, %eax
je 0x1f38
jmp 0x1f2b
movl -0x740(%rbp), %eax
subl $0x4d, %eax
je 0x1f52
jmp 0x1f6c
movq 0x30a1(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
jmp 0x1f84
movq 0x3087(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
jmp 0x1f84
movq 0x306d(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
jmp 0x1f86
jmp 0x1f88
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1de6
jmp 0x1f98
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1dd5
addq $0x740, %rsp            # imm = 0x740
popq %rbp
retq
nop