#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 */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, int, ...);
void test_line(char *file, FILE *m_File, int i, int N) {
  if (i != N) {
    printf("Error: unable to read file %s. It seems that it "
           "contains %d lines instead of %d.\n\n",
           file, i, N);
    fclose(m_File);
    exit(1);
  }
  if (!feof(m_File)) {
    printf("Error: unable to read file %s. It seems that it "
           "contains more than %d lines.\n\n",
           file, N);
    fclose(m_File);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<test_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     118d <test_line+0x4d>
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
jne    11c7 <test_line+0x87>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_line>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
cmp    %ecx,%edx
jne    1161 <test_line+0x21>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     1176 <test_line+0x36>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe98(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1189 <test_line+0x49>
lea    0xed6(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [83 x i8] c"Error: unable to read file %s. It seems that it contains %d lines instead of %d.\0A\0A\00"
@.str.1 = [79 x i8] c"Error: unable to read file %s. It seems that it contains more than %d lines.\0A\0A\00"
define void @test_line(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
%17 = load i32*, i32** %6
%18 = call i32 @fclose(i32* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4
%21 = load i32*, i32** %6
%22 = call i32 @feof(i32* %21)
%23 = icmp ne i32 %22, 0
br i1 %23, label %31, label %24
24: ; preds = %20
%25 = load i8*, i8** %5
%26 = load i32, i32* %8
%27 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0), i8* %25, i32 %26)
%28 = load i32*, i32** %6
%29 = call i32 @fclose(i32* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %20
ret void
}

LLVM IR (-O2):
@.str = [83 x i8] c"Error: unable to read file %s. It seems that it contains %d lines instead of %d.\0A\0A\00"
@.str.1 = [79 x i8] c"Error: unable to read file %s. It seems that it contains more than %d lines.\0A\0A\00"
define void @test_line(i8* %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %3)
%8 = tail call i32 @fclose(i32* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
%11 = tail call i32 @feof(i32* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %2)
%15 = tail call i32 @fclose(i32* %1)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %10
ret void
}