#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 *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strrev(char *);
void strrev_one() {
  char buf[10];
  strcpy(buf, "A");
  Assert_real((strrev(buf) == buf),
              "/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/strrev.c",
              22, ("Expected to get buf back"));
  Assert_real((strcmp(buf, "A") == 0),
              "/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/strrev.c",
              23, ("Incorrect reversal"));
}


x86 assembly (clang, -O0):
<strrev_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xa(%rbp),%rdi
call   1050 <strrev@plt>
lea    -0xa(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe8b(%rip),%rsi
mov    $0x16,%edx
lea    0xf22(%rip),%rcx
call   1060 <Assert_real@plt>
lea    -0xa(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe57(%rip),%rsi
mov    $0x17,%edx
lea    0xf07(%rip),%rcx
call   1060 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrev_one>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%r14
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strrev@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
lea    0xe8a(%rip),%r15
lea    0xf26(%rip),%rcx
mov    %r15,%rsi
mov    $0x16,%edx
call   1060 <Assert_real@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xf17(%rip),%rcx
mov    %r15,%rsi
mov    $0x17,%edx
call   1060 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [163 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/strrev.c\00"
@.str.2 = [25 x i8] c"Expected to get buf back\00"
@.str.3 = [19 x i8] c"Incorrect reversal\00"
define void @strrev_one() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i8* @strrev(i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @Assert_real(i32 %8, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @Assert_real(i32 %13, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [163 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/strrev.c\00"
@.str.2 = [25 x i8] c"Expected to get buf back\00"
@.str.3 = [19 x i8] c"Incorrect reversal\00"
define void @strrev_one() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @strrev(i8* %2)
%5 = icmp eq i8* %4, %2
%6 = zext i1 %5 to i32
%7 = call i32 @Assert_real(i32 %6, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%8 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @Assert_real(i32 %10, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret void
}