#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 */
int countOptionName(char const *);
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
int isCurlOptionName(const char *pRead, const char *pToFind) {
  int length = strlen(pToFind);
  if (!strncmp(pRead, ":curl:", 6)) {
    pRead += 6;
  }
  if (countOptionName(pRead) != length) {
    return 0;
  }
  return strncmp(pRead, pToFind, length) == 0;
}


x86 assembly (clang, -O0):
<isCurlOptionName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1177 <isCurlOptionName+0x47>
mov    -0x10(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <countOptionName@plt>
cmp    -0x1c(%rbp),%eax
je     1195 <isCurlOptionName+0x65>
movl   $0x0,-0x4(%rbp)
jmp    11b4 <isCurlOptionName+0x84>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCurlOptionName>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    %eax,%r15d
lea    0xeb1(%rip),%rsi
mov    %rbp,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
lea    0x6(%rbp),%rbx
test   %rax,%rax
cmovne %rbp,%rbx
mov    %rbx,%rdi
call   1040 <countOptionName@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %r15d,%ecx
jne    1191 <isCurlOptionName+0x61>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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