#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 */
scalar_t__ atoi(char *);
int /*<<< orphan*/ lfmm2geno(char *, char *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char input_file[512];
  char output_file1[512];
  int N, M;
  int test_N, test_M;
  strcpy(input_file, argv[1]);
  N = (int)atoi(argv[2]);
  M = (int)atoi(argv[3]);
  strcpy(output_file1, argv[4]);
  lfmm2geno(input_file, output_file1, &test_N, &test_M);
  if (N != test_N) {
    printf("Test ERROR: incorrect N detected, %d instead of %d!\n", test_N, N);
    return 1;
  }
  if (M != test_M) {
    printf("Test ERROR: incorrect M detected, %d instead of %d!\n", test_M, M);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x414(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
lea    -0x41c(%rbp),%rdx
lea    -0x420(%rbp),%rcx
call   1060 <lfmm2geno@plt>
mov    -0x414(%rbp),%eax
cmp    -0x41c(%rbp),%eax
je     11fe <main+0xbe>
mov    -0x41c(%rbp),%esi
mov    -0x414(%rbp),%edx
lea    0xe13(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123b <main+0xfb>
mov    -0x418(%rbp),%eax
cmp    -0x420(%rbp),%eax
je     1234 <main+0xf4>
mov    -0x420(%rbp),%esi
mov    -0x418(%rbp),%edx
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123b <main+0xfb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0x210(%rsp),%r12
mov    %r12,%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %rax,%r15
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %rax,%r14
mov    0x20(%rbx),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <lfmm2geno@plt>
mov    0xc(%rsp),%esi
cmp    %r15d,%esi
jne    11c3 <main+0x83>
mov    0x8(%rsp),%esi
xor    %eax,%eax
cmp    %r14d,%esi
je     11d7 <main+0x97>
lea    0xe77(%rip),%rdi
mov    %r14d,%edx
jmp    11cd <main+0x8d>
lea    0xe36(%rip),%rdi
mov    %r15d,%edx
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Test ERROR: incorrect N detected, %d instead of %d!\0A\00"
@.str.1 = [53 x i8] c"Test ERROR: incorrect M detected, %d instead of %d!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strcpy(i8* %12, i8* %15)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i64 @atoi(i8* %19)
%21 = trunc i64 %20 to i32
store i32 %21, i32* %8
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i64 @atoi(i8* %24)
%26 = trunc i64 %25 to i32
store i32 %26, i32* %9
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 4
%30 = load i8*, i8** %29
%31 = call i32 @strcpy(i8* %27, i8* %30)
%32 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%34 = call i32 @lfmm2geno(i8* %32, i8* %33, i32* %10, i32* %11)
%35 = load i32, i32* %8
%36 = load i32, i32* %10
%37 = icmp ne i32 %35, %36
br i1 %37, label %38, label %42
38: ; preds = %2
%39 = load i32, i32* %10
%40 = load i32, i32* %8
%41 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %39, i32 %40)
store i32 1, i32* %3
br label %51
42: ; preds = %2
%43 = load i32, i32* %9
%44 = load i32, i32* %11
%45 = icmp ne i32 %43, %44
br i1 %45, label %46, label %50
46: ; preds = %42
%47 = load i32, i32* %11
%48 = load i32, i32* %9
%49 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %47, i32 %48)
store i32 1, i32* %3
br label %51
50: ; preds = %42
store i32 0, i32* %3
br label %51
51: ; preds = %50, %46, %38
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@.str = [53 x i8] c"Test ERROR: incorrect N detected, %d instead of %d!\0A\00"
@.str.1 = [53 x i8] c"Test ERROR: incorrect M detected, %d instead of %d!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strcpy(i8* %7, i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call i64 @atoi(i8* %15)
%17 = trunc i64 %16 to i32
%18 = getelementptr inbounds i8*, i8** %1, i64 3
%19 = load i8*, i8** %18
%20 = call i64 @atoi(i8* %19)
%21 = trunc i64 %20 to i32
%22 = getelementptr inbounds i8*, i8** %1, i64 4
%23 = load i8*, i8** %22
%24 = call i32 @strcpy(i8* %8, i8* %23)
%25 = call i32 @lfmm2geno(i8* %7, i8* %8, i32* %5, i32* %6)
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, %17
br i1 %27, label %30, label %28
28: ; preds = %2
%29 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %17)
br label %35
30: ; preds = %2
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, %21
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %21)
br label %35
35: ; preds = %30, %33, %28
%36 = phi i32 [ 1, %28 ], [ 1, %33 ], [ 0, %30 ]
ret i32 %36
}