user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  movl   $0x1,-0x24(%rbp)
  mov    $0xe100,%esi
  mov    $0x17d7840,%edi
  call   <setup_uart@plt>
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <uart_puts@plt>
  mov    $0x20000050,%eax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
  mov    $0x20000030,%edx
  mov    -0x20(%rbp),%eax
  mov    %eax,(%rdx)
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <uart_puts@plt>
  mov    $0x7ffc,%ebx
  mov    $0x3,%esi
  mov    $0x1,%edi
  call   <build_header@plt>
  mov    %eax,(%rbx)
  mov    $0x7ffc,%eax
  movl   $0xfffffff,(%rax)
  mov    $0x7ffc,%eax
  movl   $0x0,(%rax)
  jmp    L85
L13:
  mov    $0x8000,%eax
  mov    (%rax),%eax
  test   %eax,%eax
  js     L85
  mov    $0x7ffc,%eax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <get_flit_type@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x1,-0x18(%rbp)
  jne    L61
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <uart_puts@plt>
  mov    -0x24(%rbp),%eax
  mov    $0x0,%edx
  mov    $0xa,%esi
  mov    %eax,%edi
  call   <uart_print_num@plt>
  mov    $0xa,%edi
  call   <uart_putchar@plt>
  mov    $0x7ffc,%ebx
  mov    $0x3,%esi
  mov    $0x1,%edi
  call   <build_header@plt>
  mov    %eax,(%rbx)
  jmp    L85
L61:
  cmpl   $0x4,-0x18(%rbp)
  jne    L53
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <get_flit_payload@plt>
  mov    %eax,-0x14(%rbp)
  mov    $0x7ffc,%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
  jmp    L85
L53:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <get_flit_payload@plt>
  mov    %eax,-0x14(%rbp)
  mov    $0x7ffc,%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
L85:
  cmpl   $0x64,-0x24(%rbp)
  jbe    L13
  jmp    L30
L48:
  mov    $0x7ffc,%eax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <get_flit_type@plt>
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x24(%rbp)
L30:
  mov    $0x8000,%eax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L48
  mov    $0x0,%eax
  call   <test_plasma_funcitons@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D7
datatype: string
name: parse_data
arguments: label: D16
datatype: string
name: parse_data
arguments: label: D0
datatype: string

tool: D7: UART TEST: If you can read this, then UART output works!


tool: D16: 

Beginning communication test



tool: D0: Sending packet number 

assistant: ```c
int main(int argc, char const *argv[]) {
  unsigned flit;
  unsigned flit_type;
  unsigned payload;
  unsigned packet_counter = 1;
  setup_uart(25000000, 57600);
  uart_puts("UART TEST: If you can read this, then UART output works!\n");
  unsigned gpio_in = (*(volatile unsigned int *)(0x20000050));
  (*(volatile unsigned int *)(0x20000030) = (gpio_in));
  uart_puts("\n\nBeginning communication test\n\n");
  (*(volatile unsigned int *)0x7FFCu = (build_header(1, 3)));
  (*(volatile unsigned int *)0x7FFCu = (0b1111111111111111111111111111));
  (*(volatile unsigned int *)0x7FFCu = (0));
  while (packet_counter <= 100) {
    if (((*(volatile unsigned int *)0x8000u) & 0x80000000) == 0) {
      flit = (*(volatile unsigned int *)0x7FFCu);
      flit_type = get_flit_type(flit);
      if (flit_type == 0b001) {
        uart_puts("Sending packet number ");
        uart_print_num(packet_counter, 10, 0);
        uart_putchar('\n');
        (*(volatile unsigned int *)0x7FFCu = (build_header(1, 3)));
      } else if (flit_type == 0b100) {
        payload = get_flit_payload(flit);
        (*(volatile unsigned int *)0x7FFCu = (payload));
        packet_counter++;
      } else {
        payload = get_flit_payload(flit);
        (*(volatile unsigned int *)0x7FFCu = (payload));
      }
    }
  }
  while (((*(volatile unsigned int *)0x8000u) & 0x80000000) == 0) {
    flit = (*(volatile unsigned int *)0x7FFCu);
    flit_type = get_flit_type(flit);
    packet_counter++;
  }
  test_plasma_funcitons();
  return 0;
}
```