#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*/ A_BOLD;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ usleep(int);
void ui_draw_end(int death) {
  clear();
  attron(A_BOLD);
  if (death) {
    for (int i = 0; i < 10; i++) {
      printw("YOU ARE DEAD!\n");
      refresh();
      usleep(200000);
      clear();
      refresh();
      usleep(200000);
    }
  }
  clear();
  printw("Quitting.\n");
  attroff(A_BOLD);
  refresh();
}


x86 assembly (clang, -O0):
<ui_draw_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1070 <clear@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
cmpl   $0x0,-0x4(%rbp)
je     11e3 <ui_draw_end+0x83>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11de <ui_draw_end+0x7e>
lea    0xe5e(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1191 <ui_draw_end+0x31>
jmp    11e3 <ui_draw_end+0x83>
mov    $0x0,%al
call   1070 <clear@plt>
lea    0xe1e(%rip),%rdi
call   1050 <printw@plt>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_draw_end>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1070 <clear@plt>
mov    0x2e6c(%rip),%r14
mov    (%r14),%edi
call   1040 <attron@plt>
test   %ebx,%ebx
je     1375 <ui_draw_end+0x215>
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x30d40,%edi
call   1080 <usleep@plt>
xor    %eax,%eax
call   1070 <clear@plt>
lea    0xc8c(%rip),%rdi
call   1050 <printw@plt>
mov    (%r14),%edi
call   1030 <attroff@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <refresh@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [15 x i8] c"YOU ARE DEAD!\0A\00"
@.str.1 = [11 x i8] c"Quitting.\0A\00"
define void @ui_draw_end(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @clear()
%5 = load i32, i32* @A_BOLD
%6 = call i32 @attron(i32 %5)
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @refresh()
%16 = call i32 @usleep(i32 200000)
%17 = call i32 (...) @clear()
%18 = call i32 (...) @refresh()
%19 = call i32 @usleep(i32 200000)
br label %20
20: ; preds = %13
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %10
23: ; preds = %10
br label %24
24: ; preds = %23, %1
%25 = call i32 (...) @clear()
%26 = call i32 @printw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @A_BOLD
%28 = call i32 @attroff(i32 %27)
%29 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [15 x i8] c"YOU ARE DEAD!\0A\00"
@.str.1 = [11 x i8] c"Quitting.\0A\00"
define void @ui_draw_end(i32 %0) {
%2 = tail call i32 (...) @clear()
%3 = load i32, i32* @A_BOLD
%4 = tail call i32 @attron(i32 %3)
%5 = icmp eq i32 %0, 0
br i1 %5, label %67, label %6
6: ; preds = %1
%7 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 @usleep(i32 200000)
%10 = tail call i32 (...) @clear()
%11 = tail call i32 (...) @refresh()
%12 = tail call i32 @usleep(i32 200000)
%13 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 (...) @refresh()
%15 = tail call i32 @usleep(i32 200000)
%16 = tail call i32 (...) @clear()
%17 = tail call i32 (...) @refresh()
%18 = tail call i32 @usleep(i32 200000)
%19 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 (...) @refresh()
%21 = tail call i32 @usleep(i32 200000)
%22 = tail call i32 (...) @clear()
%23 = tail call i32 (...) @refresh()
%24 = tail call i32 @usleep(i32 200000)
%25 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%26 = tail call i32 (...) @refresh()
%27 = tail call i32 @usleep(i32 200000)
%28 = tail call i32 (...) @clear()
%29 = tail call i32 (...) @refresh()
%30 = tail call i32 @usleep(i32 200000)
%31 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%32 = tail call i32 (...) @refresh()
%33 = tail call i32 @usleep(i32 200000)
%34 = tail call i32 (...) @clear()
%35 = tail call i32 (...) @refresh()
%36 = tail call i32 @usleep(i32 200000)
%37 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%38 = tail call i32 (...) @refresh()
%39 = tail call i32 @usleep(i32 200000)
%40 = tail call i32 (...) @clear()
%41 = tail call i32 (...) @refresh()
%42 = tail call i32 @usleep(i32 200000)
%43 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%44 = tail call i32 (...) @refresh()
%45 = tail call i32 @usleep(i32 200000)
%46 = tail call i32 (...) @clear()
%47 = tail call i32 (...) @refresh()
%48 = tail call i32 @usleep(i32 200000)
%49 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%50 = tail call i32 (...) @refresh()
%51 = tail call i32 @usleep(i32 200000)
%52 = tail call i32 (...) @clear()
%53 = tail call i32 (...) @refresh()
%54 = tail call i32 @usleep(i32 200000)
%55 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%56 = tail call i32 (...) @refresh()
%57 = tail call i32 @usleep(i32 200000)
%58 = tail call i32 (...) @clear()
%59 = tail call i32 (...) @refresh()
%60 = tail call i32 @usleep(i32 200000)
%61 = tail call i32 @printw(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%62 = tail call i32 (...) @refresh()
%63 = tail call i32 @usleep(i32 200000)
%64 = tail call i32 (...) @clear()
%65 = tail call i32 (...) @refresh()
%66 = tail call i32 @usleep(i32 200000)
br label %67
67: ; preds = %6, %1
%68 = tail call i32 (...) @clear()
%69 = tail call i32 @printw(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%70 = load i32, i32* @A_BOLD
%71 = tail call i32 @attroff(i32 %70)
%72 = tail call i32 (...) @refresh()
ret void
}