#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, j;
  int width, height;
  puts("让我们描绘一个长方形");
  printf("宽");
  scanf("%d", &width);
  printf("高");
  scanf("%d", &height);
  for (i = 1; i <= height; i++) {
    for (j = 1; j <= width; j++)
      putchar('*');
    putchar('\n');
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11e9 <main+0xa9>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11d1 <main+0x91>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ad <main+0x6d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119a <main+0x5a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
call   1050 <printf@plt>
lea    0xec1(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11d5 <main+0x95>
mov    $0x1,%ebx
jmp    11b4 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    (%rsp),%ebx
mov    %eax,%ebx
jge    11d5 <main+0x95>
cmpl   $0x0,0x4(%rsp)
jle    11a0 <main+0x60>
xor    %ebp,%ebp
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     11c0 <main+0x80>
jmp    11a0 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\E8\AE\A9\E6\88\91\E4\BB\AC\E6\8F\8F\E7\BB\98\E4\B8\80\E4\B8\AA\E9\95\BF\E6\96\B9\E5\BD\A2\00"
@.str.1 = [4 x i8] c"\E5\AE\BD\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"\E9\AB\98\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
store i32 1, i32* %2
br label %11
11: ; preds = %27, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %5
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %11
store i32 1, i32* %3
br label %16
16: ; preds = %22, %15
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = call i32 @putchar(i8 signext 42)
br label %22
22: ; preds = %20
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %16
25: ; preds = %16
%26 = call i32 @putchar(i8 signext 10)
br label %27
27: ; preds = %25
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %11
30: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\E8\AE\A9\E6\88\91\E4\BB\AC\E6\8F\8F\E7\BB\98\E4\B8\80\E4\B8\AA\E9\95\BF\E6\96\B9\E5\BD\A2\00"
@.str.1 = [4 x i8] c"\E5\AE\BD\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"\E9\AB\98\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 1
br i1 %11, label %27, label %12
12: ; preds = %0, %22
%13 = phi i32 [ %24, %22 ], [ 1, %0 ]
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 1
br i1 %15, label %22, label %16
16: ; preds = %12, %16
%17 = phi i32 [ %19, %16 ], [ 1, %12 ]
%18 = call i32 @putchar(i8 signext 42)
%19 = add nuw nsw i32 %17, 1
%20 = load i32, i32* %1
%21 = icmp slt i32 %17, %20
br i1 %21, label %16, label %22
22: ; preds = %16, %12
%23 = call i32 @putchar(i8 signext 10)
%24 = add nuw nsw i32 %13, 1
%25 = load i32, i32* %2
%26 = icmp slt i32 %13, %25
br i1 %26, label %12, label %27
27: ; preds = %22, %0
ret i32 0
}