#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int calculate(int, int, int, int const);
int /*<<< orphan*/ help();
int /*<<< orphan*/ printf(char *, ...);
int randomheight();
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ strcmp(char *, char *);
int windowcleaner(int);
int main(int argc, char *argv[]) {
  const int gravity = 100;
  int height;
  int speed;
  int burn;
  int tensec;
  int fuel;
  int prevheight;
  int step;
  char version[] = "1.1";
  char dead[] = "\nThere were no survivors.\n\n";
  char crashed[] = "\nThe Spaceship crashed. Good luck getting back home.\n\n";
  char success[] = "\nYou made it! Good job!\n\n";
  char emptyfuel[] =
      "\nThere is no fuel left. You're floating around like Wheatley.\n\n";
  printf("\nLunar Lander - Version %s\n", version);
  printf("This is a computer simulation of an Apollo lunar landing capsule.\n");
  printf("The on-board computer has failed so you have to land the capsule "
         "manually.\n");
  printf("Set burn rate of retro rockets to any value between 0 (free fall) "
         "and 200\n");
  printf("(maximum burn) kilo per second. Set burn rate every 10 seconds.\n");
  printf("Good Luck!\n");
  if (argc == 1) {
    speed = 1000;
    height = randomheight();
    fuel = 12000;
    tensec = 0;
    burn = 0;
    prevheight = height;
    step = 1;
  } else {
    if (strcmp(argv[1], "-d") == 0) {
      if (strcmp(argv[2], "1") == 0) {
        speed = 1000;
        height = randomheight();
        fuel = 12000;
        tensec = 0;
        burn = 0;
        prevheight = height;
        step = 1;
      }
      if (strcmp(argv[2], "2") == 0) {
        speed = 1000;
        height = randomheight();
        fuel = 1000;
        tensec = 0;
        burn = 0;
        prevheight = height;
        step = 1;
      }
      if (strcmp(argv[2], "3") == 0) {
        speed = 2000;
        height = randomheight() - 2000;
        fuel = 900;
        tensec = 0;
        burn = 0;
        prevheight = height;
        step = 1;
      } else {
        speed = 1000;
        height = randomheight();
        fuel = 12000;
        tensec = 0;
        burn = 0;
        prevheight = height;
        step = 1;
      }
    } else if (strcmp(argv[1], "--info") == 0) {
      printf("\nLunar Lander - Version %s\n", version);
      printf("Made by Lukas F%clling and Nicolai S%cper\n\n",
             (unsigned char)129, (unsigned char)129);
      printf("\n\nContact us at http://k40s.net\n");
      speed = 1000;
      height = randomheight();
      fuel = 12000;
      tensec = 0;
      burn = 0;
      prevheight = height;
      step = 1;
    } else if (strcmp(argv[1], "--help") == 0) {
      help();
      return 0;
    } else {
      speed = 1000;
      height = randomheight();
      fuel = 12000;
      tensec = 0;
      burn = 0;
      prevheight = height;
      step = 1;
    }
  }
  printf("\nTime\t");
  printf("Speed\t\t");
  printf("Fuel\t\t");
  printf("Height\t\t");
  printf("Burn\n");
  printf("----\t");
  printf("-----\t\t");
  printf("----\t\t");
  printf("------\t\t");
  printf("----\n");
  do {
    step = windowcleaner(step);
    printf("%d0\t", tensec);
    printf("%d\t\t", speed);
    printf("%d\t\t", fuel);
    if (height < prevheight) {
      printf("\x1b[31m%d\x1b[0m\t\t", height);
    } else if (height == prevheight) {
      printf("%d\t\t", height);
    } else if (height > prevheight) {
      printf("\x1b[32m%d\x1b[0m\t\t", height);
    }
    scanf("%i", &burn);
    if (burn < 0 || burn > 200) {
      printf("The burn rate rate must be between 0 and 200.\n");
      continue;
    }
    prevheight = height;
    speed = calculate(height, speed, burn, gravity);
    height = height - speed;
    fuel = fuel - burn;
    if (fuel <= 0) {
      break;
    }
    tensec++;
  } while (height > 0);
  if (height <= 0) {
    if (speed > 10) {
      printf("%s", dead);
    } else if (speed < 10 && speed > 3) {
      printf("%s", crashed);
    } else if (speed < 3) {
      printf("%s", success);
    }
  } else if (height > 0) {
    printf("%s", emptyfuel);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
mov    0xe5a(%rip),%eax
mov    %eax,-0x34(%rbp)
mov    0x1090(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x108d(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0x108a(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x1088(%rip),%eax
mov    %eax,-0x38(%rbp)
lea    -0x90(%rbp),%rdi
lea    0x107f(%rip),%rsi
mov    $0x37,%edx
call   1070 <memcpy@plt>
mov    0x10ae(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0x10a8(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0x10a2(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0x109c(%rip),%ax
mov    %ax,-0x98(%rbp)
lea    -0xf0(%rbp),%rdi
lea    0x108f(%rip),%rsi
mov    $0x40,%edx
call   1070 <memcpy@plt>
lea    -0x34(%rbp),%rsi
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    12d5 <main+0x155>
movl   $0x3e8,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2ee0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    1526 <main+0x3a6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe63(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1428 <main+0x2a8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd00(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1344 <main+0x1c4>
movl   $0x3e8,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2ee0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdf7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1395 <main+0x215>
movl   $0x3e8,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
mov    %eax,-0x18(%rbp)
movl   $0x3e8,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xda8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13f0 <main+0x270>
movl   $0x7d0,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
sub    $0x7d0,%eax
mov    %eax,-0x18(%rbp)
movl   $0x384,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    1423 <main+0x2a3>
movl   $0x3e8,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2ee0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    1521 <main+0x3a1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd17(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14b3 <main+0x333>
lea    -0x34(%rbp),%rsi
lea    0xbb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcf6(%rip),%rdi
mov    $0x81,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x3e8,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2ee0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    151c <main+0x39c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xce0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14e4 <main+0x364>
mov    $0x0,%al
call   10a0 <help@plt>
movl   $0x0,-0x4(%rbp)
jmp    1797 <main+0x617>
movl   $0x3e8,-0x1c(%rbp)
mov    $0x0,%al
call   1080 <randomheight@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2ee0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    151c <main+0x39c>
jmp    1521 <main+0x3a1>
jmp    1526 <main+0x3a6>
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%edi
call   1030 <windowcleaner@plt>
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%esi
lea    0xc1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xc10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xbff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1612 <main+0x492>
mov    -0x18(%rbp),%esi
lea    0xbe7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    165b <main+0x4db>
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jne    1634 <main+0x4b4>
mov    -0x18(%rbp),%esi
lea    0xbc0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1656 <main+0x4d6>
mov    -0x18(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    1651 <main+0x4d1>
mov    -0x18(%rbp),%esi
lea    0xbb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1656 <main+0x4d6>
jmp    165b <main+0x4db>
lea    0xba7(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x0,-0x20(%rbp)
jl     1682 <main+0x502>
cmpl   $0xc8,-0x20(%rbp)
jle    1695 <main+0x515>
lea    0xb83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16db <main+0x55b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    $0x64,%ecx
call   1050 <calculate@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jg     16d2 <main+0x552>
jmp    16e5 <main+0x565>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     15b2 <main+0x432>
cmpl   $0x0,-0x18(%rbp)
jg     176c <main+0x5ec>
cmpl   $0xa,-0x1c(%rbp)
jle    1710 <main+0x590>
lea    -0x50(%rbp),%rsi
lea    0xb37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1767 <main+0x5e7>
cmpl   $0xa,-0x1c(%rbp)
jge    173e <main+0x5be>
cmpl   $0x3,-0x1c(%rbp)
jle    173e <main+0x5be>
lea    -0x90(%rbp),%rsi
lea    0xb09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1762 <main+0x5e2>
cmpl   $0x3,-0x1c(%rbp)
jge    175d <main+0x5dd>
lea    -0xb0(%rbp),%rsi
lea    0xae5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1762 <main+0x5e2>
jmp    1767 <main+0x5e7>
jmp    1790 <main+0x610>
cmpl   $0x0,-0x18(%rbp)
jle    178b <main+0x60b>
lea    -0xf0(%rbp),%rsi
lea    0xab7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1790 <main+0x610>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x312e31,0xc(%rsp)
movups 0xe67(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xe4f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe83(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe67(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe4b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movabs $0xa0a2e656d6f68,%rax
mov    %rax,0x7f(%rsp)
movups 0xe7a(%rip),%xmm0
movups %xmm0,0x1a(%rsp)
movaps 0xe64(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xe89(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe6a(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe4b(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0xe7c(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf58(%rip),%rdi
call   1030 <puts@plt>
lea    0xf97(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd5(%rip),%rdi
call   1030 <puts@plt>
lea    0x1009(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebp
jne    1412 <main+0x292>
xor    %eax,%eax
call   1080 <randomheight@plt>
mov    %eax,%ebx
movl   $0x0,0x4(%rsp)
mov    $0x2ee0,%ebp
mov    $0x3e8,%r14d
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfab(%rip),%rdi
call   1030 <puts@plt>
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe2e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf6c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r13d
xor    %r15d,%r15d
mov    %ebx,0x8(%rsp)
jmp    1366 <main+0x1e6>
nopl   0x0(%rax,%rax,1)
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
test   %eax,%eax
jle    1481 <main+0x301>
mov    %r13d,%edi
call   1040 <windowcleaner@plt>
mov    %eax,%r13d
lea    0xdd5(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdc9(%rip),%r12
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    0x8(%rsp),%ebx
lea    0xdb8(%rip),%rdi
cmove  %r12,%rdi
lea    0xd9f(%rip),%rax
cmovl  %rax,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xda7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%edx
cmp    $0xc9,%edx
jae    1350 <main+0x1d0>
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x64,%ecx
call   1060 <calculate@plt>
mov    %eax,%r14d
mov    %ebx,%eax
sub    %r14d,%eax
sub    0x4(%rsp),%ebp
jle    1469 <main+0x2e9>
add    $0x1,%r15d
mov    %ebx,0x8(%rsp)
mov    %eax,%ebx
jmp    135e <main+0x1de>
mov    0x8(%rbx),%rdi
lea    0xcbf(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     14bd <main+0x33d>
mov    0x8(%rbx),%rdi
lea    0xcaf(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     156d <main+0x3ed>
mov    0x8(%rbx),%rdi
lea    0xcc9(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1295 <main+0x115>
xor    %eax,%eax
call   10a0 <help@plt>
jmp    1559 <main+0x3d9>
test   %eax,%eax
jle    1481 <main+0x301>
lea    0xd02(%rip),%rdi
lea    0x90(%rsp),%rsi
jmp    1552 <main+0x3d2>
cmp    $0xb,%r14d
jl     1498 <main+0x318>
lea    0xce8(%rip),%rdi
lea    0x30(%rsp),%rsi
jmp    1552 <main+0x3d2>
cmp    $0xa,%r14d
je     1540 <main+0x3c0>
cmp    $0x4,%r14d
jl     1540 <main+0x3c0>
lea    0xcc3(%rip),%rdi
lea    0x50(%rsp),%rsi
jmp    1552 <main+0x3d2>
mov    0x10(%rbx),%rdi
lea    0xc17(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    14e1 <main+0x361>
xor    %eax,%eax
call   1080 <randomheight@plt>
movl   $0x0,0x4(%rsp)
mov    0x10(%rbx),%rdi
lea    0xbf5(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    14fd <main+0x37d>
xor    %eax,%eax
call   1080 <randomheight@plt>
mov    0x10(%rbx),%rdi
lea    0xbdb(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1080 <randomheight@plt>
mov    %eax,%ebx
test   %rbp,%rbp
jne    129e <main+0x11e>
add    $0xfffff830,%ebx
movl   $0x0,0x4(%rsp)
mov    $0x384,%ebp
mov    $0x7d0,%r14d
jmp    12b1 <main+0x131>
cmp    $0x2,%r14d
jg     1559 <main+0x3d9>
lea    0xc29(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb4c(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb65(%rip),%rdi
mov    $0x81,%esi
mov    $0x81,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd34(%rip),%rdi
call   1030 <puts@plt>
jmp    1295 <main+0x115>

LLVM IR (-O0):
@__const.main.version = [4 x i8] c"1.1\00"
@__const.main.dead = [28 x i8] c"\0AThere were no survivors.\0A\0A\00"
@__const.main.crashed = [55 x i8] c"\0AThe Spaceship crashed. Good luck getting back home.\0A\0A\00"
@__const.main.success = [26 x i8] c"\0AYou made it! Good job!\0A\0A\00"
@__const.main.emptyfuel = [64 x i8] c"\0AThere is no fuel left. You're floating around like Wheatley.\0A\0A\00"
@.str = [28 x i8] c"\0ALunar Lander - Version %s\0A\00"
@.str.1 = [67 x i8] c"This is a computer simulation of an Apollo lunar landing capsule.\0A\00"
@.str.2 = [76 x i8] c"The on-board computer has failed so you have to land the capsule manually.\0A\00"
@.str.3 = [75 x i8] c"Set burn rate of retro rockets to any value between 0 (free fall) and 200\0A\00"
@.str.4 = [65 x i8] c"(maximum burn) kilo per second. Set burn rate every 10 seconds.\0A\00"
@.str.5 = [12 x i8] c"Good Luck!\0A\00"
@.str.6 = [3 x i8] c"-d\00"
@.str.7 = [2 x i8] c"1\00"
@.str.8 = [2 x i8] c"2\00"
@.str.9 = [2 x i8] c"3\00"
@.str.10 = [7 x i8] c"--info\00"
@.str.11 = [44 x i8] c"Made by Lukas F%clling and Nicolai S%cper\0A\0A\00"
@.str.12 = [33 x i8] c"\0A\0AContact us at http://k40s.net\0A\00"
@.str.13 = [7 x i8] c"--help\00"
@.str.14 = [7 x i8] c"\0ATime\09\00"
@.str.15 = [8 x i8] c"Speed\09\09\00"
@.str.16 = [7 x i8] c"Fuel\09\09\00"
@.str.17 = [9 x i8] c"Height\09\09\00"
@.str.18 = [6 x i8] c"Burn\0A\00"
@.str.19 = [6 x i8] c"----\09\00"
@.str.20 = [8 x i8] c"-----\09\09\00"
@.str.21 = [7 x i8] c"----\09\09\00"
@.str.22 = [9 x i8] c"------\09\09\00"
@.str.23 = [6 x i8] c"----\0A\00"
@.str.24 = [5 x i8] c"%d0\09\00"
@.str.25 = [5 x i8] c"%d\09\09\00"
@.str.26 = [14 x i8] c"\1B[31m%d\1B[0m\09\09\00"
@.str.27 = [14 x i8] c"\1B[32m%d\1B[0m\09\09\00"
@.str.28 = [3 x i8] c"%i\00"
@.str.29 = [47 x i8] c"The burn rate rate must be between 0 and 200.\0A\00"
@.str.30 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [4 x i8]
%15 = alloca [28 x i8]
%16 = alloca [55 x i8]
%17 = alloca [26 x i8]
%18 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%19 = bitcast [4 x i8]* %14 to i8*
%20 = bitcast [28 x i8]* %15 to i8*
%21 = bitcast [55 x i8]* %16 to i8*
%22 = bitcast [26 x i8]* %17 to i8*
%23 = bitcast [64 x i8]* %18 to i8*
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %36
33: ; preds = %2
store i32 1000, i32* %8
%34 = call i32 (...) @randomheight()
store i32 %34, i32* %7
store i32 12000, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%35 = load i32, i32* %7
store i32 %35, i32* %12
store i32 1, i32* %13
br label %101
36: ; preds = %2
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %74
42: ; preds = %36
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %42
store i32 1000, i32* %8
%49 = call i32 (...) @randomheight()
store i32 %49, i32* %7
store i32 12000, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%50 = load i32, i32* %7
store i32 %50, i32* %12
store i32 1, i32* %13
br label %51
51: ; preds = %48, %42
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 2
%54 = load i8*, i8** %53
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %51
store i32 1000, i32* %8
%58 = call i32 (...) @randomheight()
store i32 %58, i32* %7
store i32 1000, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%59 = load i32, i32* %7
store i32 %59, i32* %12
store i32 1, i32* %13
br label %60
60: ; preds = %57, %51
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 2
%63 = load i8*, i8** %62
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %60
store i32 2000, i32* %8
%67 = call i32 (...) @randomheight()
%68 = sub nsw i32 %67, 2000
store i32 %68, i32* %7
store i32 900, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%69 = load i32, i32* %7
store i32 %69, i32* %12
store i32 1, i32* %13
br label %73
70: ; preds = %60
store i32 1000, i32* %8
%71 = call i32 (...) @randomheight()
store i32 %71, i32* %7
store i32 12000, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%72 = load i32, i32* %7
store i32 %72, i32* %12
store i32 1, i32* %13
br label %73
73: ; preds = %70, %66
br label %100
74: ; preds = %36
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
%78 = call i64 @strcmp(i8* %77, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %74
%81 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %81)
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 129, i32 129)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
store i32 1000, i32* %8
%85 = call i32 (...) @randomheight()
store i32 %85, i32* %7
store i32 12000, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%86 = load i32, i32* %7
store i32 %86, i32* %12
store i32 1, i32* %13
br label %99
87: ; preds = %74
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 1
%90 = load i8*, i8** %89
%91 = call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %87
%94 = call i32 (...) @help()
store i32 0, i32* %3
br label %208
95: ; preds = %87
store i32 1000, i32* %8
%96 = call i32 (...) @randomheight()
store i32 %96, i32* %7
store i32 12000, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
%97 = load i32, i32* %7
store i32 %97, i32* %12
store i32 1, i32* %13
br label %98
98: ; preds = %95
br label %99
99: ; preds = %98, %80
br label %100
100: ; preds = %99, %73
br label %101
101: ; preds = %100, %33
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0))
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0))
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
br label %112
112: ; preds = %170, %101
%113 = load i32, i32* %13
%114 = call i32 @windowcleaner(i32 %113)
store i32 %114, i32* %13
%115 = load i32, i32* %10
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 %115)
%117 = load i32, i32* %8
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i32 %117)
%119 = load i32, i32* %11
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i32 %119)
%121 = load i32, i32* %7
%122 = load i32, i32* %12
%123 = icmp slt i32 %121, %122
br i1 %123, label %124, label %127
124: ; preds = %112
%125 = load i32, i32* %7
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.26, i64 0, i64 0), i32 %125)
br label %143
127: ; preds = %112
%128 = load i32, i32* %7
%129 = load i32, i32* %12
%130 = icmp eq i32 %128, %129
br i1 %130, label %131, label %134
131: ; preds = %127
%132 = load i32, i32* %7
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i32 %132)
br label %142
134: ; preds = %127
%135 = load i32, i32* %7
%136 = load i32, i32* %12
%137 = icmp sgt i32 %135, %136
br i1 %137, label %138, label %141
138: ; preds = %134
%139 = load i32, i32* %7
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0), i32 %139)
br label %141
141: ; preds = %138, %134
br label %142
142: ; preds = %141, %131
br label %143
143: ; preds = %142, %124
%144 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0), i32* %9)
%145 = load i32, i32* %9
%146 = icmp slt i32 %145, 0
br i1 %146, label %150, label %147
147: ; preds = %143
%148 = load i32, i32* %9
%149 = icmp sgt i32 %148, 200
br i1 %149, label %150, label %152
150: ; preds = %147, %143
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.29, i64 0, i64 0))
br label %170
152: ; preds = %147
%153 = load i32, i32* %7
store i32 %153, i32* %12
%154 = load i32, i32* %7
%155 = load i32, i32* %8
%156 = load i32, i32* %9
%157 = call i32 @calculate(i32 %154, i32 %155, i32 %156, i32 100)
store i32 %157, i32* %8
%158 = load i32, i32* %7
%159 = load i32, i32* %8
%160 = sub nsw i32 %158, %159
store i32 %160, i32* %7
%161 = load i32, i32* %11
%162 = load i32, i32* %9
%163 = sub nsw i32 %161, %162
store i32 %163, i32* %11
%164 = load i32, i32* %11
%165 = icmp sle i32 %164, 0
br i1 %165, label %166, label %167
166: ; preds = %152
br label %173
167: ; preds = %152
%168 = load i32, i32* %10
%169 = add nsw i32 %168, 1
store i32 %169, i32* %10
br label %170
170: ; preds = %167, %150
%171 = load i32, i32* %7
%172 = icmp sgt i32 %171, 0
br i1 %172, label %112, label %173
173: ; preds = %170, %166
%174 = load i32, i32* %7
%175 = icmp sle i32 %174, 0
br i1 %175, label %176, label %200
176: ; preds = %173
%177 = load i32, i32* %8
%178 = icmp sgt i32 %177, 10
br i1 %178, label %179, label %182
179: ; preds = %176
%180 = getelementptr inbounds [28 x i8], [28 x i8]* %15, i64 0, i64 0
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %180)
br label %199
182: ; preds = %176
%183 = load i32, i32* %8
%184 = icmp slt i32 %183, 10
br i1 %184, label %185, label %191
185: ; preds = %182
%186 = load i32, i32* %8
%187 = icmp sgt i32 %186, 3
br i1 %187, label %188, label %191
188: ; preds = %185
%189 = getelementptr inbounds [55 x i8], [55 x i8]* %16, i64 0, i64 0
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %189)
br label %198
191: ; preds = %185, %182
%192 = load i32, i32* %8
%193 = icmp slt i32 %192, 3
br i1 %193, label %194, label %197
194: ; preds = %191
%195 = getelementptr inbounds [26 x i8], [26 x i8]* %17, i64 0, i64 0
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %195)
br label %197
197: ; preds = %194, %191
br label %198
198: ; preds = %197, %188
br label %199
199: ; preds = %198, %179
br label %207
200: ; preds = %173
%201 = load i32, i32* %7
%202 = icmp sgt i32 %201, 0
br i1 %202, label %203, label %206
203: ; preds = %200
%204 = getelementptr inbounds [64 x i8], [64 x i8]* %18, i64 0, i64 0
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %204)
br label %206
206: ; preds = %203, %200
br label %207
207: ; preds = %206, %199
store i32 0, i32* %3
br label %208
208: ; preds = %207, %93
%209 = load i32, i32* %3
ret i32 %209
}

LLVM IR (-O2):
@__const.main.dead = [28 x i8] c"\0AThere were no survivors.\0A\0A\00"
@__const.main.crashed = [55 x i8] c"\0AThe Spaceship crashed. Good luck getting back home.\0A\0A\00"
@__const.main.success = [26 x i8] c"\0AYou made it! Good job!\0A\0A\00"
@__const.main.emptyfuel = [64 x i8] c"\0AThere is no fuel left. You're floating around like Wheatley.\0A\0A\00"
@.str = [28 x i8] c"\0ALunar Lander - Version %s\0A\00"
@.str.6 = [3 x i8] c"-d\00"
@.str.7 = [2 x i8] c"1\00"
@.str.8 = [2 x i8] c"2\00"
@.str.9 = [2 x i8] c"3\00"
@.str.10 = [7 x i8] c"--info\00"
@.str.11 = [44 x i8] c"Made by Lukas F%clling and Nicolai S%cper\0A\0A\00"
@.str.13 = [7 x i8] c"--help\00"
@.str.14 = [7 x i8] c"\0ATime\09\00"
@.str.15 = [8 x i8] c"Speed\09\09\00"
@.str.16 = [7 x i8] c"Fuel\09\09\00"
@.str.17 = [9 x i8] c"Height\09\09\00"
@.str.19 = [6 x i8] c"----\09\00"
@.str.20 = [8 x i8] c"-----\09\09\00"
@.str.21 = [7 x i8] c"----\09\09\00"
@.str.22 = [9 x i8] c"------\09\09\00"
@.str.24 = [5 x i8] c"%d0\09\00"
@.str.25 = [5 x i8] c"%d\09\09\00"
@.str.26 = [14 x i8] c"\1B[31m%d\1B[0m\09\09\00"
@.str.27 = [14 x i8] c"\1B[32m%d\1B[0m\09\09\00"
@.str.28 = [3 x i8] c"%i\00"
@.str.30 = [3 x i8] c"%s\00"
@str = [66 x i8] c"This is a computer simulation of an Apollo lunar landing capsule.\00"
@str.31 = [75 x i8] c"The on-board computer has failed so you have to land the capsule manually.\00"
@str.32 = [74 x i8] c"Set burn rate of retro rockets to any value between 0 (free fall) and 200\00"
@str.33 = [64 x i8] c"(maximum burn) kilo per second. Set burn rate every 10 seconds.\00"
@str.34 = [11 x i8] c"Good Luck!\00"
@str.35 = [5 x i8] c"Burn\00"
@str.36 = [5 x i8] c"----\00"
@str.37 = [46 x i8] c"The burn rate rate must be between 0 and 200.\00"
@str.38 = [32 x i8] c"\0A\0AContact us at http://k40s.net\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [28 x i8]
%6 = alloca [55 x i8]
%7 = alloca [26 x i8]
%8 = alloca [64 x i8]
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
store i32 3223089, i32* %4
%11 = getelementptr inbounds [28 x i8], [28 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [26 x i8], [26 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32* %4)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.31, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.32, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.33, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.34, i64 0, i64 0))
%21 = icmp eq i32 %0, 1
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = call i32 (...) @randomheight()
store i32 0, i32* %3
br label %67
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %50
29: ; preds = %24
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 (...) @randomheight()
store i32 0, i32* %3
br label %36
36: ; preds = %34, %29
%37 = load i8*, i8** %30
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 (...) @randomheight()
br label %42
42: ; preds = %40, %36
%43 = load i8*, i8** %30
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
%46 = call i32 (...) @randomheight()
br i1 %45, label %47, label %49
47: ; preds = %42
%48 = add nsw i32 %46, -2000
store i32 0, i32* %3
br label %67
49: ; preds = %42
store i32 0, i32* %3
br label %67
50: ; preds = %24
%51 = load i8*, i8** %25
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %50
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32* %4)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 129, i32 129)
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.38, i64 0, i64 0))
%58 = call i32 (...) @randomheight()
store i32 0, i32* %3
br label %67
59: ; preds = %50
%60 = load i8*, i8** %25
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (...) @help()
br label %136
65: ; preds = %59
%66 = call i32 (...) @randomheight()
store i32 0, i32* %3
br label %67
67: ; preds = %49, %47, %65, %54, %22
%68 = phi i32 [ 1000, %22 ], [ 2000, %47 ], [ 1000, %49 ], [ 1000, %54 ], [ 1000, %65 ]
%69 = phi i32 [ 12000, %22 ], [ 900, %47 ], [ 12000, %49 ], [ 12000, %54 ], [ 12000, %65 ]
%70 = phi i32 [ %23, %22 ], [ %48, %47 ], [ %46, %49 ], [ %58, %54 ], [ %66, %65 ]
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.35, i64 0, i64 0))
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0))
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0))
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0))
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.36, i64 0, i64 0))
br label %81
81: ; preds = %110, %67
%82 = phi i32 [ %70, %67 ], [ %111, %110 ]
%83 = phi i32 [ %68, %67 ], [ %112, %110 ]
%84 = phi i32 [ 0, %67 ], [ %113, %110 ]
%85 = phi i32 [ %69, %67 ], [ %114, %110 ]
%86 = phi i32 [ %70, %67 ], [ %115, %110 ]
%87 = phi i32 [ 1, %67 ], [ %88, %110 ]
%88 = call i32 @windowcleaner(i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 %84)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i32 %83)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i32 %85)
%92 = icmp slt i32 %82, %86
%93 = icmp eq i32 %82, %86
%94 = select i1 %93, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0)
%95 = select i1 %92, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.26, i64 0, i64 0), i8* %94
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %95, i32 %82)
%97 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0), i32* %3)
%98 = load i32, i32* %3
%99 = icmp ugt i32 %98, 200
br i1 %99, label %100, label %102
100: ; preds = %81
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.37, i64 0, i64 0))
br label %110
102: ; preds = %81
%103 = call i32 @calculate(i32 %82, i32 %83, i32 %98, i32 100)
%104 = sub nsw i32 %82, %103
%105 = load i32, i32* %3
%106 = sub nsw i32 %85, %105
%107 = icmp slt i32 %106, 1
br i1 %107, label %117, label %108
108: ; preds = %102
%109 = add nsw i32 %84, 1
br label %110
110: ; preds = %108, %100
%111 = phi i32 [ %82, %100 ], [ %104, %108 ]
%112 = phi i32 [ %83, %100 ], [ %103, %108 ]
%113 = phi i32 [ %84, %100 ], [ %109, %108 ]
%114 = phi i32 [ %85, %100 ], [ %106, %108 ]
%115 = phi i32 [ %86, %100 ], [ %82, %108 ]
%116 = icmp sgt i32 %111, 0
br i1 %116, label %81, label %119
117: ; preds = %102
%118 = icmp slt i32 %104, 1
br i1 %118, label %119, label %134
119: ; preds = %110, %117
%120 = phi i32 [ %103, %117 ], [ %112, %110 ]
%121 = icmp sgt i32 %120, 10
br i1 %121, label %122, label %124
122: ; preds = %119
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %11)
br label %136
124: ; preds = %119
%125 = icmp ne i32 %120, 10
%126 = icmp sgt i32 %120, 3
%127 = and i1 %125, %126
br i1 %127, label %128, label %130
128: ; preds = %124
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %12)
br label %136
130: ; preds = %124
%131 = icmp slt i32 %120, 3
br i1 %131, label %132, label %136
132: ; preds = %130
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %13)
br label %136
134: ; preds = %117
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i8* %14)
br label %136
136: ; preds = %128, %132, %130, %122, %134, %63
ret i32 0
}