user: 请将以下的汇编代码转换成C语言代码:

```asm
<dig_level>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <rand@plt>
  mov    %eax,%edx
  shr    $0x1f,%edx
  lea    (%rax,%rdx,1),%ebx
  xor    %eax,%eax
  and    $0x1,%ebx
  sub    %edx,%ebx
  call   <rand@plt>
  add    $0x1,%ebx
  mov    %eax,%edx
  shr    $0x1f,%edx
  lea    (%rax,%rdx,1),%ebp
  and    $0x1,%ebp
  sub    %edx,%ebp
L33:
  test   %r14d,%r14d
  jne    L102
L106:
  test   %r12d,%r12d
  mov    $0x18,%eax
  movl   $0xc,(%rsp)
  cmovne %r12d,%eax
  mov    %eax,0x4(%rsp)
L86:
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %ebp,%ecx
  mov    %ebx,%edx
  call   <dig_room@plt>
  test   %rax,%rax
  je     L33
L57:
  xor    %eax,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x21,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%edx
  sub    %edx,%eax
  mov    %eax,0xc(%rsp)
  js     L33
  movl   $0x0,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L23:
  mov    $0x2710,%r13d
  jmp    L93
  nopl   0x0(%rax,%rax,1)
L78:
  sub    $0x1,%r13d
  je     L101
L93:
  xor    %eax,%eax
  call   <rand@plt>
  mov    %eax,%edx
  shr    $0x1f,%edx
  lea    (%rax,%rdx,1),%ebp
  xor    %eax,%eax
  and    $0x1,%ebp
  sub    %edx,%ebp
  call   <rand@plt>
  mov    %eax,%edx
  shr    $0x1f,%edx
  lea    (%rax,%rdx,1),%ebx
  xor    %eax,%eax
  and    $0x1,%ebx
  sub    %edx,%ebx
  call   <rand@plt>
  add    $0x1,%ebx
  lea    0x0(,%rbx,8),%r14d
  cltd
  lea    0x0(,%rbx,4),%r15d
  idiv   %r14d
  mov    0x4(%rsp),%eax
  lea    (%rdx,%rax,1),%r12d
  xor    %eax,%eax
  call   <rand@plt>
  sub    %r15d,%r12d
  mov    %ebp,%ecx
  cltd
  mov    %r12d,%esi
  idiv   %r14d
  mov    (%rsp),%eax
  lea    (%rdx,%rax,1),%r8d
  mov    %ebx,%edx
  sub    %r15d,%r8d
  mov    %r8d,%edi
  mov    %r8d,%r14d
  call   <dig_room@plt>
  test   %rax,%rax
  je     L78
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r12d,%ecx
  mov    %r14d,%edx
  call   <dig_path@plt>
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jge    L23
  test   %r14d,%r14d
  je     L106
L102:
  mov    %r14d,(%rsp)
  test   %r12d,%r12d
  jne    L88
  movl   $0x18,0x4(%rsp)
  jmp    L86
  nop
L101:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L88:
  mov    %r12d,0x4(%rsp)
  jmp    L57
```

assistant: ```c
void dig_level() {
  int new_ry = 0;
  int new_rx = 0;
  int radius = 1 + rand() % 2;
  bool radial = (bool)rand() % 2;
  while (true) {
    int ry = (0 == new_ry ? 24 / 2 : new_ry);
    int rx = (0 == new_rx ? 48 / 2 : new_rx);
    if ((0 != new_rx && 0 != new_ry) || dig_room(ry, rx, radius, radial)) {
      int paths = 1 + rand() % 5;
      for (int p = 0; p < paths; p++) {
        int tries = 0;
        while (tries++ < 10000 && !dig_room(new_ry = ry + rand() % (8 * radius) - 4 * radius, new_rx = rx + rand() % (8 * radius) - 4 * radius, radius = 1 + rand() % 2, radial = rand() % 2))
          ;
        if (tries > 10000)
          return;
        dig_path(ry, rx, new_ry, new_rx);
      }
    }
  }
}
```