#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(int);
char *myStrcat(char *strDes, const char *strSrc) {
  assert((strDes != NULL) && (strSrc != NULL));
  char *address = strDes;
  while (*strDes != '\0') {
    strDes++;
  }
  while ((*strDes++ = *strSrc++) != '\0') {
    NULL;
  }
  return address;
}


x86 assembly (clang, -O0):
<myStrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
je     113b <myStrcat+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1171 <myStrcat+0x61>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <myStrcat+0x40>
jmp    1176 <myStrcat+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     11a9 <myStrcat+0x99>
jmp    1176 <myStrcat+0x66>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myStrcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %r14,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1140 <myStrcat+0x30>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rbx,%rcx,1),%edx
mov    %dl,-0x1(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1150 <myStrcat+0x40>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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