#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void main() {
  char str1[31], str2[31];
  strcpy(str1, "Apple is sweet");
  strcpy(str2, str1);
  puts(str2);
  char a[18] = "Microsoft ", b[] = "  word";
  strcat(a, b);
  puts(a);
  strcat(a, "97");
  puts(a);
  char pass_str[80];
  int i = 0;
  while (1) {
    printf("请输入密码:\n");
    gets(pass_str);
    if (strcmp(pass_str, "mypass") != 0)
      printf("口令错误，");
    else {
      printf("口令正确!");
      break;
    }
    i++;
    if (i == 3)
      exit(0);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0x20(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <puts@plt>
mov    0xe98(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe95(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe92(%rip),%ax
mov    %ax,-0x50(%rbp)
mov    0xe37(%rip),%eax
mov    %eax,-0x67(%rbp)
mov    0xe31(%rip),%ax
mov    %ax,-0x63(%rbp)
mov    0xe29(%rip),%al
mov    %al,-0x61(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x67(%rbp),%rsi
call   1090 <strcat@plt>
lea    -0x60(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x60(%rbp),%rdi
lea    0xe06(%rip),%rsi
call   1090 <strcat@plt>
lea    -0x60(%rbp),%rdi
call   1040 <puts@plt>
movl   $0x0,-0xc4(%rbp)
lea    0xdea(%rip),%rdi
call   1050 <printf@plt>
lea    -0xc0(%rbp),%rdi
call   1080 <gets@plt>
lea    -0xc0(%rbp),%rdi
lea    0xddd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     126e <main+0xee>
lea    0xdce(%rip),%rdi
call   1050 <printf@plt>
jmp    127f <main+0xff>
lea    0xdcd(%rip),%rdi
call   1050 <printf@plt>
jmp    12a7 <main+0x127>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
cmpl   $0x3,-0xc4(%rbp)
jne    12a2 <main+0x122>
xor    %edi,%edi
call   10a0 <exit@plt>
jmp    1228 <main+0xa8>
mov    $0x0,%al
call   1070 <getchar@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
lea    0xe6f(%rip),%rsi
lea    0xa0(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x20(%rsp)
movl   $0x64726f,0xb(%rsp)
movl   $0x6f772020,0x8(%rsp)
6f
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe16(%rip),%rsi
mov    %rbx,%rdi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe27(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <gets@plt>
lea    0xde9(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12af <main+0x12f>
lea    0xddc(%rip),%rdi
call   1050 <printf@plt>
lea    0xdee(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <gets@plt>
lea    0xdb0(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12af <main+0x12f>
lea    0xda3(%rip),%rdi
call   1050 <printf@plt>
lea    0xdb5(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <gets@plt>
lea    0xd77(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12cd <main+0x14d>
lea    0xd7a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xd4c(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Apple is sweet\00"
@__const.main.a = [18 x i8] c"Microsoft \00\00\00\00\00\00\00\00"
@__const.main.b = [7 x i8] c" word\00"
@.str.1 = [3 x i8] c"97\00"
@.str.2 = [18 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\AF\86\E7\A0\81:\0A\00"
@.str.3 = [7 x i8] c"mypass\00"
@.str.4 = [16 x i8] c"\E5\8F\A3\E4\BB\A4\E9\94\99\E8\AF\AF\EF\BC\8C\00"
@.str.5 = [14 x i8] c"\E5\8F\A3\E4\BB\A4\E6\AD\A3\E7\A1\AE!\00"
define void @main() {
%1 = alloca [31 x i8]
%2 = alloca [31 x i8]
%3 = alloca [18 x i8]
%4 = alloca [7 x i8]
%5 = alloca [80 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
%14 = bitcast [18 x i8]* %3 to i8*
%15 = bitcast [7 x i8]* %4 to i8*
%16 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%20 = call i32 @puts(i8* %19)
%21 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%23 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%24 = call i32 @puts(i8* %23)
store i32 0, i32* %6
br label %25
25: ; preds = %0, %43
%26 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%28 = call i32 @gets(i8* %27)
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %25
%33 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %36
34: ; preds = %25
%35 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %44
36: ; preds = %32
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 3
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %36
br label %25
44: ; preds = %34
%45 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Apple is sweet\00"
@__const.main.a = [18 x i8] c"Microsoft \00\00\00\00\00\00\00\00"
@__const.main.b = [7 x i8] c" word\00"
@.str.1 = [3 x i8] c"97\00"
@.str.3 = [7 x i8] c"mypass\00"
@.str.4 = [16 x i8] c"\E5\8F\A3\E4\BB\A4\E9\94\99\E8\AF\AF\EF\BC\8C\00"
@.str.5 = [14 x i8] c"\E5\8F\A3\E4\BB\A4\E6\AD\A3\E7\A1\AE!\00"
@str = [17 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\AF\86\E7\A0\81:\00"
define void @main() {
%1 = alloca [31 x i8]
%2 = alloca [31 x i8]
%3 = alloca [18 x i8]
%4 = alloca [7 x i8]
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [31 x i8], [31 x i8]* %2, i64 0, i64 0
%8 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @strcpy(i8* %7, i8* %6)
%10 = call i32 @puts(i8* %7)
%11 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%13 = call i32 @strcat(i8* %11, i8* %12)
%14 = call i32 @puts(i8* %11)
%15 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @puts(i8* %11)
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%19 = call i32 @gets(i8* %17)
%20 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %37, label %22
22: ; preds = %0
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%25 = call i32 @gets(i8* %17)
%26 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %37, label %28
28: ; preds = %22
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%31 = call i32 @gets(i8* %17)
%32 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %28
%35 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 @exit(i32 0)
unreachable
37: ; preds = %28, %22, %0
%38 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%39 = call i32 (...) @getchar()
ret void
}