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    D6(%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    D5(%rip),%rax
  mov    %rax,%rdi
  call   <uart_puts@plt>
  mov    $0x7ffc,%ebx
  mov    $0x3,%esi
  mov    $0x2,%edi
  call   <build_header@plt>
  mov    %eax,(%rbx)
  mov    $0x7ffc,%eax
  movl   $0xfffffff,(%rax)
  mov    $0x7ffc,%eax
  movl   $0x0,(%rax)
  jmp    L4
L75:
  mov    $0x8000,%eax
  mov    (%rax),%eax
  test   %eax,%eax
  js     L4
  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    L45
  lea    D17(%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    $0x2,%edi
  call   <build_header@plt>
  mov    %eax,(%rbx)
  jmp    L4
L45:
  cmpl   $0x4,-0x18(%rbp)
  jne    L59
  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    L4
L59:
  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)
L4:
  cmpl   $0x64,-0x24(%rbp)
  jbe    L75
  jmp    L8
L22:
  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)
L8:
  mov    $0x8000,%eax
  mov    (%rax),%eax
  test   %eax,%eax
  jns    L22
  mov    $0x0,%eax
  call   <test_plasma_funcitons@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D6
data_type: string
name: disassemble_data
arguments: data_label: D5
data_type: string
name: disassemble_data
arguments: data_label: D17
data_type: string

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


tool: D5: 

Beginning communication test



tool: D17: 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(2, 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(2, 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;
}
```