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

```asm
<dma_mm2s_status>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <dma_get@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    $0x4,%edx
  mov    %eax,%esi
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x4(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L32
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L69
L32:
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L69:
  mov    -0x4(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L30
  lea    D131(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L30:
  mov    -0x4(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L9
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L9:
  mov    -0x4(%rbp),%eax
  and    $0x10,%eax
  test   %eax,%eax
  je     L116
  lea    D105(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L116:
  mov    -0x4(%rbp),%eax
  and    $0x20,%eax
  test   %eax,%eax
  je     L6
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L6:
  mov    -0x4(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L123
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L123:
  mov    -0x4(%rbp),%eax
  and    $0x100,%eax
  test   %eax,%eax
  je     L54
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L54:
  mov    -0x4(%rbp),%eax
  and    $0x200,%eax
  test   %eax,%eax
  je     L127
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L127:
  mov    -0x4(%rbp),%eax
  and    $0x400,%eax
  test   %eax,%eax
  je     L105
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L105:
  mov    -0x4(%rbp),%eax
  and    $0x1000,%eax
  test   %eax,%eax
  je     L41
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L41:
  mov    -0x4(%rbp),%eax
  and    $0x2000,%eax
  test   %eax,%eax
  je     L119
  lea    D122(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L119:
  mov    -0x4(%rbp),%eax
  and    $0x4000,%eax
  test   %eax,%eax
  je     L67
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L67:
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D107
data_type: string
name: extract_symbolic_data
arguments: data_tag: D59
data_type: string
name: extract_symbolic_data
arguments: data_tag: D78
data_type: string
name: extract_symbolic_data
arguments: data_tag: D131
data_type: string
name: extract_symbolic_data
arguments: data_tag: D30
data_type: string
name: extract_symbolic_data
arguments: data_tag: D105
data_type: string
name: extract_symbolic_data
arguments: data_tag: D23
data_type: string
name: extract_symbolic_data
arguments: data_tag: D6
data_type: string
name: extract_symbolic_data
arguments: data_tag: D8
data_type: string
name: extract_symbolic_data
arguments: data_tag: D11
data_type: string
name: extract_symbolic_data
arguments: data_tag: D22
data_type: string
name: extract_symbolic_data
arguments: data_tag: D98
data_type: string
name: extract_symbolic_data
arguments: data_tag: D122
data_type: string
name: extract_symbolic_data
arguments: data_tag: D62
data_type: string

tool: D107: Memory-mapped to stream status (0x%08x@0x%02x):

tool: D59:  halted

tool: D78:  running

tool: D131:  idle

tool: D30:  SGIncld

tool: D105:  DMAIntErr

tool: D23:  DMASlvErr

tool: D6:  DMADecErr

tool: D8:  SGIntErr

tool: D11:  SGSlvErr

tool: D22:  SGDecErr

tool: D98:  IOC_Irq

tool: D122:  Dly_Irq

tool: D62:  Err_Irq

assistant: ```c
void dma_mm2s_status(unsigned int *dma_virtual_address) {
  unsigned int status = dma_get(dma_virtual_address, 0x04);
  printf("Memory-mapped to stream status (0x%08x@0x%02x):", status, 0x04);
  if (status & 0x00000001)
    printf(" halted");
  else
    printf(" running");
  if (status & 0x00000002)
    printf(" idle");
  if (status & 0x00000008)
    printf(" SGIncld");
  if (status & 0x00000010)
    printf(" DMAIntErr");
  if (status & 0x00000020)
    printf(" DMASlvErr");
  if (status & 0x00000040)
    printf(" DMADecErr");
  if (status & 0x00000100)
    printf(" SGIntErr");
  if (status & 0x00000200)
    printf(" SGSlvErr");
  if (status & 0x00000400)
    printf(" SGDecErr");
  if (status & 0x00001000)
    printf(" IOC_Irq");
  if (status & 0x00002000)
    printf(" Dly_Irq");
  if (status & 0x00004000)
    printf(" Err_Irq");
  printf("\n");
}
```