#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int larg, alt, i, j, car, cont;
  cont = 115;
  do {
    printf("Diga o caracter\n");
    car = getchar();
    printf("Diga o tamanho da largura\n");
    scanf("%d", &larg);
    printf("Diga o tamanho da altura\n");
    scanf("%d", &alt);
    printf("Olá, meu nome é Matheus e o retangulo ficou assim:\n");
    for (j = 0; j < alt; j++) {
      for (i = 0; i < larg; i++) {
        printf("%c", car);
      }
      printf("\n");
    }
    printf("Deseja continuar(s = novo caracter/n = 2)?");
    scanf("%d", &cont);
  } while (cont == 115);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x73,-0x1c(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1209 <main+0xd9>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ed <main+0xbd>
mov    -0x18(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c2 <main+0x92>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11af <main+0x7f>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0e(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x73,-0x1c(%rbp)
je     1146 <main+0x16>
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
movl   $0x73,0xc(%rsp)
lea    0xe93(%rip),%rbx
lea    0xe8f(%rip),%r15
lea    0xc(%rsp),%r12
jmp    11a0 <main+0x50>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
cmpl   $0x73,0xc(%rsp)
jne    1245 <main+0xf5>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%r13d
lea    0xe81(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1070 <scanf@plt>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
call   1070 <scanf@plt>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0x10(%rsp)
jle    1180 <main+0x30>
xor    %ebp,%ebp
jmp    1217 <main+0xc7>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x10(%rsp),%ebp
jge    1180 <main+0x30>
cmpl   $0x0,0x14(%rsp)
jle    1200 <main+0xb0>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13d,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    0x14(%rsp),%r14d
jl     1230 <main+0xe0>
jmp    1200 <main+0xb0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Diga o caracter\0A\00"
@.str.1 = [27 x i8] c"Diga o tamanho da largura\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"Diga o tamanho da altura\0A\00"
@.str.4 = [54 x i8] c"Ol\C3\A1, meu nome \C3\A9 Matheus e o retangulo ficou assim:\0A\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [43 x i8] c"Deseja continuar(s = novo caracter/n = 2)?\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
store i32 115, i32* %7
br label %8
8: ; preds = %39, %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @getchar()
store i32 %10, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %5
br label %16
16: ; preds = %33, %8
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %36
20: ; preds = %16
store i32 0, i32* %4
br label %21
21: ; preds = %28, %20
%22 = load i32, i32* %4
%23 = load i32, i32* %2
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i32, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %21
31: ; preds = %21
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %16
36: ; preds = %16
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
br label %39
39: ; preds = %36
%40 = load i32, i32* %7
%41 = icmp eq i32 %40, 115
br i1 %41, label %8, label %42
42: ; preds = %39
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%d\00"
@.str.7 = [43 x i8] c"Deseja continuar(s = novo caracter/n = 2)?\00"
@str = [16 x i8] c"Diga o caracter\00"
@str.8 = [26 x i8] c"Diga o tamanho da largura\00"
@str.9 = [25 x i8] c"Diga o tamanho da altura\00"
@str.10 = [53 x i8] c"Ol\C3\A1, meu nome \C3\A9 Matheus e o retangulo ficou assim:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 115, i32* %3
br label %7
7: ; preds = %32, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%9 = call i32 (...) @getchar()
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.9, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.10, i64 0, i64 0))
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %7, %27
%18 = phi i32 [ %29, %27 ], [ 0, %7 ]
%19 = load i32, i32* %1
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %17, %21
%22 = phi i32 [ %24, %21 ], [ 0, %17 ]
%23 = call i32 @putchar(i32 %9)
%24 = add nuw nsw i32 %22, 1
%25 = load i32, i32* %1
%26 = icmp slt i32 %24, %25
br i1 %26, label %21, label %27
27: ; preds = %21, %17
%28 = call i32 @putchar(i32 10)
%29 = add nuw nsw i32 %18, 1
%30 = load i32, i32* %2
%31 = icmp slt i32 %29, %30
br i1 %31, label %17, label %32
32: ; preds = %27, %7
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 115
br i1 %36, label %7, label %37
37: ; preds = %32
ret i32 0
}