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

```asm
<sim>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x130,%rsp
  mov    %rdi,-0x128(%rbp)
  movq   $0x0,-0xa0(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    %eax,-0x118(%rbp)
  mov    -0x128(%rbp),%rax
  mov    %eax,-0x114(%rbp)
  mov    -0x114(%rbp),%eax
  cmp    -0x118(%rbp),%eax
  jne    L54
  movq   $0x0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  jmp    L18
L54:
  movl   $0x0,-0x11c(%rbp)
L26:
  cmpl   $0x3,-0x11c(%rbp)
  jg     L72
  movq   $0x0,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %eax,-0xd0(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    %eax,-0xcc(%rbp)
  mov    -0xcc(%rbp),%eax
  cmp    -0xd0(%rbp),%eax
  je     L70
  mov    -0xa8(%rbp),%rax
  mov    %eax,-0xc8(%rbp)
  mov    -0xc8(%rbp),%eax
  add    $0x8,%eax
  mov    %eax,-0xc4(%rbp)
  mov    -0xc4(%rbp),%eax
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0xa8(%rbp)
L10:
  movq   $0x0,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %eax,-0xc0(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    %eax,-0xbc(%rbp)
  mov    -0xbc(%rbp),%eax
  cmp    -0xc0(%rbp),%eax
  je     L40
  mov    -0xa8(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x128(%rbp),%rax
  mov    %eax,-0xb8(%rbp)
  mov    -0xb8(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,-0xb4(%rbp)
  mov    -0xb4(%rbp),%eax
  mov    %rax,-0x20(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <put_in_hosp@plt>
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <removeList@plt>
  mov    -0xa8(%rbp),%rax
  mov    %eax,-0xb0(%rbp)
  mov    -0xb0(%rbp),%eax
  add    $0x8,%eax
  mov    %eax,-0xac(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0xa8(%rbp)
  jmp    L10
L40:
  nop
L70:
  addl   $0x1,-0x11c(%rbp)
  jmp    L26
L72:
  nop
  movl   $0x2c,-0x110(%rbp)
  mov    -0x110(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,-0x10c(%rbp)
  mov    -0x128(%rbp),%rax
  mov    %eax,-0x108(%rbp)
  mov    -0x108(%rbp),%edx
  mov    -0x10c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x104(%rbp)
  mov    -0x104(%rbp),%eax
  mov    %rax,-0x98(%rbp)
  mov    -0x98(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x90(%rbp)
  mov    -0x90(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <check_patients_inside@plt>
  movl   $0x20,-0x100(%rbp)
  mov    -0x100(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,-0xfc(%rbp)
  mov    -0x128(%rbp),%rax
  mov    %eax,-0xf8(%rbp)
  mov    -0xf8(%rbp),%edx
  mov    -0xfc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xf4(%rbp)
  mov    -0xf4(%rbp),%eax
  mov    %rax,-0x88(%rbp)
  mov    -0x88(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x80(%rbp)
  mov    -0x80(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <check_patients_assess@plt>
  mov    %rax,-0x78(%rbp)
  movl   $0x14,-0xf0(%rbp)
  mov    -0xf0(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,-0xec(%rbp)
  mov    -0x128(%rbp),%rax
  mov    %eax,-0xe8(%rbp)
  mov    -0xe8(%rbp),%edx
  mov    -0xec(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xe4(%rbp)
  mov    -0xe4(%rbp),%eax
  mov    %rax,-0x70(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <check_patients_waiting@plt>
  mov    -0x128(%rbp),%rax
  mov    %rax,%rdi
  call   <generate_patient@plt>
  mov    %rax,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %eax,-0xe0(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %eax,-0xdc(%rbp)
  mov    -0xdc(%rbp),%eax
  cmp    -0xe0(%rbp),%eax
  je     L77
  mov    -0x128(%rbp),%rax
  mov    %eax,-0xd8(%rbp)
  mov    -0xd8(%rbp),%eax
  add    $0x20,%eax
  mov    %eax,-0xd4(%rbp)
  mov    -0xd4(%rbp),%eax
  mov    %rax,-0x50(%rbp)
  mov    -0x60(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <put_in_hosp@plt>
L77:
  mov    -0x78(%rbp),%rax
L18:
  leave
  ret
```

assistant: ```c
struct List *sim(struct Village *village) {
  int i;
  struct Patient *patient;
  struct Patient *p;
  struct List *l;
  struct List *vl;
  struct List *up;
  void *__cil_tmp8;
  unsigned int __cil_tmp9;
  unsigned int __cil_tmp10;
  void *__cil_tmp11;
  void *__cil_tmp12;
  unsigned int __cil_tmp13;
  unsigned int __cil_tmp14;
  unsigned int __cil_tmp15;
  unsigned int __cil_tmp16;
  void *__cil_tmp17;
  unsigned int __cil_tmp18;
  unsigned int __cil_tmp19;
  unsigned int __cil_tmp20;
  unsigned int __cil_tmp21;
  struct Hosp *__cil_tmp22;
  unsigned int __cil_tmp23;
  unsigned int __cil_tmp24;
  unsigned int __cil_tmp25;
  unsigned int __cil_tmp26;
  unsigned int __cil_tmp27;
  unsigned int __cil_tmp28;
  struct List *__cil_tmp29;
  unsigned int __cil_tmp30;
  unsigned int __cil_tmp31;
  unsigned int __cil_tmp32;
  unsigned int __cil_tmp33;
  struct List *__cil_tmp34;
  unsigned int __cil_tmp35;
  unsigned int __cil_tmp36;
  unsigned int __cil_tmp37;
  unsigned int __cil_tmp38;
  struct List *__cil_tmp39;
  void *__cil_tmp40;
  unsigned int __cil_tmp41;
  unsigned int __cil_tmp42;
  unsigned int __cil_tmp43;
  unsigned int __cil_tmp44;
  struct Hosp *__cil_tmp45;
  struct List **mem_46;
  struct Patient **mem_47;
  struct List **mem_48;
  struct List **mem_49;
  struct List **mem_50;
  struct List **mem_51;
  {
    {
      __cil_tmp8 = (void *)0;
      __cil_tmp9 = (unsigned int)__cil_tmp8;
      __cil_tmp10 = (unsigned int)village;
      if (__cil_tmp10 == __cil_tmp9) {
        {
          __cil_tmp11 = (void *)0;
          return ((struct List *)__cil_tmp11);
        }
      } else {
      }
    }
    i = 0;
    {
      while (1) {
      while_7_continue:;
        if (i < 4) {
        } else {
          goto while_7_break;
        }
        {
          __cil_tmp12 = (void *)0;
          __cil_tmp13 = (unsigned int)__cil_tmp12;
          __cil_tmp14 = (unsigned int)l;
          if (__cil_tmp14 != __cil_tmp13) {
            __cil_tmp15 = (unsigned int)l;
            __cil_tmp16 = __cil_tmp15 + 8;
            mem_46 = (struct List **)__cil_tmp16;
            l = *mem_46;
            {
              while (1) {
              while_8_continue:;
                {
                  __cil_tmp17 = (void *)0;
                  __cil_tmp18 = (unsigned int)__cil_tmp17;
                  __cil_tmp19 = (unsigned int)l;
                  if (__cil_tmp19 != __cil_tmp18) {
                  } else {
                    goto while_8_break;
                  }
                }
                {
                  mem_47 = (struct Patient **)l;
                  p = *mem_47;
                  __cil_tmp20 = (unsigned int)village;
                  __cil_tmp21 = __cil_tmp20 + 32;
                  __cil_tmp22 = (struct Hosp *)__cil_tmp21;
                  put_in_hosp(__cil_tmp22, p);
                  removeList(vl, p);
                  __cil_tmp23 = (unsigned int)l;
                  __cil_tmp24 = __cil_tmp23 + 8;
                  mem_48 = (struct List **)__cil_tmp24;
                  l = *mem_48;
                }
              }
            while_8_break:;
            }
          } else {
          }
        }
        i = i + 1;
      }
    while_7_break:;
    }
    {
      __cil_tmp25 = 36 + 8;
      __cil_tmp26 = 32 + __cil_tmp25;
      __cil_tmp27 = (unsigned int)village;
      __cil_tmp28 = __cil_tmp27 + __cil_tmp26;
      mem_49 = (struct List **)__cil_tmp28;
      __cil_tmp29 = *mem_49;
      check_patients_inside(village, __cil_tmp29);
      __cil_tmp30 = 24 + 8;
      __cil_tmp31 = 32 + __cil_tmp30;
      __cil_tmp32 = (unsigned int)village;
      __cil_tmp33 = __cil_tmp32 + __cil_tmp31;
      mem_50 = (struct List **)__cil_tmp33;
      __cil_tmp34 = *mem_50;
      up = check_patients_assess(village, __cil_tmp34);
      __cil_tmp35 = 12 + 8;
      __cil_tmp36 = 32 + __cil_tmp35;
      __cil_tmp37 = (unsigned int)village;
      __cil_tmp38 = __cil_tmp37 + __cil_tmp36;
      mem_51 = (struct List **)__cil_tmp38;
      __cil_tmp39 = *mem_51;
      check_patients_waiting(village, __cil_tmp39);
      patient = generate_patient(village);
    }
    {
      __cil_tmp40 = (void *)0;
      __cil_tmp41 = (unsigned int)__cil_tmp40;
      __cil_tmp42 = (unsigned int)patient;
      if (__cil_tmp42 != __cil_tmp41) {
        {
          __cil_tmp43 = (unsigned int)village;
          __cil_tmp44 = __cil_tmp43 + 32;
          __cil_tmp45 = (struct Hosp *)__cil_tmp44;
          put_in_hosp(__cil_tmp45, patient);
        }
      } else {
      }
    }
    return (up);
  }
}
```