#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, int);
int main() {
  char rev[100] = {'P', 'e', 'r', 'u', '\0'};
  char rev1[100] = "Abcde";
  int ini = 0;
  int fin = 4;
  int fin1 = 5;
  reverse(rev, ini, fin);
  printf("%s\n", rev);
  reverse(rev1, ini, fin1);
  printf("%s\n", rev1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x50,-0x70(%rbp)
movb   $0x65,-0x6f(%rbp)
movb   $0x72,-0x6e(%rbp)
movb   $0x75,-0x6d(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x41,-0xe0(%rbp)
movb   $0x62,-0xdf(%rbp)
movb   $0x63,-0xde(%rbp)
movb   $0x64,-0xdd(%rbp)
movb   $0x65,-0xdc(%rbp)
movl   $0x0,-0xe4(%rbp)
movl   $0x4,-0xe8(%rbp)
movl   $0x5,-0xec(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0xe4(%rbp),%esi
mov    -0xe8(%rbp),%edx
call   1030 <reverse@plt>
lea    -0x70(%rbp),%rsi
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    -0xe4(%rbp),%esi
mov    -0xec(%rbp),%edx
call   1030 <reverse@plt>
lea    -0xe0(%rbp),%rsi
lea    0xdff(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movl   $0x0,0xd0(%rsp)
movl   $0x75726550,0x70(%rsp)
75
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x64636241,(%rsp)
movb   $0x65,0x4(%rsp)
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <reverse@plt>
lea    0xe47(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [100 x i8]* %2 to i8*
%8 = bitcast i8* %7 to <{ i8, i8, i8, i8, [96 x i8] }>*
%9 = getelementptr inbounds <{ i8, i8, i8, i8, [96 x i8] }>, <{ i8, i8, i8, i8, [96 x i8] }>* %8, i32 0, i32 0
store i8 80, i8* %9
%10 = getelementptr inbounds <{ i8, i8, i8, i8, [96 x i8] }>, <{ i8, i8, i8, i8, [96 x i8] }>* %8, i32 0, i32 1
store i8 101, i8* %10
%11 = getelementptr inbounds <{ i8, i8, i8, i8, [96 x i8] }>, <{ i8, i8, i8, i8, [96 x i8] }>* %8, i32 0, i32 2
store i8 114, i8* %11
%12 = getelementptr inbounds <{ i8, i8, i8, i8, [96 x i8] }>, <{ i8, i8, i8, i8, [96 x i8] }>* %8, i32 0, i32 3
store i8 117, i8* %12
%13 = bitcast [100 x i8]* %3 to i8*
%14 = bitcast i8* %13 to [100 x i8]*
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 0
store i8 65, i8* %15
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 1
store i8 98, i8* %16
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 2
store i8 99, i8* %17
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 3
store i8 100, i8* %18
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i32 0, i32 4
store i8 101, i8* %19
store i32 0, i32* %4
store i32 4, i32* %5
store i32 5, i32* %6
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = call i32 @reverse(i8* %20, i32 %21, i32 %22)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%27 = load i32, i32* %4
%28 = load i32, i32* %6
%29 = call i32 @reverse(i8* %26, i32 %27, i32 %28)
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 80, i8* %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 101, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 114, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 117, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 65, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 98, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 99, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
store i8 100, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 4
store i8 101, i8* %11
%12 = call i32 @reverse(i8* %3, i32 0, i32 4)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%14 = call i32 @reverse(i8* %7, i32 0, i32 5)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}