#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__ strncmp(char const *, char *, int);
int isrtfhtml(const char *buf, unsigned int len) {
  const char *c;
  for (c = buf; c < buf + len; c++) {
    if (strncmp(c, "\\from", 5) == 0)
      return strncmp(c, "\\fromhtml", 9) == 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isrtfhtml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    119c <isrtfhtml+0x8c>
mov    -0x20(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1186 <isrtfhtml+0x76>
mov    -0x20(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11a3 <isrtfhtml+0x93>
jmp    118b <isrtfhtml+0x7b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1127 <isrtfhtml+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrtfhtml>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
test   %esi,%esi
je     116e <isrtfhtml+0x5e>
mov    %rdi,%rbx
mov    %esi,%ebp
add    %rdi,%rbp
lea    0xed3(%rip),%r15
nopl   (%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1150 <isrtfhtml+0x40>
add    $0x1,%rbx
cmp    %rbp,%rbx
jb     1130 <isrtfhtml+0x20>
jmp    116e <isrtfhtml+0x5e>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
mov    $0x9,%edx
call   1030 <strncmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"\\from\00"
@.str.1 = [10 x i8] c"\\fromhtml\00"
define i32 @isrtfhtml(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %17, label %6
6: ; preds = %2, %14
%7 = phi i8* [ %15, %14 ], [ %0, %2 ]
%8 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = tail call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 9)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
br label %17
14: ; preds = %6
%15 = getelementptr inbounds i8, i8* %7, i64 1
%16 = icmp ult i8* %15, %4
br i1 %16, label %6, label %17
17: ; preds = %14, %2, %10
%18 = phi i32 [ %13, %10 ], [ 0, %2 ], [ 0, %14 ]
ret i32 %18
}