#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 *fgets_or_exit(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
scalar_t__ strncmp(char *, char *, int);
void skip_headers(char *s, char buffer[], FILE *client) {
  while (strncmp(s, "\r\n", 2) != 0) {
    fprintf(stdout, "<TeamWebServ>%s", buffer);
    s = fgets_or_exit(buffer, 1024, client);
  }
}


x86 assembly (clang, -O0):
<skip_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1197 <skip_headers+0x67>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets_or_exit@plt>
mov    %rax,-0x8(%rbp)
jmp    1144 <skip_headers+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_headers>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xeba(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     11a4 <skip_headers+0x74>
mov    0x2e84(%rip),%r13
lea    0xea0(%rip),%r15
lea    0xe96(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   1030 <fgets_or_exit@plt>
mov    %rax,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1170 <skip_headers+0x40>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
@stdout = global i32 0
@.str.1 = [16 x i8] c"<TeamWebServ>%s\00"
define void @skip_headers(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
br label %7
7: ; preds = %11, %3
%8 = load i8*, i8** %4
%9 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load i32, i32* @stdout
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %5
%16 = load i32*, i32** %6
%17 = call i8* @fgets_or_exit(i8* %15, i32 1024, i32* %16)
store i8* %17, i8** %4
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
@stdout = global i32 0
@.str.1 = [16 x i8] c"<TeamWebServ>%s\00"
define void @skip_headers(i8* %0, i8* %1, i32* %2) {
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = tail call i8* @fgets_or_exit(i8* %1, i32 1024, i32* %2)
%10 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %3
ret void
}