#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 */
scalar_t__ strcasecmp(char *, char const *);
char *ishfield(char linebuf[], char *colon, const char *field) {
  char *cp = colon;
  *cp = 0;
  if (strcasecmp(linebuf, field) != 0) {
    *cp = ':';
    return (0);
  }
  *cp = ':';
  for (cp++; *cp == ' ' || *cp == '\t'; cp++)
    ;
  return (cp);
}


x86 assembly (clang, -O0):
<ishfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     115e <ishfield+0x4e>
mov    -0x28(%rbp),%rax
movb   $0x3a,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    11c4 <ishfield+0xb4>
mov    -0x28(%rbp),%rax
movb   $0x3a,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x29(%rbp)
je     1196 <ishfield+0x86>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11a6 <ishfield+0x96>
jmp    11bc <ishfield+0xac>
jmp    11ab <ishfield+0x9b>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1171 <ishfield+0x61>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishfield>:
push   %rbx
mov    %rsi,%rbx
movb   $0x0,(%rsi)
mov    %rdx,%rsi
call   1030 <strcasecmp@plt>
movb   $0x3a,(%rbx)
test   %rax,%rax
je     1130 <ishfield+0x20>
xor    %ebx,%ebx
jmp    113f <ishfield+0x2f>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     1130 <ishfield+0x20>
cmp    $0x9,%al
je     1130 <ishfield+0x20>
mov    %rbx,%rax
pop    %rbx
ret

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

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