#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_start() {
  char *string = "TestString";
  Assert_real((strrstr(string, "Test") == string),
              "/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",
              15, ("String should be found at start"));
}


x86 assembly (clang, -O0):
<strrstr_start>:
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>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeba(%rip),%rsi
mov    $0xf,%edx
lea    0xf52(%rip),%rcx
call   1040 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrstr_start>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strrstr@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
lea    0xec9(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf,%edx
pop    %rbx
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"TestString\00"
@.str.1 = [5 x i8] c"Test\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 = [32 x i8] c"String should be found at start\00"
define void @strrstr_start() {
%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 = icmp eq i8* %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @Assert_real(i32 %6, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.2, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([32 x i8], [32 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"Test\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 = [32 x i8] c"String should be found at start\00"
define void @strrstr_start() {
%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 0)
%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 15, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret void
}