#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*/ strcat(char *, char *);
void catxx(char *sxout, char **spt, int n) {
  int i;
  sxout[0] = '\0';
  for (i = 0; i < n; i++) {
    strcat(sxout, spt[i]);
    if (i < (n - 1))
      strcat(sxout, " ");
  }
}


x86 assembly (clang, -O0):
<catxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1186 <catxx+0x76>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcat@plt>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1173 <catxx+0x63>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <strcat@plt>
jmp    1178 <catxx+0x68>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <catxx+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catxx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x0,(%rdi)
test   %edx,%edx
jle    1167 <catxx+0x57>
mov    %rsi,%r14
mov    %rdi,%rbx
lea    -0x1(%rdx),%r12d
mov    %edx,%r13d
xor    %ebp,%ebp
lea    0xec8(%rip),%r15
jmp    1149 <catxx+0x39>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r13
je     1167 <catxx+0x57>
mov    (%r14,%rbp,8),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
cmp    %r12,%rbp
jae    1140 <catxx+0x30>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcat@plt>
jmp    1140 <catxx+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @catxx(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 0, i8* %9
store i32 0, i32* %7
br label %10
10: ; preds = %30, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %33
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i8**, i8*** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @strcat(i8* %15, i8* %20)
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 1
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %29
26: ; preds = %14
%27 = load i8*, i8** %4
%28 = call i32 @strcat(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %29
29: ; preds = %26, %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %10
33: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @catxx(i8* %0, i8** nocapture %1, i32 %2) {
store i8 0, i8* %0
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = add nsw i32 %2, -1
%7 = zext i32 %6 to i64
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %5, %17
%10 = phi i64 [ 0, %5 ], [ %18, %17 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @strcat(i8* %0, i8* %12)
%14 = icmp ult i64 %10, %7
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %9, %15
%18 = add nuw nsw i64 %10, 1
%19 = icmp eq i64 %18, %8
br i1 %19, label %20, label %9
20: ; preds = %17, %3
ret void
}