#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*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int retry = 0;
  do {
    int n = 0;
    printf("请输入一个整数: ");
    scanf("%d", &n);
    if (n == 0) {
      puts("该整数为0");
    } else if (n < 0) {
      puts("该整数小于0");
    } else {
      puts("该整数大于0");
    }
    printf("是否继续? <Yes...0/No...9>: ");
    scanf("%d", &retry);
  } while (retry == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1184 <main+0x54>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
jmp    11b0 <main+0x80>
cmpl   $0x0,-0xc(%rbp)
jge    119f <main+0x6f>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
jmp    11ab <main+0x7b>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
jmp    11b0 <main+0x80>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xece(%rip),%rbx
lea    0xed8(%rip),%rbp
lea    0xee2(%rip),%r14
lea    0xebc(%rip),%r15
lea    0xee5(%rip),%r12
lea    0x4(%rsp),%r13
nopl   0x0(%rax,%rax,1)
movl   $0x0,(%rsp)
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
mov    %r14,%rdi
cmovs  %rbp,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E4\B8\BA0\00"
@.str.3 = [17 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\B0\8F\E4\BA\8E0\00"
@.str.4 = [17 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\A4\A7\E4\BA\8E0\00"
@.str.5 = [33 x i8] c"\E6\98\AF\E5\90\A6\E7\BB\A7\E7\BB\AD? <Yes...0/No...9>: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %22, %0
store i32 0, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %19
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18, %9
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %22
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 0
br i1 %24, label %4, label %25
25: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E4\B8\BA0\00"
@.str.3 = [17 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\B0\8F\E4\BA\8E0\00"
@.str.4 = [17 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\A4\A7\E4\BA\8E0\00"
@.str.5 = [33 x i8] c"\E6\98\AF\E5\90\A6\E7\BB\A7\E7\BB\AD? <Yes...0/No...9>: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
store i32 0, i32* %2
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = icmp slt i32 %8, 0
%11 = select i1 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0)
%12 = select i1 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %11
%13 = call i32 @puts(i8* dereferenceable(1) %12)
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 0
br i1 %17, label %5, label %18
18: ; preds = %5
ret i32 0
}