#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*/ putchar(char);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int strlen(char *);
int main(void) {
  int i;
  char name[] = "BohYoh Shibata";
  int name_len = strlen(name);
  while (1) {
    for (i = 0; i < name_len; i++) {
      putchar(name[i]);
      fflush(stdout);
      sleep(500);
    }
    for (i = 0; i < name_len; i++) {
      printf("\b \b");
      fflush(stdout);
      sleep(500);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xe98(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xe92(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xe8a(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x17(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11da <main+0x8a>
movslq -0x8(%rbp),%rax
movsbl -0x17(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x1f4,%edi
call   1070 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119a <main+0x4a>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    121f <main+0xcf>
lea    0xe1b(%rip),%rdi
call   1050 <printf@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x1f4,%edi
call   1070 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e1 <main+0x91>
jmp    1193 <main+0x43>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movabs $0x61746162696853,%rax
mov    %rax,0xf(%rsp)
movabs $0x5320686f59686f42,%rax
68 20 53
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
test   %eax,%eax
setg   %r14b
mov    %eax,%ebp
mov    0x2e48(%rip),%r13
lea    0xe70(%rip),%r12
nop
mov    %r14d,%eax
test   $0x1,%al
mov    %r14d,%eax
je     11a3 <main+0x53>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl 0x8(%rsp,%rbx,1),%edi
call   1030 <putchar@plt>
mov    0x0(%r13),%edi
call   1060 <fflush@plt>
mov    $0x1f4,%edi
call   1070 <sleep@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11b0 <main+0x60>
xor    %eax,%eax
mov    %r15d,%ebx
test   %r15d,%r15d
jle    11a3 <main+0x53>
mov    %r12,%rdi
call   1050 <printf@plt>
mov    0x0(%r13),%edi
call   1060 <fflush@plt>
mov    $0x1f4,%edi
call   1070 <sleep@plt>
add    $0xffffffff,%ebx
jne    11e0 <main+0x90>
jmp    11a0 <main+0x50>

LLVM IR (-O0):
@__const.main.name = [15 x i8] c"BohYoh Shibata\00"
@stdout = global i32 0
@.str = [4 x i8] c"\08 \08\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [15 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [15 x i8]* %3 to i8*
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
br label %8
8: ; preds = %0, %38
store i32 0, i32* %2
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @putchar(i8 signext %17)
%19 = load i32, i32* @stdout
%20 = call i32 @fflush(i32 %19)
%21 = call i32 @sleep(i32 500)
br label %22
22: ; preds = %13
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %9
25: ; preds = %9
store i32 0, i32* %2
br label %26
26: ; preds = %35, %25
%27 = load i32, i32* %2
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %38
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%32 = load i32, i32* @stdout
%33 = call i32 @fflush(i32 %32)
%34 = call i32 @sleep(i32 500)
br label %35
35: ; preds = %30
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %26
38: ; preds = %26
br label %8
}

LLVM IR (-O2):
@__const.main.name = [15 x i8] c"BohYoh Shibata\00"
@stdout = global i32 0
@.str = [4 x i8] c"\08 \08\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp sgt i32 %3, 0
%5 = zext i32 %3 to i64
br label %6
6: ; preds = %8, %0
%7 = phi i1 [ %4, %0 ], [ %9, %8 ]
br i1 %7, label %11, label %8
8: ; preds = %21, %6, %10
%9 = phi i1 [ false, %10 ], [ %4, %6 ], [ %4, %21 ]
br label %6
10: ; preds = %11
br i1 %4, label %21, label %8
11: ; preds = %6, %11
%12 = phi i64 [ %19, %11 ], [ 0, %6 ]
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @putchar(i8 signext %14)
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
%18 = call i32 @sleep(i32 500)
%19 = add nuw nsw i64 %12, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %10, label %11
21: ; preds = %10, %21
%22 = phi i32 [ %27, %21 ], [ 0, %10 ]
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @stdout
%25 = call i32 @fflush(i32 %24)
%26 = call i32 @sleep(i32 500)
%27 = add nuw nsw i32 %22, 1
%28 = icmp eq i32 %27, %3
br i1 %28, label %8, label %21
}