#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 atoi(char *);
int /*<<< orphan*/ initialize(int **, int);
int /*<<< orphan*/ print_playway();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ proceed(int **);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  int map[23 + 2][80 + 2] = {};
  int input;
  if (argc != 2) {
    printf("沒有傳入引數，或是傳入錯誤格式！\n");
    goto exit;
  }
  input = atoi(argv[1]);
  printf("%d\n", input);
  sleep(3);
  system("clear");
  if ((input > 0) && (input <= 100)) {
    initialize(map, input);
    do {
      proceed(map);
      system("clear");
    } while (1);
  } else {
    printf("Input error! Please input by the right format!\n");
    goto exit;
  }
exit:
  print_playway();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2030,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2020(%rbp),%rdi
xor    %esi,%esi
mov    $0x2008,%edx
call   1050 <memset@plt>
cmpl   $0x2,-0x8(%rbp)
je     11c9 <main+0x49>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1276 <main+0xf6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x2024(%rbp)
mov    -0x2024(%rbp),%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3,%edi
call   10a0 <sleep@plt>
lea    0xe35(%rip),%rdi
call   1030 <system@plt>
cmpl   $0x0,-0x2024(%rbp)
jle    125e <main+0xde>
cmpl   $0x64,-0x2024(%rbp)
jg     125e <main+0xde>
lea    -0x2020(%rbp),%rdi
mov    -0x2024(%rbp),%esi
call   1060 <initialize@plt>
lea    -0x2020(%rbp),%rdi
call   1070 <proceed@plt>
lea    0xdf1(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1232 <main+0xb2>
jmp    1259 <main+0xd9>
jmp    1271 <main+0xf1>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1276 <main+0xf6>
jmp    1276 <main+0xf6>
mov    $0x0,%al
call   1090 <print_playway@plt>
xor    %eax,%eax
add    $0x2030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x2008,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rdi
mov    $0x2008,%edx
xor    %esi,%esi
call   1060 <memset@plt>
cmp    $0x2,%ebp
jne    1222 <main+0x92>
mov    0x8(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r14d
lea    0xe37(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%edi
call   10b0 <sleep@plt>
lea    0xe21(%rip),%rdi
call   1040 <system@plt>
lea    -0x1(%r14),%eax
cmp    $0x63,%eax
ja     122b <main+0x9b>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14d,%esi
call   1070 <initialize@plt>
lea    0xdfe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1080 <proceed@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
jmp    1210 <main+0x80>
lea    0xe10(%rip),%rdi
jmp    1232 <main+0xa2>
lea    0xdd8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10a0 <print_playway@plt>
xor    %eax,%eax
add    $0x2008,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"\E6\B2\92\E6\9C\89\E5\82\B3\E5\85\A5\E5\BC\95\E6\95\B8\EF\BC\8C\E6\88\96\E6\98\AF\E5\82\B3\E5\85\A5\E9\8C\AF\E8\AA\A4\E6\A0\BC\E5\BC\8F\EF\BC\81\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"clear\00"
@.str.3 = [48 x i8] c"Input error! Please input by the right format!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [25 x [82 x i32]]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [25 x [82 x i32]]* %6 to i8*
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %42
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = call i32 @sleep(i32 3)
%21 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %7
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %39
24: ; preds = %13
%25 = load i32, i32* %7
%26 = icmp sle i32 %25, 100
br i1 %26, label %27, label %39
27: ; preds = %24
%28 = getelementptr inbounds [25 x [82 x i32]], [25 x [82 x i32]]* %6, i64 0, i64 0
%29 = bitcast [82 x i32]* %28 to i32**
%30 = load i32, i32* %7
%31 = call i32 @initialize(i32** %29, i32 %30)
br label %32
32: ; preds = %37, %27
%33 = getelementptr inbounds [25 x [82 x i32]], [25 x [82 x i32]]* %6, i64 0, i64 0
%34 = bitcast [82 x i32]* %33 to i32**
%35 = call i32 @proceed(i32** %34)
%36 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %32
br i1 true, label %32, label %38
38: ; preds = %37
br label %41
39: ; preds = %24, %13
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
br label %42
41: ; preds = %38
br label %42
42: ; preds = %41, %39, %11
%43 = call i32 (...) @print_playway()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [6 x i8] c"clear\00"
@str = [47 x i8] c"Input error! Please input by the right format!\00"
@str.4 = [49 x i8] c"\E6\B2\92\E6\9C\89\E5\82\B3\E5\85\A5\E5\BC\95\E6\95\B8\EF\BC\8C\E6\88\96\E6\98\AF\E5\82\B3\E5\85\A5\E9\8C\AF\E8\AA\A4\E6\A0\BC\E5\BC\8F\EF\BC\81\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [25 x [82 x i32]]
%4 = bitcast [25 x [82 x i32]]* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %21
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = tail call i32 @sleep(i32 3)
%12 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%13 = add i32 %9, -1
%14 = icmp ult i32 %13, 100
br i1 %14, label %15, label %21
15: ; preds = %6
%16 = bitcast [25 x [82 x i32]]* %3 to i32**
%17 = call i32 @initialize(i32** %16, i32 %9)
br label %18
18: ; preds = %18, %15
%19 = call i32 @proceed(i32** %16)
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %18
21: ; preds = %6, %2
%22 = phi i8* [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0), %2 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0), %6 ]
%23 = tail call i32 @puts(i8* dereferenceable(1) %22)
%24 = tail call i32 (...) @print_playway()
ret i32 0
}