#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 *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char s1[128] = "";
  char s2[128] = "Test string.";
  char s3[128] = "Another test string.";
  char s4[128] = "The last test string.";
  printf("%s -> ", s1);
  reverse(s1);
  printf("%s -> ", s1);
  reverse(s1);
  printf("%s\n", s1);
  printf("%s -> ", s2);
  reverse(s2);
  printf("%s -> ", s2);
  reverse(s2);
  printf("%s\n", s2);
  printf("%s -> ", s3);
  reverse(s3);
  printf("%s -> ", s3);
  reverse(s3);
  printf("%s\n", s3);
  printf("%s -> ", s4);
  reverse(s4);
  printf("%s -> ", s4);
  reverse(s4);
  printf("%s\n", s4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x80,%edx
call   1060 <memcpy@plt>
lea    -0x190(%rbp),%rdi
lea    0xef5(%rip),%rsi
mov    $0x80,%edx
call   1060 <memcpy@plt>
lea    -0x210(%rbp),%rdi
lea    0xf5d(%rip),%rsi
mov    $0x80,%edx
call   1060 <memcpy@plt>
lea    -0x90(%rbp),%rsi
lea    0xfc5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x90(%rbp),%rsi
lea    0xfa6(%rip),%rdi
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x90(%rbp),%rsi
lea    0xf8e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xf74(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x110(%rbp),%rsi
lea    0xf55(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x110(%rbp),%rsi
lea    0xf3d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rsi
lea    0xf23(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x190(%rbp),%rsi
lea    0xf04(%rip),%rdi
call   1040 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x190(%rbp),%rsi
lea    0xeec(%rip),%rdi
call   1040 <printf@plt>
lea    -0x210(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x210(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x210(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xe9d(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe5f(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe40(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xe21(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe67(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe48(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe29(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe62(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe46(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebb(%rip),%r15
lea    0x180(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xe8d(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x100(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x80(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s2 = [128 x i8] c"Test string.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.s3 = [128 x i8] c"Another test string.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.s4 = [128 x i8] c"The last test string.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"%s -> \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
store i32 0, i32* %1
%6 = bitcast [128 x i8]* %2 to i8*
%7 = bitcast [128 x i8]* %3 to i8*
%8 = bitcast [128 x i8]* %4 to i8*
%9 = bitcast [128 x i8]* %5 to i8*
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%13 = call i32 @reverse(i8* %12)
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%17 = call i32 @reverse(i8* %16)
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%23 = call i32 @reverse(i8* %22)
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%27 = call i32 @reverse(i8* %26)
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%33 = call i32 @reverse(i8* %32)
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%37 = call i32 @reverse(i8* %36)
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%41 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%43 = call i32 @reverse(i8* %42)
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%45 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%47 = call i32 @reverse(i8* %46)
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %48)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s2 = [128 x i8] c"Test string.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.s3 = [128 x i8] c"Another test string.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.s4 = [128 x i8] c"The last test string.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"%s -> \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%10 = call i32 @reverse(i8* %5)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%12 = call i32 @reverse(i8* %5)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%15 = call i32 @reverse(i8* %6)
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%17 = call i32 @reverse(i8* %6)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
%20 = call i32 @reverse(i8* %7)
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
%22 = call i32 @reverse(i8* %7)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8)
%25 = call i32 @reverse(i8* %8)
%26 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8)
%27 = call i32 @reverse(i8* %8)
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}