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

/* Variables and functions */
int /*<<< orphan*/ *fgets_or_exit(char *, int, int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
void skip_headers(FILE *file) {
  char entete[1024];
  int fini = 0;
  while (fini == 0 && fgets_or_exit(entete, sizeof(entete), file) != NULL) {
    if (strcmp(entete, "\r\n") == 0 || strcmp(entete, "\n") == 0) {
      fini = 1;
    }
  }
}


x86 assembly (clang, -O0):
<skip_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x414(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x414(%rbp)
mov    %al,-0x415(%rbp)
jne    1170 <skip_headers+0x50>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets_or_exit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x415(%rbp)
mov    -0x415(%rbp),%al
test   $0x1,%al
jne    1183 <skip_headers+0x63>
jmp    11cc <skip_headers+0xac>
lea    -0x410(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11bd <skip_headers+0x9d>
lea    -0x410(%rbp),%rdi
lea    0xe53(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c7 <skip_headers+0xa7>
movl   $0x1,-0x414(%rbp)
jmp    1139 <skip_headers+0x19>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_headers>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
lea    0xec5(%rip),%r15
lea    0xebf(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <fgets_or_exit@plt>
test   %rax,%rax
je     1185 <skip_headers+0x65>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1185 <skip_headers+0x65>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <skip_headers+0x30>
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @skip_headers(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = load i32*, i32** %2
%11 = call i32* @fgets_or_exit(i8* %9, i32 1024, i32* %10)
%12 = icmp ne i32* %11, null
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %25
15: ; preds = %13
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19, %15
store i32 1, i32* %4
br label %24
24: ; preds = %23, %19
br label %5
25: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @skip_headers(i32* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %10, %1
%5 = call i32* @fgets_or_exit(i8* %3, i32 1024, i32* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %10, %7, %4
ret void
}