#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 main() {
  int i = 0, j = 0;
  int l, h;
  int continuar = 0;
  char c, fim;
  while (continuar == 0) {
    printf("Insira a largura desejada \n");
    scanf("%d", &l);
    printf("Insira a altura desejada \n");
    scanf("%d", &h);
    printf("Escolha o simbolo desejado \n");
    scanf(" %c", &c);
    printf("Olá meu Nome é Gabriel Pontes Monteiro e esse é meu Retângulo:\n");
    for (j; j < h; j++) {
      for (i; i < l; i++) {
        if (j == 0 || j == h - 1 || i == 0 || i == l - 1) {
          printf(" %c ", c);
        } else {
          printf("   ");
        }
      }
      i = 0;
      printf("\n");
    }
    printf("Deseja continuar ?   digite (1) para sim e (2) para encerrar o "
           "progama ?\n");
    scanf(" %c", &fim);
    if (fim == '2') {
      continuar = 1;
    }
  }
  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,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    129e <main+0x17e>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x19(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1265 <main+0x145>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1242 <main+0x122>
cmpl   $0x0,-0xc(%rbp)
je     120a <main+0xea>
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     120a <main+0xea>
cmpl   $0x0,-0x8(%rbp)
je     120a <main+0xea>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1221 <main+0x101>
movsbl -0x19(%rbp),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122f <main+0x10f>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1234 <main+0x114>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c8 <main+0xa8>
movl   $0x0,-0x8(%rbp)
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11bc <main+0x9c>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xddd(%rip),%rdi
lea    -0x1a(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x1a(%rbp),%eax
cmp    $0x32,%eax
jne    1299 <main+0x179>
movl   $0x1,-0x18(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeab(%rip),%rbx
lea    0xea7(%rip),%r14
lea    0xea4(%rip),%r13
lea    0xea2(%rip),%rbp
xor    %r15d,%r15d
jmp    1196 <main+0x56>
nop
lea    0xf2d(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
lea    0xe(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpb   $0x32,0xe(%rsp)
je     1276 <main+0x136>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe72(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe73(%rip),%rdi
call   1040 <puts@plt>
jmp    120e <main+0xce>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    0x10(%rsp),%r15d
jge    1170 <main+0x30>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    1200 <main+0xc0>
xor    %r12d,%r12d
jmp    124c <main+0x10c>
cs nopw 0x0(%rax,%rax,1)
movsbl 0xf(%rsp),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r12d
mov    0x14(%rsp),%eax
cmp    %eax,%r12d
jge    1200 <main+0xc0>
test   %r15d,%r15d
je     1230 <main+0xf0>
mov    0x10(%rsp),%ecx
add    $0xffffffff,%ecx
cmp    %ecx,%r15d
je     1230 <main+0xf0>
test   %r12d,%r12d
je     1230 <main+0xf0>
add    $0xffffffff,%eax
cmp    %eax,%r12d
je     1230 <main+0xf0>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    123f <main+0xff>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Insira a largura desejada \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Insira a altura desejada \0A\00"
@.str.3 = [29 x i8] c"Escolha o simbolo desejado \0A\00"
@.str.4 = [4 x i8] c" %c\00"
@.str.5 = [68 x i8] c"Ol\C3\A1 meu Nome \C3\A9 Gabriel Pontes Monteiro e esse \C3\A9 meu Ret\C3\A2ngulo:\0A\00"
@.str.6 = [5 x i8] c" %c \00"
@.str.7 = [4 x i8] c" \00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [74 x i8] c"Deseja continuar ? digite (1) para sim e (2) para encerrar o progama ?\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 i8
%8 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %6
br label %9
9: ; preds = %69, %0
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %70
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32, i32* %3
br label %21
21: ; preds = %59, %12
%22 = load i32, i32* %3
%23 = load i32, i32* %5
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %62
25: ; preds = %21
%26 = load i32, i32* %2
br label %27
27: ; preds = %54, %25
%28 = load i32, i32* %2
%29 = load i32, i32* %4
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %57
31: ; preds = %27
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 0
br i1 %33, label %47, label %34
34: ; preds = %31
%35 = load i32, i32* %3
%36 = load i32, i32* %5
%37 = sub nsw i32 %36, 1
%38 = icmp eq i32 %35, %37
br i1 %38, label %47, label %39
39: ; preds = %34
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 0
br i1 %41, label %47, label %42
42: ; preds = %39
%43 = load i32, i32* %2
%44 = load i32, i32* %4
%45 = sub nsw i32 %44, 1
%46 = icmp eq i32 %43, %45
br i1 %46, label %47, label %51
47: ; preds = %42, %39, %34, %31
%48 = load i8, i8* %7
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %49)
br label %53
51: ; preds = %42
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %53
53: ; preds = %51, %47
br label %54
54: ; preds = %53
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %27
57: ; preds = %27
store i32 0, i32* %2
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %59
59: ; preds = %57
%60 = load i32, i32* %3
%61 = add nsw i32 %60, 1
store i32 %61, i32* %3
br label %21
62: ; preds = %21
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.9, i64 0, i64 0))
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%65 = load i8, i8* %8
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 50
br i1 %67, label %68, label %69
68: ; preds = %62
store i32 1, i32* %6
br label %69
69: ; preds = %68, %62
br label %9
70: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c" %c\00"
@.str.6 = [5 x i8] c" %c \00"
@.str.7 = [4 x i8] c" \00"
@str = [27 x i8] c"Insira a largura desejada \00"
@str.10 = [26 x i8] c"Insira a altura desejada \00"
@str.11 = [28 x i8] c"Escolha o simbolo desejado \00"
@str.12 = [67 x i8] c"Ol\C3\A1 meu Nome \C3\A9 Gabriel Pontes Monteiro e esse \C3\A9 meu Ret\C3\A2ngulo:\00"
@str.13 = [73 x i8] c"Deseja continuar ? digite (1) para sim e (2) para encerrar o progama ?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
br label %7
7: ; preds = %0, %51
%8 = phi i32 [ 0, %0 ], [ %52, %51 ]
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.10, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.12, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = icmp slt i32 %8, %16
br i1 %17, label %18, label %51
18: ; preds = %7, %46
%19 = phi i32 [ %48, %46 ], [ %8, %7 ]
%20 = load i32, i32* %1
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %46
22: ; preds = %18
%23 = icmp eq i32 %19, 0
br label %24
24: ; preds = %22, %42
%25 = phi i32 [ %20, %22 ], [ %44, %42 ]
%26 = phi i32 [ 0, %22 ], [ %43, %42 ]
br i1 %23, label %36, label %27
27: ; preds = %24
%28 = load i32, i32* %2
%29 = add nsw i32 %28, -1
%30 = icmp eq i32 %19, %29
%31 = icmp eq i32 %26, 0
%32 = select i1 %30, i1 true, i1 %31
%33 = add nsw i32 %25, -1
%34 = icmp eq i32 %26, %33
%35 = select i1 %32, i1 true, i1 %34
br i1 %35, label %36, label %40
36: ; preds = %27, %24
%37 = load i8, i8* %3
%38 = sext i8 %37 to i32
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %38)
br label %42
40: ; preds = %27
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %42
42: ; preds = %36, %40
%43 = add nuw nsw i32 %26, 1
%44 = load i32, i32* %1
%45 = icmp slt i32 %43, %44
br i1 %45, label %24, label %46
46: ; preds = %42, %18
%47 = call i32 @putchar(i32 10)
%48 = add nsw i32 %19, 1
%49 = load i32, i32* %2
%50 = icmp slt i32 %48, %49
br i1 %50, label %18, label %51
51: ; preds = %46, %7
%52 = phi i32 [ %8, %7 ], [ %48, %46 ]
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.13, i64 0, i64 0))
%54 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%55 = load i8, i8* %4
%56 = icmp eq i8 %55, 50
br i1 %56, label %57, label %7
57: ; preds = %51
ret i32 0
}