#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*/ add();
int /*<<< orphan*/ create();
int /*<<< orphan*/ opcao_menu();
int /*<<< orphan*/ scanf(char *, int *);
int main(int args, char *arg[]) {
  int op;
  while (op != 0) {
    opcao_menu();
    scanf("%d", &op);
    if (op == 1)
      create();
    if (op == 2)
      add();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     119e <main+0x5e>
mov    $0x0,%al
call   1050 <opcao_menu@plt>
lea    0xe92(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1188 <main+0x48>
mov    $0x0,%al
call   1040 <create@plt>
cmpl   $0x2,-0x14(%rbp)
jne    1199 <main+0x59>
mov    $0x0,%al
call   1030 <add@plt>
jmp    1156 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    1164 <main+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
je     11ad <main+0x6d>
xor    %eax,%eax
call   1050 <opcao_menu@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1190 <main+0x50>
cmp    $0x2,%eax
jne    1160 <main+0x20>
jmp    11a0 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <create@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jne    1160 <main+0x20>
xor    %eax,%eax
call   1030 <add@plt>
mov    0x4(%rsp),%eax
jmp    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = call i32 (...) @opcao_menu()
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 (...) @create()
br label %17
17: ; preds = %15, %10
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (...) @add()
br label %22
22: ; preds = %20, %17
br label %7
23: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %2, %19
%6 = call i32 (...) @opcao_menu()
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = call i32 (...) @create()
%12 = load i32, i32* %3
br label %13
13: ; preds = %10, %5
%14 = phi i32 [ %12, %10 ], [ %8, %5 ]
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i32 (...) @add()
%18 = load i32, i32* %3
br label %19
19: ; preds = %16, %13
%20 = phi i32 [ %18, %16 ], [ %14, %13 ]
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %5
22: ; preds = %19
ret i32 0
}