#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 *);
int rectangle() {
  int length, width;
  int row, colume;
  printf("===========================================\n");
  printf("rectangle!\n please input length and width:\n");
  scanf("%d %d", &length, &width);
  for (row = 1; row <= width; row++) {
    for (colume = 1; colume <= length; colume++) {
      printf("*");
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<rectangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11ae <rectangle+0x8e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1194 <rectangle+0x74>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <rectangle+0x4e>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <rectangle+0x3b>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectangle>:
push   %rbp
push   %rbx
push   %rax
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11a5 <rectangle+0x75>
mov    $0x1,%ebx
jmp    1184 <rectangle+0x54>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    (%rsp),%ebx
mov    %eax,%ebx
jge    11a5 <rectangle+0x75>
cmpl   $0x0,0x4(%rsp)
jle    1170 <rectangle+0x40>
xor    %ebp,%ebp
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1190 <rectangle+0x60>
jmp    1170 <rectangle+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"===========================================\0A\00"
@.str.1 = [44 x i8] c"rectangle!\0A please input length and width:\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @rectangle() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
store i32 1, i32* %4
br label %9
9: ; preds = %25, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
store i32 1, i32* %5
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %14
23: ; preds = %14
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %9
28: ; preds = %9
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"%d %d\00"
@str = [44 x i8] c"===========================================\00"
@str.5 = [43 x i8] c"rectangle!\0A please input length and width:\00"
define i32 @rectangle() {
%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 ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 1
br i1 %9, label %25, label %10
10: ; preds = %0, %20
%11 = phi i32 [ %22, %20 ], [ 1, %0 ]
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 1
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi i32 [ %17, %14 ], [ 1, %10 ]
%16 = call i32 @putchar(i32 42)
%17 = add nuw nsw i32 %15, 1
%18 = load i32, i32* %1
%19 = icmp slt i32 %15, %18
br i1 %19, label %14, label %20
20: ; preds = %14, %10
%21 = call i32 @putchar(i32 10)
%22 = add nuw nsw i32 %11, 1
%23 = load i32, i32* %2
%24 = icmp slt i32 %11, %23
br i1 %24, label %10, label %25
25: ; preds = %20, %0
%26 = call i32 @putchar(i32 10)
ret i32 undef
}