#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 */

/* Variables and functions */
char *strchr(char *, char);
char *header_end_field(char *field) {
  char *e = strchr(field + 1, '\n');
  while (e && ((e[1] == ' ') || (e[1] == '\t'))) {
    e = strchr(e + 1, '\n');
  }
  return e;
}


x86 assembly (clang, -O0):
<header_end_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     116f <header_end_field+0x5f>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     1169 <header_end_field+0x59>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    117f <header_end_field+0x6f>
jmp    119a <header_end_field+0x8a>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1132 <header_end_field+0x22>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_end_field>:
push   %rax
add    $0x1,%rdi
jmp    1127 <header_end_field+0x17>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1146 <header_end_field+0x36>
movzbl 0x1(%rax),%ecx
cmp    $0x20,%cl
je     1120 <header_end_field+0x10>
cmp    $0x9,%cl
je     1120 <header_end_field+0x10>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @header_end_field(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i8* @strchr(i8* %5, i8 signext 10)
store i8* %6, i8** %3
br label %7
7: ; preds = %26, %1
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 32
br i1 %15, label %22, label %16
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br label %22
22: ; preds = %16, %10
%23 = phi i1 [ true, %10 ], [ %21, %16 ]
br label %24
24: ; preds = %22, %7
%25 = phi i1 [ false, %7 ], [ %23, %22 ]
br i1 %25, label %26, label %30
26: ; preds = %24
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = call i8* @strchr(i8* %28, i8 signext 10)
store i8* %29, i8** %3
br label %7
30: ; preds = %24
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @header_end_field(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @strchr(i8* %2, i8 signext 10)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %3, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
switch i8 %8, label %12 [
i8 32, label %9
i8 9, label %9
]
9: ; preds = %5, %5
%10 = tail call i8* @strchr(i8* %7, i8 signext 10)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %9, %5, %1
%13 = phi i8* [ null, %1 ], [ %6, %5 ], [ null, %9 ]
ret i8* %13
}