#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*/ TEST_knn(char *, int, int, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char file[] = "../treinamento.in";
  int size_database = 290, quantity_atributes = 17;
  char file1[] = "../teste.in";
  int size_database1 = 145;
  int k = 7;
  printf("Treinamento:\n");
  TEST_knn(file, size_database, quantity_atributes, k);
  printf("\nTeste:\n");
  TEST_knn(file1, size_database1, quantity_atributes, k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x10(%rbp)
movl   $0x122,-0x24(%rbp)
movl   $0x11,-0x28(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x34(%rbp)
mov    0xeab(%rip),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x91,-0x38(%rbp)
movl   $0x7,-0x3c(%rbp)
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x3c(%rbp),%ecx
call   1030 <TEST_knn@plt>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
lea    -0x34(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x3c(%rbp),%ecx
call   1030 <TEST_knn@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x6e,0x20(%rsp)
movabs $0x65747365742f2e2e,%rax
73 74 65
mov    %rax,(%rsp)
movl   $0x6e692e,0x8(%rsp)
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rdi
mov    $0x122,%esi
mov    $0x11,%edx
mov    $0x7,%ecx
call   1030 <TEST_knn@plt>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
mov    $0x91,%esi
mov    $0x11,%edx
mov    $0x7,%ecx
call   1030 <TEST_knn@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.file = [18 x i8] c"../treinamento.in\00"
@__const.main.file1 = [12 x i8] c"../teste.in\00"
@.str = [14 x i8] c"Treinamento:\0A\00"
@.str.1 = [9 x i8] c"\0ATeste:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [18 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [12 x i8]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [18 x i8]* %2 to i8*
store i32 290, i32* %3
store i32 17, i32* %4
%9 = bitcast [12 x i8]* %5 to i8*
store i32 145, i32* %6
store i32 7, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [18 x i8], [18 x i8]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = call i32 @TEST_knn(i8* %11, i32 %12, i32 %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %7
%21 = call i32 @TEST_knn(i8* %17, i32 %18, i32 %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.file = [18 x i8] c"../treinamento.in\00"
@__const.main.file1 = [12 x i8] c"../teste.in\00"
@str = [13 x i8] c"Treinamento:\00"
@str.2 = [8 x i8] c"\0ATeste:\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = call i32 @TEST_knn(i8* %3, i32 290, i32 17, i32 7)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
%8 = call i32 @TEST_knn(i8* %4, i32 145, i32 17, i32 7)
ret i32 0
}