#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*/ Assert_real(int, char *, int, char *);
char *strrstr(char *, char *);
void strrstr_middle() {
  char *string = "TestString";
  Assert_real((strrstr(string, "tStr") == string + 3),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/string/strrstr.c",
              22, ("String should be found in middle"));
}


x86 assembly (clang, -O0):
<strrstr_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strrstr@plt>
mov    -0x8(%rbp),%rcx
add    $0x3,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb3(%rip),%rsi
mov    $0x16,%edx
lea    0xf4b(%rip),%rcx
call   1040 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrstr_middle>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <strrstr@plt>
lea    0xec8(%rip),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf62(%rip),%rcx
mov    $0x16,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"TestString\00"
@.str.1 = [5 x i8] c"tStr\00"
@.str.2 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strrstr.c\00"
@.str.3 = [33 x i8] c"String should be found in middle\00"
define void @strrstr_middle() {
%1 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i8* @strrstr(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = icmp eq i8* %3, %5
%7 = zext i1 %6 to i32
%8 = call i32 @Assert_real(i32 %7, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"TestString\00"
@.str.1 = [5 x i8] c"tStr\00"
@.str.2 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/strrstr.c\00"
@.str.3 = [33 x i8] c"String should be found in middle\00"
define void @strrstr_middle() {
%1 = tail call i8* @strrstr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i8* %1, getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 3)
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret void
}