#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *, ...);
int /*<<< orphan*/ refresh_screen();
int /*<<< orphan*/ usleep(int);
void delay(int milis) {
  attron(COLOR_PAIR(3));
  mvprintw(6, 14, "Delay %d milis", milis);
  attroff(COLOR_PAIR(3));
  refresh_screen();
  usleep(milis * 1000);
  mvprintw(6, 14, "                   ");
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%ecx
mov    $0x6,%edi
mov    $0xe,%esi
lea    0xe70(%rip),%rdx
mov    $0x0,%al
call   1070 <mvprintw@plt>
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    $0x0,%al
call   1060 <refresh_screen@plt>
imul   $0x3e8,-0x4(%rbp),%edi
call   1080 <usleep@plt>
mov    $0x6,%edi
mov    $0xe,%esi
lea    0xe43(%rip),%rdx
mov    $0x0,%al
call   1070 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xe85(%rip),%rdx
mov    $0x6,%edi
mov    $0xe,%esi
mov    %ebx,%ecx
xor    %eax,%eax
call   1070 <mvprintw@plt>
mov    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %eax,%eax
call   1060 <refresh_screen@plt>
imul   $0x3e8,%ebx,%edi
call   1080 <usleep@plt>
lea    0xe57(%rip),%rdx
mov    $0x6,%edi
mov    $0xe,%esi
xor    %eax,%eax
pop    %rbx
jmp    1070 <mvprintw@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Delay %d milis\00"
@.str.1 = [20 x i8] c" \00"
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @COLOR_PAIR(i32 3)
%4 = call i32 @attron(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 6, i32 14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @COLOR_PAIR(i32 3)
%8 = call i32 @attroff(i32 %7)
%9 = call i32 (...) @refresh_screen()
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 1000
%12 = call i32 @usleep(i32 %11)
%13 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 6, i32 14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Delay %d milis\00"
@.str.1 = [20 x i8] c" \00"
define void @delay(i32 %0) {
%2 = tail call i32 @COLOR_PAIR(i32 3)
%3 = tail call i32 @attron(i32 %2)
%4 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 6, i32 14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @COLOR_PAIR(i32 3)
%6 = tail call i32 @attroff(i32 %5)
%7 = tail call i32 (...) @refresh_screen()
%8 = mul nsw i32 %0, 1000
%9 = tail call i32 @usleep(i32 %8)
%10 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 6, i32 14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}