user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<recs_per_track>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%eax
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ax,-0x24(%rbp)
  movzwl -0x24(%rbp),%eax
  cmp    $0x9345,%eax
  je     L57
  cmp    $0x9345,%eax
  jg     L48
  cmp    $0x3380,%eax
  je     L95
  cmp    $0x3390,%eax
  je     L102
  jmp    L48
L95:
  cmpl   $0x0,-0x28(%rbp)
  je     L47
  mov    -0x28(%rbp),%eax
  add    $0xc,%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    0x16(%rax),%ebx
  mov    -0x2c(%rbp),%eax
  add    $0xc,%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    (%rbx,%rax,1),%ecx
  mov    $0x5db,%eax
  cltd
  idiv   %ecx
  jmp    L101
L47:
  mov    -0x2c(%rbp),%eax
  add    $0xc,%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    0xf(%rax),%ecx
  mov    $0x5db,%eax
  cltd
  idiv   %ecx
  jmp    L101
L102:
  mov    -0x2c(%rbp),%eax
  add    $0x6,%eax
  mov    $0xe8,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L13
  mov    -0x28(%rbp),%eax
  add    $0x6,%eax
  mov    $0xe8,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    $0x22,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    0x1c(%rax),%ebx
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    $0x22,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    (%rbx,%rax,1),%ecx
  mov    $0x6c1,%eax
  cltd
  idiv   %ecx
  jmp    L101
L13:
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    $0x22,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    0x13(%rax),%ecx
  mov    $0x6c1,%eax
  cltd
  idiv   %ecx
  jmp    L101
L57:
  mov    -0x2c(%rbp),%eax
  add    $0x6,%eax
  mov    $0xe8,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L10
  mov    -0x28(%rbp),%eax
  add    $0x6,%eax
  mov    $0xe8,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    $0x22,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    0x19(%rax),%ebx
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    $0x22,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  add    %eax,%ebx
  mov    $0x58c,%eax
  cltd
  idiv   %ebx
  jmp    L101
L10:
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    $0x22,%esi
  mov    %eax,%edi
  call   <ceil_quot@plt>
  lea    0x19(%rax),%ecx
  mov    $0x58c,%eax
  cltd
  idiv   %ecx
  jmp    L101
L48:
  mov    $0x0,%eax
L101:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
unsigned int recs_per_track(unsigned short dev_type, unsigned int kl, unsigned int dl) {
  int dn, kn;
  switch (dev_type) {
  case 13184:
    if (kl)
      return 1499 / (15 + 7 + ceil_quot(kl + 12, 32) + ceil_quot(dl + 12, 32));
    else
      return 1499 / (15 + ceil_quot(dl + 12, 32));
  case 13200:
    dn = ceil_quot(dl + 6, 232) + 1;
    if (kl) {
      kn = ceil_quot(kl + 6, 232) + 1;
      return 1729 / (10 + 9 + ceil_quot(kl + 6 * kn, 34) + 9 + ceil_quot(dl + 6 * dn, 34));
    } else
      return 1729 / (10 + 9 + ceil_quot(dl + 6 * dn, 34));
  case 37701:
    dn = ceil_quot(dl + 6, 232) + 1;
    if (kl) {
      kn = ceil_quot(kl + 6, 232) + 1;
      return 1420 / (18 + 7 + ceil_quot(kl + 6 * kn, 34) + ceil_quot(dl + 6 * dn, 34));
    } else
      return 1420 / (18 + 7 + ceil_quot(dl + 6 * dn, 34));
  }
  return 0;
}
```