#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[81];
  freopen("input.txt", "r", stdin);
  while (gets(str) != NULL) {
    if (str[0] == '!' && str[1] == '\0') {
      break;
    }
    change(str);
    puts(str);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
lea    0xe9a(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <freopen@plt>
lea    -0x70(%rbp),%rdi
call   1060 <gets@plt>
cmp    $0x0,%rax
je     11bb <main+0x7b>
movsbl -0x70(%rbp),%eax
cmp    $0x21,%eax
jne    11a4 <main+0x64>
movsbl -0x6f(%rbp),%eax
cmp    $0x0,%eax
jne    11a4 <main+0x64>
jmp    11bb <main+0x7b>
lea    -0x70(%rbp),%rdi
call   1030 <change@plt>
lea    -0x70(%rbp),%rdi
call   1040 <puts@plt>
jmp    1172 <main+0x32>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xeab(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1050 <freopen@plt>
mov    %rsp,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     11aa <main+0x6a>
mov    %rsp,%rbx
jmp    119d <main+0x5d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <change@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     11aa <main+0x6a>
cmpb   $0x21,(%rsp)
jne    1180 <main+0x40>
cmpb   $0x0,0x1(%rsp)
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
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 [81 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)
br label %9
9: ; preds = %24, %2
%10 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%11 = call i32* @gets(i8* %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 33
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
br label %29
24: ; preds = %18, %13
%25 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%26 = call i32 @change(i8* %25)
%27 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%28 = call i32 @puts(i8* %27)
br label %9
29: ; preds = %23, %9
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 [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 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)
%7 = call i32* @gets(i8* %4)
%8 = icmp eq i32* %7, null
br i1 %8, label %22, label %9
9: ; preds = %2
%10 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 1
br label %11
11: ; preds = %9, %17
%12 = load i8, i8* %4
%13 = icmp eq i8 %12, 33
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
%16 = select i1 %13, i1 %15, i1 false
br i1 %16, label %22, label %17
17: ; preds = %11
%18 = call i32 @change(i8* %4)
%19 = call i32 @puts(i8* %4)
%20 = call i32* @gets(i8* %4)
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %11
22: ; preds = %17, %11, %2
ret i32 0
}