#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*/ manipulateString(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[40] = "blam blammo dam";
  char stringTwo[40] = "    blammo!  ";
  printf("%s becomes: ", string);
  manipulateString(string);
  printf("%s\n", string);
  printf("%s becomes:   ", stringTwo);
  manipulateString(stringTwo);
  printf("%s\n", stringTwo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <manipulateString@plt>
lea    -0x30(%rbp),%rsi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1050 <manipulateString@plt>
lea    -0x60(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x50(%rsp)
movaps 0xef1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0xee9(%rip),%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <manipulateString@plt>
lea    0xeda(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <manipulateString@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.string = [40 x i8] c"blam blammo dam\00\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.stringTwo = [40 x i8] c" blammo! \00\00\00\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 = [13 x i8] c"%s becomes: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [15 x i8] c"%s becomes: \00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [40 x i8]
%3 = bitcast [40 x i8]* %1 to i8*
%4 = bitcast [40 x i8]* %2 to i8*
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%8 = call i32 @manipulateString(i8* %7)
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%14 = call i32 @manipulateString(i8* %13)
%15 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [40 x i8] c"blam blammo dam\00\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.stringTwo = [40 x i8] c" blammo! \00\00\00\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 = [13 x i8] c"%s becomes: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [15 x i8] c"%s becomes: \00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [40 x i8]
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @manipulateString(i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%9 = call i32 @manipulateString(i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}