#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 *strstr(char const *, char *);
int TabularHline(const char *row) {
  char *s, *t;
  if (row == NULL)
    return 0;
  s = strstr(row, "\\hline");
  if (s == NULL)
    return 0;
  t = strstr(s + 6, "\\hline");
  if (t == NULL)
    return 1;
  return 2;
}


x86 assembly (clang, -O0):
<TabularHline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <TabularHline+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1194 <TabularHline+0x84>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <TabularHline+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1194 <TabularHline+0x84>
mov    -0x18(%rbp),%rdi
add    $0x6,%rdi
lea    0xe93(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    118d <TabularHline+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    1194 <TabularHline+0x84>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TabularHline>:
push   %rbx
xor    %ebx,%ebx
test   %rdi,%rdi
je     1148 <TabularHline+0x38>
lea    0xee1(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1148 <TabularHline+0x38>
add    $0x6,%rax
lea    0xecc(%rip),%rsi
mov    %rax,%rdi
call   1030 <strstr@plt>
cmp    $0x1,%rax
mov    $0x2,%ebx
sbb    $0x0,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"\\hline\00"
define i32 @TabularHline(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 6
%8 = tail call i8* @strstr(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
%10 = select i1 %9, i32 1, i32 2
br label %11
11: ; preds = %6, %3, %1
%12 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}