#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 COLS;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ deleteLink();
int /*<<< orphan*/ move(int /*<<< orphan*/, int);
int /*<<< orphan*/ setTicker(int /*<<< orphan*/);
void over(int i) {
  move(0, 0);
  int j;
  for (j = 0; j < COLS; j++)
    addstr(" ");
  move(0, 2);
  if (1 == i)
    addstr("Crash the wall. Game over");
  else if (2 == i)
    addstr("Crash itself. Game over");
  else if (3 == i)
    addstr("Mission Complete");
  setTicker(0);
  deleteLink();
}


x86 assembly (clang, -O0):
<over>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1060 <move@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%eax
jge    1187 <over+0x47>
lea    0xe8c(%rip),%rdi
call   1050 <addstr@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <over+0x1b>
xor    %edi,%edi
mov    $0x2,%esi
call   1060 <move@plt>
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jne    11b2 <over+0x72>
lea    0xe5a(%rip),%rdi
call   1050 <addstr@plt>
jmp    11f5 <over+0xb5>
mov    $0x2,%eax
cmp    -0x4(%rbp),%eax
jne    11d1 <over+0x91>
lea    0xe55(%rip),%rdi
call   1050 <addstr@plt>
jmp    11f0 <over+0xb0>
mov    $0x3,%eax
cmp    -0x4(%rbp),%eax
jne    11eb <over+0xab>
lea    0xe4e(%rip),%rdi
call   1050 <addstr@plt>
jmp    11f0 <over+0xb0>
jmp    11f5 <over+0xb5>
xor    %edi,%edi
call   1030 <setTicker@plt>
mov    $0x0,%al
call   1040 <deleteLink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<over>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xor    %ebp,%ebp
xor    %edi,%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    0x2e8c(%rip),%r15
cmpl   $0x0,(%r15)
jle    1180 <over+0x40>
lea    0xe97(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <addstr@plt>
add    $0x1,%ebp
cmp    (%r15),%ebp
jl     1170 <over+0x30>
xor    %edi,%edi
mov    $0x2,%esi
call   1060 <move@plt>
add    $0xffffffff,%r14d
cmp    $0x2,%r14d
ja     11ac <over+0x6c>
movslq %r14d,%rax
lea    0xea8(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1050 <addstr@plt>
xor    %edi,%edi
call   1030 <setTicker@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <deleteLink@plt>

LLVM IR (-O0):
@COLS = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [26 x i8] c"Crash the wall. Game over\00"
@.str.2 = [24 x i8] c"Crash itself. Game over\00"
@.str.3 = [17 x i8] c"Mission Complete\00"
define void @over(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @move(i32 0, i32 0)
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %3
%7 = load i32, i32* @COLS
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %5
14: ; preds = %5
%15 = call i32 @move(i32 0, i32 2)
%16 = load i32, i32* %2
%17 = icmp eq i32 1, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @addstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %32
20: ; preds = %14
%21 = load i32, i32* %2
%22 = icmp eq i32 2, %21
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @addstr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %31
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp eq i32 3, %26
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @addstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
br label %31
31: ; preds = %30, %23
br label %32
32: ; preds = %31, %18
%33 = call i32 @setTicker(i32 0)
%34 = call i32 (...) @deleteLink()
ret void
}

LLVM IR (-O2):
@COLS = global i32 0
@.str = [2 x i8] c" \00"
@.str.1 = [26 x i8] c"Crash the wall. Game over\00"
@.str.2 = [24 x i8] c"Crash itself. Game over\00"
@.str.3 = [17 x i8] c"Mission Complete\00"
@reltable.over = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.over to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.over to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([17 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.over to i64)) to i32)]
define void @over(i32 %0) {
%2 = tail call i32 @move(i32 0, i32 0)
%3 = load i32, i32* @COLS
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @addstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = load i32, i32* @COLS
%10 = icmp slt i32 %8, %9
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = tail call i32 @move(i32 0, i32 2)
%13 = add i32 %0, -1
%14 = icmp ult i32 %13, 3
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = sext i32 %13 to i64
%17 = shl i64 %16, 2
%18 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.over to i8*), i64 %17)
%19 = tail call i32 @addstr(i8* %18)
br label %20
20: ; preds = %11, %15
%21 = tail call i32 @setTicker(i32 0)
%22 = tail call i32 (...) @deleteLink()
ret void
}