#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 ResultadoFordFulkerson();
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ limpa();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main() {
  int opcao = -1, ford = -1;
  while (1) {
    limpa();
    printf("Digite 1 para realizar nova busca\nDigite 0 para encerrar o "
           "programa\n::>");
    scanf("%i", &opcao);
    if (opcao == 1) {
      ford = ResultadoFordFulkerson();
      if (ford != -1)
        printf("Fluxo Maximo: %d\n ", ford);
      puts("Digite algo para continuar...");
      __fpurge(stdin);
      getchar();
    } else if (opcao == 0)
      return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    $0x0,%al
call   1080 <limpa@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1207 <main+0x97>
mov    $0x0,%al
call   1060 <ResultadoFordFulkerson@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     11e1 <main+0x71>
mov    -0xc(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
call   1040 <__fpurge@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
jmp    121e <main+0xae>
cmpl   $0x0,-0x8(%rbp)
jne    1219 <main+0xa9>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    121e <main+0xae>
jmp    118d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xe76(%rip),%r14
lea    0xeb7(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xec1(%rip),%r12
mov    0x2e44(%rip),%rbp
lea    0xea0(%rip),%r13
jmp    11b4 <main+0x44>
nopl   (%rax)
test   %eax,%eax
je     120a <main+0x9a>
xor    %eax,%eax
call   1080 <limpa@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
jne    11b0 <main+0x40>
xor    %eax,%eax
call   1060 <ResultadoFordFulkerson@plt>
cmp    $0xffffffff,%eax
je     11f1 <main+0x81>
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    0x0(%rbp),%edi
call   1040 <__fpurge@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
jmp    11b4 <main+0x44>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [72 x i8] c"Digite 1 para realizar nova busca\0ADigite 0 para encerrar o programa\0A::>\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [19 x i8] c"Fluxo Maximo: %d\0A \00"
@.str.3 = [30 x i8] c"Digite algo para continuar...\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
store i32 -1, i32* %3
br label %4
4: ; preds = %0, %27
%5 = call i32 (...) @limpa()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %22
10: ; preds = %4
%11 = call i32 (...) @ResultadoFordFulkerson()
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %10
%18 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* @stdin
%20 = call i32 @__fpurge(i32 %19)
%21 = call i32 (...) @getchar()
br label %27
22: ; preds = %4
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
ret i32 0
26: ; preds = %22
br label %27
27: ; preds = %26, %17
br label %4
}

LLVM IR (-O2):
@.str = [72 x i8] c"Digite 1 para realizar nova busca\0ADigite 0 para encerrar o programa\0A::>\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [19 x i8] c"Fluxo Maximo: %d\0A \00"
@.str.3 = [30 x i8] c"Digite algo para continuar...\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @limpa()
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %8 [
i32 1, label %9
i32 0, label %19
]
8: ; preds = %3, %14
br label %3
9: ; preds = %3
%10 = call i32 (...) @ResultadoFordFulkerson()
%11 = icmp eq i32 %10, -1
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %10)
br label %14
14: ; preds = %12, %9
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @stdin
%17 = call i32 @__fpurge(i32 %16)
%18 = call i32 (...) @getchar()
br label %8
19: ; preds = %3
ret i32 0
}