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

```asm
<sayHello>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  mov    %rsi,%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rsp)
  mov    %rsp,%r12
  call   <strlen@plt>
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  add    $0x1,%eax
  mov    %eax,0x4(%rsp)
  xor    %eax,%eax
  call   <write@plt>
  cmp    $0xffffffff,%eax
  je     L84
L83:
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  cmp    $0x4,%eax
  jne    L45
  mov    (%rsp),%ecx
  test   %ecx,%ecx
  jne    L45
L71:
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  mov    $0x4,%edx
  mov    %ebp,%edi
  call   <write@plt>
  cmp    $0xffffffff,%eax
  je     L158
L154:
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  cmp    $0x4,%eax
  jne    L82
  mov    (%rsp),%edx
  test   %edx,%edx
  jne    L82
  mov    0x4(%rsp),%edx
  cmp    $0x1,%edx
  jne    L167
  nopl   0x0(%rax,%rax,1)
L113:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L116
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L82:
  lea    D45(%rip),%rdi
  call   <fatalError@plt>
  mov    0x4(%rsp),%edx
  cmp    $0x1,%edx
  je     L113
L167:
  xor    %eax,%eax
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <write@plt>
  cmp    $0xffffffff,%eax
  je     L156
L117:
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  cmp    $0x4,%eax
  jne    L57
  mov    (%rsp),%eax
  test   %eax,%eax
  je     L113
L57:
  lea    D28(%rip),%rdi
  call   <fatalError@plt>
  jmp    L113
  nop
L45:
  lea    D37(%rip),%rdi
  call   <fatalError@plt>
  jmp    L71
  nopl   0x0(%rax)
L158:
  lea    D53(%rip),%rdi
  call   <fatalError@plt>
  jmp    L154
  nopl   0x0(%rax)
L84:
  lea    D40(%rip),%rdi
  call   <fatalError@plt>
  jmp    L83
  nopl   0x0(%rax)
L156:
  lea    D3(%rip),%rdi
  call   <fatalError@plt>
  jmp    L117
L116:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D45
type_guessed: string
name: parse_data
arguments: tag: D28
type_guessed: string
name: parse_data
arguments: tag: D37
type_guessed: string
name: parse_data
arguments: tag: D53
type_guessed: string
name: parse_data
arguments: tag: D40
type_guessed: string
name: parse_data
arguments: tag: D3
type_guessed: string

tool: D45: Client protocol error 4

tool: D28: Client protocol error 6

tool: D37: Client protocol error 2

tool: D53: Client protocol error 3

tool: D40: Client protocol error 0

tool: D3: Client protocol error 5

assistant: ```c
int sayHello(int socketFD, char *username) {
  int serverResponse = 0;
  int argLength = strlen(username) + 1;
  int n = 0;
  if (write(socketFD, &serverResponse, 4) == -1)
    fatalError("Client protocol error 0");
  n = read(socketFD, &serverResponse, 4);
  if (n != 4 || serverResponse != 0) {
    fatalError("Client protocol error 2");
  }
  if (write(socketFD, &argLength, 4) == -1)
    fatalError("Client protocol error 3");
  n = read(socketFD, &serverResponse, 4);
  if (n != 4 || serverResponse != 0)
    fatalError("Client protocol error 4");
  if (argLength != 1) {
    if ((n = write(socketFD, username, argLength)) == -1)
      fatalError("Client protocol error 5");
    n = read(socketFD, &serverResponse, 4);
    if (n != 4 || serverResponse != 0)
      fatalError("Client protocol error 6");
  }
  return 0;
}
```