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

```asm
<ta>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x830,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%edx
  mov    $0xe100,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <serOpen@plt>
  mov    %eax,-0x824(%rbp)
  mov    -0x824(%rbp),%eax
  lea    D108(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0x1,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  lea    -0x810(%rbp),%rcx
  mov    -0x824(%rbp),%eax
  mov    $0x800,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <serRead@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serDataAvailable@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x820(%rbp),%eax
  lea    D90(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0x2,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  lea    D139(%rip),%rax
  mov    %rax,-0x818(%rbp)
  mov    -0x818(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x818(%rbp),%rcx
  mov    -0x824(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <serWrite@plt>
  mov    %eax,-0x81c(%rbp)
  mov    -0x81c(%rbp),%eax
  lea    D134(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0x3,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    $0xaa,%esi
  mov    %eax,%edi
  call   <serWriteByte@plt>
  mov    %eax,-0x81c(%rbp)
  mov    -0x824(%rbp),%eax
  mov    $0x55,%esi
  mov    %eax,%edi
  call   <serWriteByte@plt>
  mov    %eax,-0x81c(%rbp)
  mov    -0x824(%rbp),%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <serWriteByte@plt>
  mov    %eax,-0x81c(%rbp)
  mov    -0x824(%rbp),%eax
  mov    $0xff,%esi
  mov    %eax,%edi
  call   <serWriteByte@plt>
  mov    %eax,-0x81c(%rbp)
  mov    -0x81c(%rbp),%eax
  lea    D159(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0x4,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    D25(%rip),%rax
  movq   %rax,%xmm0
  call   <time_sleep@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serDataAvailable@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x818(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    0x4(%rax),%edx
  mov    -0x820(%rbp),%eax
  lea    D90(%rip),%r9
  mov    $0x0,%r8d
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0x5,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x818(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x810(%rbp),%rcx
  mov    -0x824(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <serRead@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x818(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x820(%rbp),%eax
  lea    D166(%rip),%r9
  mov    $0x0,%r8d
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0x6,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  cmpl   $0x0,-0x820(%rbp)
  js     L16
  mov    -0x820(%rbp),%eax
  cltq
  movb   $0x0,-0x810(%rbp,%rax,1)
L16:
  lea    -0x810(%rbp),%rdx
  mov    -0x818(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  lea    D166(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0x7,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serReadByte@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x820(%rbp),%eax
  lea    D124(%rip),%r9
  mov    $0x0,%r8d
  mov    $0xaa,%ecx
  mov    %eax,%edx
  mov    $0x8,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serReadByte@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x820(%rbp),%eax
  lea    D124(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x55,%ecx
  mov    %eax,%edx
  mov    $0x9,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serReadByte@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x820(%rbp),%eax
  lea    D124(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0xa,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serReadByte@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x820(%rbp),%eax
  lea    D124(%rip),%r9
  mov    $0x0,%r8d
  mov    $0xff,%ecx
  mov    %eax,%edx
  mov    $0xb,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serDataAvailable@plt>
  mov    %eax,-0x820(%rbp)
  mov    -0x820(%rbp),%eax
  lea    D74(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0xc,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  mov    -0x824(%rbp),%eax
  mov    %eax,%edi
  call   <serClose@plt>
  mov    %eax,-0x81c(%rbp)
  mov    -0x81c(%rbp),%eax
  lea    D85(%rip),%r9
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edx
  mov    $0xd,%esi
  mov    $0xa,%edi
  call   <CHECK@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D76
type: string
name: disassemble_data
arguments: label: D48
type: string
name: disassemble_data
arguments: label: D108
type: string
name: disassemble_data
arguments: label: D90
type: string
name: disassemble_data
arguments: label: D139
type: string
name: disassemble_data
arguments: label: D134
type: string
name: disassemble_data
arguments: label: D159
type: string
name: disassemble_data
arguments: label: D25
type: f64
name: disassemble_data
arguments: label: D166
type: string
name: disassemble_data
arguments: label: D124
type: string
name: disassemble_data
arguments: label: D74
type: string
name: disassemble_data
arguments: label: D85
type: string

tool: D76: Serial link tests.


tool: D48: /dev/ttyAMA0

tool: D108: serial open

tool: D90: serial data available

tool: D139: 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: D134: serial write

tool: D159: serial write byte

tool: D25: 0.1

tool: D166: serial read

tool: D124: serial read byte

tool: D74: serial data availabe

tool: D85: 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");
}
```