user: Translate the below assembly code into C programming language:

```asm
<ta>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x818,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  lea    D90(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edx
  mov    $0xe100,%esi
  lea    D110(%rip),%rdi
  call   <serOpen@plt>
  mov    %eax,%ebx
  lea    D68(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0x1,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %rsp,%r13
  mov    $0x800,%edx
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <serRead@plt>
  mov    %ebx,%edi
  call   <serDataAvailable@plt>
  mov    %eax,%edx
  lea    D46(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x2,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  lea    D83(%rip),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r12,%rsi
  mov    %ebx,%edi
  call   <serWrite@plt>
  mov    %eax,%edx
  lea    D66(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x3,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    $0xaa,%esi
  mov    %ebx,%edi
  call   <serWriteByte@plt>
  mov    $0x55,%esi
  mov    %ebx,%edi
  call   <serWriteByte@plt>
  mov    $0x0,%esi
  mov    %ebx,%edi
  call   <serWriteByte@plt>
  mov    $0xff,%esi
  mov    %ebx,%edi
  call   <serWriteByte@plt>
  mov    %eax,%edx
  lea    D151(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x4,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  movsd  D144(%rip),%xmm0
  call   <time_sleep@plt>
  mov    %ebx,%edi
  call   <serDataAvailable@plt>
  mov    %eax,%ebp
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    0x4(%rax),%ecx
  lea    D46(%rip),%r9
  mov    $0x0,%r8d
  mov    %ebp,%edx
  mov    $0x5,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <serRead@plt>
  mov    %eax,%ebp
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%ecx
  lea    D129(%rip),%r9
  mov    $0x0,%r8d
  mov    %ebp,%edx
  mov    $0x6,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  test   %ebp,%ebp
  js     L13
  movslq %ebp,%rbp
  movb   $0x0,(%rsp,%rbp,1)
L13:
  mov    %rsp,%rsi
  lea    D83(%rip),%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  lea    D129(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x7,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %ebx,%edi
  call   <serReadByte@plt>
  mov    %eax,%edx
  lea    D114(%rip),%r9
  mov    $0x0,%r8d
  mov    $0xaa,%ecx
  mov    $0x8,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %ebx,%edi
  call   <serReadByte@plt>
  mov    %eax,%edx
  lea    D114(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x55,%ecx
  mov    $0x9,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %ebx,%edi
  call   <serReadByte@plt>
  mov    %eax,%edx
  lea    D114(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0xa,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %ebx,%edi
  call   <serReadByte@plt>
  mov    %eax,%edx
  lea    D114(%rip),%r9
  mov    $0x0,%r8d
  mov    $0xff,%ecx
  mov    $0xb,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %ebx,%edi
  call   <serDataAvailable@plt>
  mov    %eax,%edx
  lea    D153(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0xc,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    %ebx,%edi
  call   <serClose@plt>
  mov    %eax,%edx
  lea    D161(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0xd,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x818,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D90
datatype: string
name: unpack_data
arguments: data_label: D110
datatype: string
name: unpack_data
arguments: data_label: D68
datatype: string
name: unpack_data
arguments: data_label: D46
datatype: string
name: unpack_data
arguments: data_label: D83
datatype: string
name: unpack_data
arguments: data_label: D66
datatype: string
name: unpack_data
arguments: data_label: D151
datatype: string
name: unpack_data
arguments: data_label: D144
datatype: f64
name: unpack_data
arguments: data_label: D129
datatype: string
name: unpack_data
arguments: data_label: D114
datatype: string
name: unpack_data
arguments: data_label: D153
datatype: string
name: unpack_data
arguments: data_label: D161
datatype: string

tool: D90: Serial link tests.


tool: D110: /dev/ttyAMA0

tool: D68: serial open

tool: D46: serial data available

tool: D83: To be, or not to be, that is the question-Whether 'tis Nobler in the mind to sufferThe Slings and Arrows of outrageous Fortune,Or to take Arms against a Sea of troubles,

tool: D66: serial write

tool: D151: serial write byte

tool: D144: 0.1

tool: D129: serial read

tool: D114: serial read byte

tool: D153: serial data availabe

tool: D161: serial close

assistant: ```c
void ta() {
  int h, b, e;
  char *TEXT;
  char text[2048];
  printf("Serial link tests.\n");
  h = serOpen("/dev/ttyAMA0", 57600, 0);
  CHECK(10, 1, h, 0, 0, "serial open");
  b = serRead(h, text, sizeof(text));
  b = serDataAvailable(h);
  CHECK(10, 2, b, 0, 0, "serial data available");
  TEXT = "To be, or not to be, that is the question-Whether 'tis Nobler in the mind to sufferThe Slings and Arrows of outrageous Fortune,Or to take Arms against a Sea of troubles,";
  e = serWrite(h, TEXT, strlen(TEXT));
  CHECK(10, 3, e, 0, 0, "serial write");
  e = serWriteByte(h, 0xAA);
  e = serWriteByte(h, 0x55);
  e = serWriteByte(h, 0x00);
  e = serWriteByte(h, 0xFF);
  CHECK(10, 4, e, 0, 0, "serial write byte");
  time_sleep(0.1);
  b = serDataAvailable(h);
  CHECK(10, 5, b, strlen(TEXT) + 4, 0, "serial data available");
  b = serRead(h, text, strlen(TEXT));
  CHECK(10, 6, b, strlen(TEXT), 0, "serial read");
  if (b >= 0)
    text[b] = 0;
  CHECK(10, 7, strcmp(TEXT, text), 0, 0, "serial read");
  b = serReadByte(h);
  CHECK(10, 8, b, 0xAA, 0, "serial read byte");
  b = serReadByte(h);
  CHECK(10, 9, b, 0x55, 0, "serial read byte");
  b = serReadByte(h);
  CHECK(10, 10, b, 0x00, 0, "serial read byte");
  b = serReadByte(h);
  CHECK(10, 11, b, 0xFF, 0, "serial read byte");
  b = serDataAvailable(h);
  CHECK(10, 12, b, 0, 0, "serial data availabe");
  e = serClose(h);
  CHECK(10, 13, e, 0, 0, "serial close");
}
```