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

```asm
<meter_monitor_dump>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x38(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x1,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2,%al
  jne    L7
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0x7,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x3,%al
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  shr    $0x5,%al
  movzbl %al,%eax
  and    $0x7,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <get_meter_type_string@plt>
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  shr    $0x5,%al
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movq   $0x0,-0x18(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L22
L41:
  mov    -0x18(%rbp),%rax
  shl    $0x8,%rax
  mov    %rax,%rcx
  mov    -0x2c(%rbp),%eax
  add    $0x3,%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %rcx,%rax
  mov    %rax,-0x18(%rbp)
  addl   $0x1,-0x2c(%rbp)
L22:
  mov    -0x2c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L41
  movl   $0x0,-0x2c(%rbp)
  jmp    L50
L40:
  mov    -0x10(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0x10(%rbp)
  addl   $0x1,-0x2c(%rbp)
L50:
  mov    -0x2c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L40
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <get_meter_scale_string@plt>
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  mov    $0x0,%edx
  divq   -0x10(%rbp)
  mov    %rdx,%rsi
  mov    -0x18(%rbp),%rax
  mov    $0x0,%edx
  divq   -0x10(%rbp)
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rsi,%rcx
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L43
L7:
  nop
L43:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D25
datatype: string
name: retrieve_data
arguments: data_tag: D19
datatype: string
name: retrieve_data
arguments: data_tag: D36
datatype: string
name: retrieve_data
arguments: data_tag: D39
datatype: string

tool: D25: Meter type: %s 

tool: D19: Rate type %x 

tool: D36: scale: %d 

tool: D39: val: %lu (%lu.%lu %s)


assistant: ```c
void meter_monitor_dump(int src, void *payload, int len) {
  unsigned char *pp = (unsigned char *)payload;
  int type, size, scale, precision, i;
  unsigned long val;
  unsigned long div = 1;
  if (pp[0] != 0x02) {
    return;
  }
  type = pp[1] & 0x1f;
  size = pp[2] & 7;
  scale = (pp[2] >> 3) & 3;
  precision = (pp[2] >> 5) & 7;
  printf("Meter type: %s ", get_meter_type_string(type));
  printf("Rate type %x ", (pp[1] >> 5) & 0x3);
  printf("scale: %d ", scale);
  val = 0;
  for (i = 0; i < size; i++)
    val = val << 8 | pp[3 + i];
  for (i = 0; i < precision; i++)
    div = div * 10;
  printf("val: %lu (%lu.%lu %s)\n", val, val / div, val % div, get_meter_scale_string(type, scale));
}
```