#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 a, b;
  printf("\tCálculo de Áreas de un Rectángulo\n\n");
  printf("Introduce la medida de la base: ");
  scanf("%d", &a);
  printf("Introduce la medida de la altura: ");
  scanf("%d", &b);
  printf("La medida del Rectángulo de %dx%d es: %d.\n", a, b, a * b);
  printf("\nRepresentación Gráfica:\n\n\t");
  for (int i = 0; i < a; i++) {
    printf("#");
  }
  printf("\n");
  for (int i = 0; i < b - 2; i++) {
    printf("\t#");
    for (int j = 0; j < a - 2; j++) {
      printf(" ");
    }
    printf("#\n");
  }
  printf("\t");
  for (int i = 0; i < a; i++) {
    printf("#");
  }
  printf("\nFin del Programa\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d1 <main+0xb1>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a9 <main+0x89>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1255 <main+0x135>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1239 <main+0x119>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    120c <main+0xec>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e6 <main+0xc6>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1292 <main+0x172>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    126a <main+0x14a>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xf46(%rip),%rdi
call   1040 <puts@plt>
lea    0xea6(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb7(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,(%rsp)
jle    11d2 <main+0x92>
xchg   %ax,%ax
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     11c0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x3,0x4(%rsp)
jl     1249 <main+0x109>
lea    0xea7(%rip),%r14
lea    0xea1(%rip),%r15
xor    %ebp,%ebp
jmp    1216 <main+0xd6>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebp
jge    1249 <main+0x109>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x3,(%rsp)
jl     1200 <main+0xc0>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    (%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebx
jl     1230 <main+0xf0>
jmp    1200 <main+0xc0>
mov    $0x9,%edi
call   1030 <putchar@plt>
cmpl   $0x0,(%rsp)
jle    1272 <main+0x132>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     1260 <main+0x120>
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\09C\C3\A1lculo de \C3\81reas de un Rect\C3\A1ngulo\0A\0A\00"
@.str.1 = [33 x i8] c"Introduce la medida de la base: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [35 x i8] c"Introduce la medida de la altura: \00"
@.str.4 = [44 x i8] c"La medida del Rect\C3\A1ngulo de %dx%d es: %d.\0A\00"
@.str.5 = [30 x i8] c"\0ARepresentaci\C3\B3n Gr\C3\A1fica:\0A\0A\09\00"
@.str.6 = [2 x i8] c"#\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [3 x i8] c"\09#\00"
@.str.9 = [2 x i8] c" \00"
@.str.10 = [3 x i8] c"#\0A\00"
@.str.11 = [2 x i8] c"\09\00"
@.str.12 = [19 x i8] c"\0AFin del Programa\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = mul nsw i32 %15, %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i32 %13, i32 %14, i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %4
br label %20
20: ; preds = %26, %0
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %20
29: ; preds = %20
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %5
br label %31
31: ; preds = %50, %29
%32 = load i32, i32* %5
%33 = load i32, i32* %3
%34 = sub nsw i32 %33, 2
%35 = icmp slt i32 %32, %34
br i1 %35, label %36, label %53
36: ; preds = %31
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %6
br label %38
38: ; preds = %45, %36
%39 = load i32, i32* %6
%40 = load i32, i32* %2
%41 = sub nsw i32 %40, 2
%42 = icmp slt i32 %39, %41
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %45
45: ; preds = %43
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %38
48: ; preds = %38
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %50
50: ; preds = %48
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %31
53: ; preds = %31
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %7
br label %55
55: ; preds = %61, %53
%56 = load i32, i32* %7
%57 = load i32, i32* %2
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %64
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %61
61: ; preds = %59
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %55
64: ; preds = %55
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"Introduce la medida de la base: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [35 x i8] c"Introduce la medida de la altura: \00"
@.str.4 = [44 x i8] c"La medida del Rect\C3\A1ngulo de %dx%d es: %d.\0A\00"
@.str.5 = [30 x i8] c"\0ARepresentaci\C3\B3n Gr\C3\A1fica:\0A\0A\09\00"
@.str.8 = [3 x i8] c"\09#\00"
@str = [39 x i8] c"\09C\C3\A1lculo de \C3\81reas de un Rect\C3\A1ngulo\0A\00"
@str.13 = [18 x i8] c"\0AFin del Programa\00"
@str.14 = [2 x i8] c"#\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 ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 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* %1
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, %10
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = icmp sgt i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %21, %0
%18 = call i32 @putchar(i32 10)
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 2
br i1 %20, label %31, label %27
21: ; preds = %0, %21
%22 = phi i32 [ %24, %21 ], [ 0, %0 ]
%23 = call i32 @putchar(i32 35)
%24 = add nuw nsw i32 %22, 1
%25 = load i32, i32* %1
%26 = icmp slt i32 %24, %25
br i1 %26, label %21, label %17
27: ; preds = %36, %17
%28 = call i32 @putchar(i32 9)
%29 = load i32, i32* %1
%30 = icmp sgt i32 %29, 0
br i1 %30, label %51, label %49
31: ; preds = %17, %36
%32 = phi i32 [ %38, %36 ], [ 0, %17 ]
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%34 = load i32, i32* %1
%35 = icmp sgt i32 %34, 2
br i1 %35, label %42, label %36
36: ; preds = %42, %31
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0))
%38 = add nuw nsw i32 %32, 1
%39 = load i32, i32* %2
%40 = add nsw i32 %39, -2
%41 = icmp slt i32 %38, %40
br i1 %41, label %31, label %27
42: ; preds = %31, %42
%43 = phi i32 [ %45, %42 ], [ 0, %31 ]
%44 = call i32 @putchar(i32 32)
%45 = add nuw nsw i32 %43, 1
%46 = load i32, i32* %1
%47 = add nsw i32 %46, -2
%48 = icmp slt i32 %45, %47
br i1 %48, label %42, label %36
49: ; preds = %51, %27
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.13, i64 0, i64 0))
ret i32 0
51: ; preds = %27, %51
%52 = phi i32 [ %54, %51 ], [ 0, %27 ]
%53 = call i32 @putchar(i32 35)
%54 = add nuw nsw i32 %52, 1
%55 = load i32, i32* %1
%56 = icmp slt i32 %54, %55
br i1 %56, label %51, label %49
}