#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__ isspace(char);
scalar_t__ strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char tolower(char);
int line_isignore(char *line) {
  int rc;
  int i;
  int length;
  char possible_ignore[10];
  rc = 0;
  length = (int)strlen(line);
  for (i = 0; (i < 10) && (i < length); i++) {
    possible_ignore[i] = tolower(line[i]);
  }
  if (strncmp(possible_ignore, ">>?ignore", 9) == 0) {
    if ((isspace(possible_ignore[9])) || (possible_ignore[9] == '\n'))
      rc = 1;
  }
  return rc;
}


x86 assembly (clang, -O0):
<line_isignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x10(%rbp)
mov    %al,-0x1f(%rbp)
jge    1181 <line_isignore+0x41>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x1f(%rbp)
mov    -0x1f(%rbp),%al
test   $0x1,%al
jne    1191 <line_isignore+0x51>
jmp    11ba <line_isignore+0x7a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <tolower@plt>
mov    %al,%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0x1e(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <line_isignore+0x26>
lea    -0x1e(%rbp),%rdi
lea    0xe3b(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1205 <line_isignore+0xc5>
movsbl -0x15(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
jne    11f9 <line_isignore+0xb9>
movsbl -0x15(%rbp),%eax
cmp    $0xa,%eax
jne    1200 <line_isignore+0xc0>
movl   $0x1,-0xc(%rbp)
jmp    1205 <line_isignore+0xc5>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_isignore>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1187 <line_isignore+0x47>
add    $0xffffffff,%eax
cmp    $0x9,%eax
mov    $0x9,%r15d
cmovb  %eax,%r15d
add    $0x1,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1060 <tolower@plt>
mov    %al,0x6(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <line_isignore+0x30>
lea    0xe72(%rip),%rsi
lea    0x6(%rsp),%rdi
mov    $0x9,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    11c4 <line_isignore+0x84>
movsbl 0xf(%rsp),%edi
call   1050 <isspace@plt>
test   %rax,%rax
setne  %al
cmpb   $0xa,0xf(%rsp)
sete   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c">>?ignore\00"
define i32 @line_isignore(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
store i32 0, i32* %4
br label %10
10: ; preds = %29, %1
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br label %17
17: ; preds = %13, %10
%18 = phi i1 [ false, %10 ], [ %16, %13 ]
br i1 %18, label %19, label %32
19: ; preds = %17
%20 = load i8*, i8** %2
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = call signext i8 @tolower(i8 signext %24)
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 %27
store i8 %25, i8* %28
br label %29
29: ; preds = %19
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %10
32: ; preds = %17
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%34 = call i64 @strncmp(i8* %33, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 9
%38 = load i8, i8* %37
%39 = call i64 @isspace(i8 signext %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 9
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 10
br i1 %45, label %46, label %47
46: ; preds = %41, %36
store i32 1, i32* %3
br label %47
47: ; preds = %46, %41
br label %48
48: ; preds = %47, %32
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
@.str = [10 x i8] c">>?ignore\00"
define i32 @line_isignore(i8* nocapture %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = trunc i64 %4 to i32
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %1
%8 = add nsw i32 %5, -1
%9 = call i32 @llvm.umin.i32(i32 %8, i32 9)
%10 = add nuw nsw i32 %9, 1
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %7, %12
%13 = phi i64 [ 0, %7 ], [ %18, %12 ]
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = tail call signext i8 @tolower(i8 signext %15)
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %13
store i8 %16, i8* %17
%18 = add nuw nsw i64 %13, 1
%19 = icmp eq i64 %18, %11
br i1 %19, label %20, label %12
20: ; preds = %12, %1
%21 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 9
%25 = load i8, i8* %24
%26 = call i64 @isspace(i8 signext %25)
%27 = icmp ne i64 %26, 0
%28 = load i8, i8* %24
%29 = icmp eq i8 %28, 10
%30 = select i1 %27, i1 true, i1 %29
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %23, %20
%33 = phi i32 [ 0, %20 ], [ %31, %23 ]
ret i32 %33
}