#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*/ assert(char const *);
char *StrConcat(char *pcDest, const char *pcSrc) {
  assert(pcDest);
  assert(pcSrc);
  char *pc = pcDest;
  while (*pc != '\0') {
    pc++;
  }
  while (*pcSrc != '\0') {
    *pc = *pcSrc;
    pcSrc++;
    pc++;
  }
  *pc = '\0';
  return pcDest;
}


x86 assembly (clang, -O0):
<StrConcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <StrConcat+0x4b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113a <StrConcat+0x2a>
jmp    1160 <StrConcat+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1199 <StrConcat+0x89>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1160 <StrConcat+0x50>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrConcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1030 <assert@plt>
mov    %r14,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdx
add    $0x1,%rax
cmpb   $0x0,(%rdx)
jne    1130 <StrConcat+0x20>
mov    (%rbx),%cl
test   %cl,%cl
je     1166 <StrConcat+0x56>
mov    $0xffffffffffffffff,%rdx
nopl   0x0(%rax)
mov    %cl,(%rax,%rdx,1)
movzbl 0x2(%rbx,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1150 <StrConcat+0x40>
add    %rdx,%rax
mov    %rax,%rdx
movb   $0x0,(%rdx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @StrConcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @assert(i8* %8)
%10 = load i8*, i8** %3
store i8* %10, i8** %5
br label %11
11: ; preds = %16, %2
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
br label %11
19: ; preds = %11
br label %20
20: ; preds = %25, %19
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = load i8*, i8** %5
store i8 %27, i8* %28
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %4
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %5
br label %20
33: ; preds = %20
%34 = load i8*, i8** %5
store i8 0, i8* %34
%35 = load i8*, i8** %3
ret i8* %35
}

LLVM IR (-O2):
define i8* @StrConcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %9, %5 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %8, label %10, label %5
10: ; preds = %5
%11 = load i8, i8* %1
%12 = icmp eq i8 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %10, %13
%14 = phi i8 [ %19, %13 ], [ %11, %10 ]
%15 = phi i8* [ %18, %13 ], [ %6, %10 ]
%16 = phi i8* [ %17, %13 ], [ %1, %10 ]
store i8 %14, i8* %15
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = getelementptr inbounds i8, i8* %15, i64 1
%19 = load i8, i8* %17
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %13
21: ; preds = %13, %10
%22 = phi i8* [ %6, %10 ], [ %18, %13 ]
store i8 0, i8* %22
ret i8* %0
}