#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*/ printf(char *);
int /*<<< orphan*/ test_str_rev(char *);
int main(int argc, const char *argv[]) {
  printf("\nEven\n");
  test_str_rev("123456");
  printf("\nOdd\n");
  test_str_rev("1234567");
  printf("\nTwo\n");
  test_str_rev("Hi");
  printf("\nOne\n");
  test_str_rev("H");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
call   1040 <test_str_rev@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1040 <test_str_rev@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1040 <test_str_rev@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
call   1040 <test_str_rev@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <test_str_rev@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xebb(%rip),%rdi
call   1040 <test_str_rev@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeab(%rip),%rdi
call   1040 <test_str_rev@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rdi
call   1040 <test_str_rev@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\0AEven\0A\00"
@.str.1 = [7 x i8] c"123456\00"
@.str.2 = [6 x i8] c"\0AOdd\0A\00"
@.str.3 = [8 x i8] c"1234567\00"
@.str.4 = [6 x i8] c"\0ATwo\0A\00"
@.str.5 = [3 x i8] c"Hi\00"
@.str.6 = [6 x i8] c"\0AOne\0A\00"
@.str.7 = [2 x i8] c"H\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @test_str_rev(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @test_str_rev(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @test_str_rev(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @test_str_rev(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"123456\00"
@.str.3 = [8 x i8] c"1234567\00"
@.str.5 = [3 x i8] c"Hi\00"
@.str.7 = [2 x i8] c"H\00"
@str = [6 x i8] c"\0AEven\00"
@str.8 = [5 x i8] c"\0AOdd\00"
@str.9 = [5 x i8] c"\0ATwo\00"
@str.10 = [5 x i8] c"\0AOne\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @test_str_rev(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @test_str_rev(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.9, i64 0, i64 0))
%8 = tail call i32 @test_str_rev(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0))
%10 = tail call i32 @test_str_rev(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}