#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*/ concat(char *, char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, char *);
void testConcat(void) {
  test(concat("hello", "world"), "helloworld");
  test(concat("hello", ""), "hello");
  test(concat("", "world"), "world");
}


x86 assembly (clang, -O0):
<testConcat>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <concat@plt>
mov    %eax,%edi
lea    0xec6(%rip),%rsi
call   1040 <test@plt>
lea    0xeb4(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <concat@plt>
mov    %eax,%edi
lea    0xe9f(%rip),%rsi
call   1040 <test@plt>
lea    0xea3(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1030 <concat@plt>
mov    %eax,%edi
lea    0xe89(%rip),%rsi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConcat>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rbx
lea    0xed8(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <concat@plt>
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1040 <test@plt>
lea    0xebd(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <concat@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <test@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <concat@plt>
mov    %eax,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [11 x i8] c"helloworld\00"
@.str.3 = [1 x i8] zeroinitializer
define void @testConcat() {
%1 = call i32 @concat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @concat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @concat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @test(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [11 x i8] c"helloworld\00"
@.str.3 = [1 x i8] zeroinitializer
define void @testConcat() {
%1 = tail call i32 @concat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @concat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @concat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @test(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}