#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*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int strlen(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  char *hi = "Howdy, World!";
  system("clear");
  for (int i = 0; i < strlen(hi); i++) {
    for (int j = 0; j < (80 - i) / 2; j++) {
      printf(" ");
    }
    for (int j = 0; j <= i; j++) {
      printf("%c", hi[j]);
    }
    fflush(stdout);
    sleep(1);
    printf("\r");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe96(%rip),%rdi
call   1040 <system@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jge    1255 <main+0x105>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    $0x50,%eax
sub    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    11e6 <main+0x96>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a7 <main+0x57>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1221 <main+0xd1>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ed <main+0x9d>
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1184 <main+0x34>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeac(%rip),%rdi
call   1050 <system@plt>
lea    0xe92(%rip),%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    121a <main+0xca>
xor    %r14d,%r14d
mov    $0x1,%ebx
mov    $0x50,%r13d
mov    0x2e4d(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x4f,%r14d
jae    11bf <main+0x6f>
mov    %r13d,%ebp
shr    %ebp
and    $0x7f,%ebp
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x60>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl 0x0(%rbp,%r15,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11d0 <main+0x80>
mov    (%r12),%edi
call   1060 <fflush@plt>
mov    $0x1,%edi
call   1070 <sleep@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
mov    %r15,%rdi
call   1040 <strlen@plt>
add    $0x1,%rbx
add    $0xffffffff,%r13d
cmp    %eax,%r14d
jl     11a0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Howdy, World!\00"
@.str.1 = [6 x i8] c"clear\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %2, %22
%7 = phi i64 [ %30, %22 ], [ 1, %2 ]
%8 = phi i32 [ %27, %22 ], [ 0, %2 ]
%9 = icmp ult i32 %8, 79
br i1 %9, label %11, label %10
10: ; preds = %17, %6
br label %31
11: ; preds = %6
%12 = sub nsw i32 80, %8
%13 = lshr i32 %12, 1
%14 = and i32 %13, 127
br label %17
15: ; preds = %22, %2
%16 = tail call i32 @putchar(i32 10)
ret i32 0
17: ; preds = %11, %17
%18 = phi i32 [ %20, %17 ], [ 0, %11 ]
%19 = tail call i32 @putchar(i32 32)
%20 = add nuw nsw i32 %18, 1
%21 = icmp eq i32 %20, %14
br i1 %21, label %10, label %17
22: ; preds = %31
%23 = load i32, i32* @stdout
%24 = tail call i32 @fflush(i32 %23)
%25 = tail call i32 @sleep(i32 1)
%26 = tail call i32 @putchar(i32 13)
%27 = add nuw nsw i32 %8, 1
%28 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%29 = icmp slt i32 %27, %28
%30 = add nuw nsw i64 %7, 1
br i1 %29, label %6, label %15
31: ; preds = %10, %31
%32 = phi i64 [ %37, %31 ], [ 0, %10 ]
%33 = getelementptr inbounds [14 x i8], [14 x i8]* @.str, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = tail call i32 @putchar(i32 %35)
%37 = add nuw nsw i64 %32, 1
%38 = icmp eq i64 %37, %7
br i1 %38, label %22, label %31
}