#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*/ atoi(char *);
int /*<<< orphan*/ loadmap(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i;
  printf("convertidor de csv a mapa binario\n");
  for (i = 1; i < 6; i++) {
    if (argv[i] == NULL) {
      printf("usage:csvconv [WHITE|COMMA] nombre_archivo_a_convertir "
             "nro_columnas nro_filas nombre_archivo_nuevo\n");
      return 1;
    }
  }
  loadmap(atoi(argv[1]), argv[2], atoi(argv[3]), atoi(argv[4]), argv[5]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    11a1 <main+0x71>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    118e <main+0x5e>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11fa <main+0xca>
jmp    1193 <main+0x63>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x29>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%r8
call   1040 <loadmap@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     11a7 <main+0x77>
mov    0x10(%rbx),%r14
test   %r14,%r14
je     11a7 <main+0x77>
mov    0x18(%rbx),%r15
test   %r15,%r15
je     11a7 <main+0x77>
mov    0x20(%rbx),%r12
test   %r12,%r12
je     11a7 <main+0x77>
mov    0x28(%rbx),%rbx
test   %rbx,%rbx
je     11a7 <main+0x77>
call   1050 <atoi@plt>
mov    %eax,%r13d
mov    %r15,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1050 <atoi@plt>
mov    %r13d,%edi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
mov    %rbx,%r8
call   1040 <loadmap@plt>
xor    %eax,%eax
jmp    11b8 <main+0x88>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"convertidor de csv a mapa binario\0A\00"
@.str.1 = [100 x i8] c"usage:csvconv [WHITE|COMMA] nombre_archivo_a_convertir nro_columnas nro_filas nombre_archivo_nuevo\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %44
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %8
24: ; preds = %8
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 4
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 5
%42 = load i8*, i8** %41
%43 = call i32 @loadmap(i32 %28, i8* %31, i32 %35, i32 %39, i8* %42)
store i32 0, i32* %3
br label %44
44: ; preds = %24, %18
%45 = load i32, i32* %3
ret i32 %45
}

LLVM IR (-O2):
@str = [34 x i8] c"convertidor de csv a mapa binario\00"
@str.2 = [99 x i8] c"usage:csvconv [WHITE|COMMA] nombre_archivo_a_convertir nro_columnas nro_filas nombre_archivo_nuevo\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %28, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %28, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %28, label %15
15: ; preds = %11
%16 = getelementptr inbounds i8*, i8** %1, i64 4
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %28, label %19
19: ; preds = %15
%20 = getelementptr inbounds i8*, i8** %1, i64 5
%21 = load i8*, i8** %20
%22 = icmp eq i8* %21, null
br i1 %22, label %28, label %23
23: ; preds = %19
%24 = tail call i32 @atoi(i8* %5)
%25 = tail call i32 @atoi(i8* %13)
%26 = tail call i32 @atoi(i8* %17)
%27 = tail call i32 @loadmap(i32 %24, i8* %9, i32 %25, i32 %26, i8* %21)
br label %30
28: ; preds = %19, %15, %11, %7, %2
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str.2, i64 0, i64 0))
br label %30
30: ; preds = %23, %28
%31 = phi i32 [ 1, %28 ], [ 0, %23 ]
ret i32 %31
}