#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*/ sqrt(int);
int main() {
  int num1, num2;
  int soma, sub, mult, divi, resp, operacoes, raiz;
  printf("\ntabela da calculadora\n");
  printf("_____________________");
  printf("\n1)soma\n");
  printf("\n2)subtração\n");
  printf("\n3)multiplicação\n");
  printf("\n4)divisão\n");
  do {
    printf("\nentre com num1:\n ");
    scanf("%d", &num1);
    printf("\nentre com um2:\n ");
    scanf("%d", &num2);
    printf("escolha sua operação pelos números da tabela ");
    scanf("%d", &operacoes);
    if (operacoes == 1) {
      soma = num1 + num2;
      printf("soma=%d", soma);
      printf("\ndeseja tirar a raiz quadrada: ");
      scanf("%d", &operacoes);
      if (resp == 5) {
        sqrt(soma);
        printf("%d", raiz);
      }
    }
  } while (resp == 1);
  { printf("bons estudos"); }
  return 0;
}


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    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    1257 <main+0x127>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x20(%rbp)
jne    1252 <main+0x122>
mov    -0x10(%rbp),%edi
call   1050 <sqrt@plt>
mov    -0x28(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1257 <main+0x127>
jmp    125c <main+0x12c>
cmpl   $0x1,-0x20(%rbp)
je     1193 <main+0x63>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf65(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf62(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf61(%rip),%rdi
call   1030 <puts@plt>
lea    0xf68(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
cmpl   $0x1,0x4(%rsp)
jne    1213 <main+0xe3>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0Atabela da calculadora\0A\00"
@.str.1 = [22 x i8] c"_____________________\00"
@.str.2 = [9 x i8] c"\0A1)soma\0A\00"
@.str.3 = [16 x i8] c"\0A2)subtra\C3\A7\C3\A3o\0A\00"
@.str.4 = [20 x i8] c"\0A3)multiplica\C3\A7\C3\A3o\0A\00"
@.str.5 = [13 x i8] c"\0A4)divis\C3\A3o\0A\00"
@.str.6 = [19 x i8] c"\0Aentre com num1:\0A \00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [18 x i8] c"\0Aentre com um2:\0A \00"
@.str.9 = [49 x i8] c"escolha sua opera\C3\A7\C3\A3o pelos n\C3\BAmeros da tabela \00"
@.str.10 = [8 x i8] c"soma=%d\00"
@.str.11 = [32 x i8] c"\0Adeseja tirar a raiz quadrada: \00"
@.str.12 = [13 x i8] c"bons estudos\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
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %17
17: ; preds = %43, %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %9)
%24 = load i32, i32* %9
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %42
26: ; preds = %17
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = add nsw i32 %27, %28
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %9)
%34 = load i32, i32* %8
%35 = icmp eq i32 %34, 5
br i1 %35, label %36, label %41
36: ; preds = %26
%37 = load i32, i32* %4
%38 = call i32 @sqrt(i32 %37)
%39 = load i32, i32* %10
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %36, %26
br label %42
42: ; preds = %41, %17
br label %43
43: ; preds = %42
%44 = load i32, i32* %8
%45 = icmp eq i32 %44, 1
br i1 %45, label %17, label %46
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"_____________________\00"
@.str.6 = [19 x i8] c"\0Aentre com num1:\0A \00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [18 x i8] c"\0Aentre com um2:\0A \00"
@.str.9 = [49 x i8] c"escolha sua opera\C3\A7\C3\A3o pelos n\C3\BAmeros da tabela \00"
@.str.10 = [8 x i8] c"soma=%d\00"
@.str.11 = [32 x i8] c"\0Adeseja tirar a raiz quadrada: \00"
@.str.12 = [13 x i8] c"bons estudos\00"
@str = [23 x i8] c"\0Atabela da calculadora\00"
@str.13 = [8 x i8] c"\0A1)soma\00"
@str.14 = [15 x i8] c"\0A2)subtra\C3\A7\C3\A3o\00"
@str.15 = [19 x i8] c"\0A3)multiplica\C3\A7\C3\A3o\00"
@str.16 = [12 x i8] c"\0A4)divis\C3\A3o\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*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.14, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.15, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.16, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %28
21: ; preds = %0
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = add nsw i32 %23, %22
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
br label %28
28: ; preds = %0, %21
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}