#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);
int strlen(char *);
int is_header(char *txtline) {
  char searchchar;
  char searchchar2;
  char *gotit;
  int header;
  int linelength;
  searchchar = '>';
  searchchar2 = '\%';
  gotit = strchr(txtline, searchchar);
  if (gotit) {
    header = 1;
  } else {
    gotit = strchr(txtline, searchchar2);
    if (gotit) {
      header = 1;
    } else {
      header = 0;
    }
  }
  if (header == 0) {
    linelength = strlen(txtline);
    if (linelength == 0)
      header = 1;
  }
  return header;
}


x86 assembly (clang, -O0):
<is_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x3e,-0x9(%rbp)
movb   $0x25,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115c <is_header+0x3c>
movl   $0x1,-0x1c(%rbp)
jmp    1190 <is_header+0x70>
mov    -0x8(%rbp),%rdi
movsbl -0xa(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1184 <is_header+0x64>
movl   $0x1,-0x1c(%rbp)
jmp    118b <is_header+0x6b>
movl   $0x0,-0x1c(%rbp)
jmp    1190 <is_header+0x70>
cmpl   $0x0,-0x1c(%rbp)
jne    11bc <is_header+0x9c>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    11b7 <is_header+0x97>
movl   $0x1,-0x1c(%rbp)
jmp    11bc <is_header+0x9c>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_header>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x3e,%esi
call   1040 <strchr@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    115c <is_header+0x3c>
mov    %rbx,%rdi
mov    $0x25,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    115c <is_header+0x3c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_header(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
store i8 62, i8* %3
store i8 37, i8* %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %3
%10 = call i8* @strchr(i8* %8, i8 signext %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %6
br label %23
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i8, i8* %4
%17 = call i8* @strchr(i8* %15, i8 signext %16)
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %6
br label %22
21: ; preds = %14
store i32 0, i32* %6
br label %22
22: ; preds = %21, %20
br label %23
23: ; preds = %22, %13
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load i8*, i8** %2
%28 = call i32 @strlen(i8* %27)
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %26
store i32 1, i32* %6
br label %32
32: ; preds = %31, %26
br label %33
33: ; preds = %32, %23
%34 = load i32, i32* %6
ret i32 %34
}

LLVM IR (-O2):
define i32 @is_header(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 62)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 37)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1, %4
%12 = phi i32 [ 1, %4 ], [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}