#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*/ squeeze(char *, char *);
main() {
  char s1[] = "hello, world";
  char s2[] = "goodbye home";
  printf("s1=%s\n", s1);
  squeeze(s1, s2);
  printf("s1=%s,s2=%s\n", s1, s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x12(%rbp)
lea    -0x11(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x11(%rbp),%rdi
lea    -0x1e(%rbp),%rsi
call   1030 <squeeze@plt>
lea    -0x11(%rbp),%rsi
lea    -0x1e(%rbp),%rdx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movabs $0x646c726f77202c,%rax
mov    %rax,0x1d(%rsp)
movabs $0x77202c6f6c6c6568,%rax
2c 20 77
mov    %rax,0x18(%rsp)
movabs $0x656d6f68206579,%rax
mov    %rax,0xd(%rsp)
movabs $0x20657962646f6f67,%rax
79 65 20
mov    %rax,0x8(%rsp)
lea    0xeb0(%rip),%rdi
lea    0x18(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <squeeze@plt>
lea    0xe91(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s1 = [13 x i8] c"hello, world\00"
@__const.main.s2 = [13 x i8] c"goodbye home\00"
@.str = [7 x i8] c"s1=%s\0A\00"
@.str.1 = [13 x i8] c"s1=%s,s2=%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca [13 x i8]
store i32 0, i32* %1
%4 = bitcast [13 x i8]* %2 to i8*
%5 = bitcast [13 x i8]* %3 to i8*
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%10 = call i32 @squeeze(i8* %8, i8* %9)
%11 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [13 x i8] c"hello, world\00"
@__const.main.s2 = [13 x i8] c"goodbye home\00"
@.str = [7 x i8] c"s1=%s\0A\00"
@.str.1 = [13 x i8] c"s1=%s,s2=%s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @squeeze(i8* %3, i8* %4)
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}