#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ interface(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int opcao;
  do {
    printf("            Resolucao de Equacoes Diferenciais Pelo Metodo Range "
           "Kutta\n");
    printf("\n\n\n\t(1)..........................Range Kutta de 2 Ordem\n");
    printf("\t(2)..........................Range Kutta de 4 Ordem\n");
    printf("\t(0)..........................Sair\n");
    printf("\nOpcao Desejada: ");
    scanf("%d", &opcao);
    switch (opcao) {
    case 1:
      interface(opcao);
      break;
    case 2:
      interface(opcao);
      break;
    case 0:
      exit(0);
      break;
    }
  } while (opcao);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf55(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11ea <main+0xaa>
jmp    11ae <main+0x6e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     11d0 <main+0x90>
jmp    11bf <main+0x7f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11dd <main+0x9d>
jmp    11f1 <main+0xb1>
mov    -0x8(%rbp),%edi
call   1040 <interface@plt>
jmp    11f1 <main+0xb1>
mov    -0x8(%rbp),%edi
call   1040 <interface@plt>
jmp    11f1 <main+0xb1>
xor    %edi,%edi
call   1060 <exit@plt>
jmp    11f6 <main+0xb6>
cmpl   $0x0,-0x8(%rbp)
jne    114f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xefa(%rip),%r15
lea    0xf2b(%rip),%r12
lea    0xf59(%rip),%r13
lea    0xe89(%rip),%rbx
lea    0xe94(%rip),%rbp
lea    0x4(%rsp),%r14
jmp    11a2 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%edi
call   1050 <interface@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     11f2 <main+0xa2>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0x1,%edi
je     1195 <main+0x45>
cmp    $0x2,%edi
je     1190 <main+0x40>
test   %edi,%edi
jne    119e <main+0x4e>
xor    %edi,%edi
call   1070 <exit@plt>
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" Resolucao de Equacoes Diferenciais Pelo Metodo Range Kutta\0A\00"
@.str.1 = [57 x i8] c"\0A\0A\0A\09(1)..........................Range Kutta de 2 Ordem\0A\00"
@.str.2 = [54 x i8] c"\09(2)..........................Range Kutta de 4 Ordem\0A\00"
@.str.3 = [36 x i8] c"\09(0)..........................Sair\0A\00"
@.str.4 = [18 x i8] c"\0AOpcao Desejada: \00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %20, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
switch i32 %10, label %19 [
i32 1, label %11
i32 2, label %14
i32 0, label %17
]
11: ; preds = %3
%12 = load i32, i32* %2
%13 = call i32 @interface(i32 %12)
br label %19
14: ; preds = %3
%15 = load i32, i32* %2
%16 = call i32 @interface(i32 %15)
br label %19
17: ; preds = %3
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %3, %14, %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %3, label %23
23: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [18 x i8] c"\0AOpcao Desejada: \00"
@.str.5 = [3 x i8] c"%d\00"
@str = [71 x i8] c" Resolucao de Equacoes Diferenciais Pelo Metodo Range Kutta\00"
@str.6 = [56 x i8] c"\0A\0A\0A\09(1)..........................Range Kutta de 2 Ordem\00"
@str.7 = [53 x i8] c"\09(2)..........................Range Kutta de 4 Ordem\00"
@str.8 = [35 x i8] c"\09(0)..........................Sair\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %18, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.6, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.7, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.8, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
switch i32 %10, label %18 [
i32 1, label %14
i32 2, label %11
i32 0, label %12
]
11: ; preds = %3
br label %14
12: ; preds = %3
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %3, %11
%15 = phi i32 [ 2, %11 ], [ %10, %3 ]
%16 = call i32 @interface(i32 %15)
%17 = load i32, i32* %1
br label %18
18: ; preds = %14, %3
%19 = phi i32 [ %17, %14 ], [ %10, %3 ]
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %3
21: ; preds = %18
ret i32 0
}