user: What would the C source look like for the assembly code provided here:

```asm
<print_mem>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x4,-0x30(%rbp)
  je     L97
  cmpl   $0x4,-0x30(%rbp)
  jg     L40
  cmpl   $0x1,-0x30(%rbp)
  je     L2
  cmpl   $0x2,-0x30(%rbp)
  je     L154
  jmp    L40
L2:
  movl   $0x0,-0x20(%rbp)
  jmp    L141
L54:
  mov    -0x20(%rbp),%eax
  and    $0xf,%eax
  test   %eax,%eax
  jne    L167
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L167:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x1c(%rbp)
  addl   $0x1,-0x20(%rbp)
L141:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L54
  jmp    L18
L154:
  movl   $0x0,-0x20(%rbp)
  jmp    L31
L125:
  mov    -0x20(%rbp),%eax
  and    $0x7,%eax
  test   %eax,%eax
  jne    L104
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L104:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x2,-0x1c(%rbp)
  addl   $0x1,-0x20(%rbp)
L31:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L125
  jmp    L18
L97:
  movl   $0x0,-0x20(%rbp)
  jmp    L123
L117:
  mov    -0x20(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L87
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L87:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x4,-0x1c(%rbp)
  addl   $0x1,-0x20(%rbp)
L123:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L117
  jmp    L18
L40:
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
L18:
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D29
type: string
name: extract_symbolic_data
arguments: tag: D41
type: string
name: extract_symbolic_data
arguments: tag: D22
type: string
name: extract_symbolic_data
arguments: tag: D54
type: string
name: extract_symbolic_data
arguments: tag: D12
type: string
name: extract_symbolic_data
arguments: tag: D77
type: string

tool: D29: 
0x%08X: 

tool: D41:  %02X

tool: D22:  %04X

tool: D54:  %08X

tool: D12: error value!

tool: D77: 


assistant: ```c
void print_mem(void *addr, uint32_t count, uint32_t size) {
  int i;
  uint8_t *addr8 = addr;
  uint16_t *addr16 = addr;
  uint32_t *addr32 = addr;
  uint32_t g_paddr;
  g_paddr = (uint32_t)addr;
  switch (size) {
  case 1:
    for (i = 0; i < count; i++) {
      if ((i % 16) == 0)
        printf("\n0x%08X: ", g_paddr);
      printf(" %02X", addr8[i]);
      g_paddr++;
    }
    break;
  case 2:
    for (i = 0; i < count; i++) {
      if ((i % 8) == 0)
        printf("\n0x%08X: ", g_paddr);
      printf(" %04X", addr16[i]);
      g_paddr += 2;
    }
    break;
  case 4:
    for (i = 0; i < count; i++) {
      if ((i % 4) == 0)
        printf("\n0x%08X: ", g_paddr);
      printf(" %08X", addr32[i]);
      g_paddr += 4;
    }
    break;
  default:
    printf("error value!\n");
    break;
  }
  printf("\n\n");
}
```