#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*/ sprintf(char *, char *, char const *, char const *);
int /*<<< orphan*/ stic_simple_test_result(int, char *, char const *,
                                           char const *, unsigned int);
scalar_t__ strstr(char const *, char const *);
void stic_assert_string_contains(const char *expected, const char *actual,
                                 const char *function, const char file[],
                                 unsigned int line) {
  char s[100000];
  sprintf(s, "Expected \"%s\" to be in \"%s\"", expected, actual);
  stic_simple_test_result(strstr(actual, expected) != 0, s, function, file,
                          line);
}


x86 assembly (clang, -O0):
<stic_assert_string_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186d0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
lea    -0x186d0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe9b(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    -0x186d0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <stic_simple_test_result@plt>
add    $0x186d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stic_assert_string_contains>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x186a8,%rsp
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xea9(%rip),%rsi
mov    %rsp,%r13
mov    %r13,%rdi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <strstr@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1030 <stic_simple_test_result@plt>
add    $0x186a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Expected \22%s\22 to be in \22%s\22\00"
define void @stic_assert_string_contains(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [100000 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = getelementptr inbounds [100000 x i8], [100000 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
%16 = load i8*, i8** %7
%17 = load i8*, i8** %6
%18 = call i64 @strstr(i8* %16, i8* %17)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
%21 = getelementptr inbounds [100000 x i8], [100000 x i8]* %11, i64 0, i64 0
%22 = load i8*, i8** %8
%23 = load i8*, i8** %9
%24 = load i32, i32* %10
%25 = call i32 @stic_simple_test_result(i32 %20, i8* %21, i8* %22, i8* %23, i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Expected \22%s\22 to be in \22%s\22\00"
define void @stic_assert_string_contains(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [100000 x i8]
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%9 = tail call i64 @strstr(i8* %1, i8* %0)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @stic_simple_test_result(i32 %11, i8* %7, i8* %2, i8* %3, i32 %4)
ret void
}