#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 /*<<< orphan*/ system(char *);
int main() {
  int l1, l2, l3, l4 = 0;
  printf("Digite o valor do lado 1: ");
  scanf("%d", &l1);
  printf("Digite o valor do lado 2: ");
  scanf("%d", &l2);
  printf("Digite o valor do lado 3: ");
  scanf("%d", &l3);
  printf("Digite o valor do lado 4: ");
  scanf("%d", &l4);
  printf("Lado 1: %d\nLado 2: %d\nLado 3: %d\nLado 4: %d\n", l1, l2, l3, l4);
  if (l1 == l2 && l2 == l3 && l3 == l4) {
    printf("Quadrado\n");
  } else if (l1 == l3 && l2 == l4) {
    printf("Retangulo\n");
  } else {
    printf("Figura nao conhecida\n");
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1210 <main+0xe0>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1210 <main+0xe0>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1210 <main+0xe0>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124e <main+0x11e>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    123b <main+0x10b>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    123b <main+0x10b>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1249 <main+0x119>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124e <main+0x11e>
lea    0xe72(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,(%rsp)
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeba(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%edx
cmp    %ecx,%eax
jne    11ff <main+0xbf>
mov    (%rsp),%esi
cmp    %edx,%eax
jne    1202 <main+0xc2>
cmp    %esi,%edx
jne    1202 <main+0xc2>
lea    0xec4(%rip),%rdi
jmp    121a <main+0xda>
mov    (%rsp),%esi
xor    %edx,%eax
xor    %esi,%ecx
lea    0xeaa(%rip),%rdx
lea    0xe8e(%rip),%rdi
or     %eax,%ecx
cmove  %rdx,%rdi
call   1030 <puts@plt>
lea    0xe76(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Digite o valor do lado 1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Digite o valor do lado 2: \00"
@.str.3 = [27 x i8] c"Digite o valor do lado 3: \00"
@.str.4 = [27 x i8] c"Digite o valor do lado 4: \00"
@.str.5 = [45 x i8] c"Lado 1: %d\0ALado 2: %d\0ALado 3: %d\0ALado 4: %d\0A\00"
@.str.6 = [10 x i8] c"Quadrado\0A\00"
@.str.7 = [11 x i8] c"Retangulo\0A\00"
@.str.8 = [22 x i8] c"Figura nao conhecida\0A\00"
@.str.9 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %32
22: ; preds = %0
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %45
32: ; preds = %26, %22, %0
%33 = load i32, i32* %2
%34 = load i32, i32* %4
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %42
36: ; preds = %32
%37 = load i32, i32* %3
%38 = load i32, i32* %5
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %44
42: ; preds = %36, %32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44, %30
%46 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Digite o valor do lado 1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Digite o valor do lado 2: \00"
@.str.3 = [27 x i8] c"Digite o valor do lado 3: \00"
@.str.4 = [27 x i8] c"Digite o valor do lado 4: \00"
@.str.5 = [45 x i8] c"Lado 1: %d\0ALado 2: %d\0ALado 3: %d\0ALado 4: %d\0A\00"
@.str.9 = [6 x i8] c"pause\00"
@str = [21 x i8] c"Figura nao conhecida\00"
@str.10 = [10 x i8] c"Retangulo\00"
@str.11 = [9 x i8] c"Quadrado\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = icmp eq i32 %22, %23
%25 = load i32, i32* %3
br i1 %24, label %28, label %26
26: ; preds = %0
%27 = load i32, i32* %4
br label %33
28: ; preds = %0
%29 = icmp eq i32 %22, %25
%30 = load i32, i32* %4
%31 = icmp eq i32 %25, %30
%32 = select i1 %29, i1 %31, i1 false
br i1 %32, label %39, label %33
33: ; preds = %26, %28
%34 = phi i32 [ %27, %26 ], [ %30, %28 ]
%35 = icmp eq i32 %22, %25
%36 = icmp eq i32 %23, %34
%37 = select i1 %35, i1 %36, i1 false
%38 = select i1 %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0)
br label %39
39: ; preds = %33, %28
%40 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0), %28 ], [ %38, %33 ]
%41 = call i32 @puts(i8* dereferenceable(1) %40)
%42 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}