#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ captura(char *, int);
int desbloquear_senha(int *, int, int);
int /*<<< orphan*/ erro();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ menu_principal(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sair();
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ system(char *);
void gerente(int *terminal) {
  int agencia, cc;
  int opc;
  system("cls");
  printf(
      "############### BANCO KNC - O SEU BANCO DE SUCESSO ###############\n\n");
  printf("Contato com o Gerente - Terminal %d\n", *terminal);
  int senha_arq, senha_gerente, eh_gerente = 0;
  FILE *arq_usuarios;
  char buffer[200];
  arq_usuarios = fopen("usuarios.txt", "r");
  if (arq_usuarios != NULL) {
    while ((eh_gerente == 0) && (!feof(arq_usuarios))) {
      fgets(buffer, 200, arq_usuarios);
      if ((strcmp(captura(buffer, 1), "1001") == 0) &&
          (strcmp(captura(buffer, 2), "1001") == 0)) {
        senha_arq = atoi(captura(buffer, 3));
        eh_gerente = 1;
      }
    }
    fclose(arq_usuarios);
    printf(
        "\nDigite a senha para acesso a criacao de conta (Somente Gerente):");
    scanf("%d", &senha_gerente);
    if (senha_gerente == senha_arq) {
      printf("Digite o numero da Agencia: ");
      scanf("%d", &agencia);
      printf("\nDigite o numero da Conta Corrente: ");
      scanf("%d", &cc);
      if (desbloquear_senha(terminal, agencia, cc) == 1) {
        printf("Senha desbloqueada com sucesso!\n");
        opc = 0;
        while ((opc < 1) || (opc > 2)) {
          printf("Deseja voltar ao menu principal? (1 - S/ 2 - N): ");
          scanf("%d", &opc);
          if ((opc < 1) || (opc > 2))
            printf("\nOpcao invalida!\n");
        }
        if (opc == 1)
          menu_principal(terminal);
        else
          sair();
      } else if (desbloquear_senha(terminal, agencia, cc) == 2) {
        printf("Conta nao estava bloqueada!\n");
        opc = 0;
        while ((opc < 1) || (opc > 2)) {
          printf("Deseja falar com o gerente novamente? (1 - S/ 2 - N): ");
          scanf("%d", &opc);
          if ((opc < 1) || (opc > 2))
            printf("\nOpcao invalida!\n");
        }
        if (opc == 1)
          gerente(terminal);
        else
          menu_principal(terminal);
      } else {
        printf("Conta nao encontrada!\n");
        opc = 0;
        while ((opc < 1) || (opc > 2)) {
          printf(
              "Deseja tentar falar novamente com o gerente? (1 - S/ 2 - N): ");
          scanf("%d", &opc);
          if ((opc < 1) || (opc > 2))
            printf("\nOpcao invalida!\n");
        }
        if (opc == 1)
          gerente(terminal);
        else
          menu_principal(terminal);
      }
    } else {
      printf("Acesso negado, senha incorreta!\n");
      system("pause");
      menu_principal(terminal);
    }
  } else {
    erro();
    menu_principal(terminal);
  }
}


x86 assembly (clang, -O0):
<gerente>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xdfa(%rip),%rdi
call   1050 <system@plt>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x20(%rbp)
lea    0xe33(%rip),%rdi
lea    0xe39(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     160a <gerente+0x41a>
jmp    125b <gerente+0x6b>
xor    %eax,%eax
cmpl   $0x0,-0x20(%rbp)
mov    %al,-0xf1(%rbp)
jne    1284 <gerente+0x94>
mov    -0x28(%rbp),%rdi
call   10b0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xf1(%rbp)
mov    -0xf1(%rbp),%al
test   $0x1,%al
jne    1297 <gerente+0xa7>
jmp    1325 <gerente+0x135>
lea    -0xf0(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xc8,%esi
call   1090 <fgets@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x1,%esi
call   1110 <captura@plt>
mov    %eax,%edi
lea    0xdb7(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1320 <gerente+0x130>
lea    -0xf0(%rbp),%rdi
mov    $0x2,%esi
call   1110 <captura@plt>
mov    %eax,%edi
lea    0xd8e(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1320 <gerente+0x130>
lea    -0xf0(%rbp),%rdi
mov    $0x3,%esi
call   1110 <captura@plt>
mov    %eax,%edi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    125b <gerente+0x6b>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd81(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   10e0 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    15e2 <gerente+0x3f2>
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd57(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   10e0 <scanf@plt>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd39(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10e0 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1080 <desbloquear_senha@plt>
cmp    $0x1,%eax
jne    145c <gerente+0x26c>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0xf2(%rbp)
jl     13e0 <gerente+0x1f0>
cmpl   $0x2,-0x14(%rbp)
setg   %al
mov    %al,-0xf2(%rbp)
mov    -0xf2(%rbp),%al
test   $0x1,%al
jne    13f3 <gerente+0x203>
jmp    1438 <gerente+0x248>
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xcbc(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10e0 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jl     1425 <gerente+0x235>
cmpl   $0x2,-0x14(%rbp)
jle    1433 <gerente+0x243>
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13c1 <gerente+0x1d1>
cmpl   $0x1,-0x14(%rbp)
jne    1450 <gerente+0x260>
mov    -0x8(%rbp),%rdi
call   10c0 <menu_principal@plt>
jmp    1457 <gerente+0x267>
mov    $0x0,%al
call   10d0 <sair@plt>
jmp    15dd <gerente+0x3ed>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1080 <desbloquear_senha@plt>
cmp    $0x2,%eax
jne    1526 <gerente+0x336>
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0xf3(%rbp)
jl     14a8 <gerente+0x2b8>
cmpl   $0x2,-0x14(%rbp)
setg   %al
mov    %al,-0xf3(%rbp)
mov    -0xf3(%rbp),%al
test   $0x1,%al
jne    14bb <gerente+0x2cb>
jmp    1500 <gerente+0x310>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbf4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10e0 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jl     14ed <gerente+0x2fd>
cmpl   $0x2,-0x14(%rbp)
jle    14fb <gerente+0x30b>
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1489 <gerente+0x299>
cmpl   $0x1,-0x14(%rbp)
jne    1518 <gerente+0x328>
mov    -0x8(%rbp),%rdi
call   1030 <gerente@plt>
jmp    1521 <gerente+0x331>
mov    -0x8(%rbp),%rdi
call   10c0 <menu_principal@plt>
jmp    15d8 <gerente+0x3e8>
lea    0xc95(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0xf4(%rbp)
jl     155a <gerente+0x36a>
cmpl   $0x2,-0x14(%rbp)
setg   %al
mov    %al,-0xf4(%rbp)
mov    -0xf4(%rbp),%al
test   $0x1,%al
jne    156d <gerente+0x37d>
jmp    15b2 <gerente+0x3c2>
lea    0xc65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb42(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10e0 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jl     159f <gerente+0x3af>
cmpl   $0x2,-0x14(%rbp)
jle    15ad <gerente+0x3bd>
lea    0xbb6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    153b <gerente+0x34b>
cmpl   $0x1,-0x14(%rbp)
jne    15ca <gerente+0x3da>
mov    -0x8(%rbp),%rdi
call   1030 <gerente@plt>
jmp    15d3 <gerente+0x3e3>
mov    -0x8(%rbp),%rdi
call   10c0 <menu_principal@plt>
jmp    15d8 <gerente+0x3e8>
jmp    15dd <gerente+0x3ed>
jmp    1605 <gerente+0x415>
lea    0xc2e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc41(%rip),%rdi
call   1050 <system@plt>
mov    -0x8(%rbp),%rdi
call   10c0 <menu_principal@plt>
jmp    161a <gerente+0x42a>
mov    $0x0,%al
call   1070 <erro@plt>
mov    -0x8(%rbp),%rdi
call   10c0 <menu_principal@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gerente>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rdi,%r14
lea    0xde5(%rip),%rdi
call   1060 <system@plt>
lea    0xf4a(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%esi
lea    0xdce(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xde5(%rip),%rdi
lea    0xdeb(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     1368 <gerente+0x168>
mov    %rax,%rbx
mov    %rax,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
je     13a5 <gerente+0x1a5>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xdc2(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdf6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10f0 <scanf@plt>
cmp    %ebp,0xc(%rsp)
jne    1388 <gerente+0x188>
lea    0xdde(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdcd(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   10f0 <scanf@plt>
lea    0xdd9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   10f0 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r14,%rdi
call   1090 <desbloquear_senha@plt>
cmp    $0x1,%eax
jne    1435 <gerente+0x235>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,(%rsp)
lea    0xdb7(%rip),%r15
lea    0xd6b(%rip),%r12
mov    %rsp,%rbx
lea    0xf09(%rip),%r13
xchg   %ax,%ax
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10f0 <scanf@plt>
mov    (%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1353 <gerente+0x153>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    (%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffe,%ecx
jb     1320 <gerente+0x120>
cmp    $0x1,%eax
je     1522 <gerente+0x322>
xor    %eax,%eax
call   10e0 <sair@plt>
jmp    152a <gerente+0x32a>
xor    %eax,%eax
call   1080 <erro@plt>
mov    %r14,%rdi
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10d0 <menu_principal@plt>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
lea    0xdd0(%rip),%rdi
call   1060 <system@plt>
jmp    1522 <gerente+0x322>
lea    0x10(%rsp),%r15
lea    0xc87(%rip),%r12
jmp    13d0 <gerente+0x1d0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   10c0 <feof@plt>
test   %eax,%eax
jne    126c <gerente+0x6c>
mov    %r15,%rdi
mov    $0xc8,%esi
mov    %rbx,%rdx
call   10a0 <fgets@plt>
mov    %r15,%rdi
mov    $0x1,%esi
call   1120 <captura@plt>
mov    %eax,%edi
mov    %r12,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    13c0 <gerente+0x1c0>
mov    %r15,%rdi
mov    $0x2,%esi
call   1120 <captura@plt>
mov    %eax,%edi
mov    %r12,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    13c0 <gerente+0x1c0>
lea    0x10(%rsp),%rdi
mov    $0x3,%esi
call   1120 <captura@plt>
mov    %eax,%edi
call   1110 <atoi@plt>
mov    %eax,%ebp
jmp    126c <gerente+0x6c>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r14,%rdi
call   1090 <desbloquear_senha@plt>
cmp    $0x2,%eax
jne    14b5 <gerente+0x2b5>
lea    0xd9a(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,(%rsp)
lea    0xc92(%rip),%r15
lea    0xc14(%rip),%r12
mov    %rsp,%rbx
lea    0xdb2(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10f0 <scanf@plt>
mov    (%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1513 <gerente+0x313>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    (%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffe,%ecx
jb     1480 <gerente+0x280>
jmp    1513 <gerente+0x313>
lea    0xd19(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,(%rsp)
lea    0xc5e(%rip),%r15
lea    0xba9(%rip),%r12
mov    %rsp,%rbx
lea    0xd47(%rip),%r13
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10f0 <scanf@plt>
mov    (%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1513 <gerente+0x313>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    (%rsp),%eax
lea    -0x3(%rax),%ecx
cmp    $0xfffffffe,%ecx
jb     14e0 <gerente+0x2e0>
cmp    $0x1,%eax
jne    1522 <gerente+0x322>
mov    %r14,%rdi
call   1040 <gerente@plt>
jmp    152a <gerente+0x32a>
mov    %r14,%rdi
call   10d0 <menu_principal@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [69 x i8] c"############### BANCO KNC - O SEU BANCO DE SUCESSO ###############\0A\0A\00"
@.str.2 = [37 x i8] c"Contato com o Gerente - Terminal %d\0A\00"
@.str.3 = [13 x i8] c"usuarios.txt\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [5 x i8] c"1001\00"
@.str.6 = [66 x i8] c"\0ADigite a senha para acesso a criacao de conta (Somente Gerente):\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [29 x i8] c"Digite o numero da Agencia: \00"
@.str.9 = [37 x i8] c"\0ADigite o numero da Conta Corrente: \00"
@.str.10 = [33 x i8] c"Senha desbloqueada com sucesso!\0A\00"
@.str.11 = [50 x i8] c"Deseja voltar ao menu principal? (1 - S/ 2 - N): \00"
@.str.12 = [18 x i8] c"\0AOpcao invalida!\0A\00"
@.str.13 = [29 x i8] c"Conta nao estava bloqueada!\0A\00"
@.str.14 = [55 x i8] c"Deseja falar com o gerente novamente? (1 - S/ 2 - N): \00"
@.str.15 = [23 x i8] c"Conta nao encontrada!\0A\00"
@.str.16 = [62 x i8] c"Deseja tentar falar novamente com o gerente? (1 - S/ 2 - N): \00"
@.str.17 = [33 x i8] c"Acesso negado, senha incorreta!\0A\00"
@.str.18 = [6 x i8] c"pause\00"
define void @gerente(i32* %0) {
%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 [200 x i8]
store i32* %0, i32** %2
%11 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %14)
store i32 0, i32* %8
%16 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %16, i32** %9
%17 = load i32*, i32** %9
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %170
19: ; preds = %1
br label %20
20: ; preds = %47, %19
%21 = load i32, i32* %8
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32*, i32** %9
%25 = call i32 @feof(i32* %24)
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
br label %28
28: ; preds = %23, %20
%29 = phi i1 [ false, %20 ], [ %27, %23 ]
br i1 %29, label %30, label %48
30: ; preds = %28
%31 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%32 = load i32*, i32** %9
%33 = call i32 @fgets(i8* %31, i32 200, i32* %32)
%34 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%35 = call i32 @captura(i8* %34, i32 1)
%36 = call i64 @strcmp(i32 %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %47
38: ; preds = %30
%39 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%40 = call i32 @captura(i8* %39, i32 2)
%41 = call i64 @strcmp(i32 %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %38
%44 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%45 = call i32 @captura(i8* %44, i32 3)
%46 = call i32 @atoi(i32 %45)
store i32 %46, i32* %6
store i32 1, i32* %8
br label %47
47: ; preds = %43, %38, %30
br label %20
48: ; preds = %28
%49 = load i32*, i32** %9
%50 = call i32 @fclose(i32* %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0))
%52 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %7)
%53 = load i32, i32* %7
%54 = load i32, i32* %6
%55 = icmp eq i32 %53, %54
br i1 %55, label %56, label %164
56: ; preds = %48
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
%58 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%60 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %4)
%61 = load i32*, i32** %2
%62 = load i32, i32* %3
%63 = load i32, i32* %4
%64 = call i32 @desbloquear_senha(i32* %61, i32 %62, i32 %63)
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %96
66: ; preds = %56
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %5
br label %68
68: ; preds = %86, %66
%69 = load i32, i32* %5
%70 = icmp slt i32 %69, 1
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = load i32, i32* %5
%73 = icmp sgt i32 %72, 2
br label %74
74: ; preds = %71, %68
%75 = phi i1 [ true, %68 ], [ %73, %71 ]
br i1 %75, label %76, label %87
76: ; preds = %74
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
%78 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%79 = load i32, i32* %5
%80 = icmp slt i32 %79, 1
br i1 %80, label %84, label %81
81: ; preds = %76
%82 = load i32, i32* %5
%83 = icmp sgt i32 %82, 2
br i1 %83, label %84, label %86
84: ; preds = %81, %76
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
br label %86
86: ; preds = %84, %81
br label %68
87: ; preds = %74
%88 = load i32, i32* %5
%89 = icmp eq i32 %88, 1
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = load i32*, i32** %2
%92 = call i32 @menu_principal(i32* %91)
br label %95
93: ; preds = %87
%94 = call i32 (...) @sair()
br label %95
95: ; preds = %93, %90
br label %163
96: ; preds = %56
%97 = load i32*, i32** %2
%98 = load i32, i32* %3
%99 = load i32, i32* %4
%100 = call i32 @desbloquear_senha(i32* %97, i32 %98, i32 %99)
%101 = icmp eq i32 %100, 2
br i1 %101, label %102, label %132
102: ; preds = %96
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %5
br label %104
104: ; preds = %122, %102
%105 = load i32, i32* %5
%106 = icmp slt i32 %105, 1
br i1 %106, label %110, label %107
107: ; preds = %104
%108 = load i32, i32* %5
%109 = icmp sgt i32 %108, 2
br label %110
110: ; preds = %107, %104
%111 = phi i1 [ true, %104 ], [ %109, %107 ]
br i1 %111, label %112, label %123
112: ; preds = %110
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%114 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%115 = load i32, i32* %5
%116 = icmp slt i32 %115, 1
br i1 %116, label %120, label %117
117: ; preds = %112
%118 = load i32, i32* %5
%119 = icmp sgt i32 %118, 2
br i1 %119, label %120, label %122
120: ; preds = %117, %112
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
br label %122
122: ; preds = %120, %117
br label %104
123: ; preds = %110
%124 = load i32, i32* %5
%125 = icmp eq i32 %124, 1
br i1 %125, label %126, label %128
126: ; preds = %123
%127 = load i32*, i32** %2
br label %131
128: ; preds = %123
%129 = load i32*, i32** %2
%130 = call i32 @menu_principal(i32* %129)
br label %131
131: ; preds = %128, %126
br label %162
132: ; preds = %96
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0))
store i32 0, i32* %5
br label %134
134: ; preds = %152, %132
%135 = load i32, i32* %5
%136 = icmp slt i32 %135, 1
br i1 %136, label %140, label %137
137: ; preds = %134
%138 = load i32, i32* %5
%139 = icmp sgt i32 %138, 2
br label %140
140: ; preds = %137, %134
%141 = phi i1 [ true, %134 ], [ %139, %137 ]
br i1 %141, label %142, label %153
142: ; preds = %140
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0))
%144 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%145 = load i32, i32* %5
%146 = icmp slt i32 %145, 1
br i1 %146, label %150, label %147
147: ; preds = %142
%148 = load i32, i32* %5
%149 = icmp sgt i32 %148, 2
br i1 %149, label %150, label %152
150: ; preds = %147, %142
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
br label %152
152: ; preds = %150, %147
br label %134
153: ; preds = %140
%154 = load i32, i32* %5
%155 = icmp eq i32 %154, 1
br i1 %155, label %156, label %158
156: ; preds = %153
%157 = load i32*, i32** %2
br label %161
158: ; preds = %153
%159 = load i32*, i32** %2
%160 = call i32 @menu_principal(i32* %159)
br label %161
161: ; preds = %158, %156
br label %162
162: ; preds = %161, %131
br label %163
163: ; preds = %162, %95
br label %169
164: ; preds = %48
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.17, i64 0, i64 0))
%166 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%167 = load i32*, i32** %2
%168 = call i32 @menu_principal(i32* %167)
br label %169
169: ; preds = %164, %163
br label %174
170: ; preds = %1
%171 = call i32 (...) @erro()
%172 = load i32*, i32** %2
%173 = call i32 @menu_principal(i32* %172)
br label %174
174: ; preds = %170, %169
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.2 = [37 x i8] c"Contato com o Gerente - Terminal %d\0A\00"
@.str.3 = [13 x i8] c"usuarios.txt\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [5 x i8] c"1001\00"
@.str.6 = [66 x i8] c"\0ADigite a senha para acesso a criacao de conta (Somente Gerente):\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [29 x i8] c"Digite o numero da Agencia: \00"
@.str.9 = [37 x i8] c"\0ADigite o numero da Conta Corrente: \00"
@.str.11 = [50 x i8] c"Deseja voltar ao menu principal? (1 - S/ 2 - N): \00"
@.str.14 = [55 x i8] c"Deseja falar com o gerente novamente? (1 - S/ 2 - N): \00"
@.str.16 = [62 x i8] c"Deseja tentar falar novamente com o gerente? (1 - S/ 2 - N): \00"
@.str.18 = [6 x i8] c"pause\00"
@str = [68 x i8] c"############### BANCO KNC - O SEU BANCO DE SUCESSO ###############\0A\00"
@str.19 = [32 x i8] c"Acesso negado, senha incorreta!\00"
@str.20 = [22 x i8] c"Conta nao encontrada!\00"
@str.22 = [28 x i8] c"Conta nao estava bloqueada!\00"
@str.24 = [32 x i8] c"Senha desbloqueada com sucesso!\00"
@str.25 = [17 x i8] c"\0AOpcao invalida!\00"
define void @gerente(i32* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [200 x i8]
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* %0
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = bitcast i32* %5 to i8*
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%16 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %119, label %18
18: ; preds = %1
%19 = call i32 @feof(i32* %16)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %36
21: ; preds = %18, %33
%22 = call i32 @fgets(i8* %15, i32 200, i32* %16)
%23 = call i32 @captura(i8* %15, i32 1)
%24 = call i64 @strcmp(i32 %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %21
%27 = call i32 @captura(i8* %15, i32 2)
%28 = call i64 @strcmp(i32 %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 @captura(i8* %15, i32 3)
%32 = call i32 @atoi(i32 %31)
br label %36
33: ; preds = %26, %21
%34 = call i32 @feof(i32* %16)
%35 = icmp eq i32 %34, 0
br i1 %35, label %21, label %36
36: ; preds = %33, %18, %30
%37 = phi i32 [ %32, %30 ], [ undef, %18 ], [ undef, %33 ]
%38 = call i32 @fclose(i32* %16)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%41 = load i32, i32* %5
%42 = icmp eq i32 %41, %37
br i1 %42, label %43, label %115
43: ; preds = %36
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = call i32 @desbloquear_senha(i32* %0, i32 %48, i32 %49)
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %72
52: ; preds = %43
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.24, i64 0, i64 0))
store i32 0, i32* %4
br label %54
54: ; preds = %52, %60
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %4)
%57 = load i32, i32* %4
%58 = add i32 %57, -3
%59 = icmp ult i32 %58, -2
br i1 %59, label %60, label %65
60: ; preds = %54
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.25, i64 0, i64 0))
%62 = load i32, i32* %4
%63 = add i32 %62, -3
%64 = icmp ult i32 %63, -2
br i1 %64, label %54, label %65
65: ; preds = %54, %60
%66 = phi i32 [ %62, %60 ], [ %57, %54 ]
%67 = icmp eq i32 %66, 1
br i1 %67, label %68, label %70
68: ; preds = %65
%69 = call i32 @menu_principal(i32* %0)
br label %122
70: ; preds = %65
%71 = call i32 (...) @sair()
br label %122
72: ; preds = %43
%73 = load i32, i32* %2
%74 = load i32, i32* %3
%75 = call i32 @desbloquear_senha(i32* %0, i32 %73, i32 %74)
%76 = icmp eq i32 %75, 2
br i1 %76, label %77, label %96
77: ; preds = %72
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.22, i64 0, i64 0))
store i32 0, i32* %4
br label %79
79: ; preds = %77, %85
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%81 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %4)
%82 = load i32, i32* %4
%83 = add i32 %82, -3
%84 = icmp ult i32 %83, -2
br i1 %84, label %85, label %90
85: ; preds = %79
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.25, i64 0, i64 0))
%87 = load i32, i32* %4
%88 = add i32 %87, -3
%89 = icmp ult i32 %88, -2
br i1 %89, label %79, label %90
90: ; preds = %79, %85
%91 = phi i32 [ %87, %85 ], [ %82, %79 ]
%92 = icmp eq i32 %91, 1
br i1 %92, label %93, label %94
93: ; preds = %90
br label %122
94: ; preds = %90
%95 = call i32 @menu_principal(i32* %0)
br label %122
96: ; preds = %72
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.20, i64 0, i64 0))
store i32 0, i32* %4
br label %98
98: ; preds = %96, %104
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0))
%100 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %4)
%101 = load i32, i32* %4
%102 = add i32 %101, -3
%103 = icmp ult i32 %102, -2
br i1 %103, label %104, label %109
104: ; preds = %98
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.25, i64 0, i64 0))
%106 = load i32, i32* %4
%107 = add i32 %106, -3
%108 = icmp ult i32 %107, -2
br i1 %108, label %98, label %109
109: ; preds = %98, %104
%110 = phi i32 [ %106, %104 ], [ %101, %98 ]
%111 = icmp eq i32 %110, 1
br i1 %111, label %112, label %113
112: ; preds = %109
br label %122
113: ; preds = %109
%114 = call i32 @menu_principal(i32* %0)
br label %122
115: ; preds = %36
%116 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
%117 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%118 = call i32 @menu_principal(i32* %0)
br label %122
119: ; preds = %1
%120 = tail call i32 (...) @erro()
%121 = tail call i32 @menu_principal(i32* %0)
br label %122
122: ; preds = %115, %94, %93, %113, %112, %68, %70, %119
ret void
}