#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strstr(char const *, char const *);
scalar_t__ strstr_sunday(char const *, char const *);
int main(int argc, char const *argv[]) {
  const char *str, *target;
  str = "aaabbbccchelloxxx";
  target = "hello";
  do {
    if (!(strstr(str, target) == strstr_sunday(str, target))) {
      fprintf(stderr,
              "[ASSERT]: "
              "strstr(str, target) == strstr_sunday(str, target)"
              " failed at "
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/chishaxie/tools/refs/heads/master/"
              "strstr_sunday.c/demo.c"
              ":%u\n",
              22);
      abort();
    }
  } while (0);
  str = "aaabbbccchelloxxx";
  target = "hello2";
  do {
    if (!(strstr(str, target) == strstr_sunday(str, target))) {
      fprintf(stderr,
              "[ASSERT]: "
              "strstr(str, target) == strstr_sunday(str, target)"
              " failed at "
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/chishaxie/tools/refs/heads/master/"
              "strstr_sunday.c/demo.c"
              ":%u\n",
              26);
      abort();
    }
  } while (0);
  str = "aaabhellobbccchelloxxx";
  target = "hello";
  do {
    if (!(strstr(str, target) == strstr_sunday(str, target))) {
      fprintf(stderr,
              "[ASSERT]: "
              "strstr(str, target) == strstr_sunday(str, target)"
              " failed at "
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/chishaxie/tools/refs/heads/master/"
              "strstr_sunday.c/demo.c"
              ":%u\n",
              30);
      abort();
    }
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strstr_sunday@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     11bb <main+0x7b>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xe6e(%rip),%rsi
mov    $0x16,%edx
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11c0 <main+0x80>
lea    0xe39(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xf23(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strstr_sunday@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
je     1225 <main+0xe5>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
lea    0xe04(%rip),%rsi
mov    $0x1a,%edx
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    122a <main+0xea>
lea    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xdd6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strstr_sunday@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
je     128f <main+0x14f>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
lea    0xd9a(%rip),%rsi
mov    $0x1e,%edx
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1294 <main+0x154>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%r15
lea    0xebf(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <strstr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strstr_sunday@plt>
cmp    %rax,%rbx
jne    11d1 <main+0x91>
lea    0xe88(%rip),%r15
lea    0xf76(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <strstr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strstr_sunday@plt>
cmp    %rax,%rbx
jne    11e8 <main+0xa8>
lea    0xf58(%rip),%r15
lea    0xe67(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <strstr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strstr_sunday@plt>
cmp    %rax,%rbx
jne    11ff <main+0xbf>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
mov    $0x16,%edx
jmp    1214 <main+0xd4>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
lea    0xe20(%rip),%rsi
mov    $0x1a,%edx
jmp    1214 <main+0xd4>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
mov    $0x1e,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"aaabbbccchelloxxx\00"
@.str.1 = [6 x i8] c"hello\00"
@stderr = global i32 0
@.str.2 = [221 x i8] c"[ASSERT]: strstr(str, target) == strstr_sunday(str, target) failed at /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chishaxie/tools/refs/heads/master/strstr_sunday.c/demo.c:%u\0A\00"
@.str.3 = [7 x i8] c"hello2\00"
@.str.4 = [23 x i8] c"aaabhellobbccchelloxxx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %8
8: ; preds = %2
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i64 @strstr(i8* %9, i8* %10)
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = call i64 @strstr_sunday(i8* %12, i8* %13)
%15 = icmp eq i64 %11, %14
br i1 %15, label %20, label %16
16: ; preds = %8
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str.2, i64 0, i64 0), i32 22)
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %8
br label %21
21: ; preds = %20
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %7
br label %22
22: ; preds = %21
%23 = load i8*, i8** %6
%24 = load i8*, i8** %7
%25 = call i64 @strstr(i8* %23, i8* %24)
%26 = load i8*, i8** %6
%27 = load i8*, i8** %7
%28 = call i64 @strstr_sunday(i8* %26, i8* %27)
%29 = icmp eq i64 %25, %28
br i1 %29, label %34, label %30
30: ; preds = %22
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str.2, i64 0, i64 0), i32 26)
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %22
br label %35
35: ; preds = %34
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %36
36: ; preds = %35
%37 = load i8*, i8** %6
%38 = load i8*, i8** %7
%39 = call i64 @strstr(i8* %37, i8* %38)
%40 = load i8*, i8** %6
%41 = load i8*, i8** %7
%42 = call i64 @strstr_sunday(i8* %40, i8* %41)
%43 = icmp eq i64 %39, %42
br i1 %43, label %48, label %44
44: ; preds = %36
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str.2, i64 0, i64 0), i32 30)
%47 = call i32 (...) @abort()
unreachable
48: ; preds = %36
br label %49
49: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"aaabbbccchelloxxx\00"
@.str.1 = [6 x i8] c"hello\00"
@stderr = global i32 0
@.str.2 = [221 x i8] c"[ASSERT]: strstr(str, target) == strstr_sunday(str, target) failed at /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/chishaxie/tools/refs/heads/master/strstr_sunday.c/demo.c:%u\0A\00"
@.str.3 = [7 x i8] c"hello2\00"
@.str.4 = [23 x i8] c"aaabhellobbccchelloxxx\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @strstr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i64 @strstr_sunday(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str.2, i64 0, i64 0), i32 22)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2
%11 = tail call i64 @strstr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i64 @strstr_sunday(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %11, %12
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str.2, i64 0, i64 0), i32 26)
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %10
%19 = tail call i64 @strstr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i64 @strstr_sunday(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %19, %20
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([221 x i8], [221 x i8]* @.str.2, i64 0, i64 0), i32 30)
%25 = tail call i32 (...) @abort()
unreachable
26: ; preds = %18
ret i32 0
}