#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 main() {
  int forma = 0;
  printf("Entre o numero da forma desejada:\n1 - Quadrado\n2 - Circulo\n3 - "
         "flecha\n4 - Losango\n\n");
  scanf("%i", &forma);
  if (forma == 1) {
    printf("\n*********\n*       *\n*       *\n*       *\n*       *\n*       "
           "*\n*       *\n*       *\n*********");
  } else if (forma == 2) {
    printf("\n  ***  \n *   * \n*     *\n*     *\n*     *\n*     *\n*     *\n "
           "*   * \n  ***");
  } else if (forma == 3) {
    printf("\n  *  \n *** \n*****\n  *  \n  *  \n  *  \n  *  \n  *  \n  *");
  } else if (forma == 4) {
    printf("\n    *    \n   * *  \n  *   *\n *     *\n*       *\n *     *\n  * "
           "  *\n   * *\n    *");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    116d <main+0x4d>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
cmpl   $0x2,-0x8(%rbp)
jne    1188 <main+0x68>
lea    0xf34(%rip),%rdi
call   1030 <printf@plt>
jmp    11c3 <main+0xa3>
cmpl   $0x3,-0x8(%rbp)
jne    11a3 <main+0x83>
lea    0xf60(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
cmpl   $0x4,-0x8(%rbp)
jne    11b9 <main+0x99>
lea    0xf7a(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
jmp    11c3 <main+0xa3>
jmp    11c8 <main+0xa8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xfe7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1177 <main+0x47>
cltq
lea    0x1011(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [84 x i8] c"Entre o numero da forma desejada:\0A1 - Quadrado\0A2 - Circulo\0A3 - flecha\0A4 - Losango\0A\0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [91 x i8] c"\0A*********\0A* *\0A* *\0A* *\0A* *\0A* *\0A* *\0A* *\0A*********\00"
@.str.3 = [71 x i8] c"\0A *** \0A * * \0A* *\0A* *\0A* *\0A* *\0A* *\0A * * \0A ***\00"
@.str.4 = [53 x i8] c"\0A * \0A *** \0A*****\0A * \0A * \0A * \0A * \0A * \0A *\00"
@.str.5 = [77 x i8] c"\0A * \0A * * \0A * *\0A * *\0A* *\0A * *\0A * *\0A * *\0A *\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.2, i64 0, i64 0))
br label %27
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0))
br label %26
14: ; preds = %9
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
br label %25
19: ; preds = %14
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %22, %19
br label %25
25: ; preds = %24, %17
br label %26
26: ; preds = %25, %12
br label %27
27: ; preds = %26, %7
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [91 x i8] c"\0A*********\0A* *\0A* *\0A* *\0A* *\0A* *\0A* *\0A* *\0A*********\00"
@.str.3 = [71 x i8] c"\0A *** \0A * * \0A* *\0A* *\0A* *\0A* *\0A* *\0A * * \0A ***\00"
@.str.4 = [53 x i8] c"\0A * \0A *** \0A*****\0A * \0A * \0A * \0A * \0A * \0A *\00"
@.str.5 = [77 x i8] c"\0A * \0A * * \0A * *\0A * *\0A* *\0A * *\0A * *\0A * *\0A *\00"
@str = [83 x i8] c"Entre o numero da forma desejada:\0A1 - Quadrado\0A2 - Circulo\0A3 - flecha\0A4 - Losango\0A\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([91 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([71 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([53 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([77 x i8]* @.str.5 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 4
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %10)
%12 = call i32 @printf(i8* dereferenceable(1) %11)
br label %13
13: ; preds = %0, %8
ret i32 0
}