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

```asm
<print_state>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  xor    %edi,%edi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <time@plt>
  lea    0x4(%rsp),%rdi
  mov    %eax,0x4(%rsp)
  call   <ctime@plt>
  mov    $0x40,%esi
  mov    $0x2,%edi
  lea    D11(%rip),%rdx
  mov    %eax,%ecx
  xor    %eax,%eax
  call   <report@plt>
  mov    $0x1,%r8d
  mov    %rbx,%rcx
  xor    %eax,%eax
  lea    D96(%rip),%rdx
  mov    $0x44,%esi
  mov    $0x2,%edi
  call   <report@plt>
  lea    0x1(%rbx),%rcx
  mov    $0x44,%esi
  xor    %eax,%eax
  mov    $0x8,%r8d
  lea    D88(%rip),%rdx
  mov    $0x2,%edi
  call   <report@plt>
  lea    0x9(%rbx),%rcx
  mov    $0x44,%esi
  xor    %eax,%eax
  mov    $0x4,%r8d
  lea    D91(%rip),%rdx
  mov    $0x2,%edi
  call   <report@plt>
  lea    0xd(%rbx),%rcx
  mov    $0x44,%esi
  xor    %eax,%eax
  mov    $0x1,%r8d
  lea    D66(%rip),%rdx
  mov    $0x2,%edi
  call   <report@plt>
  lea    0xe(%rbx),%rcx
  mov    $0x44,%esi
  xor    %eax,%eax
  mov    $0x1,%r8d
  lea    D10(%rip),%rdx
  mov    $0x2,%edi
  call   <report@plt>
  movzbl (%rbx),%eax
  cmp    $0x10,%al
  je     L18
  ja     L95
  test   %al,%al
  je     L3
  cmp    $0x8,%al
  jne    L6
  lea    D76(%rip),%rdx
  mov    $0x20,%esi
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <report@plt>
  nopl   0x0(%rax)
L6:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  ret
  nopl   0x0(%rax)
L95:
  cmp    $0x20,%al
  jne    L6
  mov    0x1(%rbx),%ecx
  mov    0x5(%rbx),%r8d
  mov    %ecx,%eax
  or     %r8d,%eax
  test   %ax,%ax
  je     L25
L0:
  lea    D69(%rip),%rdx
  mov    $0x20,%esi
  xor    %edi,%edi
  xor    %eax,%eax
  call   <report@plt>
  jmp    L6
  nopl   0x0(%rax)
L3:
  lea    D87(%rip),%rdx
  mov    $0x20,%esi
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <report@plt>
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L18:
  lea    D5(%rip),%rdx
  mov    $0x20,%esi
  mov    $0x1,%edi
  xor    %eax,%eax
  call   <report@plt>
  jmp    L6
  nopl   (%rax)
L25:
  sar    $0x10,%ecx
  sar    $0x10,%r8d
  jmp    L0
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D11
data_type: string
name: extract_symbolic_data
arguments: tag: D96
data_type: string
name: extract_symbolic_data
arguments: tag: D88
data_type: string
name: extract_symbolic_data
arguments: tag: D91
data_type: string
name: extract_symbolic_data
arguments: tag: D66
data_type: string
name: extract_symbolic_data
arguments: tag: D10
data_type: string
name: extract_symbolic_data
arguments: tag: D76
data_type: string
name: extract_symbolic_data
arguments: tag: D69
data_type: string
name: extract_symbolic_data
arguments: tag: D87
data_type: string
name: extract_symbolic_data
arguments: tag: D5
data_type: string

tool: D11: Modem State


tool: D96: c0 12 0007 : 

tool: D88: c0 12 000b : 

tool: D91: c0 12 000d : 

tool: D66: c0 01 000e : 

tool: D10: c0 01 000f : 

tool: D76: ADSL line is blocked?


tool: D69: ADSL line is up (%d kbit/s down | %d kbit/s up)


tool: D87: ADSL line is down


tool: D5: ADSL line is synchronising


assistant: ```c
int print_state(unsigned char *buf) {
  time_t t = time(NULL);
  int down_speed = 0, up_speed = 0;
  report(2, ((unsigned int)0x00000040), "Modem State\n", ctime(&t));
  report(2, ((unsigned int)0x00000040) | ((unsigned int)0x00000004), "c0 12 0007 : ", buf + 0, 1);
  report(2, ((unsigned int)0x00000040) | ((unsigned int)0x00000004), "c0 12 000b : ", buf + 1, 8);
  report(2, ((unsigned int)0x00000040) | ((unsigned int)0x00000004), "c0 12 000d : ", buf + 9, 4);
  report(2, ((unsigned int)0x00000040) | ((unsigned int)0x00000004), "c0 01 000e : ", buf + 13, 1);
  report(2, ((unsigned int)0x00000040) | ((unsigned int)0x00000004), "c0 01 000f : ", buf + 14, 1);
  switch (buf[0]) {
  case 0x00:
    report(1, ((unsigned int)0x00000020), "ADSL line is down\n");
    break;
  case 0x08:
    report(1, ((unsigned int)0x00000020), "ADSL line is blocked?\n");
    break;
  case 0x10:
    report(1, ((unsigned int)0x00000020), "ADSL line is synchronising\n");
    break;
  case 0x20:
    down_speed = buf[1] | (buf[1 + 1] << 8) | (buf[1 + 2] << 16) | (buf[1 + 3] << 24);
    up_speed = buf[1 + 4] | (buf[1 + 5] << 8) | (buf[1 + 6] << 16) | (buf[1 + 7] << 24);
    if (((down_speed & 0x0000ffff) == 0) && ((up_speed & 0x0000ffff) == 0)) {
      down_speed >>= 16;
      up_speed >>= 16;
    }
    report(0, ((unsigned int)0x00000020), "ADSL line is up (%d kbit/s down | %d kbit/s up)\n", down_speed, up_speed);
    break;
  }
  return (0);
}
```