#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*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i = 0, j = 0;
  int x = 0, y = 0, z = 0;
  do {
    printf("0~100的整数值: ");
    scanf("%d", &x);
  } while (x < 0 || x > 100);
  y = x;
  z = x;
  while (y >= 0) {
    printf("%2d %2d\n", y--, ++z);
  }
  printf("宽和高为整数面积为%d的长方形的边长是: \n", x);
  for (i = 1; i < x; i++) {
    if (i * i > x) {
      break;
    }
    if (x % i != 0) {
      continue;
    }
    printf("%d * %d\n", i, x / i);
  }
  puts("5行7列的星号");
  for (i = 1; i <= 5; i++) {
    for (j = 1; j <= 7; j++) {
      putchar('*');
    }
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
jl     11a9 <main+0x69>
cmpl   $0x64,-0x10(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1172 <main+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11f1 <main+0xb1>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11c0 <main+0x80>
mov    -0x10(%rbp),%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1267 <main+0x127>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    122a <main+0xea>
jmp    1267 <main+0x127>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     123f <main+0xff>
jmp    1259 <main+0x119>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edx
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1209 <main+0xc9>
lea    0xdf4(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     12c5 <main+0x185>
movl   $0x1,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jg     12ad <main+0x16d>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    128b <main+0x14b>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    127a <main+0x13a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeaa(%rip),%r14
lea    0xeb7(%rip),%r15
lea    0x4(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%ebx
cmp    $0x64,%ebx
ja     1170 <main+0x30>
lea    0x1(%rbx),%ebp
lea    0xe7f(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jb     11a0 <main+0x60>
mov    0x4(%rsp),%esi
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%ecx
cmp    $0x2,%ecx
jl     120b <main+0xcb>
mov    $0x1,%ebx
lea    0xe7c(%rip),%r14
nopl   (%rax)
mov    %ecx,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    11fb <main+0xbb>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%ecx
add    $0x1,%ebx
cmp    %ecx,%ebx
jge    120b <main+0xcb>
mov    %ebx,%eax
imul   %ebx,%eax
cmp    %ecx,%eax
jle    11e0 <main+0xa0>
lea    0xe50(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"0~100\E7\9A\84\E6\95\B4\E6\95\B0\E5\80\BC: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"%2d %2d\0A\00"
@.str.3 = [57 x i8] c"\E5\AE\BD\E5\92\8C\E9\AB\98\E4\B8\BA\E6\95\B4\E6\95\B0\E9\9D\A2\E7\A7\AF\E4\B8\BA%d\E7\9A\84\E9\95\BF\E6\96\B9\E5\BD\A2\E7\9A\84\E8\BE\B9\E9\95\BF\E6\98\AF: \0A\00"
@.str.4 = [9 x i8] c"%d * %d\0A\00"
@.str.5 = [18 x i8] c"5\E8\A1\8C7\E5\88\97\E7\9A\84\E6\98\9F\E5\8F\B7\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %16, %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
br label %10
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 100
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ true, %10 ], [ %15, %13 ]
br i1 %17, label %7, label %18
18: ; preds = %16
%19 = load i32, i32* %4
store i32 %19, i32* %5
%20 = load i32, i32* %4
store i32 %20, i32* %6
br label %21
21: ; preds = %24, %18
%22 = load i32, i32* %5
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %5
%26 = add nsw i32 %25, -1
store i32 %26, i32* %5
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %25, i32 %28)
br label %21
30: ; preds = %21
%31 = load i32, i32* %4
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i32 %31)
store i32 1, i32* %2
br label %33
33: ; preds = %56, %30
%34 = load i32, i32* %2
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %59
37: ; preds = %33
%38 = load i32, i32* %2
%39 = load i32, i32* %2
%40 = mul nsw i32 %38, %39
%41 = load i32, i32* %4
%42 = icmp sgt i32 %40, %41
br i1 %42, label %43, label %44
43: ; preds = %37
br label %59
44: ; preds = %37
%45 = load i32, i32* %4
%46 = load i32, i32* %2
%47 = srem i32 %45, %46
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %44
br label %56
50: ; preds = %44
%51 = load i32, i32* %2
%52 = load i32, i32* %4
%53 = load i32, i32* %2
%54 = sdiv i32 %52, %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %51, i32 %54)
br label %56
56: ; preds = %50, %49
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %33
59: ; preds = %43, %33
%60 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %61
61: ; preds = %75, %59
%62 = load i32, i32* %2
%63 = icmp sle i32 %62, 5
br i1 %63, label %64, label %78
64: ; preds = %61
store i32 1, i32* %3
br label %65
65: ; preds = %70, %64
%66 = load i32, i32* %3
%67 = icmp sle i32 %66, 7
br i1 %67, label %68, label %73
68: ; preds = %65
%69 = call i32 @putchar(i8 signext 42)
br label %70
70: ; preds = %68
%71 = load i32, i32* %3
%72 = add nsw i32 %71, 1
store i32 %72, i32* %3
br label %65
73: ; preds = %65
%74 = call i32 @putchar(i8 signext 10)
br label %75
75: ; preds = %73
%76 = load i32, i32* %2
%77 = add nsw i32 %76, 1
store i32 %77, i32* %2
br label %61
78: ; preds = %61
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"0~100\E7\9A\84\E6\95\B4\E6\95\B0\E5\80\BC: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"%2d %2d\0A\00"
@.str.3 = [57 x i8] c"\E5\AE\BD\E5\92\8C\E9\AB\98\E4\B8\BA\E6\95\B4\E6\95\B0\E9\9D\A2\E7\A7\AF\E4\B8\BA%d\E7\9A\84\E9\95\BF\E6\96\B9\E5\BD\A2\E7\9A\84\E8\BE\B9\E9\95\BF\E6\98\AF: \0A\00"
@.str.4 = [9 x i8] c"%d * %d\0A\00"
@.str.5 = [18 x i8] c"5\E8\A1\8C7\E5\88\97\E7\9A\84\E6\98\9F\E5\8F\B7\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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* %1)
%6 = load i32, i32* %1
%7 = icmp ugt i32 %6, 100
br i1 %7, label %3, label %8
8: ; preds = %3, %8
%9 = phi i32 [ %12, %8 ], [ %6, %3 ]
%10 = phi i32 [ %11, %8 ], [ %6, %3 ]
%11 = add nsw i32 %10, -1
%12 = add nsw i32 %9, 1
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %12)
%14 = icmp eq i32 %10, 0
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = load i32, i32* %1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
%19 = icmp slt i32 %18, 2
br i1 %19, label %36, label %20
20: ; preds = %15, %29
%21 = phi i32 [ %30, %29 ], [ %18, %15 ]
%22 = phi i32 [ %31, %29 ], [ 1, %15 ]
%23 = srem i32 %21, %22
%24 = sdiv i32 %21, %22
%25 = icmp eq i32 %23, 0
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %22, i32 %24)
%28 = load i32, i32* %1
br label %29
29: ; preds = %20, %26
%30 = phi i32 [ %21, %20 ], [ %28, %26 ]
%31 = add nuw nsw i32 %22, 1
%32 = icmp sge i32 %31, %30
%33 = mul nsw i32 %31, %31
%34 = icmp sgt i32 %33, %30
%35 = select i1 %32, i1 true, i1 %34
br i1 %35, label %36, label %20
36: ; preds = %29, %15
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%38 = call i32 @putchar(i8 signext 42)
%39 = call i32 @putchar(i8 signext 42)
%40 = call i32 @putchar(i8 signext 42)
%41 = call i32 @putchar(i8 signext 42)
%42 = call i32 @putchar(i8 signext 42)
%43 = call i32 @putchar(i8 signext 42)
%44 = call i32 @putchar(i8 signext 42)
%45 = call i32 @putchar(i8 signext 10)
%46 = call i32 @putchar(i8 signext 42)
%47 = call i32 @putchar(i8 signext 42)
%48 = call i32 @putchar(i8 signext 42)
%49 = call i32 @putchar(i8 signext 42)
%50 = call i32 @putchar(i8 signext 42)
%51 = call i32 @putchar(i8 signext 42)
%52 = call i32 @putchar(i8 signext 42)
%53 = call i32 @putchar(i8 signext 10)
%54 = call i32 @putchar(i8 signext 42)
%55 = call i32 @putchar(i8 signext 42)
%56 = call i32 @putchar(i8 signext 42)
%57 = call i32 @putchar(i8 signext 42)
%58 = call i32 @putchar(i8 signext 42)
%59 = call i32 @putchar(i8 signext 42)
%60 = call i32 @putchar(i8 signext 42)
%61 = call i32 @putchar(i8 signext 10)
%62 = call i32 @putchar(i8 signext 42)
%63 = call i32 @putchar(i8 signext 42)
%64 = call i32 @putchar(i8 signext 42)
%65 = call i32 @putchar(i8 signext 42)
%66 = call i32 @putchar(i8 signext 42)
%67 = call i32 @putchar(i8 signext 42)
%68 = call i32 @putchar(i8 signext 42)
%69 = call i32 @putchar(i8 signext 10)
%70 = call i32 @putchar(i8 signext 42)
%71 = call i32 @putchar(i8 signext 42)
%72 = call i32 @putchar(i8 signext 42)
%73 = call i32 @putchar(i8 signext 42)
%74 = call i32 @putchar(i8 signext 42)
%75 = call i32 @putchar(i8 signext 42)
%76 = call i32 @putchar(i8 signext 42)
%77 = call i32 @putchar(i8 signext 10)
ret i32 0
}