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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x410,%rsp
  mov    %edi,-0x404(%rbp)
  mov    %rsi,-0x410(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x2580,%esi
  lea    D74(%rip),%rax
  mov    %rax,%rdi
  call   <ser_init@plt>
  mov    %eax,-0x3f8(%rbp)
  mov    $0x2,%edi
  call   <sleep@plt>
  cmpl   $0xffffffff,-0x3f8(%rbp)
  jne    L18
  mov    $0x4d,%edi
  call   <exit@plt>
L18:
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x3f0(%rbp),%rdx
  mov    -0x3f8(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <ser_readln@plt>
  mov    %eax,-0x3f4(%rbp)
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x3f4(%rbp)
  je     L25
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L25:
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x3f4(%rbp)
  je     L36
  mov    -0x3f4(%rbp),%eax
  mov    %eax,%esi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rsi
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L36:
  mov    -0x3f4(%rbp),%edx
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rsi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L24
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rsi
  lea    D91(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L24:
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rsi
  lea    D91(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L28
  call   <__stack_chk_fail@plt>
L28:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D46
datatype: string
name: read_data
arguments: label: D74
datatype: string
name: read_data
arguments: label: D5
datatype: string
name: read_data
arguments: label: D31
datatype: string
name: read_data
arguments: label: D119
datatype: string
name: read_data
arguments: label: D33
datatype: string
name: read_data
arguments: label: D79
datatype: string
name: read_data
arguments: label: D35
datatype: string
name: read_data
arguments: label: D91
datatype: string
name: read_data
arguments: label: D89
datatype: string
name: read_data
arguments: label: D42
datatype: string

tool: D46: Start initialization process

tool: D74: /dev/ttyACM0

tool: D5: Arduino initialized

tool: D31: Read string is not 0-terminated.

tool: D119: Test program for testing libarduserial

tool: D33: Not the correct amount of characters was read [%i]


tool: D79: "%s" read

tool: D35: Failed to read the correct string from the arduino.

tool: D91: "%s" was read


tool: D89: String read from the arduino was correct.

tool: D42: Test: PASS

assistant: ```c
int main(int argc, char **argv) {
  int charactersAmount;
  char readBuffer[1000];
  int fd;
  printf("Start initialization process\n");
  fd = ser_init("/dev/ttyACM0", 9600);
  sleep(2);
  if (fd == -1) {
    exit(77);
  }
  printf("Arduino initialized\n");
  charactersAmount = ser_readln(fd, readBuffer);
  if (strlen(readBuffer) != charactersAmount) {
    printf("Read string is not 0-terminated.\n");
    exit(1);
  }
  if (charactersAmount != strlen("Test program for testing libarduserial")) {
    printf("Not the correct amount of characters was read [%i]\n", charactersAmount);
    printf("\"%s\" read", readBuffer);
    exit(1);
  }
  if (strncmp("Test program for testing libarduserial", readBuffer, charactersAmount) != 0) {
    printf("Failed to read the correct string from the arduino.\n");
    printf("\"%s\" was read\n", readBuffer);
    exit(1);
  }
  printf("String read from the arduino was correct.\n");
  printf("\"%s\" was read\n", readBuffer);
  printf("Test: PASS\n");
  exit(0);
}
```