#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*/ cat2(char *, char *);
char *cat4(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/);
char *cat8(char *str1, char *str2, char *str3, char *str4, char *str5,
           char *str6, char *str7, char *str8) {
  return cat4(cat2(str1, str2), cat2(str3, str4), cat2(str5, str6),
              cat2(str7, str8));
}


x86 assembly (clang, -O0):
<cat8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cat2@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <cat2@plt>
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <cat2@plt>
mov    %eax,-0x34(%rbp)
mov    0x10(%rbp),%rdi
mov    0x18(%rbp),%rsi
call   1030 <cat2@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    %eax,%ecx
call   1040 <cat4@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat8>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbp
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    0x40(%rsp),%r13
mov    0x48(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <cat2@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <cat2@plt>
mov    %eax,%ebx
mov    %r15,%rdi
mov    %rbp,%rsi
call   1030 <cat2@plt>
mov    %eax,%ebp
mov    %r13,%rdi
mov    (%rsp),%rsi
call   1030 <cat2@plt>
mov    %r14d,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <cat4@plt>

LLVM IR (-O0):
define i8* @cat8(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = call i32 @cat2(i8* %17, i8* %18)
%20 = load i8*, i8** %11
%21 = load i8*, i8** %12
%22 = call i32 @cat2(i8* %20, i8* %21)
%23 = load i8*, i8** %13
%24 = load i8*, i8** %14
%25 = call i32 @cat2(i8* %23, i8* %24)
%26 = load i8*, i8** %15
%27 = load i8*, i8** %16
%28 = call i32 @cat2(i8* %26, i8* %27)
%29 = call i8* @cat4(i32 %19, i32 %22, i32 %25, i32 %28)
ret i8* %29
}

LLVM IR (-O2):
define i8* @cat8(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = tail call i32 @cat2(i8* %0, i8* %1)
%10 = tail call i32 @cat2(i8* %2, i8* %3)
%11 = tail call i32 @cat2(i8* %4, i8* %5)
%12 = tail call i32 @cat2(i8* %6, i8* %7)
%13 = tail call i8* @cat4(i32 %9, i32 %10, i32 %11, i32 %12)
ret i8* %13
}