#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*/ change(char *);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ *gets(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char str[102];
  freopen("input.txt", "r", stdin);
  str[0] = ' ';
  while (gets(str + 1) != NULL) {
    change(str);
    puts(str + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xe97(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1050 <freopen@plt>
movb   $0x20,-0x80(%rbp)
lea    -0x80(%rbp),%rdi
add    $0x1,%rdi
call   1060 <gets@plt>
cmp    $0x0,%rax
je     11ab <main+0x6b>
lea    -0x80(%rbp),%rdi
call   1030 <change@plt>
lea    -0x80(%rbp),%rdi
add    $0x1,%rdi
call   1040 <puts@plt>
jmp    1179 <main+0x39>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
lea    0xea9(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <freopen@plt>
movb   $0x20,(%rsp)
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     119d <main+0x5d>
mov    %rsp,%r14
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <change@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <gets@plt>
test   %rax,%rax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [102 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdin
%8 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [102 x i8], [102 x i8]* %6, i64 0, i64 0
store i8 32, i8* %9
br label %10
10: ; preds = %15, %2
%11 = getelementptr inbounds [102 x i8], [102 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = call i32* @gets(i8* %12)
%14 = icmp ne i32* %13, null
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = getelementptr inbounds [102 x i8], [102 x i8]* %6, i64 0, i64 0
%17 = call i32 @change(i8* %16)
%18 = getelementptr inbounds [102 x i8], [102 x i8]* %6, i64 0, i64 0
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = call i32 @puts(i8* %19)
br label %10
21: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [102 x i8]
%4 = getelementptr inbounds [102 x i8], [102 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
store i8 32, i8* %4
%7 = getelementptr inbounds [102 x i8], [102 x i8]* %3, i64 0, i64 1
%8 = call i32* @gets(i8* %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2, %10
%11 = call i32 @change(i8* %4)
%12 = call i32 @puts(i8* %7)
%13 = call i32* @gets(i8* %7)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %10
15: ; preds = %10, %2
ret i32 0
}