#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() {
  int x, y;
  printf("输入x:");
  scanf("%d", &x);
  if (x < 1) {
    y = x;
    printf("x=%3d,y=x=%d\n", x, y);
  } else if (x >= 10) {
    y = 3 * x - 11;
    printf("x=%d,x=3x-11=%d", x, y);
  } else {
    y = 2 * x - 1;
    printf("x=%d,y=2x-1=%d", x, y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jge    1176 <main+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
cmpl   $0xa,-0x8(%rbp)
jl     11a3 <main+0x83>
imul   $0x3,-0x8(%rbp),%eax
sub    $0xb,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <main+0xa3>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    115c <main+0x3c>
cmp    $0xa,%esi
jb     1167 <main+0x47>
lea    (%rsi,%rsi,2),%edx
add    $0xfffffff5,%edx
lea    0xebd(%rip),%rdi
jmp    1174 <main+0x54>
lea    0xea6(%rip),%rdi
mov    %esi,%edx
jmp    1174 <main+0x54>
lea    (%rsi,%rsi,1),%edx
add    $0xffffffff,%edx
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\E8\BE\93\E5\85\A5x:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"x=%3d,y=x=%d\0A\00"
@.str.3 = [16 x i8] c"x=%d,x=3x-11=%d\00"
@.str.4 = [15 x i8] c"x=%d,y=2x-1=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 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* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
br label %31
13: ; preds = %0
%14 = load i32, i32* %2
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %2
%18 = mul nsw i32 3, %17
%19 = sub nsw i32 %18, 11
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %21)
br label %30
23: ; preds = %13
%24 = load i32, i32* %2
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %3
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %27, i32 %28)
br label %30
30: ; preds = %23, %16
br label %31
31: ; preds = %30, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"\E8\BE\93\E5\85\A5x:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"x=%3d,y=x=%d\0A\00"
@.str.3 = [16 x i8] c"x=%d,x=3x-11=%d\00"
@.str.4 = [15 x i8] c"x=%d,y=2x-1=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 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, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %5)
br label %19
9: ; preds = %0
%10 = icmp ugt i32 %5, 9
br i1 %10, label %11, label %15
11: ; preds = %9
%12 = mul nsw i32 %5, 3
%13 = add nsw i32 %12, -11
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %5, i32 %13)
br label %19
15: ; preds = %9
%16 = shl nuw nsw i32 %5, 1
%17 = add nsw i32 %16, -1
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %5, i32 %17)
br label %19
19: ; preds = %11, %15, %7
ret i32 0
}