#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 /*<<< orphan*/ custom_strncmp(int /*<<< orphan*/, unsigned char const *,
                                  int);
int is_str_present_in_ss_comment(const unsigned char *src, int srclen,
                                 const unsigned char *substr, int substrlen) {
  srclen = srclen - substrlen + 1;
  while (srclen--) {
    if (*src == '\n')
      return (0);
    if (!custom_strncmp(src++, substr, substrlen))
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_str_present_in_ss_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1199 <is_str_present_in_ss_comment+0x89>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
jne    1162 <is_str_present_in_ss_comment+0x52>
movl   $0x0,-0x4(%rbp)
jmp    11a0 <is_str_present_in_ss_comment+0x90>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    %eax,%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <custom_strncmp@plt>
cmp    $0x0,%eax
jne    1194 <is_str_present_in_ss_comment+0x84>
movl   $0x1,-0x4(%rbp)
jmp    11a0 <is_str_present_in_ss_comment+0x90>
jmp    1132 <is_str_present_in_ss_comment+0x22>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_str_present_in_ss_comment>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r15
mov    %esi,%r13d
mov    %rdi,%rbp
sub    %ecx,%r13d
add    $0x1,%r13d
xor    %r14d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %ebx,%r13d
je     1168 <is_str_present_in_ss_comment+0x58>
cmpb   $0xa,0x0(%rbp,%rbx,1)
je     1168 <is_str_present_in_ss_comment+0x58>
lea    (%rbx,%rbp,1),%edi
mov    %r15,%rsi
mov    %r12d,%edx
call   1030 <custom_strncmp@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1140 <is_str_present_in_ss_comment+0x30>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_str_present_in_ss_comment(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* %9
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %7
br label %14
14: ; preds = %33, %4
%15 = load i32, i32* %7
%16 = add nsw i32 %15, -1
store i32 %16, i32* %7
%17 = icmp ne i32 %15, 0
br i1 %17, label %18, label %34
18: ; preds = %14
%19 = load i8*, i8** %6
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 0, i32* %5
br label %35
24: ; preds = %18
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %6
%27 = ptrtoint i8* %25 to i32
%28 = load i8*, i8** %8
%29 = load i32, i32* %9
%30 = call i32 @custom_strncmp(i32 %27, i8* %28, i32 %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %24
store i32 1, i32* %5
br label %35
33: ; preds = %24
br label %14
34: ; preds = %14
store i32 0, i32* %5
br label %35
35: ; preds = %34, %32, %23
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
define i32 @is_str_present_in_ss_comment(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = add i32 %1, 1
%6 = sub i32 %5, %3
br label %7
7: ; preds = %15, %4
%8 = phi i32 [ %6, %4 ], [ %10, %15 ]
%9 = phi i8* [ %0, %4 ], [ %16, %15 ]
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %21, label %12
12: ; preds = %7
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 10
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, i8* %9, i64 1
%17 = ptrtoint i8* %9 to i64
%18 = trunc i64 %17 to i32
%19 = tail call i32 @custom_strncmp(i32 %18, i8* %2, i32 %3)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %7
21: ; preds = %7, %15, %12
%22 = phi i32 [ 0, %12 ], [ 1, %15 ], [ 0, %7 ]
ret i32 %22
}