#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 *, ...);
main() {
  int linha, coluna, l, a;
  char nome[15], continuar;
  printf("Digite o seu nome.");
  scanf("%s", nome);
  do {
    printf("Qual a largura do retangulo? ");
    scanf("%d", &l);
  } while (l <= 0);
  do {
    printf("Qual a altura do retangulo? ");
    scanf("%d", &a);
  } while (a <= 0);
  printf("\n\nOlá, meu nome eh %s, e o meu retangulo ficou assim:\n\n", nome);
  for (coluna = 1; coluna <= a; coluna++) {
    for (linha = 1; linha <= l; linha++)
      if (linha == 1 || linha == l || coluna == 1 || coluna == a)
        printf("*");
      else
        printf(" ");
    printf("\n");
  }
  printf("\nDeseja continuar (s/n)?\n");
  scanf(" %c", &continuar);
  while (continuar == 's')
    ;
  return main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x23(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
jle    115f <main+0x2f>
jmp    118e <main+0x5e>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    118e <main+0x5e>
lea    -0x23(%rbp),%rsi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     126c <main+0x13c>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1250 <main+0x120>
cmpl   $0x1,-0x8(%rbp)
je     121c <main+0xec>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     121c <main+0xec>
cmpl   $0x1,-0xc(%rbp)
je     121c <main+0xec>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    122f <main+0xff>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123d <main+0x10d>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1242 <main+0x112>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e4 <main+0xb4>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d1 <main+0xa1>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe28(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movsbl -0x24(%rbp),%eax
cmp    $0x73,%eax
jne    129e <main+0x16e>
jmp    128c <main+0x15c>
call   1040 <main@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0x9(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe94(%rip),%r14
lea    0xeab(%rip),%r15
lea    0x4(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1190 <main+0x40>
lea    0xe82(%rip),%r14
lea    0xe78(%rip),%r15
mov    %rsp,%rbx
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11c0 <main+0x70>
lea    0xe70(%rip),%rdi
lea    0x9(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,(%rsp)
jle    1271 <main+0x121>
mov    $0x1,%ebx
jmp    1214 <main+0xc4>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    (%rsp),%ebx
mov    %eax,%ebx
jge    1271 <main+0x121>
cmpl   $0x0,0x4(%rsp)
jle    1200 <main+0xb0>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jl     1200 <main+0xb0>
mov    $0x1,%ebp
jmp    1258 <main+0x108>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x1,%ebx
cmove  %ecx,%edi
cmp    %eax,%ebp
cmove  %ecx,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jge    1200 <main+0xb0>
add    $0x1,%ebp
mov    $0x2a,%ecx
mov    $0x2a,%edi
cmp    (%rsp),%ebx
je     1240 <main+0xf0>
mov    $0x20,%edi
jmp    1240 <main+0xf0>
lea    0xe19(%rip),%rdi
call   1040 <puts@plt>
lea    0xe09(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
call   1060 <main@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite o seu nome.\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [30 x i8] c"Qual a largura do retangulo? \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [29 x i8] c"Qual a altura do retangulo? \00"
@.str.5 = [57 x i8] c"\0A\0AOl\C3\A1, meu nome eh %s, e o meu retangulo ficou assim:\0A\0A\00"
@.str.6 = [2 x i8] c"*\00"
@.str.7 = [2 x i8] c" \00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [26 x i8] c"\0ADeseja continuar (s/n)?\0A\00"
@.str.10 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [15 x i8]
%7 = alloca i8
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %14, %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
br label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp sle i32 %15, 0
br i1 %16, label %11, label %17
17: ; preds = %14
br label %18
18: ; preds = %21, %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
br label %21
21: ; preds = %18
%22 = load i32, i32* %5
%23 = icmp sle i32 %22, 0
br i1 %23, label %18, label %24
24: ; preds = %21
%25 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8* %25)
store i32 1, i32* %3
br label %27
27: ; preds = %60, %24
%28 = load i32, i32* %3
%29 = load i32, i32* %5
%30 = icmp sle i32 %28, %29
br i1 %30, label %31, label %63
31: ; preds = %27
store i32 1, i32* %2
br label %32
32: ; preds = %55, %31
%33 = load i32, i32* %2
%34 = load i32, i32* %4
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %58
36: ; preds = %32
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 1
br i1 %38, label %50, label %39
39: ; preds = %36
%40 = load i32, i32* %2
%41 = load i32, i32* %4
%42 = icmp eq i32 %40, %41
br i1 %42, label %50, label %43
43: ; preds = %39
%44 = load i32, i32* %3
%45 = icmp eq i32 %44, 1
br i1 %45, label %50, label %46
46: ; preds = %43
%47 = load i32, i32* %3
%48 = load i32, i32* %5
%49 = icmp eq i32 %47, %48
br i1 %49, label %50, label %52
50: ; preds = %46, %43, %39, %36
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %54
52: ; preds = %46
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %54
54: ; preds = %52, %50
br label %55
55: ; preds = %54
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %32
58: ; preds = %32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %60
60: ; preds = %58
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %27
63: ; preds = %27
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
%65 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %7)
br label %66
66: ; preds = %70, %63
%67 = load i8, i8* %7
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 115
br i1 %69, label %70, label %71
70: ; preds = %66
br label %66
71: ; preds = %66
%72 = call i32 @main()
ret i32 %72
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite o seu nome.\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [30 x i8] c"Qual a largura do retangulo? \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [29 x i8] c"Qual a altura do retangulo? \00"
@.str.5 = [57 x i8] c"\0A\0AOl\C3\A1, meu nome eh %s, e o meu retangulo ficou assim:\0A\0A\00"
@.str.10 = [4 x i8] c" %c\00"
@str = [25 x i8] c"\0ADeseja continuar (s/n)?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [15 x i8]
%4 = alloca i8
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %10
10: ; preds = %10, %0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 1
br i1 %14, label %10, label %15
15: ; preds = %10, %15
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 1
br i1 %19, label %15, label %20
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 1
br i1 %23, label %51, label %24
24: ; preds = %20, %46
%25 = phi i32 [ %48, %46 ], [ 1, %20 ]
%26 = load i32, i32* %1
%27 = icmp slt i32 %26, 1
br i1 %27, label %46, label %28
28: ; preds = %24
%29 = icmp eq i32 %25, 1
%30 = call i32 @putchar(i32 42)
%31 = load i32, i32* %1
%32 = icmp sgt i32 %31, 1
br i1 %32, label %33, label %46
33: ; preds = %28, %33
%34 = phi i32 [ %44, %33 ], [ %31, %28 ]
%35 = phi i32 [ %43, %33 ], [ 2, %28 ]
%36 = icmp eq i32 %35, %34
%37 = select i1 %36, i1 true, i1 %29
%38 = load i32, i32* %2
%39 = icmp eq i32 %25, %38
%40 = select i1 %37, i1 true, i1 %39
%41 = select i1 %40, i32 42, i32 32
%42 = call i32 @putchar(i32 %41)
%43 = add nuw nsw i32 %35, 1
%44 = load i32, i32* %1
%45 = icmp slt i32 %35, %44
br i1 %45, label %33, label %46
46: ; preds = %33, %28, %24
%47 = call i32 @putchar(i32 10)
%48 = add nuw nsw i32 %25, 1
%49 = load i32, i32* %2
%50 = icmp slt i32 %25, %49
br i1 %50, label %24, label %51
51: ; preds = %46, %20
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %4)
%54 = call i32 @main()
ret i32 undef
}