#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*/ addcliente();
int /*<<< orphan*/ addopr(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mostrar();
int /*<<< orphan*/ mostraroprs();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdin;
main() {
  char aux[6];
  int op = 0;
  printf(
      "Escolha a operacao\n(1) - Adicionar\n(2) - Mostrar todos clientes\n(3) "
      "- Adicionar operacao\n(4) - Mostrar operacoes\n(5) - Sair\n\n-->");
  setbuf(stdin, NULL);
  scanf("%d", &op);
  switch (op) {
  case 1:
    addcliente();
    break;
  case 2:
    mostrar();
    break;
  case 3:
    printf("digite o numero de sua conta: ");
    setbuf(stdin, NULL);
    scanf("%s", aux);
    setbuf(stdin, NULL);
    addopr(aux);
    break;
  case 4:
    mostraroprs();
    break;
  case 5:
    exit(0);
    break;
  default:
    printf("Operacao inválida !\n");
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    -0x1c(%rbp),%eax
lea    0xed4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     126e <main+0xee>
mov    -0x18(%rbp),%rax
lea    0xe16(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <addcliente@plt>
jmp    127a <main+0xfa>
mov    $0x0,%al
call   1080 <mostrar@plt>
jmp    127a <main+0xfa>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    -0xa(%rbp),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    -0xa(%rbp),%rdi
call   10a0 <addopr@plt>
jmp    127a <main+0xfa>
mov    $0x0,%al
call   1090 <mostraroprs@plt>
jmp    127a <main+0xfa>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
lea    0xe6e(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e36(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xed3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     123a <main+0xaa>
lea    0xe1f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <addcliente@plt>
jmp    124f <main+0xbf>
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
mov    (%rbx),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xea8(%rip),%rdi
lea    0x12(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rbx),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
mov    %r14,%rdi
call   10b0 <addopr@plt>
jmp    124f <main+0xbf>
xor    %eax,%eax
call   10a0 <mostraroprs@plt>
jmp    124f <main+0xbf>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
jmp    124f <main+0xbf>
xor    %eax,%eax
call   1090 <mostrar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [129 x i8] c"Escolha a operacao\0A(1) - Adicionar\0A(2) - Mostrar todos clientes\0A(3) - Adicionar operacao\0A(4) - Mostrar operacoes\0A(5) - Sair\0A\0A-->\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"digite o numero de sua conta: \00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [22 x i8] c"Operacao inv\C3\A1lida !\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @setbuf(i32 %5, i32* null)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
switch i32 %8, label %27 [
i32 1, label %9
i32 2, label %11
i32 3, label %13
i32 4, label %23
i32 5, label %25
]
9: ; preds = %0
%10 = call i32 (...) @addcliente()
br label %29
11: ; preds = %0
%12 = call i32 (...) @mostrar()
br label %29
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stdin
%16 = call i32 @setbuf(i32 %15, i32* null)
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @stdin
%20 = call i32 @setbuf(i32 %19, i32* null)
%21 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%22 = call i32 @addopr(i8* %21)
br label %29
23: ; preds = %0
%24 = call i32 (...) @mostraroprs()
br label %29
25: ; preds = %0
%26 = call i32 @exit(i32 0)
unreachable
27: ; preds = %0
%28 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27, %23, %13, %11, %9
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [129 x i8] c"Escolha a operacao\0A(1) - Adicionar\0A(2) - Mostrar todos clientes\0A(3) - Adicionar operacao\0A(4) - Mostrar operacoes\0A(5) - Sair\0A\0A-->\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"digite o numero de sua conta: \00"
@.str.3 = [3 x i8] c"%s\00"
@str = [21 x i8] c"Operacao inv\C3\A1lida !\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = tail call i32 @setbuf(i32 %6, i32* null)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
switch i32 %9, label %26 [
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %22
i32 5, label %24
]
10: ; preds = %0
%11 = call i32 (...) @addcliente()
br label %28
12: ; preds = %0
%13 = call i32 (...) @mostrar()
br label %28
14: ; preds = %0
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @stdin
%17 = call i32 @setbuf(i32 %16, i32* null)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%19 = load i32, i32* @stdin
%20 = call i32 @setbuf(i32 %19, i32* null)
%21 = call i32 @addopr(i8* %3)
br label %28
22: ; preds = %0
%23 = call i32 (...) @mostraroprs()
br label %28
24: ; preds = %0
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %0
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %28
28: ; preds = %26, %22, %14, %12, %10
ret i32 0
}