#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*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ usleep(int);
int main() {
  int frame_counter, counter = 10;
  int i, j, space;
  for (frame_counter = 0; frame_counter <= 10; frame_counter++) {
    system("clear");
    printf("Counting down: %d\n", counter);
    counter--;
    for (i = 0; i < 20; i++) {
      for (space = 0; space < (10 - counter - 1); space++)
        printf(" ");
      for (j = 0; j <= i; j++)
        printf("*");
      printf("\n");
    }
    usleep(1000000);
  }
  system("clear");
  printf("The End of the animation.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     122a <main+0xfa>
lea    0xea2(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1212 <main+0xe2>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11c7 <main+0x97>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1195 <main+0x65>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f6 <main+0xc6>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ce <main+0x9e>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1184 <main+0x54>
mov    $0xf4240,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
lea    0xdcf(%rip),%rdi
call   1030 <system@plt>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xa,%r13d
lea    0xe98(%rip),%r14
lea    0xe97(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1050 <system@plt>
mov    %r15,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0xa,%r13d
je     11bf <main+0x6f>
mov    %r12d,%ebx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11b0 <main+0x60>
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x15,%ebp
jne    11a0 <main+0x50>
add    $0xffffffff,%r13d
mov    $0xf4240,%edi
call   1070 <usleep@plt>
add    $0x1,%r12d
cmp    $0xb,%r12d
jne    1180 <main+0x30>
lea    0xdec(%rip),%rdi
call   1050 <system@plt>
lea    0xdf9(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [19 x i8] c"Counting down: %d\0A\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [27 x i8] c"The End of the animation.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
store i32 0, i32* %2
br label %7
7: ; preds = %48, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %51
10: ; preds = %7
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, -1
store i32 %15, i32* %3
store i32 0, i32* %4
br label %16
16: ; preds = %43, %10
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 20
br i1 %18, label %19, label %46
19: ; preds = %16
store i32 0, i32* %6
br label %20
20: ; preds = %28, %19
%21 = load i32, i32* %6
%22 = load i32, i32* %3
%23 = sub nsw i32 10, %22
%24 = sub nsw i32 %23, 1
%25 = icmp slt i32 %21, %24
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %20
31: ; preds = %20
store i32 0, i32* %5
br label %32
32: ; preds = %38, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %32
41: ; preds = %32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %16
46: ; preds = %16
%47 = call i32 @usleep(i32 1000000)
br label %48
48: ; preds = %46
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %7
51: ; preds = %7
%52 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [19 x i8] c"Counting down: %d\0A\00"
@str = [26 x i8] c"The End of the animation.\00"
define i32 @main() {
br label %1
1: ; preds = %0, %24
%2 = phi i32 [ 10, %0 ], [ %25, %24 ]
%3 = phi i32 [ 0, %0 ], [ %27, %24 ]
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%6 = icmp eq i32 %2, 10
br label %7
7: ; preds = %1, %20
%8 = phi i32 [ 1, %1 ], [ %22, %20 ]
br i1 %6, label %14, label %9
9: ; preds = %7, %9
%10 = phi i32 [ %12, %9 ], [ 0, %7 ]
%11 = tail call i32 @putchar(i32 32)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %3
br i1 %13, label %14, label %9
14: ; preds = %9, %7
br label %15
15: ; preds = %14, %15
%16 = phi i32 [ %18, %15 ], [ 0, %14 ]
%17 = tail call i32 @putchar(i32 42)
%18 = add nuw nsw i32 %16, 1
%19 = icmp eq i32 %18, %8
br i1 %19, label %20, label %15
20: ; preds = %15
%21 = tail call i32 @putchar(i32 10)
%22 = add nuw nsw i32 %8, 1
%23 = icmp eq i32 %22, 21
br i1 %23, label %24, label %7
24: ; preds = %20
%25 = add nsw i32 %2, -1
%26 = tail call i32 @usleep(i32 1000000)
%27 = add nuw nsw i32 %3, 1
%28 = icmp eq i32 %27, 11
br i1 %28, label %29, label %1
29: ; preds = %24
%30 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}