// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/racer/racer.c
// Function: draw_road
static void draw_road(int curve, int speed, bool draw_blank)
{
  static unsigned int ticks = 0;
  int row;
  int col;
  int road_start;
  int road_width;
  bool divider_toggle;

  curve += 36; /* Relative to center. */

  divider_toggle = ((ticks * speed) / SPEED_MAX) % 2;

  for (row = 0; row < ROAD_HEIGHT; row++) {
    road_start = (curve / (float)(ROAD_HEIGHT - 1)) * (ROAD_HEIGHT - 1 - row);
    road_width = ((row * 4) + 1);

    /* Left side of the road: */
    for (col = 0; col < road_start + 3; col++) {
      if (has_colors()) {
        attron(COLOR_PAIR(COL_GREEN));
      }
      if (draw_blank) {
        mvaddch(5 + row, col, ' ');
      } else {
        mvaddch(5 + row, col, '#');
      }
      if (has_colors()) {
        attroff(COLOR_PAIR(COL_GREEN));
      }
    }
    
    /* Lane divider: */
    if (row > 1 && (row % 2 == divider_toggle)) {
      if (has_colors()) {
        attron(COLOR_PAIR(COL_WHITE));
      }
      if (draw_blank) {
        mvaddch(5 + row, road_start + (road_width / 2) + 3, ' ');
      } else {
        mvaddch(5 + row, road_start + (road_width / 2) + 3, '|');
      }
      if (has_colors()) {
        attroff(COLOR_PAIR(COL_WHITE));
      }
    }

    /* Right side of the road: */
    for (col = road_start + road_width + 3; col < 80; col++) {
      if (has_colors()) {
        attron(COLOR_PAIR(COL_GREEN));
      }
      if (draw_blank) {
        mvaddch(5 + row, col, ' ');
      } else {
        mvaddch(5 + row, col, '#');
      }
      if (has_colors()) {
        attroff(COLOR_PAIR(COL_GREEN));
      }
    }
  }

  ticks++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movl -0x4(%rbp), %eax
addl $0x24, %eax
movl %eax, -0x4(%rbp)
movl 0x311c(%rip), %eax      # 0x50f0
imull -0x8(%rbp), %eax
movl $0x1e, %ecx
xorl %edx, %edx
divl %ecx
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x1d(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x13, -0x10(%rbp)
jge 0x2301
cvtsi2ssl -0x4(%rbp), %xmm0
movss 0x104f(%rip), %xmm1     # 0x305c
divss %xmm1, %xmm0
movl $0x12, %eax
subl -0x10(%rbp), %eax
cvtsi2ss %eax, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
shll $0x2, %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
addl $0x3, %ecx
cmpl %ecx, %eax
jge 0x2110
callq 0x1030
testb $0x1, %al
jne 0x2057
jmp 0x206f
movq 0x2f82(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
testb $0x1, -0x9(%rbp)
je 0x20aa
movq 0x2f64(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl $0x5, %esi
movl -0x14(%rbp), %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x2094
jmp 0x20a8
movq 0x2f45(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x20, %esi
callq 0x1160
jmp 0x20dd
movq 0x2f2f(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl $0x5, %esi
movl -0x14(%rbp), %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x20c9
jmp 0x20dd
movq 0x2f10(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x23, %esi
callq 0x1160
callq 0x1030
testb $0x1, %al
jne 0x20e8
jmp 0x2100
movq 0x2ef1(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
jmp 0x2102
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x203b
cmpl $0x1, -0x10(%rbp)
jle 0x2217
movl -0x10(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movb -0x1d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl %eax, %edx
jne 0x2217
callq 0x1030
testb $0x1, %al
jne 0x2140
jmp 0x2158
movq 0x2e99(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
testb $0x1, -0x9(%rbp)
je 0x21a9
movq 0x2e7b(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl $0x5, %esi
movl -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x24(%rbp), %edx
addl %eax, %edx
addl $0x3, %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x2193
jmp 0x21a7
movq 0x2e46(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x20, %esi
callq 0x1160
jmp 0x21f2
movq 0x2e30(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl $0x5, %esi
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x28(%rbp), %edx
addl %eax, %edx
addl $0x3, %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x21de
jmp 0x21f2
movq 0x2dfb(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x7c, %esi
callq 0x1160
callq 0x1030
testb $0x1, %al
jne 0x21fd
jmp 0x2215
movq 0x2ddc(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
jmp 0x2217
movl -0x18(%rbp), %eax
addl -0x1c(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x14(%rbp)
cmpl $0x50, -0x14(%rbp)
jge 0x22f1
callq 0x1030
testb $0x1, %al
jne 0x2238
jmp 0x2250
movq 0x2da1(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x10c0
testb $0x1, -0x9(%rbp)
je 0x228b
movq 0x2d83(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl $0x5, %esi
movl -0x14(%rbp), %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x2275
jmp 0x2289
movq 0x2d64(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x20, %esi
callq 0x1160
jmp 0x22be
movq 0x2d4e(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
addl $0x5, %esi
movl -0x14(%rbp), %edx
callq 0x1150
cmpl $-0x1, %eax
jne 0x22aa
jmp 0x22be
movq 0x2d2f(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x23, %esi
callq 0x1160
callq 0x1030
testb $0x1, %al
jne 0x22c9
jmp 0x22e1
movq 0x2d10(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x300, %esi            # imm = 0x300
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
jmp 0x22e3
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2223
jmp 0x22f3
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1ff6
movl 0x2de9(%rip), %eax      # 0x50f0
addl $0x1, %eax
movl %eax, 0x2de0(%rip)      # 0x50f0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)