#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 */
scalar_t__ fun(char *);
char getchar();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char c, a[100], *p;
  p = a;
  while ((c = getchar()) != '\n')
    *p++ = c;
  *p = 0;
  if (fun(a))
    printf("%sÊÇ»ØÎÄÊý", a);
  else
    printf("%s²»ÊÇ»ØÎÄÊý", a);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1179 <main+0x49>
mov    -0x5(%rbp),%cl
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x78(%rbp)
mov    %cl,(%rax)
jmp    114a <main+0x1a>
mov    -0x78(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x70(%rbp),%rdi
call   1030 <fun@plt>
cmp    $0x0,%rax
je     11a8 <main+0x78>
lea    -0x70(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
jmp    11b8 <main+0x88>
lea    -0x70(%rbp),%rsi
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %rsp,%rbx
cmp    $0xa,%al
je     1161 <main+0x31>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %al,(%rbx)
add    $0x1,%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1150 <main+0x20>
movb   $0x0,(%rbx)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fun@plt>
test   %rax,%rax
lea    0xe9a(%rip),%rax
lea    0xe80(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%s\C3\8A\C3\87\C2\BB\C3\98\C3\8E\C3\84\C3\8A\C3\BD\00"
@.str.1 = [23 x i8] c"%s\C2\B2\C2\BB\C3\8A\C3\87\C2\BB\C3\98\C3\8E\C3\84\C3\8A\C3\BD\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [100 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8* %5, i8** %4
br label %6
6: ; preds = %10, %0
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
store i8 %11, i8* %12
br label %6
14: ; preds = %6
%15 = load i8*, i8** %4
store i8 0, i8* %15
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i64 @fun(i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %25
22: ; preds = %14
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22, %19
%26 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s\C3\8A\C3\87\C2\BB\C3\98\C3\8E\C3\84\C3\8A\C3\BD\00"
@.str.1 = [23 x i8] c"%s\C2\B2\C2\BB\C3\8A\C3\87\C2\BB\C3\98\C3\8E\C3\84\C3\8A\C3\BD\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = phi i8 [ %9, %5 ], [ %3, %0 ]
%7 = phi i8* [ %8, %5 ], [ %2, %0 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%9 = tail call signext i8 (...) @getchar()
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %0
%12 = phi i8* [ %2, %0 ], [ %8, %5 ]
store i8 0, i8* %12
%13 = call i64 @fun(i8* %2)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
%16 = call i32 @printf(i8* %15, i8* %2)
%17 = call signext i8 (...) @getchar()
ret i32 0
}