#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*/ print_deathstar();
int /*<<< orphan*/ print_fail();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void death_star_wins() {
  int i = 0;
  print_deathstar();
  printf("                                   \\\\    ||    //\n");
  usleep(200000);
  printf("                                    \\\\   ||   //\n");
  usleep(200000);
  printf("                                     \\\\  ||  //\n");
  usleep(200000);
  printf("                                      \\\\ || //\n");
  usleep(200000);
  printf("                                         ||\n");
  for (i = 0; i < 30; i++) {
    usleep(100000);
    printf("                                         ||\n");
  }
  print_fail();
}


x86 assembly (clang, -O0):
<death_star_wins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <print_deathstar@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xedc(%rip),%rdi
call   1040 <printf@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xef7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xf11(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1e,-0x4(%rbp)
jge    11ef <death_star_wins+0xaf>
mov    $0x186a0,%edi
call   1060 <usleep@plt>
lea    0xeea(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11c1 <death_star_wins+0x81>
mov    $0x0,%al
call   1030 <print_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<death_star_wins>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <print_deathstar@plt>
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xee6(%rip),%rdi
call   1040 <puts@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xf00(%rip),%rdi
call   1040 <puts@plt>
mov    $0x30d40,%edi
call   1060 <usleep@plt>
lea    0xf19(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1e,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x186a0,%edi
call   1060 <usleep@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0xffffffff,%ebp
jne    11c0 <death_star_wins+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <print_fail@plt>

LLVM IR (-O0):
@.str = [51 x i8] c" \\\\ || //\0A\00"
@.str.1 = [50 x i8] c" \\\\ || //\0A\00"
@.str.2 = [49 x i8] c" \\\\ || //\0A\00"
@.str.3 = [48 x i8] c" \\\\ || //\0A\00"
@.str.4 = [45 x i8] c" ||\0A\00"
define void @death_star_wins() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_deathstar()
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @usleep(i32 200000)
%5 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @usleep(i32 200000)
%7 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @usleep(i32 200000)
%9 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @usleep(i32 200000)
%11 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %12
12: ; preds = %18, %0
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 30
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = call i32 @usleep(i32 100000)
%17 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
%22 = call i32 (...) @print_fail()
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c" \\\\ || //\00"
@str.5 = [49 x i8] c" \\\\ || //\00"
@str.6 = [48 x i8] c" \\\\ || //\00"
@str.7 = [47 x i8] c" \\\\ || //\00"
@str.9 = [44 x i8] c" ||\00"
define void @death_star_wins() {
%1 = tail call i32 (...) @print_deathstar()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @usleep(i32 200000)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @usleep(i32 200000)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 @usleep(i32 200000)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 @usleep(i32 200000)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.9, i64 0, i64 0))
br label %11
11: ; preds = %0, %11
%12 = phi i32 [ 0, %0 ], [ %15, %11 ]
%13 = tail call i32 @usleep(i32 100000)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.9, i64 0, i64 0))
%15 = add nuw nsw i32 %12, 1
%16 = icmp eq i32 %15, 30
br i1 %16, label %17, label %11
17: ; preds = %11
%18 = tail call i32 (...) @print_fail()
ret void
}