#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*/ add_str(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, char *);
int main() {
  char t[20];
  char a[20];
  int i;
  for (i = 0; i < 20; i++) {
    a[i] = '0';
  }
  while (scanf("%s", t) == 1) {
    add_str(t, a);
  }
  printf("%s\r\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x14,-0x44(%rbp)
jge    1167 <main+0x37>
movslq -0x44(%rbp),%rax
movb   $0x30,-0x40(%rbp,%rax,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1146 <main+0x16>
jmp    116c <main+0x3c>
lea    -0x20(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1197 <main+0x67>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <add_str@plt>
jmp    116c <main+0x3c>
lea    -0x40(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movaps 0xec0(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x30303030,0x10(%rsp)
30
lea    0xebd(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    119b <main+0x6b>
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
lea    0xe9f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <add_str@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1180 <main+0x50>
lea    0xe71(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%s\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %10
store i8 48, i8* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
br label %16
16: ; preds = %20, %15
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%23 = call i32 @add_str(i8* %21, i8* %22)
br label %16
24: ; preds = %16
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%s\0D\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %0, %8
%9 = call i32 @add_str(i8* %4, i8* %5)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = icmp eq i32 %10, 1
br i1 %11, label %8, label %12
12: ; preds = %8, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}