#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 */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *concat(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6,
             char *s7) {
  char *result = malloc(strlen(s1) + strlen(s2) + strlen(s3) + strlen(s4) +
                        strlen(s5) + strlen(s6) + strlen(s7) + 1);
  strcpy(result, s1);
  strcat(result, s2);
  strcat(result, s3);
  strcat(result, s4);
  strcat(result, s5);
  strcat(result, s6);
  strcat(result, s7);
  return result;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
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
call   1040 <strlen@plt>
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x38(%rbp),%rdi
mov    0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x38(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,%r14
mov    %r8,%r13
mov    %rcx,%r12
mov    %rcx,0x30(%rsp)
mov    %rdx,%rbp
mov    %rdx,0x28(%rsp)
mov    %rsi,%rbx
mov    %rsi,0x20(%rsp)
mov    %rdi,0x18(%rsp)
call   1040 <strlen@plt>
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rax,0x8(%rsp)
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %rax,%r12
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    0x70(%rsp),%rdi
call   1040 <strlen@plt>
add    0x10(%rsp),%r15
add    0x8(%rsp),%r15
add    %r12,%r15
add    %rbp,%r15
add    %rbx,%r15
lea    (%rax,%r15,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    0x18(%rsp),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    0x20(%rsp),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    0x28(%rsp),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    0x30(%rsp),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    0x70(%rsp),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @concat(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%16 = load i8*, i8** %8
%17 = call i64 @strlen(i8* %16)
%18 = load i8*, i8** %9
%19 = call i64 @strlen(i8* %18)
%20 = add nsw i64 %17, %19
%21 = load i8*, i8** %10
%22 = call i64 @strlen(i8* %21)
%23 = add nsw i64 %20, %22
%24 = load i8*, i8** %11
%25 = call i64 @strlen(i8* %24)
%26 = add nsw i64 %23, %25
%27 = load i8*, i8** %12
%28 = call i64 @strlen(i8* %27)
%29 = add nsw i64 %26, %28
%30 = load i8*, i8** %13
%31 = call i64 @strlen(i8* %30)
%32 = add nsw i64 %29, %31
%33 = load i8*, i8** %14
%34 = call i64 @strlen(i8* %33)
%35 = add nsw i64 %32, %34
%36 = add nsw i64 %35, 1
%37 = call i8* @malloc(i64 %36)
store i8* %37, i8** %15
%38 = load i8*, i8** %15
%39 = load i8*, i8** %8
%40 = call i32 @strcpy(i8* %38, i8* %39)
%41 = load i8*, i8** %15
%42 = load i8*, i8** %9
%43 = call i32 @strcat(i8* %41, i8* %42)
%44 = load i8*, i8** %15
%45 = load i8*, i8** %10
%46 = call i32 @strcat(i8* %44, i8* %45)
%47 = load i8*, i8** %15
%48 = load i8*, i8** %11
%49 = call i32 @strcat(i8* %47, i8* %48)
%50 = load i8*, i8** %15
%51 = load i8*, i8** %12
%52 = call i32 @strcat(i8* %50, i8* %51)
%53 = load i8*, i8** %15
%54 = load i8*, i8** %13
%55 = call i32 @strcat(i8* %53, i8* %54)
%56 = load i8*, i8** %15
%57 = load i8*, i8** %14
%58 = call i32 @strcat(i8* %56, i8* %57)
%59 = load i8*, i8** %15
ret i8* %59
}

LLVM IR (-O2):
define i8* @concat(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%10 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%11 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%12 = tail call i64 @strlen(i8* dereferenceable(1) %4)
%13 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%14 = tail call i64 @strlen(i8* dereferenceable(1) %6)
%15 = add i64 %8, 1
%16 = add i64 %15, %9
%17 = add i64 %16, %10
%18 = add i64 %17, %11
%19 = add i64 %18, %12
%20 = add i64 %19, %13
%21 = add i64 %20, %14
%22 = tail call i8* @malloc(i64 %21)
%23 = tail call i32 @strcpy(i8* %22, i8* %0)
%24 = tail call i32 @strcat(i8* %22, i8* %1)
%25 = tail call i32 @strcat(i8* %22, i8* %2)
%26 = tail call i32 @strcat(i8* %22, i8* %3)
%27 = tail call i32 @strcat(i8* %22, i8* %4)
%28 = tail call i32 @strcat(i8* %22, i8* %5)
%29 = tail call i32 @strcat(i8* %22, i8* %6)
ret i8* %22
}