#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 cont;
  do {
    int no;
    printf("输入一个整数:");
    scanf("%d", &no);
    if (no % 2)
      puts("奇数");
    else
      puts("偶数");
    printf("再来一次么 [yes ''' 0 / NO '''9]:");
    scanf("%d", &cont);
  } while (cont == 0);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1180 <main+0x50>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
jmp    118c <main+0x5c>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
lea    0xe75(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     113f <main+0xf>
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
lea    0xed2(%rip),%rbx
mov    %rsp,%r15
lea    0xed2(%rip),%rbp
lea    0xec4(%rip),%r14
lea    0xecb(%rip),%r12
lea    0x4(%rsp),%r13
nop
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
testb  $0x1,(%rsp)
mov    %r14,%rdi
cmove  %rbp,%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     1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\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 = [7 x i8] c"\E5\A5\87\E6\95\B0\00"
@.str.3 = [7 x i8] c"\E5\81\B6\E6\95\B0\00"
@.str.4 = [39 x i8] c"\E5\86\8D\E6\9D\A5\E4\B8\80\E6\AC\A1\E4\B9\88 [yes ''' 0 / NO '''9]:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %17, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 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 = srem i32 %7, 2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %4
%13 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 0
br i1 %19, label %4, label %20
20: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\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 = [7 x i8] c"\E5\A5\87\E6\95\B0\00"
@.str.3 = [7 x i8] c"\E5\81\B6\E6\95\B0\00"
@.str.4 = [39 x i8] c"\E5\86\8D\E6\9D\A5\E4\B8\80\E6\AC\A1\E4\B9\88 [yes ''' 0 / NO '''9]:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 0
br i1 %16, label %5, label %17
17: ; preds = %5
ret i32 0
}