// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/racer/racer.c
// Function: draw_car
static void draw_car(int curve, int row, int hpos, bool player, bool draw_blank)
{
  int col;
  int road_width;
  int road_start;

  if (row == -1) {
    return;
  }

  /* Compensate for distance: */
  road_width = ((row - HORIZON_HEIGHT) * 4);
  hpos = ((float)hpos / 80.0) * road_width;

  /* Compensate for curve: */
  road_start = (curve / (float)(ROAD_HEIGHT - 1)) *
    (ROAD_HEIGHT - 1 - (row - HORIZON_HEIGHT));
  hpos -= road_start;

  /* Size of the car depends on the row where it is drawn: */
  if (row > 16) { /* Large */
    col = 34 - hpos;

    /* Body: */
    if (player) {
      if (has_colors()) {
        attron(COLOR_PAIR(COL_MAGENTA));
      }
      if (draw_blank) {
        mvaddstr(row    , col + 1, "          ");
        mvaddstr(row + 1, col    , "            ");
        mvaddstr(row + 2, col    , "            ");
      } else {
        mvaddstr(row    , col + 1, "/%%%%%%%%\\");
        mvaddstr(row + 1, col    , "/%%%%%%%%%%\\");
        mvaddstr(row + 2, col    , "|%%%%%%%%%%|");
      }
      if (has_colors()) {
        attroff(COLOR_PAIR(COL_MAGENTA));
      }

    } else {
      if (has_colors()) {
        attron(COLOR_PAIR(COL_CYAN));
      }
      if (draw_blank) {
        mvaddstr(row    , col + 1, "          ");
        mvaddstr(row + 1, col    , "            ");
        mvaddstr(row + 2, col    , "            ");
      } else {
        mvaddstr(row    , col + 1, "/########\\");
        mvaddstr(row + 1, col    , "/##########\\");
        mvaddstr(row + 2, col    , "|##########|");
      }
      if (has_colors()) {
        attroff(COLOR_PAIR(COL_CYAN));
      }
    }

    /* Tyres: */
    if (has_colors()) {
      attron(COLOR_PAIR(COL_BLUE));
    }
    if (draw_blank) {
      mvaddch(row + 2, col + 1,  ' ');
      mvaddch(row + 2, col + 2,  ' ');
      mvaddch(row + 2, col + 9,  ' ');
      mvaddch(row + 2, col + 10, ' ');
    } else {
      mvaddch(row + 2, col + 1,  '@');
      mvaddch(row + 2, col + 2,  '@');
      mvaddch(row + 2, col + 9,  '@');
      mvaddch(row + 2, col + 10, '@');
    }
    if (has_colors()) {
      attroff(COLOR_PAIR(COL_BLUE));
    }

  } else if (row > 11) { /* Medium */
    col = 36 - hpos;

    /* Body: */
    if (has_colors()) {
      attron(COLOR_PAIR(COL_CYAN));
    }
    if (draw_blank) {
      mvaddstr(row    , col + 1, "      ");
      mvaddstr(row + 1, col    , "        ");
    } else {
      mvaddstr(row    , col + 1, "/####\\");
      mvaddstr(row + 1, col    , "|######|");
    }
    if (has_colors()) {
      attroff(COLOR_PAIR(COL_CYAN));
    }

    /* Tyres: */
    if (has_colors()) {
      attron(COLOR_PAIR(COL_BLUE));
    }
    if (draw_blank) {
      mvaddch(row + 1, col + 1,  ' ');
      mvaddch(row + 1, col + 6,  ' ');
    } else {
      mvaddch(row + 1, col + 1,  '@');
      mvaddch(row + 1, col + 6,  '@');
    }
    if (has_colors()) {
      attroff(COLOR_PAIR(COL_BLUE));
    }

  } else if (row > 8) { /* Small */
    col = 38 - hpos;

    /* Body: */
    if (has_colors()) {
      attron(COLOR_PAIR(COL_CYAN));
    }
    if (draw_blank) {
      mvaddstr(row, col, "   ");
    } else {
      mvaddstr(row, col, "###");
    }
    if (has_colors()) {
      attroff(COLOR_PAIR(COL_CYAN));
    }

  } else if (row > 4) { /* Tiny */
    col = 39 - hpos;

    /* Body: */
    if (has_colors()) {
      attron(COLOR_PAIR(COL_CYAN));
    }
    if (draw_blank) {
      mvaddch(row, col, ' ');
    } else {
      mvaddch(row, col, '#');
    }
    if (has_colors()) {
      attroff(COLOR_PAIR(COL_CYAN));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $-0x1, %esi
je 0x2359
movl %r8d, %ebp
movl %esi, %ebx
leal -0x14(,%rbx,4), %eax
cvtsi2ss %edx, %xmm0
cvtss2sd %xmm0, %xmm0
divsd 0x1373(%rip), %xmm0     # 0x3080
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
divss 0x132f(%rip), %xmm0     # 0x3058
movl $0x17, %eax
subl %esi, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
subl %eax, %r12d
cmpl $0x11, %esi
jl 0x1e04
movl %ecx, %r15d
movl $0x22, %r14d
subl %r12d, %r14d
callq 0x1030
testb %r15b, %r15b
je 0x1e93
testb %al, %al
je 0x1d7f
movq 0x3270(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x600, %esi            # imm = 0x600
xorl %edx, %edx
callq 0x10c0
movq 0x325a(%rip), %r15      # 0x4fe0
movq (%r15), %rdi
movl $0x23, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
testb %bpl, %bpl
je 0x1fa7
cmpl $-0x1, %eax
je 0x1dba
movq (%r15), %rdi
leaq 0x1aed(%rip), %rsi      # 0x389d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x1(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x1de1
movq (%r15), %rdi
leaq 0x1ac4(%rip), %rsi      # 0x389b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x2(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x200e
leaq 0x1a9c(%rip), %rsi      # 0x389b
jmp 0x2001
cmpl $0xc, %ebx
jl 0x1f32
movl $0x24, %r14d
callq 0x1030
testb %al, %al
je 0x1e32
movq 0x31bd(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x10c0
subl %r12d, %r14d
movq 0x31a4(%rip), %r15      # 0x4fe0
movq (%r15), %rdi
movl $0x25, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
testb %bpl, %bpl
je 0x2019
cmpl $-0x1, %eax
je 0x1e70
movq (%r15), %rdi
leaq 0x1a3b(%rip), %rsi      # 0x38a1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x1(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x2059
leaq 0x1a11(%rip), %rsi      # 0x389f
jmp 0x204c
testb %al, %al
je 0x1ead
movq 0x3142(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x10c0
movq 0x312c(%rip), %r15      # 0x4fe0
movq (%r15), %rdi
movl $0x23, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
testb %bpl, %bpl
je 0x20d4
cmpl $-0x1, %eax
je 0x1ee8
movq (%r15), %rdi
leaq 0x19bf(%rip), %rsi      # 0x389d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x1(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x1f0f
movq (%r15), %rdi
leaq 0x1996(%rip), %rsi      # 0x389b
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x2(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x213b
leaq 0x196e(%rip), %rsi      # 0x389b
jmp 0x212e
cmpl $0x9, %ebx
jl 0x2293
movl $0x26, %r14d
subl %r12d, %r14d
callq 0x1030
testb %al, %al
je 0x1f63
movq 0x308c(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x10c0
movq 0x3076(%rip), %r15      # 0x4fe0
movq (%r15), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x22f3
leaq 0x191d(%rip), %rax      # 0x38a4
leaq 0x1974(%rip), %rsi      # 0x3902
testb %bpl, %bpl
cmovneq %rax, %rsi
movq (%r15), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
jmp 0x22f3
cmpl $-0x1, %eax
je 0x1fc0
movq (%r15), %rdi
leaq 0x18f2(%rip), %rsi      # 0x38a8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x1(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x1fe7
movq (%r15), %rdi
leaq 0x18d6(%rip), %rsi      # 0x38b3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x2(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x200e
leaq 0x18bf(%rip), %rsi      # 0x38c0
movq (%r15), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movl $0x600, %r14d           # imm = 0x600
jmp 0x2141
cmpl $-0x1, %eax
je 0x2032
movq (%r15), %rdi
leaq 0x18ca(%rip), %rsi      # 0x38f2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x1(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x2059
leaq 0x18ad(%rip), %rsi      # 0x38f9
movq (%r15), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
callq 0x1030
testb %al, %al
je 0x2071
movq (%r15), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x1190
callq 0x1030
testb %al, %al
je 0x2089
movq (%r15), %rdi
movl $0x500, %esi            # imm = 0x500
xorl %edx, %edx
callq 0x10c0
movq (%r15), %rdi
incl %ebx
movl $0x25, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
testb %bpl, %bpl
je 0x22fa
cmpl $-0x1, %eax
je 0x20b8
movq (%r15), %rdi
movl $0x20, %esi
callq 0x1150
movq (%r15), %rdi
movl $0x2a, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
movl $0x20, %esi
jmp 0x2323
cmpl $-0x1, %eax
je 0x20ed
movq (%r15), %rdi
leaq 0x17ea(%rip), %rsi      # 0x38cd
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x1(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x2114
movq (%r15), %rdi
leaq 0x17ce(%rip), %rsi      # 0x38d8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movq (%r15), %rdi
leal 0x2(%rbx), %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x213b
leaq 0x17b7(%rip), %rsi      # 0x38e5
movq (%r15), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1180
movl $0x700, %r14d           # imm = 0x700
callq 0x1030
testb %al, %al
je 0x215e
movq 0x2e8f(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x1190
callq 0x1030
testb %al, %al
je 0x217d
movq 0x2e72(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x500, %esi            # imm = 0x500
xorl %edx, %edx
callq 0x10c0
movq 0x2e5c(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
addl $0x2, %ebx
movl $0x23, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
testb %bpl, %bpl
je 0x2211
cmpl $-0x1, %eax
je 0x21b0
movq (%r14), %rdi
movl $0x20, %esi
callq 0x1150
movq (%r14), %rdi
movl $0x24, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
cmpl $-0x1, %eax
je 0x21d4
movq (%r14), %rdi
movl $0x20, %esi
callq 0x1150
movq (%r14), %rdi
movl $0x2b, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
cmpl $-0x1, %eax
je 0x21f8
movq (%r14), %rdi
movl $0x20, %esi
callq 0x1150
movq (%r14), %rdi
movl $0x2c, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
movl $0x20, %esi
jmp 0x2282
cmpl $-0x1, %eax
je 0x2223
movq (%r14), %rdi
movl $0x40, %esi
callq 0x1150
movq (%r14), %rdi
movl $0x24, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
cmpl $-0x1, %eax
je 0x2247
movq (%r14), %rdi
movl $0x40, %esi
callq 0x1150
movq (%r14), %rdi
movl $0x2b, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
cmpl $-0x1, %eax
je 0x226b
movq (%r14), %rdi
movl $0x40, %esi
callq 0x1150
movq (%r14), %rdi
movl $0x2c, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
movl $0x40, %esi
cmpl $-0x1, %eax
je 0x2330
movq (%r14), %rdi
jmp 0x232b
cmpl $0x5, %ebx
jl 0x2359
movl $0x27, %r14d
subl %r12d, %r14d
callq 0x1030
testb %al, %al
je 0x22c4
movq 0x2d2b(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x10c0
movq 0x2d15(%rip), %r15      # 0x4fe0
movq (%r15), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x1140
cmpl $-0x1, %eax
je 0x22f3
xorb $0x1, %bpl
movzbl %bpl, %eax
leal (%rax,%rax,2), %esi
addl $0x20, %esi
movq (%r15), %rdi
callq 0x1150
movl $0x700, %ebx            # imm = 0x700
jmp 0x2335
cmpl $-0x1, %eax
je 0x230c
movq (%r15), %rdi
movl $0x40, %esi
callq 0x1150
movq (%r15), %rdi
movl $0x2a, %edx
subl %r12d, %edx
movl %ebx, %esi
callq 0x1140
movl $0x40, %esi
cmpl $-0x1, %eax
je 0x2330
movq (%r15), %rdi
callq 0x1150
movl $0x500, %ebx            # imm = 0x500
callq 0x1030
testb %al, %al
je 0x2359
movq 0x2c9b(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl %ebx, %esi
xorl %edx, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1190
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq