#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 != '\n' && *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     11e8 <test_column+0xb8>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11e8 <test_column+0xb8>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
mov    0x2e36(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11e8 <test_column+0xb8>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xeaa(%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    1158 <test_column+0x28>
test   %r9,%r9
je     1156 <test_column+0x26>
mov    (%r9),%dl
cmp    $0xa,%dl
je     1156 <test_column+0x26>
mov    0x2e96(%rip),%rdi
cmp    (%rdi),%dl
jne    116c <test_column+0x3c>
pop    %rbx
ret
lea    0xea1(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    117e <test_column+0x4e>
lea    0xf05(%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>

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 %48
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 %48
33: ; preds = %28
%34 = load i8*, i8** %12
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = load i8, i8* @EOF
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %36, %38
br i1 %39, label %40, label %48
40: ; preds = %33
%41 = load i8*, i8** %7
%42 = load i32, i32* %10
%43 = load i32, i32* %11
%44 = call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0), i8* %41, i32 %42, i32 %43)
%45 = load i32*, i32** %8
%46 = call i32 @fclose(i32* %45)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %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 %24, label %14
14: ; preds = %12
%15 = load i8, i8* %5
%16 = icmp eq i8 %15, 10
%17 = load i8, i8* @EOF
%18 = icmp eq i8 %15, %17
%19 = select i1 %16, i1 true, i1 %18
br i1 %19, label %24, label %20
20: ; preds = %14
%21 = 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)
%22 = tail call i32 @fclose(i32* %1)
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %14, %12
ret void
}