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

```asm
<diskd0>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x318,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x308(%rsp)
  xor    %eax,%eax
  lea    D115(%rip),%rdi
  call   <puts0@plt>
  mov    %rsp,%r12
  mov    $0x100,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <getsn@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <htoi@plt>
  mov    %eax,%ebx
  lea    D90(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    $0x100,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <getsn@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,%ebp
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    $0x100,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <getsn@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,%r13d
  lea    D15(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    $0x100,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <getsn@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,%r14d
  lea    D114(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <puthex_b@plt>
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <putdec@plt>
  lea    D92(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    %r13d,%edi
  mov    $0x0,%eax
  call   <putdec@plt>
  lea    D112(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <putdec@plt>
  lea    0x100(%rsp),%r12
  lea    0x300(%rsp),%rdx
  mov    %r12,%rax
L30:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L30
  lea    0x100(%rsp),%r8
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <readsec0@plt>
  mov    %eax,%ebx
  cmp    $0x1,%eax
  je     L74
  lea    D107(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <puthex@plt>
L101:
  lea    D12(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  add    $0x10,%r12
  mov    $0x0,%r13d
  lea    D12(%rip),%r14
  lea    D80(%rip),%r15
  jmp    L44
L74:
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  jmp    L101
L107:
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    $0xd,%edi
  mov    $0x0,%eax
  call   <putch@plt>
  jmp    L26
L119:
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <putch@plt>
L20:
  add    $0x1,%rbx
  cmp    %r12,%rbx
  je     L111
L85:
  movsbl (%rbx),%edi
  test   $0xe0,%dil
  jne    L119
  mov    $0x2e,%edi
  mov    $0x0,%eax
  call   <putch@plt>
  jmp    L20
L111:
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <puts0@plt>
  add    $0x1,%r13d
  cmp    $0x20,%r13d
  je     L78
  cmp    $0xf,%r13d
  je     L107
L26:
  add    $0x10,%r12
L44:
  lea    -0x10(%r12),%rbx
  mov    %rbx,%rbp
L129:
  movsbl 0x0(%rbp),%edi
  mov    $0x0,%eax
  call   <puthex_b@plt>
  mov    $0x20,%edi
  mov    $0x0,%eax
  call   <putch@plt>
  add    $0x1,%rbp
  cmp    %r12,%rbp
  jne    L129
  jmp    L85
L78:
  mov    0x308(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  add    $0x318,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D115
type_infered: string
name: parse_data
arguments: tag: D90
type_infered: string
name: parse_data
arguments: tag: D40
type_infered: string
name: parse_data
arguments: tag: D15
type_infered: string
name: parse_data
arguments: tag: D114
type_infered: string
name: parse_data
arguments: tag: D43
type_infered: string
name: parse_data
arguments: tag: D92
type_infered: string
name: parse_data
arguments: tag: D112
type_infered: string
name: parse_data
arguments: tag: D107
type_infered: string
name: parse_data
arguments: tag: D12
type_infered: string
name: parse_data
arguments: tag: D80
type_infered: string
name: parse_data
arguments: tag: D19
type_infered: string

tool: D115: Drive, hex? 

tool: D90: 
sec? (1-..., dec) 

tool: D40: 
head, dec? 

tool: D15: 
trk (cyl), dec? 

tool: D114: 
Drive = 0x

tool: D43:  sec = 

tool: D92:  head = 

tool: D112:  trk = 

tool: D107:  err code = 

tool: D12: 


tool: D80:  press any key 

tool: D19:  OK

assistant: ```c
void diskd0(void) {
  char Buffer[512];
  char str[256];
  int drive, sec, head, trk, i, ii, c, line;
  puts0("Drive, hex? ");
  getsn(str, 256);
  drive = htoi(str);
  puts0("\r\nsec? (1-..., dec) ");
  getsn(str, 256);
  sec = atoi(str);
  puts0("\r\nhead, dec? ");
  getsn(str, 256);
  head = atoi(str);
  puts0("\r\ntrk (cyl), dec? ");
  getsn(str, 256);
  trk = atoi(str);
  puts0("\r\nDrive = 0x");
  puthex_b(drive);
  puts0(" sec = ");
  putdec(sec);
  puts0(" head = ");
  putdec(head);
  puts0(" trk = ");
  putdec(trk);
  for (i = 0; i < 512; i++)
    Buffer[i] = 0;
  i = readsec0(drive, sec, head, trk, Buffer);
  if (i == 1)
    puts0(" OK");
  else {
    puts0(" err code = ");
    puthex(i);
  }
  puts0("\r\n");
  ii = 0;
  for (line = 0; line < 32; line++) {
    if (line == 15) {
      puts0(" press any key ");
      getch();
      putch('\r');
    }
    for (i = 0; i < 16; i++) {
      c = Buffer[ii++];
      puthex_b(c);
      putch(' ');
    }
    ii = ii - 16;
    for (i = 0; i < 16; i++) {
      c = (Buffer[ii++]) & 0xFFU;
      if (c < ' ')
        putch('.');
      else
        putch(c);
    }
    puts0("\r\n");
  }
}
```