user: Converte this assembly snippet into its equivalent C code:

```asm
<dma_mm2s_status>:
  endbr64
  push   %rbx
  mov    $0x4,%esi
  call   <dma_get@plt>
  mov    $0x4,%edx
  lea    D138(%rip),%rdi
  mov    %eax,%ebx
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  test   $0x1,%bl
  je     L78
  xor    %eax,%eax
  lea    D90(%rip),%rdi
  call   <printf@plt>
  test   $0x2,%bl
  jne    L150
L119:
  test   $0x8,%bl
  jne    L96
L229:
  test   $0x10,%bl
  jne    L178
L102:
  test   $0x20,%bl
  jne    L140
L66:
  test   $0x40,%bl
  jne    L121
L182:
  test   $0x1,%bh
  jne    L195
L208:
  test   $0x2,%bh
  jne    L18
L71:
  test   $0x4,%bh
  jne    L84
L38:
  test   $0x10,%bh
  jne    L16
L220:
  test   $0x20,%bh
  jne    L62
L65:
  and    $0x40,%bh
  jne    L205
L177:
  mov    $0xa,%edi
  pop    %rbx
  jmp    1070 <putchar@plt>
  nopl   0x0(%rax,%rax,1)
L78:
  xor    %eax,%eax
  lea    D2(%rip),%rdi
  call   <printf@plt>
  test   $0x2,%bl
  je     L119
L150:
  xor    %eax,%eax
  lea    D64(%rip),%rdi
  call   <printf@plt>
  test   $0x8,%bl
  je     L229
L96:
  xor    %eax,%eax
  lea    D81(%rip),%rdi
  call   <printf@plt>
  test   $0x10,%bl
  je     L102
L178:
  xor    %eax,%eax
  lea    D134(%rip),%rdi
  call   <printf@plt>
  test   $0x20,%bl
  je     L66
L140:
  xor    %eax,%eax
  lea    D120(%rip),%rdi
  call   <printf@plt>
  test   $0x40,%bl
  je     L182
L121:
  xor    %eax,%eax
  lea    D117(%rip),%rdi
  call   <printf@plt>
  test   $0x1,%bh
  je     L208
L195:
  xor    %eax,%eax
  lea    D125(%rip),%rdi
  call   <printf@plt>
  test   $0x2,%bh
  je     L71
L18:
  xor    %eax,%eax
  lea    D111(%rip),%rdi
  call   <printf@plt>
  test   $0x4,%bh
  je     L38
L84:
  xor    %eax,%eax
  lea    D91(%rip),%rdi
  call   <printf@plt>
  test   $0x10,%bh
  je     L220
L16:
  xor    %eax,%eax
  lea    D66(%rip),%rdi
  call   <printf@plt>
  test   $0x20,%bh
  je     L65
L62:
  xor    %eax,%eax
  lea    D82(%rip),%rdi
  call   <printf@plt>
  and    $0x40,%bh
  je     L177
L205:
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  pop    %rbx
  jmp    1070 <putchar@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D138
datatype: string
name: disassemble_data
arguments: data_tag: D90
datatype: string
name: disassemble_data
arguments: data_tag: D2
datatype: string
name: disassemble_data
arguments: data_tag: D64
datatype: string
name: disassemble_data
arguments: data_tag: D81
datatype: string
name: disassemble_data
arguments: data_tag: D134
datatype: string
name: disassemble_data
arguments: data_tag: D120
datatype: string
name: disassemble_data
arguments: data_tag: D117
datatype: string
name: disassemble_data
arguments: data_tag: D125
datatype: string
name: disassemble_data
arguments: data_tag: D111
datatype: string
name: disassemble_data
arguments: data_tag: D91
datatype: string
name: disassemble_data
arguments: data_tag: D66
datatype: string
name: disassemble_data
arguments: data_tag: D82
datatype: string
name: disassemble_data
arguments: data_tag: D60
datatype: string

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

tool: D90:  halted

tool: D2:  running

tool: D64:  idle

tool: D81:  SGIncld

tool: D134:  DMAIntErr

tool: D120:  DMASlvErr

tool: D117:  DMADecErr

tool: D125:  SGIntErr

tool: D111:  SGSlvErr

tool: D91:  SGDecErr

tool: D66:  IOC_Irq

tool: D82:  Dly_Irq

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