#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[10], i;
  for (i = 0; i < 10; i++)
    scanf(" %c", c + i);
  for (i = 0; i < 10; i++)
    printf("%c", c[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0xf(%rbp)
movsbl -0xf(%rbp),%eax
cmp    $0xa,%eax
jge    1166 <main+0x46>
lea    -0xe(%rbp),%rsi
movsbl -0xf(%rbp),%eax
cltq
add    %rax,%rsi
lea    0xeac(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xf(%rbp),%al
add    $0x1,%al
mov    %al,-0xf(%rbp)
jmp    1133 <main+0x13>
movb   $0x0,-0xf(%rbp)
movsbl -0xf(%rbp),%eax
cmp    $0xa,%eax
jge    119a <main+0x7a>
movsbq -0xf(%rbp),%rax
lea    0xe7e(%rip),%rdi
movsbl -0xe(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0xf(%rbp),%al
add    $0x1,%al
mov    %al,-0xf(%rbp)
jmp    116a <main+0x4a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x6(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x7(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x9(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xa(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xb(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0x6(%rsp),%esi
lea    0xe47(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x9(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xa(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xd(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xe(%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 = [4 x i8] c" %c\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %3
br label %4
4: ; preds = %15, %0
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %8
%16 = load i8, i8* %3
%17 = add i8 %16, 1
store i8 %17, i8* %3
br label %4
18: ; preds = %4
store i8 0, i8* %3
br label %19
19: ; preds = %29, %18
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp slt i32 %21, 10
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i64
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %27)
br label %29
29: ; preds = %23
%30 = load i8, i8* %3
%31 = add i8 %30, 1
store i8 %31, i8* %3
br label %19
32: ; preds = %19
ret i32 0
}

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