#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*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
int main() {
  char str[20];
  gets(str);
  int len;
  len = strlen(str);
  int i = 0, j = len - 1;
  int flag = 1;
  while (i < j) {
    if (str[i] == str[j]) {
      i++;
      j--;
    } else {
      flag = 0;
      break;
    }
  }
  if (flag == 1) {
    printf("This is huiwen\n");
  } else {
    printf("This isn't huiwen\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11b9 <main+0x89>
movslq -0x28(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
movslq -0x2c(%rbp),%rcx
movsbl -0x20(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11a8 <main+0x78>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b4 <main+0x84>
movl   $0x0,-0x30(%rbp)
jmp    11b9 <main+0x89>
jmp    116b <main+0x3b>
cmpl   $0x1,-0x30(%rbp)
jne    11d4 <main+0xa4>
lea    0xe36(%rip),%rdi
call   1040 <printf@plt>
jmp    11e0 <main+0xb0>
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xec3(%rip),%rdi
cmp    $0x2,%eax
jl     118f <main+0x5f>
mov    %eax,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
lea    0xe9d(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsp,%rcx,1),%ebx
cmp    0x1(%rsp,%rax,1),%bl
jne    118c <main+0x5c>
add    $0x1,%rcx
lea    -0x1(%rax),%rsi
cmp    %rax,%rcx
mov    %rsi,%rax
jl     1170 <main+0x40>
jmp    118f <main+0x5f>
mov    %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"This is huiwen\0A\00"
@.str.1 = [19 x i8] c"This isn't huiwen\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %3
store i32 0, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %5
store i32 1, i32* %6
br label %13
13: ; preds = %35, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %36
17: ; preds = %13
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %22, %27
br i1 %28, label %29, label %34
29: ; preds = %17
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
%32 = load i32, i32* %5
%33 = add nsw i32 %32, -1
store i32 %33, i32* %5
br label %35
34: ; preds = %17
store i32 0, i32* %6
br label %36
35: ; preds = %29
br label %13
36: ; preds = %34, %13
%37 = load i32, i32* %6
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %43
41: ; preds = %36
%42 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"This isn't huiwen\00"
@str.2 = [15 x i8] c"This is huiwen\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %21
6: ; preds = %0
%7 = zext i32 %4 to i64
%8 = add nsw i64 %7, -1
br label %12
9: ; preds = %12
%10 = add nsw i64 %14, -1
%11 = icmp slt i64 %20, %10
br i1 %11, label %12, label %21
12: ; preds = %6, %9
%13 = phi i64 [ 0, %6 ], [ %20, %9 ]
%14 = phi i64 [ %8, %6 ], [ %10, %9 ]
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %13
%16 = load i8, i8* %15
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %14
%18 = load i8, i8* %17
%19 = icmp eq i8 %16, %18
%20 = add nuw nsw i64 %13, 1
br i1 %19, label %9, label %21
21: ; preds = %12, %9, %0
%22 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0), %9 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %12 ]
%23 = call i32 @puts(i8* dereferenceable(1) %22)
ret i32 0
}