#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*/ ArgText();
char *TextOf(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int Cnd_SubStr(void) {
  char *a = TextOf(ArgText());
  char *b = TextOf(ArgText());
  while (*a) {
    if (strncmp(a, b, strlen(b)) == 0)
      return (1);
    a++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<Cnd_SubStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1050 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11c8 <Cnd_SubStr+0x88>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11b7 <Cnd_SubStr+0x77>
movl   $0x1,-0x4(%rbp)
jmp    11cf <Cnd_SubStr+0x8f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116c <Cnd_SubStr+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_SubStr>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
cmpb   $0x0,(%rbx)
je     119c <Cnd_SubStr+0x5c>
mov    %rax,%rbp
xchg   %ax,%ax
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1196 <Cnd_SubStr+0x56>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1170 <Cnd_SubStr+0x30>
jmp    119c <Cnd_SubStr+0x5c>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Cnd_SubStr() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i32 (...) @ArgText()
%5 = call i8* @TextOf(i32 %4)
store i8* %5, i8** %2
%6 = call i32 (...) @ArgText()
%7 = call i8* @TextOf(i32 %6)
store i8* %7, i8** %3
br label %8
8: ; preds = %20, %0
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %3
%16 = call i32 @strlen(i8* %15)
%17 = call i64 @strncmp(i8* %13, i8* %14, i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 1, i32* %1
br label %24
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %8
23: ; preds = %8
store i32 0, i32* %1
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
define i32 @Cnd_SubStr() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 (...) @ArgText()
%4 = tail call i8* @TextOf(i32 %3)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %10
7: ; preds = %10
%8 = load i8, i8* %15
%9 = icmp eq i8 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %0, %7
%11 = phi i8* [ %15, %7 ], [ %2, %0 ]
%12 = tail call i32 @strlen(i8* %4)
%13 = tail call i64 @strncmp(i8* %11, i8* %4, i32 %12)
%14 = icmp eq i64 %13, 0
%15 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %14, label %16, label %7
16: ; preds = %10, %7, %0
%17 = phi i32 [ 0, %0 ], [ 0, %7 ], [ 1, %10 ]
ret i32 %17
}