#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*/ mirror(char *);
int /*<<< orphan*/ mycpy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  char str[100];
  mycpy("desserts I", str);
  printf("%s\n", str);
  mirror(str);
  printf("%s\n", str);
  mirror(str);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1050 <mycpy@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <mirror@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <mirror@plt>
lea    -0x70(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <mycpy@plt>
lea    0xebb(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <mirror@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <mirror@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"desserts I\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @mycpy(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @mirror(i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = call i32 @mirror(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"desserts I\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @mycpy(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @mirror(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = call i32 @mirror(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}