#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 EXIT_SUCCESS;
int /*<<< orphan*/ atof(char *);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ control(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/, char *,
                           char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  if (argc != 7) {
    (void)puts("Utilização:\n"
               "./main <a> <y0> <m> <b> [nome metodo1, nome metodo2,...] <nome "
               "do arquivo>");
    (void)puts("Opções: \n"
               "\ta - valor inicial do intervalo\n"
               "\ty0 - condição inicial do problema\n"
               "\tm - numero de subintervalos desejados\n"
               "\tb - valor final do intervalo\n"
               "\tnome do arquivo - nome do arquivo com os resultados\n");
    (void)puts("Métodos:\n"
               "\te - Euler\n"
               "\trk2 - Runge-Kutta ordem 2\n"
               "\trk3 - Runge-Kutta ordem 3\n"
               "\trk4 - Runge-Kutta ordem 4\n"
               "\tabm4 - Adams-Bashforth-Moulton ordem 4\n"
               "\tdp - Dormand-Prince\n"
               "\tmil - Milne\n"
               "\tham - Hamming\n");
    (void)puts("Exemplo de uso:\n"
               "\t./main 0 1 10 1 e,abm4,mil,ham out.txt");
  } else
    control(atof(argv[1]), atof(argv[2]), atoi(argv[3]), atof(argv[4]), argv[5],
            argv[6]);
  return EXIT_SUCCESS;
}


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   $0x7,-0x8(%rbp)
je     1195 <main+0x55>
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
lea    0xee6(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa5(%rip),%rdi
call   1040 <puts@plt>
lea    0x1059(%rip),%rdi
call   1040 <puts@plt>
jmp    11f2 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atof@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atof@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1050 <atof@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%r8
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%r9
call   1030 <control@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x7,%edi
jne    1194 <main+0x54>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atof@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   1050 <atof@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   1050 <atof@plt>
mov    0x28(%rbx),%r8
mov    0x30(%rbx),%r9
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <control@plt>
jmp    11c4 <main+0x84>
lea    0xe65(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xf71(%rip),%rdi
call   1040 <puts@plt>
lea    0x1025(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [89 x i8] c"Utiliza\C3\A7\C3\A3o:\0A./main <a> <y0> <m> <b> [nome metodo1, nome metodo2,...] <nome do arquivo>\00"
@.str.1 = [203 x i8] c"Op\C3\A7\C3\B5es: \0A\09a - valor inicial do intervalo\0A\09y0 - condi\C3\A7\C3\A3o inicial do problema\0A\09m - numero de subintervalos desejados\0A\09b - valor final do intervalo\0A\09nome do arquivo - nome do arquivo com os resultados\0A\00"
@.str.2 = [192 x i8] c"M\C3\A9todos:\0A\09e - Euler\0A\09rk2 - Runge-Kutta ordem 2\0A\09rk3 - Runge-Kutta ordem 3\0A\09rk4 - Runge-Kutta ordem 4\0A\09abm4 - Adams-Bashforth-Moulton ordem 4\0A\09dp - Dormand-Prince\0A\09mil - Milne\0A\09ham - Hamming\0A\00"
@.str.3 = [56 x i8] c"Exemplo de uso:\0A\09./main 0 1 10 1 e,abm4,mil,ham out.txt\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 7
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([203 x i8], [203 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %37
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atof(i8* %16)
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @atof(i8* %20)
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 4
%28 = load i8*, i8** %27
%29 = call i32 @atof(i8* %28)
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 5
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 6
%35 = load i8*, i8** %34
%36 = call i32 @control(i32 %17, i32 %21, i32 %25, i32 %29, i8* %32, i8* %35)
br label %37
37: ; preds = %13, %8
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

LLVM IR (-O2):
@.str = [89 x i8] c"Utiliza\C3\A7\C3\A3o:\0A./main <a> <y0> <m> <b> [nome metodo1, nome metodo2,...] <nome do arquivo>\00"
@.str.1 = [203 x i8] c"Op\C3\A7\C3\B5es: \0A\09a - valor inicial do intervalo\0A\09y0 - condi\C3\A7\C3\A3o inicial do problema\0A\09m - numero de subintervalos desejados\0A\09b - valor final do intervalo\0A\09nome do arquivo - nome do arquivo com os resultados\0A\00"
@.str.2 = [192 x i8] c"M\C3\A9todos:\0A\09e - Euler\0A\09rk2 - Runge-Kutta ordem 2\0A\09rk3 - Runge-Kutta ordem 3\0A\09rk4 - Runge-Kutta ordem 4\0A\09abm4 - Adams-Bashforth-Moulton ordem 4\0A\09dp - Dormand-Prince\0A\09mil - Milne\0A\09ham - Hamming\0A\00"
@.str.3 = [56 x i8] c"Exemplo de uso:\0A\09./main 0 1 10 1 e,abm4,mil,ham out.txt\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 7
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([203 x i8], [203 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([192 x i8], [192 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %27
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atof(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 @atof(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 4
%20 = load i8*, i8** %19
%21 = tail call i32 @atof(i8* %20)
%22 = getelementptr inbounds i8*, i8** %1, i64 5
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %1, i64 6
%25 = load i8*, i8** %24
%26 = tail call i32 @control(i32 %12, i32 %15, i32 %18, i32 %21, i8* %23, i8* %25)
br label %27
27: ; preds = %9, %4
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}