#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*/ buf;
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 *client) {
  char buf[1024];
  while ((fgets_or_exit(buf, sizeof(buf), client) != NULL &&
          strcmp(buf, "\n") && strcmp(buf, "\r\n") != 0))
    ;
}


x86 assembly (clang, -O0):
<skip_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets_or_exit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x411(%rbp)
je     11a1 <skip_headers+0x81>
lea    -0x410(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x411(%rbp)
je     11a1 <skip_headers+0x81>
lea    -0x410(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x411(%rbp)
mov    -0x411(%rbp),%al
test   $0x1,%al
jne    11b4 <skip_headers+0x94>
jmp    11b9 <skip_headers+0x99>
jmp    112f <skip_headers+0xf>
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    0xec6(%rip),%r15
lea    0xebe(%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 = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @skip_headers(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
store i32* %0, i32** %2
br label %4
4: ; preds = %19, %1
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32* @fgets_or_exit(i8* %5, i32 1024, i32* %6)
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %13, %9, %4
%18 = phi i1 [ false, %9 ], [ false, %4 ], [ %16, %13 ]
br i1 %18, label %19, label %20
19: ; preds = %17
br label %4
20: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0D\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 ([2 x i8], [2 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 ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %7, %10
ret void
}