#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__ isalpha(char);
scalar_t__ strncmp(char *, char *, int);
int line_isheading(char *line) {
  int rc;
  rc = 0;
  if (isalpha(line[0]))
    rc = 1;
  else if (line[0] == '"')
    rc = 1;
  else if (strncmp(line, "(EXPR)", 6) == 0)
    rc = 1;
  return rc;
}


x86 assembly (clang, -O0):
<line_isheading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     1155 <line_isheading+0x35>
movl   $0x1,-0xc(%rbp)
jmp    11a1 <line_isheading+0x81>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1171 <line_isheading+0x51>
movl   $0x1,-0xc(%rbp)
jmp    119c <line_isheading+0x7c>
mov    -0x8(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1197 <line_isheading+0x77>
movl   $0x1,-0xc(%rbp)
jmp    119c <line_isheading+0x7c>
jmp    11a1 <line_isheading+0x81>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_isheading>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113b <line_isheading+0x1b>
pop    %rbx
ret
cmpb   $0x22,(%rbx)
je     1139 <line_isheading+0x19>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"(EXPR)\00"
define i32 @line_isheading(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = call i64 @isalpha(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %3
br label %24
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 34
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %23
17: ; preds = %10
%18 = load i8*, i8** %2
%19 = call i64 @strncmp(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %3
br label %22
22: ; preds = %21, %17
br label %23
23: ; preds = %22, %16
br label %24
24: ; preds = %23, %9
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [7 x i8] c"(EXPR)\00"
define i32 @line_isheading(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isalpha(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 34
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ %11, %8 ]
ret i32 %13
}