#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 */
char EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, int, int, ...);
void test_column(char *file, FILE *m_File, int i, int j, int N, char *token) {
  if (i != N) {
    printf("Error: unable to read file %s. It seems that"
           " line %d contains %d columns instead of %d"
           " (number of columns of line 1)."
           "\n\n",
           file, j, i, N);
    fclose(m_File);
    exit(1);
  }
  if (token && *token != 10 && *token != 13 && *token != EOF) {
    printf("Error: unable to read file %s. It seems that"
           " line %d contains more than %d columns"
           " (number of columns of line 1).\n\n",
           file, j, N);
    fclose(m_File);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<test_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1189 <test_column+0x59>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
cmpq   $0x0,-0x28(%rbp)
je     11f8 <test_column+0xc8>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11f8 <test_column+0xc8>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     11f8 <test_column+0xc8>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
mov    0x2e26(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11f8 <test_column+0xc8>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_column>:
push   %rbx
mov    %edx,%eax
mov    %rsi,%rbx
mov    %rdi,%rsi
cmp    %r8d,%edx
jne    115d <test_column+0x2d>
test   %r9,%r9
je     115b <test_column+0x2b>
mov    (%r9),%dl
cmp    $0xa,%dl
je     115b <test_column+0x2b>
cmp    $0xd,%dl
je     115b <test_column+0x2b>
mov    0x2e91(%rip),%rdi
cmp    (%rdi),%dl
jne    1181 <test_column+0x51>
pop    %rbx
ret
lea    0xe9c(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xef0(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116f <test_column+0x3f>

LLVM IR (-O0):
@.str = [120 x i8] c"Error: unable to read file %s. It seems that line %d contains %d columns instead of %d (number of columns of line 1).\0A\0A\00"
@EOF = global i8 0
@.str.1 = [116 x i8] c"Error: unable to read file %s. It seems that line %d contains more than %d columns (number of columns of line 1).\0A\0A\00"
define void @test_column(i8* %0, i32* %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i32, i32* %9
%14 = load i32, i32* %11
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %25
16: ; preds = %6
%17 = load i8*, i8** %7
%18 = load i32, i32* %10
%19 = load i32, i32* %9
%20 = load i32, i32* %11
%21 = call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i32 %19, i32 %20)
%22 = load i32*, i32** %8
%23 = call i32 @fclose(i32* %22)
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %6
%26 = load i8*, i8** %12
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %53
28: ; preds = %25
%29 = load i8*, i8** %12
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 10
br i1 %32, label %33, label %53
33: ; preds = %28
%34 = load i8*, i8** %12
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 13
br i1 %37, label %38, label %53
38: ; preds = %33
%39 = load i8*, i8** %12
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = load i8, i8* @EOF
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %41, %43
br i1 %44, label %45, label %53
45: ; preds = %38
%46 = load i8*, i8** %7
%47 = load i32, i32* %10
%48 = load i32, i32* %11
%49 = call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0), i8* %46, i32 %47, i32 %48)
%50 = load i32*, i32** %8
%51 = call i32 @fclose(i32* %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %38, %33, %28, %25
ret void
}

LLVM IR (-O2):
@.str = [120 x i8] c"Error: unable to read file %s. It seems that line %d contains %d columns instead of %d (number of columns of line 1).\0A\0A\00"
@EOF = global i8 0
@.str.1 = [116 x i8] c"Error: unable to read file %s. It seems that line %d contains more than %d columns (number of columns of line 1).\0A\0A\00"
define void @test_column(i8* %0, i32* nocapture %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = icmp eq i32 %2, %4
br i1 %7, label %12, label %8
8: ; preds = %6
%9 = tail call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i32 %2, i32 %4)
%10 = tail call i32 @fclose(i32* %1)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %6
%13 = icmp eq i8* %5, null
br i1 %13, label %23, label %14
14: ; preds = %12
%15 = load i8, i8* %5
switch i8 %15, label %16 [
i8 10, label %23
i8 13, label %23
]
16: ; preds = %14
%17 = load i8, i8* @EOF
%18 = icmp eq i8 %15, %17
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = tail call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3, i32 %2)
%21 = tail call i32 @fclose(i32* %1)
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %14, %14, %16, %12
ret void
}