#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*/ fmt2(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, char *);
int main() {
  char buff[20];
  char sb[20];
  while (scanf("%s", buff) == 1) {
    printf("%s\n", buff);
    fmt2(sb, buff);
    printf("%s\n", sb);
    memset(buff, 0, 20);
    memset(sb, 0, 20);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    11ba <main+0x7a>
lea    -0x20(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <fmt2@plt>
lea    -0x40(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xeae(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    11cf <main+0x8f>
lea    0xe9d(%rip),%r14
mov    %rsp,%rbx
lea    0x20(%rsp),%r15
lea    0xe8b(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <fmt2@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     1180 <main+0x40>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %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* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%13 = call i32 @fmt2(i8* %11, i8* %12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%17 = call i32 @memset(i8* %16, i32 0, i32 20)
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%19 = call i32 @memset(i8* %18, i32 0, i32 20)
br label %4
20: ; preds = %4
ret i32 0
}

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