#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 *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c, i = 0;
  scanf("%c", &c);
  for (; i < 20; i++)
    printf("%c", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x6(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x6(%rbp),%eax
cmp    $0x14,%eax
jge    116d <main+0x4d>
lea    0xea9(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    1143 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %5
5: ; preds = %12, %0
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %12
12: ; preds = %9
%13 = load i8, i8* %3
%14 = add i8 %13, 1
store i8 %14, i8* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = load i8, i8* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = load i8, i8* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8, i8* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = load i8, i8* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = load i8, i8* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = load i8, i8* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %15)
%17 = load i8, i8* %1
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = load i8, i8* %1
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %19)
%21 = load i8, i8* %1
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %21)
%23 = load i8, i8* %1
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %23)
%25 = load i8, i8* %1
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %25)
%27 = load i8, i8* %1
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %27)
%29 = load i8, i8* %1
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %29)
%31 = load i8, i8* %1
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %31)
%33 = load i8, i8* %1
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %33)
%35 = load i8, i8* %1
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %35)
%37 = load i8, i8* %1
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %37)
%39 = load i8, i8* %1
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %39)
%41 = load i8, i8* %1
%42 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %41)
ret i32 0
}