#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stderr, "Aaaaaaaaa, zle!\n");
  fprintf(stdout, "Jakos tam!\n");
  fprintf(stdout, "Ha!\n");
  int i = 0;
  while (i < 5) {
    printf("2");
    fflush(stdout);
    sleep(1);
    i++;
  }
  while (i < 10) {
    printf("1");
    sleep(1);
    i++;
  }
  while (i < 15) {
    fprintf(stderr, ".");
    sleep(1);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11d8 <main+0x98>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119c <main+0x5c>
jmp    11dd <main+0x9d>
cmpl   $0xa,-0x14(%rbp)
jge    120b <main+0xcb>
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11dd <main+0x9d>
jmp    1210 <main+0xd0>
cmpl   $0xf,-0x14(%rbp)
jge    1247 <main+0x107>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xdfc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1210 <main+0xd0>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e95(%rip),%r14
mov    (%r14),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e77(%rip),%rbx
mov    (%rbx),%edi
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    (%r14),%edi
lea    0xdb0(%rip),%rbx
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Aaaaaaaaa, zle!\0A\00"
@stdout = global i32 0
@.str.1 = [12 x i8] c"Jakos tam!\0A\00"
@.str.2 = [5 x i8] c"Ha!\0A\00"
@.str.3 = [2 x i8] c"2\00"
@.str.4 = [2 x i8] c"1\00"
@.str.5 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %13
13: ; preds = %16, %2
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 5
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
%20 = call i32 @sleep(i32 1)
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %13
23: ; preds = %13
br label %24
24: ; preds = %27, %23
%25 = load i32, i32* %6
%26 = icmp slt i32 %25, 10
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @sleep(i32 1)
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %24
32: ; preds = %24
br label %33
33: ; preds = %36, %32
%34 = load i32, i32* %6
%35 = icmp slt i32 %34, 15
br i1 %35, label %36, label %42
36: ; preds = %33
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%39 = call i32 @sleep(i32 1)
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %33
42: ; preds = %33
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Aaaaaaaaa, zle!\0A\00"
@stdout = global i32 0
@.str.1 = [12 x i8] c"Jakos tam!\0A\00"
@.str.2 = [5 x i8] c"Ha!\0A\00"
@.str.5 = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 50)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
%12 = tail call i32 @sleep(i32 1)
%13 = tail call i32 @putchar(i32 50)
%14 = load i32, i32* @stdout
%15 = tail call i32 @fflush(i32 %14)
%16 = tail call i32 @sleep(i32 1)
%17 = tail call i32 @putchar(i32 50)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
%20 = tail call i32 @sleep(i32 1)
%21 = tail call i32 @putchar(i32 50)
%22 = load i32, i32* @stdout
%23 = tail call i32 @fflush(i32 %22)
%24 = tail call i32 @sleep(i32 1)
%25 = tail call i32 @putchar(i32 50)
%26 = load i32, i32* @stdout
%27 = tail call i32 @fflush(i32 %26)
%28 = tail call i32 @sleep(i32 1)
%29 = tail call i32 @putchar(i32 49)
%30 = tail call i32 @sleep(i32 1)
%31 = tail call i32 @putchar(i32 49)
%32 = tail call i32 @sleep(i32 1)
%33 = tail call i32 @putchar(i32 49)
%34 = tail call i32 @sleep(i32 1)
%35 = tail call i32 @putchar(i32 49)
%36 = tail call i32 @sleep(i32 1)
%37 = tail call i32 @putchar(i32 49)
%38 = tail call i32 @sleep(i32 1)
%39 = load i32, i32* @stderr
%40 = tail call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%41 = tail call i32 @sleep(i32 1)
%42 = load i32, i32* @stderr
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%44 = tail call i32 @sleep(i32 1)
%45 = load i32, i32* @stderr
%46 = tail call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%47 = tail call i32 @sleep(i32 1)
%48 = load i32, i32* @stderr
%49 = tail call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%50 = tail call i32 @sleep(i32 1)
%51 = load i32, i32* @stderr
%52 = tail call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%53 = tail call i32 @sleep(i32 1)
ret i32 0
}