#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*/ scanf(char *, int *);
int main(void) {
  int i = 0, n = 0;
  printf("请输入一个整数: ");
  scanf("%d", &n);
  i = 2;
  while (i <= n) {
    if (i % 2 == 0) {
      printf("%d ", i);
    }
    i++;
    if (i > n) {
      printf("\n");
    }
  }
  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    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11bb <main+0x9b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1193 <main+0x73>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b6 <main+0x96>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1162 <main+0x42>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jge    116e <main+0x3e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%ebx
lea    0xea1(%rip),%r14
jmp    1184 <main+0x54>
nopl   0x0(%rax)
cmp    %eax,%ebx
jge    1164 <main+0x34>
add    $0x1,%ebx
test   $0x1,%bl
je     11a0 <main+0x70>
cmp    %eax,%ebx
jl     1180 <main+0x50>
jmp    11b4 <main+0x84>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
jl     1180 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
jmp    1180 <main+0x50>

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 = [4 x i8] c"%d \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 2, i32* %2
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %17
br label %6
26: ; preds = %6
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 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %25, label %7
7: ; preds = %0, %22
%8 = phi i32 [ %23, %22 ], [ %5, %0 ]
%9 = phi i32 [ %17, %22 ], [ 2, %0 ]
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%14 = load i32, i32* %1
br label %15
15: ; preds = %12, %7
%16 = phi i32 [ %14, %12 ], [ %8, %7 ]
%17 = add nuw nsw i32 %9, 1
%18 = icmp slt i32 %9, %16
br i1 %18, label %22, label %19
19: ; preds = %15
%20 = call i32 @putchar(i32 10)
%21 = load i32, i32* %1
br label %22
22: ; preds = %19, %15
%23 = phi i32 [ %21, %19 ], [ %16, %15 ]
%24 = icmp slt i32 %9, %23
br i1 %24, label %7, label %25
25: ; preds = %22, %0
ret i32 0
}