#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*/ puts(char *);
int /*<<< orphan*/ squeeze(char *, char *);
int main() {
  char str1[8] = "apple";
  char str2[8] = "tomtom";
  char str3[16] = "bloodyorange";
  char str4[8] = "orange";
  squeeze(str1, "orange");
  puts(str1);
  squeeze(str2, "orange");
  puts(str2);
  squeeze(str3, "orange");
  puts(str3);
  squeeze(str4, "orange");
  puts(str4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0xc(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0xc(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x14(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0x14(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x30(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0x30(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x38(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0x38(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movabs $0x656c707061,%rax
mov    %rax,0x18(%rsp)
movabs $0x6d6f746d6f74,%rax
mov    %rax,0x10(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x65676e61726f,%rax
mov    %rax,0x8(%rsp)
lea    0xea9(%rip),%r14
lea    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <squeeze@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <squeeze@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <squeeze@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <squeeze@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str1 = [8 x i8] c"apple\00\00\00"
@__const.main.str2 = [8 x i8] c"tomtom\00\00"
@__const.main.str3 = [16 x i8] c"bloodyorange\00\00\00\00"
@__const.main.str4 = [8 x i8] c"orange\00\00"
@.str = [7 x i8] c"orange\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [8 x i8]
%4 = alloca [16 x i8]
%5 = alloca [8 x i8]
store i32 0, i32* %1
%6 = bitcast [8 x i8]* %2 to i8*
%7 = bitcast [8 x i8]* %3 to i8*
%8 = bitcast [16 x i8]* %4 to i8*
%9 = bitcast [8 x i8]* %5 to i8*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%11 = call i32 @squeeze(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%15 = call i32 @squeeze(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%17 = call i32 @puts(i8* %16)
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%19 = call i32 @squeeze(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%21 = call i32 @puts(i8* %20)
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%23 = call i32 @squeeze(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%25 = call i32 @puts(i8* %24)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str3 = [16 x i8] c"bloodyorange\00\00\00\00"
@.str = [7 x i8] c"orange\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [16 x i8]
%4 = alloca i64
%5 = bitcast i64* %1 to i8*
store i64 435611005025, i64* %1
%6 = bitcast i64* %2 to i8*
store i64 120325462126452, i64* %2
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = bitcast i64* %4 to i8*
store i64 111494907916911, i64* %4
%9 = call i32 @squeeze(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @puts(i8* %5)
%11 = call i32 @squeeze(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @puts(i8* %6)
%13 = call i32 @squeeze(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @puts(i8* %7)
%15 = call i32 @squeeze(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @puts(i8* %8)
ret i32 0
}