#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 *, char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  char first[] = "first";
  char second[] = "second";
  char third[] = "third";
  printf("%s %s %s\n", first, second, third);
  reverse(first);
  reverse(second);
  reverse(third);
  printf("%s %s %s\n", first, second, third);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0xd(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0xb(%rbp)
mov    0xea7(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0x13(%rbp)
lea    -0xa(%rbp),%rsi
lea    -0x11(%rbp),%rdx
lea    -0x17(%rbp),%rcx
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
lea    -0xa(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x11(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x17(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0xa(%rbp),%rsi
lea    -0x11(%rbp),%rdx
lea    -0x17(%rbp),%rcx
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x74,0xc(%rsp)
movl   $0x73726966,0x8(%rsp)
73
movl   $0x646e6f,0x13(%rsp)
movl   $0x6f636573,0x10(%rsp)
6f
movw   $0x64,0x4(%rsp)
movl   $0x72696874,(%rsp)
lea    0xeb4(%rip),%r14
lea    0x8(%rsp),%rbx
lea    0x10(%rsp),%r15
mov    %rsp,%r12
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r15,%rdi
call   1030 <reverse@plt>
mov    %r12,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.first = [6 x i8] c"first\00"
@__const.main.second = [7 x i8] c"second\00"
@__const.main.third = [6 x i8] c"third\00"
@.str = [10 x i8] c"%s %s %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [7 x i8]
%4 = alloca [6 x i8]
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
%6 = bitcast [7 x i8]* %3 to i8*
%7 = bitcast [6 x i8]* %4 to i8*
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* %10)
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%13 = call i32 @reverse(i8* %12)
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%15 = call i32 @reverse(i8* %14)
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%17 = call i32 @reverse(i8* %16)
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%19 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%20 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.first = [6 x i8] c"first\00"
@__const.main.second = [7 x i8] c"second\00"
@__const.main.third = [6 x i8] c"third\00"
@.str = [10 x i8] c"%s %s %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [7 x i8]
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
%8 = call i32 @reverse(i8* %4)
%9 = call i32 @reverse(i8* %5)
%10 = call i32 @reverse(i8* %6)
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
ret i32 0
}