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

```asm
<addValue>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rdi
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %eax,%r15d
  call   <strlen@plt>
  test   %r15d,%r15d
  je     L269
  mov    %eax,%r13d
  test   %eax,%eax
  je     L269
  mov    $0x800,%edi
  call   <malloc@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <searchKeyIndex@plt>
  mov    %eax,%ecx
  cmp    $0xffffffff,%eax
  je     L247
  test   %eax,%eax
  jle    L58
  lea    0x1(%rbx),%rdi
  mov    %rbp,%rdx
  mov    %eax,%esi
  sub    %rdi,%rdx
  lea    -0x1(%rax),%eax
  cmp    $0xe,%rdx
  jbe    L56
  cmp    $0x6,%eax
  jbe    L56
  cmp    $0xe,%eax
  jbe    L381
  mov    %ecx,%edx
  xor    %eax,%eax
  shr    $0x4,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L306:
  movdqu (%rbx,%rax,1),%xmm0
  movups %xmm0,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L306
  mov    %ecx,%edx
  and    $0xfffffff0,%edx
  mov    %edx,%eax
  cmp    %edx,%ecx
  je     L158
  mov    %ecx,%esi
  sub    %edx,%esi
  lea    -0x1(%rsi),%edi
  cmp    $0x6,%edi
  jbe    L255
L404:
  mov    (%rbx,%rdx,1),%rdi
  mov    %rdi,0x0(%rbp,%rdx,1)
  mov    %esi,%edx
  and    $0xfffffff8,%edx
  add    %edx,%eax
  cmp    %esi,%edx
  je     L158
L255:
  movslq %eax,%rdx
  movzbl (%rbx,%rdx,1),%esi
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x1(%rax),%edx
  cmp    %edx,%ecx
  jle    L158
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%esi
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x2(%rax),%edx
  cmp    %edx,%ecx
  jle    L158
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%esi
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x3(%rax),%edx
  cmp    %edx,%ecx
  jle    L158
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%esi
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x4(%rax),%edx
  cmp    %edx,%ecx
  jle    L158
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%esi
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x5(%rax),%edx
  cmp    %ecx,%edx
  jge    L158
  movslq %edx,%rdx
  add    $0x6,%eax
  movzbl (%rbx,%rdx,1),%esi
  mov    %sil,0x0(%rbp,%rdx,1)
  cmp    %eax,%ecx
  jle    L158
  cltq
  movzbl (%rbx,%rax,1),%edx
  mov    %dl,0x0(%rbp,%rax,1)
L158:
  movslq %ecx,%rax
  add    $0x1,%ecx
  add    %rbp,%rax
  movslq %ecx,%r8
L153:
  movb   $0x3a,(%rax)
  test   %r13d,%r13d
  jle    L278
  movslq %ecx,%rax
  movslq %r13d,%rdi
  add    %rax,%rdi
  sub    %rax,%r12
  jmp    L82
  nopl   0x0(%rax)
L155:
  mov    %dl,0x0(%rbp,%rax,1)
  lea    0x1(%rax),%esi
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L12
L82:
  movzbl (%r12,%rax,1),%edx
  mov    %eax,%esi
  test   %dl,%dl
  jne    L155
L49:
  add    %rbp,%rax
  movb   $0x3b,(%rax)
  cmpb   $0x3b,(%rbx,%r8,1)
  je     L345
  lea    0x1(%rcx),%edx
  movslq %edx,%rdx
  nopw   0x0(%rax,%rax,1)
L372:
  mov    %edx,%ecx
  add    $0x1,%rdx
  cmpb   $0x3b,-0x1(%rbx,%rdx,1)
  jne    L372
L345:
  cmp    $0x7ff,%ecx
  jg     L183
  mov    $0x7ff,%eax
  movslq %esi,%rdi
  lea    0x1(%rsi),%edx
  sub    %ecx,%eax
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdi,1),%rsi
  lea    0x2(%rdi,%rax,1),%r8
  movslq %ecx,%rax
  sub    %rdi,%rax
  add    %rax,%rbx
  jmp    L71
  nopw   0x0(%rax,%rax,1)
L406:
  mov    %cl,(%rsi)
  movslq %edx,%rcx
  add    $0x1,%rdx
  lea    0x1(%rsi),%rsi
  cmp    %r8,%rdx
  je     L262
L71:
  movzbl -0x1(%rbx,%rdx,1),%ecx
  mov    %rsi,%rax
  test   %cl,%cl
  jne    L406
L183:
  movb   $0x0,(%rax)
  xor    %eax,%eax
L149:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L269:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L262:
  lea    0x0(%rbp,%rcx,1),%rax
  movb   $0x0,(%rax)
  xor    %eax,%eax
  jmp    L149
  nopl   0x0(%rax)
L12:
  movslq %esi,%rax
  jmp    L49
L247:
  movzbl (%rbx),%edx
  test   %dl,%dl
  je     L85
  mov    $0x1,%eax
L141:
  mov    %dl,-0x1(%rbp,%rax,1)
  movslq %eax,%rsi
  mov    %rax,%rcx
  add    $0x1,%rax
  movzbl -0x1(%rbx,%rax,1),%edx
  test   %dl,%dl
  jne    L141
  lea    0x1(%rsi),%edi
  lea    0x2(%rsi),%edx
  lea    0x0(%rbp,%rcx,1),%rax
  movslq %edi,%r8
  movslq %edx,%rdx
L387:
  movzbl (%r14),%ecx
  test   %cl,%cl
  je     L30
  lea    0x1(%rsi),%eax
  sub    %rsi,%r14
  cltq
  nopl   0x0(%rax,%rax,1)
L13:
  mov    %cl,-0x1(%rbp,%rax,1)
  mov    %eax,%edx
  add    $0x1,%rax
  movzbl -0x1(%r14,%rax,1),%ecx
  test   %cl,%cl
  jne    L13
  movslq %edx,%rcx
  lea    0x1(%rdx),%edi
  add    $0x2,%edx
  lea    0x0(%rbp,%rcx,1),%rax
  movslq %edi,%r8
  movslq %edx,%rdx
L30:
  movb   $0x3a,(%rax)
  movzbl (%r12),%ecx
  test   %cl,%cl
  je     L362
  lea    0x1(%rdi),%eax
  movslq %edi,%rdi
  cltq
  sub    %rdi,%r12
  nop
L235:
  mov    %cl,-0x1(%rbp,%rax,1)
  mov    %eax,%edx
  add    $0x1,%rax
  movzbl -0x1(%r12,%rax,1),%ecx
  test   %cl,%cl
  jne    L235
  movslq %edx,%r8
  add    $0x1,%edx
  movslq %edx,%rdx
L362:
  movb   $0x3b,0x0(%rbp,%r8,1)
  xor    %eax,%eax
  movb   $0x0,0x0(%rbp,%rdx,1)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L56:
  mov    %ecx,%esi
  xor    %eax,%eax
  nopl   0x0(%rax)
L28:
  movzbl (%rbx,%rax,1),%edx
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L28
  jmp    L158
  xchg   %ax,%ax
L58:
  mov    %rbp,%rax
  mov    $0x1,%r8d
  mov    $0x1,%ecx
  jmp    L153
L381:
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L404
L278:
  mov    %r8,%rax
  mov    %ecx,%esi
  jmp    L49
L85:
  mov    %rbp,%rax
  mov    $0x2,%edx
  mov    $0x1,%r8d
  xor    %esi,%esi
  mov    $0x1,%edi
  jmp    L387
```

assistant: ```c
int addValue(const char *configurationBuffer, const char *targetKey, const char *value, char *resultConfigurationBuffer, int resultConfigurationBufferSize) {
  const int key_size = (unsigned)strlen(targetKey);
  const int value_size = (unsigned)strlen(value);
  if (key_size == 0 || value_size == 0)
    return 1;
  int keyIndex = 0;
  char *writeBuffer = (char *)malloc(sizeof(char) * 2048);
  keyIndex = searchKeyIndex(configurationBuffer, targetKey);
  int tempIndex = 0;
  int tempUpdateIndex = 0;
  int i = 0;
  if (keyIndex == -1) {
    while (configurationBuffer[i] != '\0') {
      resultConfigurationBuffer[i] = configurationBuffer[i];
      i++;
    }
    while (targetKey[tempIndex] != '\0') {
      resultConfigurationBuffer[i] = targetKey[tempIndex];
      i++;
      tempIndex++;
    }
    resultConfigurationBuffer[i] = ':';
    i++;
    tempIndex = 0;
    while (value[tempIndex] != '\0') {
      resultConfigurationBuffer[i] = value[tempIndex];
      i++;
      tempIndex++;
    }
    resultConfigurationBuffer[i] = ';';
    i++;
    resultConfigurationBuffer[i] = '\0';
    return 0;
  }
  for (i = 0; i < keyIndex; i++) {
    resultConfigurationBuffer[i] = configurationBuffer[i];
  }
  resultConfigurationBuffer[i] = ':';
  i++;
  tempUpdateIndex = i;
  for (tempIndex = 0; tempIndex < value_size; tempIndex++) {
    if (value[tempIndex] == '\0')
      break;
    resultConfigurationBuffer[tempUpdateIndex] = value[tempIndex];
    tempUpdateIndex++;
  }
  resultConfigurationBuffer[tempUpdateIndex] = ';';
  tempIndex = tempUpdateIndex;
  while (configurationBuffer[i] != ';') {
    i++;
  }
  for (i = i; i < 2048; i++) {
    if (configurationBuffer[i] == '\0')
      break;
    resultConfigurationBuffer[tempIndex] = configurationBuffer[i];
    tempIndex++;
  }
  resultConfigurationBuffer[tempIndex] = '\0';
  return 0;
}
```