#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*/ delay_s(double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
main() {
  int i;
  for (i = 1; i < 1000; i++) {
    printf(":/(\n");
    delay_s(0.01);
    system("clear");
    printf(":\\(\n");
    delay_s(0.01);
    system("clear");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11ab <main+0x7b>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe99(%rip),%xmm0
call   1050 <delay_s@plt>
lea    0xe9a(%rip),%rdi
call   1030 <system@plt>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe74(%rip),%xmm0
call   1050 <delay_s@plt>
lea    0xe75(%rip),%rdi
call   1030 <system@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x3e7,%ebp
lea    0xecb(%rip),%r14
lea    0xebe(%rip),%rbx
lea    0xec1(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
movsd  0xe90(%rip),%xmm0
call   1050 <delay_s@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
movsd  0xe73(%rip),%xmm0
call   1050 <delay_s@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c":/(\0A\00"
@.str.1 = [6 x i8] c"clear\00"
@.str.2 = [5 x i8] c":\\(\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @delay_s(double 1.000000e-02)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @delay_s(double 1.000000e-02)
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"clear\00"
@str = [4 x i8] c":/(\00"
@str.3 = [4 x i8] c":\\(\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %9, %1 ]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @delay_s(double 1.000000e-02)
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
%7 = tail call i32 @delay_s(double 1.000000e-02)
%8 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %11, label %1
11: ; preds = %1
ret i32 0
}