#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 /*<<< orphan*/ addShortEnemy(int);
int /*<<< orphan*/ addTallEnemy(int);
int qran_range(int /*<<< orphan*/, int);
int /*<<< orphan*/ set_spawn_delay(int);
void level0(int wave) {
  if (wave < 2) {
    addTallEnemy(((wave & 1 & 1) * (240 - 7) + 2));
  } else if (wave == 2) {
    addShortEnemy(((1 & 1) * (240 - 7) + 2));
    set_spawn_delay(5);
  } else if (wave == 3) {
    addTallEnemy(10);
    set_spawn_delay(20);
  } else {
    addTallEnemy(((qran_range(0, 2) & 1) * (240 - 7) + 2));
    set_spawn_delay(20);
  }
  if (wave == 0) {
    set_spawn_delay(10);
  }
}


x86 assembly (clang, -O0):
<level0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1171 <level0+0x31>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
and    $0x1,%eax
imul   $0xe9,%eax,%edi
add    $0x2,%edi
call   1030 <addTallEnemy@plt>
jmp    11e8 <level0+0xa8>
cmpl   $0x2,-0x4(%rbp)
jne    1194 <level0+0x54>
mov    $0xeb,%edi
call   1060 <addShortEnemy@plt>
mov    $0x5,%edi
call   1050 <set_spawn_delay@plt>
jmp    11e3 <level0+0xa3>
cmpl   $0x3,-0x4(%rbp)
jne    11b7 <level0+0x77>
mov    $0xa,%edi
call   1030 <addTallEnemy@plt>
mov    $0x14,%edi
call   1050 <set_spawn_delay@plt>
jmp    11de <level0+0x9e>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <qran_range@plt>
and    $0x1,%eax
imul   $0xe9,%eax,%edi
add    $0x2,%edi
call   1030 <addTallEnemy@plt>
mov    $0x14,%edi
call   1050 <set_spawn_delay@plt>
jmp    11e3 <level0+0xa3>
jmp    11e8 <level0+0xa8>
cmpl   $0x0,-0x4(%rbp)
jne    11fc <level0+0xbc>
mov    $0xa,%edi
call   1050 <set_spawn_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level0>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jge    1161 <level0+0x21>
mov    %ebx,%eax
and    $0x1,%eax
imul   $0xe9,%eax,%edi
add    $0x2,%edi
call   1030 <addTallEnemy@plt>
test   %ebx,%ebx
je     1180 <level0+0x40>
pop    %rbx
ret
cmp    $0x3,%ebx
je     118b <level0+0x4b>
cmp    $0x2,%ebx
jne    1192 <level0+0x52>
mov    $0xeb,%edi
call   1060 <addShortEnemy@plt>
mov    $0x5,%edi
pop    %rbx
jmp    1050 <set_spawn_delay@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1050 <set_spawn_delay@plt>
mov    $0xa,%edi
jmp    11aa <level0+0x6a>
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <qran_range@plt>
and    $0x1,%eax
imul   $0xe9,%eax,%edi
add    $0x2,%edi
call   1030 <addTallEnemy@plt>
mov    $0x14,%edi
pop    %rbx
jmp    1050 <set_spawn_delay@plt>

LLVM IR (-O0):
define void @level0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = and i32 %7, 1
%9 = mul nsw i32 %8, 233
%10 = add nsw i32 %9, 2
%11 = call i32 @addTallEnemy(i32 %10)
br label %33
12: ; preds = %1
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @addShortEnemy(i32 235)
%17 = call i32 @set_spawn_delay(i32 5)
br label %32
18: ; preds = %12
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = call i32 @addTallEnemy(i32 10)
%23 = call i32 @set_spawn_delay(i32 20)
br label %31
24: ; preds = %18
%25 = call i32 @qran_range(i32 0, i32 2)
%26 = and i32 %25, 1
%27 = mul nsw i32 %26, 233
%28 = add nsw i32 %27, 2
%29 = call i32 @addTallEnemy(i32 %28)
%30 = call i32 @set_spawn_delay(i32 20)
br label %31
31: ; preds = %24, %21
br label %32
32: ; preds = %31, %15
br label %33
33: ; preds = %32, %5
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @set_spawn_delay(i32 10)
br label %38
38: ; preds = %36, %33
ret void
}

LLVM IR (-O2):
define void @level0(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %14, label %3
3: ; preds = %1
switch i32 %0, label %8 [
i32 2, label %4
i32 3, label %6
]
4: ; preds = %3
%5 = tail call i32 @addShortEnemy(i32 235)
br label %20
6: ; preds = %3
%7 = tail call i32 @addTallEnemy(i32 10)
br label %20
8: ; preds = %3
%9 = tail call i32 @qran_range(i32 0, i32 2)
%10 = and i32 %9, 1
%11 = mul nuw nsw i32 %10, 233
%12 = add nuw nsw i32 %11, 2
%13 = tail call i32 @addTallEnemy(i32 %12)
br label %20
14: ; preds = %1
%15 = and i32 %0, 1
%16 = mul nuw nsw i32 %15, 233
%17 = add nuw nsw i32 %16, 2
%18 = tail call i32 @addTallEnemy(i32 %17)
%19 = icmp eq i32 %0, 0
br i1 %19, label %20, label %23
20: ; preds = %14, %4, %8, %6
%21 = phi i32 [ 20, %6 ], [ 20, %8 ], [ 5, %4 ], [ 10, %14 ]
%22 = tail call i32 @set_spawn_delay(i32 %21)
br label %23
23: ; preds = %20, %14
ret void
}