user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Concatenate2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,%r15
  mov    %rdx,%r12
  mov    %ecx,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsi,%rdi
  call   <GetStringLength@plt>
  mov    %eax,%r14d
  mov    %r12,%rdi
  call   <GetStringLength@plt>
  mov    %eax,%r13d
  mov    %r14d,%eax
  or     %r13d,%eax
  js     L105
  cmp    $0xffffffff,%ebx
  je     L85
  cmp    %ebx,%r14d
  jl     L59
  test   %ebx,%ebx
  jns    L109
L59:
  mov    -0x48(%rbp),%rdi
  call   <ReturnNullMallocStack@plt>
  jmp    L120
L105:
  mov    -0x48(%rbp),%rdi
  call   <ReturnNullMallocStack@plt>
  jmp    L120
L85:
  mov    %r14d,%ebx
L109:
  lea    0x0(%r13,%rbx,1),%eax
  sub    %r14d,%eax
  mov    $0x0,%edx
  cmovs  %edx,%eax
  add    %eax,%r14d
  lea    D5(%rip),%rsi
  mov    %r14d,%edi
  call   <GetStackSize@plt>
  cltq
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L140:
  cmp    %rdx,%rsp
  je     L20
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L140
L20:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L5
  orq    $0x0,-0x8(%rsp,%rax,1)
L5:
  mov    %rsp,%rsi
  test   %r14d,%r14d
  jle    L137
  mov    %r14d,%edi
  mov    $0x0,%eax
  mov    $0xffffffff,%edx
  jmp    L171
L137:
  mov    $0x0,%r14d
L12:
  movslq %r14d,%rax
  movb   $0x0,(%rsi,%rax,1)
  mov    %r14d,%edx
  mov    -0x48(%rbp),%rdi
  call   <ReturnOutputMallocStack@plt>
L120:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L130
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L17:
  mov    $0x0,%edx
L46:
  movslq %edx,%rcx
  movzbl (%r12,%rcx,1),%ecx
  add    $0x1,%edx
L175:
  mov    %cl,(%rsi,%rax,1)
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L12
L171:
  cmp    $0xffffffff,%edx
  jne    L69
  cmp    %eax,%ebx
  je     L17
L69:
  cmp    %edx,%r13d
  je     L84
  cmp    $0xffffffff,%edx
  jne    L46
L84:
  movzbl (%r15,%rax,1),%ecx
  mov    $0xffffffff,%edx
  jmp    L175
L130:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D5
type: string

tool: D5: char

assistant: ```c
char *Concatenate2(char *output, char *first, char *second, const int startI) {
  int length1 = GetStringLength(first);
  int length2 = GetStringLength(second);
  if (length1 < 0 || length2 < 0) {
    return ReturnNullMallocStack(output);
  }
  int startI2 = startI;
  if (startI2 == -1)
    startI2 = length1;
  if (startI2 > length1 || startI2 < 0) {
    return ReturnNullMallocStack(output);
  }
  int extra = startI2 + length2 - length1;
  if (extra < 0)
    extra = 0;
  int length0 = length1 + (extra < 0 ? length2 : extra);
  char output2[GetStackSize(length0, "char")];
  int i = 0;
  int i2 = -1;
  for (i = 0; i < length0; i++) {
    if (i2 == -1 && i == startI2)
      i2 = 0;
    else if (i2 == length2)
      i2 = -1;
    output2[i] = (i2 == -1 ? first[i] : second[i2]);
    if (i2 != -1)
      i2++;
  }
  output2[i] = '\0';
  return ReturnOutputMallocStack(output, output2, i);
}
```