#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ atoi(char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ test_column(char *, int /*<<< orphan*/ *, int, int, int,
                               char *);
int /*<<< orphan*/ test_line(char *, int /*<<< orphan*/ *, int, int);
int main(int argc, char *argv[]) {
  int i1, i2, N;
  char *token = NULL;
  FILE *m_File;
  i1 = (int)atoi(argv[1]);
  i2 = (int)atoi(argv[2]);
  N = (int)atoi(argv[3]);
  if (argc > 4) {
    token = (char *)calloc(4, sizeof(char));
    token = "tmp";
  }
  m_File = fopen("files/test.txt", "r");
  test_column("files/test.txt", m_File, i1, 10, N, token);
  test_line("files/test.txt", m_File, i2, N);
  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)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    11c6 <main+0x76>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe3e(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe37(%rip),%rdi
lea    0xe3f(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
lea    0xe11(%rip),%rdi
mov    $0xa,%ecx
call   1040 <test_column@plt>
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xdf6(%rip),%rdi
call   1070 <test_line@plt>
xor    %eax,%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
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %rax,%r15
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %rax,%r14
mov    0x18(%rbx),%rdi
call   1060 <atoi@plt>
mov    %rax,%r13
cmp    $0x5,%ebp
jl     11a1 <main+0x51>
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
lea    0xe61(%rip),%r12
jmp    11a4 <main+0x54>
xor    %r12d,%r12d
lea    0xe59(%rip),%rbp
lea    0xe61(%rip),%rsi
mov    %rbp,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %r15d,%edx
mov    $0xa,%ecx
mov    %r13d,%r8d
mov    %r12,%r9
call   1040 <test_column@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    %r13d,%ecx
call   1070 <test_line@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"tmp\00"
@.str.1 = [15 x i8] c"files/test.txt\00"
@.str.2 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %9
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @atoi(i8* %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i64 @atoi(i8* %18)
%20 = trunc i64 %19 to i32
store i32 %20, i32* %7
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i64 @atoi(i8* %23)
%25 = trunc i64 %24 to i32
store i32 %25, i32* %8
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 4
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = call i64 @calloc(i32 4, i32 1)
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %9
br label %31
31: ; preds = %28, %2
%32 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %32, i32** %10
%33 = load i32*, i32** %10
%34 = load i32, i32* %6
%35 = load i32, i32* %8
%36 = load i8*, i8** %9
%37 = call i32 @test_column(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %33, i32 %34, i32 10, i32 %35, i8* %36)
%38 = load i32*, i32** %10
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = call i32 @test_line(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %38, i32 %39, i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"tmp\00"
@.str.1 = [15 x i8] c"files/test.txt\00"
@.str.2 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i64 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i64 @atoi(i8* %10)
%12 = trunc i64 %11 to i32
%13 = icmp sgt i32 %0, 4
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = tail call i64 @calloc(i32 4, i32 1)
br label %16
16: ; preds = %14, %2
%17 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %14 ], [ null, %2 ]
%18 = trunc i64 %8 to i32
%19 = trunc i64 %5 to i32
%20 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%21 = tail call i32 @test_column(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %20, i32 %19, i32 10, i32 %12, i8* %17)
%22 = tail call i32 @test_line(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %20, i32 %18, i32 %12)
ret i32 0
}