#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 *);
main() {
  printf("作者邮箱：yubowen@mail.sdu.edu.cn\n");
  char pig[100];
  char egg[20];
  egg[0] = 'y';
  egg[1] = '\0';
  int cat;
  float dog;
  while (egg[0] == 'y' && egg[1] == '\0') {
    printf("本程序可判断一个字符串是否是回文字符串。\n");
    printf("请输入字符串。\n");
    dog = 0;
    gets(pig);
    cat = strlen(pig);
    int i;
    for (i = 0; i < cat; i++) {
      if (pig[i] != pig[cat - i - 1]) {
        dog = 1;
        break;
      }
    }
    if (dog == 0)
      printf("是回文字符串。\n");
    else
      printf("不是回文字符串。\n");
    printf("是否继续运行?（y/n)\n");
    gets(egg);
  }
  printf("程序已结束。\n");
  printf("获取更多信息请访问：\n"
         "github.com/ybw2016v\n"
         "或git.ustclug.org/yubowen");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
movb   $0x79,-0x90(%rbp)
movb   $0x0,-0x8f(%rbp)
movsbl -0x90(%rbp),%ecx
xor    %eax,%eax
cmp    $0x79,%ecx
mov    %al,-0x9d(%rbp)
jne    1187 <main+0x57>
movsbl -0x8f(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9d(%rbp)
mov    -0x9d(%rbp),%al
test   $0x1,%al
jne    119a <main+0x6a>
jmp    129e <main+0x16e>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x94(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x94(%rbp),%eax
jge    124a <main+0x11a>
movslq -0x9c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    -0x94(%rbp),%ecx
sub    -0x9c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     1231 <main+0x101>
movss  0xddc(%rip),%xmm0
movss  %xmm0,-0x98(%rbp)
ff
jmp    124a <main+0x11a>
jmp    1236 <main+0x106>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    11df <main+0xaf>
movss  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1275 <main+0x145>
jp     1275 <main+0x145>
lea    0xe19(%rip),%rdi
call   1040 <printf@plt>
jmp    1281 <main+0x151>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
lea    0xe13(%rip),%rdi
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1050 <gets@plt>
jmp    115c <main+0x2c>
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
lea    0xe1a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
movw   $0x79,(%rsp)
lea    0xf5b(%rip),%r15
lea    0x20(%rsp),%r14
lea    0xf68(%rip),%rbp
lea    0xf77(%rip),%r12
mov    %rsp,%r13
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1060 <gets@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
test   %eax,%eax
jle    11e7 <main+0xa7>
mov    %eax,%ecx
add    $0xffffffff,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x20(%rsp,%rdx,1),%ebx
movslq %eax,%rsi
cmp    0x20(%rsp,%rsi,1),%bl
jne    11e0 <main+0xa0>
add    $0x1,%rdx
add    $0xffffffff,%eax
cmp    %rdx,%rcx
jne    11c0 <main+0x80>
mov    %rbp,%rdi
jmp    11e7 <main+0xa7>
nop
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1060 <gets@plt>
cmpb   $0x79,(%rsp)
jne    120d <main+0xcd>
cmpb   $0x0,0x1(%rsp)
je     1180 <main+0x40>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
lea    0xde0(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\E4\BD\9C\E8\80\85\E9\82\AE\E7\AE\B1\EF\BC\9Ayubowen@mail.sdu.edu.cn\0A\00"
@.str.1 = [62 x i8] c"\E6\9C\AC\E7\A8\8B\E5\BA\8F\E5\8F\AF\E5\88\A4\E6\96\AD\E4\B8\80\E4\B8\AA\E5\AD\97\E7\AC\A6\E4\B8\B2\E6\98\AF\E5\90\A6\E6\98\AF\E5\9B\9E\E6\96\87\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\0A\00"
@.str.2 = [23 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\0A\00"
@.str.3 = [23 x i8] c"\E6\98\AF\E5\9B\9E\E6\96\87\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\0A\00"
@.str.4 = [26 x i8] c"\E4\B8\8D\E6\98\AF\E5\9B\9E\E6\96\87\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\0A\00"
@.str.5 = [28 x i8] c"\E6\98\AF\E5\90\A6\E7\BB\A7\E7\BB\AD\E8\BF\90\E8\A1\8C?\EF\BC\88y/n)\0A\00"
@.str.6 = [20 x i8] c"\E7\A8\8B\E5\BA\8F\E5\B7\B2\E7\BB\93\E6\9D\9F\E3\80\82\0A\00"
@.str.7 = [78 x i8] c"\E8\8E\B7\E5\8F\96\E6\9B\B4\E5\A4\9A\E4\BF\A1\E6\81\AF\E8\AF\B7\E8\AE\BF\E9\97\AE\EF\BC\9A\0Agithub.com/ybw2016v\0A\E6\88\96git.ustclug.org/yubowen\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8 121, i8* %8
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 1
store i8 0, i8* %9
br label %10
10: ; preds = %60, %0
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 121
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br label %20
20: ; preds = %15, %10
%21 = phi i1 [ false, %10 ], [ %19, %15 ]
br i1 %21, label %22, label %64
22: ; preds = %20
%23 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store float 0.000000e+00, float* %5
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%26 = call i32 @gets(i8* %25)
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%28 = call i32 @strlen(i8* %27)
store i32 %28, i32* %4
store i32 0, i32* %6
br label %29
29: ; preds = %50, %22
%30 = load i32, i32* %6
%31 = load i32, i32* %4
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %53
33: ; preds = %29
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = load i32, i32* %4
%40 = load i32, i32* %6
%41 = sub nsw i32 %39, %40
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %38, %46
br i1 %47, label %48, label %49
48: ; preds = %33
store float 1.000000e+00, float* %5
br label %53
49: ; preds = %33
br label %50
50: ; preds = %49
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %29
53: ; preds = %48, %29
%54 = load float, float* %5
%55 = fcmp oeq float %54, 0.000000e+00
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %60
58: ; preds = %53
%59 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
%61 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%63 = call i32 @gets(i8* %62)
br label %10
64: ; preds = %20
%65 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%66 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0))
%67 = load i32, i32* %1
ret i32 %67
}

LLVM IR (-O2):
@.str.7 = [78 x i8] c"\E8\8E\B7\E5\8F\96\E6\9B\B4\E5\A4\9A\E4\BF\A1\E6\81\AF\E8\AF\B7\E8\AE\BF\E9\97\AE\EF\BC\9A\0Agithub.com/ybw2016v\0A\E6\88\96git.ustclug.org/yubowen\00"
@str = [39 x i8] c"\E4\BD\9C\E8\80\85\E9\82\AE\E7\AE\B1\EF\BC\9Ayubowen@mail.sdu.edu.cn\00"
@str.8 = [19 x i8] c"\E7\A8\8B\E5\BA\8F\E5\B7\B2\E7\BB\93\E6\9D\9F\E3\80\82\00"
@str.9 = [61 x i8] c"\E6\9C\AC\E7\A8\8B\E5\BA\8F\E5\8F\AF\E5\88\A4\E6\96\AD\E4\B8\80\E4\B8\AA\E5\AD\97\E7\AC\A6\E4\B8\B2\E6\98\AF\E5\90\A6\E6\98\AF\E5\9B\9E\E6\96\87\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\00"
@str.10 = [22 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\00"
@str.11 = [25 x i8] c"\E4\B8\8D\E6\98\AF\E5\9B\9E\E6\96\87\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\00"
@str.12 = [27 x i8] c"\E6\98\AF\E5\90\A6\E7\BB\A7\E7\BB\AD\E8\BF\90\E8\A1\8C?\EF\BC\88y/n)\00"
@str.13 = [22 x i8] c"\E6\98\AF\E5\9B\9E\E6\96\87\E5\AD\97\E7\AC\A6\E4\B8\B2\E3\80\82\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [20 x i8]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
store i8 121, i8* %5
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 1
store i8 0, i8* %6
br label %7
7: ; preds = %0, %29
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.9, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, i64 0, i64 0))
%10 = call i32 @gets(i8* %4)
%11 = call i32 @strlen(i8* %4)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %29
13: ; preds = %7
%14 = zext i32 %11 to i64
br label %17
15: ; preds = %17
%16 = icmp eq i64 %28, %14
br i1 %16, label %29, label %17
17: ; preds = %13, %15
%18 = phi i64 [ 0, %13 ], [ %28, %15 ]
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = trunc i64 %18 to i32
%22 = xor i32 %21, -1
%23 = add i32 %11, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %20, %26
%28 = add nuw nsw i64 %18, 1
br i1 %27, label %15, label %29
29: ; preds = %17, %15, %7
%30 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.13, i64 0, i64 0), %7 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.13, i64 0, i64 0), %15 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0), %17 ]
%31 = call i32 @puts(i8* dereferenceable(1) %30)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.12, i64 0, i64 0))
%33 = call i32 @gets(i8* %5)
%34 = load i8, i8* %5
%35 = icmp eq i8 %34, 121
%36 = load i8, i8* %6
%37 = icmp eq i8 %36, 0
%38 = select i1 %35, i1 %37, i1 false
br i1 %38, label %7, label %39
39: ; preds = %29
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0))
%41 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}