#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 abs(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ retangulo(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int linhas, colunas, novalinha, novacoluna, x, y;
  printf("Digite as linhas: ");
  scanf("%d", &linhas);
  printf("Digite as colunas: ");
  scanf("%d", &colunas);
  if ((linhas >= 1) && (colunas <= 20))
    retangulo(linhas, colunas);
  else {
    y = abs(linhas - 1);
    novalinha = linhas + y;
    x = colunas - 20;
    novacoluna = colunas - x;
    printf("Seus valores de entrada foram alterados para %d %d\n", novalinha,
           novacoluna);
    retangulo(novalinha, novacoluna);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     11af <main+0x6f>
cmpl   $0x14,-0xc(%rbp)
jg     11af <main+0x6f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <retangulo@plt>
jmp    1205 <main+0xc5>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <abs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x14,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <retangulo@plt>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb9(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    119a <main+0x5a>
mov    0x8(%rsp),%esi
cmp    $0x14,%esi
jg     119a <main+0x5a>
call   1050 <retangulo@plt>
jmp    11d6 <main+0x96>
lea    -0x1(%rdi),%eax
mov    $0x1,%ebx
sub    %edi,%ebx
test   %edi,%edi
cmovg  %eax,%ebx
add    %edi,%ebx
lea    0xe78(%rip),%rdi
mov    %ebx,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x14,%esi
call   1050 <retangulo@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digite as linhas: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Digite as colunas: \00"
@.str.3 = [52 x i8] c"Seus valores de entrada foram alterados para %d %d\0A\00"
@.str.4 = [2 x i8] c"\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 ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 1
br i1 %13, label %14, label %21
14: ; preds = %0
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 20
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @retangulo(i32 %18, i32 %19)
br label %40
21: ; preds = %14, %0
%22 = load i32, i32* %2
%23 = sub nsw i32 %22, 1
%24 = call i32 @abs(i32 %23)
store i32 %24, i32* %7
%25 = load i32, i32* %2
%26 = load i32, i32* %7
%27 = add nsw i32 %25, %26
store i32 %27, i32* %4
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 20
store i32 %29, i32* %6
%30 = load i32, i32* %3
%31 = load i32, i32* %6
%32 = sub nsw i32 %30, %31
store i32 %32, i32* %5
%33 = load i32, i32* %4
%34 = load i32, i32* %5
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %33, i32 %34)
%36 = load i32, i32* %4
%37 = load i32, i32* %5
%38 = call i32 @retangulo(i32 %36, i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %40
40: ; preds = %21, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digite as linhas: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Digite as colunas: \00"
@.str.3 = [52 x i8] c"Seus valores de entrada foram alterados para %d %d\0A\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 21
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @retangulo(i32 %9, i32 %11)
br label %25
16: ; preds = %0
%17 = add nsw i32 %9, -1
%18 = icmp slt i32 %9, 1
%19 = sub i32 1, %9
%20 = select i1 %18, i32 %19, i32 %17
%21 = add nsw i32 %20, %9
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 20)
%23 = call i32 @retangulo(i32 %21, i32 20)
%24 = call i32 @putchar(i32 10)
br label %25
25: ; preds = %16, %14
ret i32 0
}