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

```asm
<test_bitmap2_120>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movl   $0x78,-0x6c(%rbp)
  mov    -0x6c(%rbp),%eax
  mov    %eax,%edi
  call   <bitmap2_size@plt>
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x60(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%ecx
  mov    $0x0,%edx
  div    %rcx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L50:
  cmp    %rdx,%rsp
  je     L17
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L50
L17:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L1
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L1:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x6c(%rbp),%edx
  mov    -0x50(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_create@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <bitmap2_len@plt>
  mov    %eax,-0x6c(%rbp)
  cmpl   $0x80,-0x6c(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <bitmap2_set_first_free@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x1,-0x40(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <bitmap2_clear@plt>
  movl   $0x0,-0x70(%rbp)
  jmp    L27
L33:
  mov    -0x70(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_get@plt>
  mov    %eax,-0x64(%rbp)
  cmpl   $0x0,-0x64(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x70(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_set@plt>
  mov    -0x70(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_get@plt>
  mov    %eax,-0x64(%rbp)
  cmpl   $0x0,-0x64(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  addl   $0x1,-0x70(%rbp)
L27:
  mov    -0x6c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x70(%rbp)
  jl     L33
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <bitmap2_set_first_free@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x6c(%rbp),%eax
  cltq
  cmp    %rax,-0x40(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <bitmap2_set_first_free@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <bitmap2_get@plt>
  mov    %eax,-0x68(%rbp)
  cmpl   $0x1,-0x68(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x6c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_get@plt>
  mov    %eax,-0x68(%rbp)
  cmpl   $0x1,-0x68(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x6c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_clear@plt>
  mov    -0x6c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_get@plt>
  mov    %eax,-0x68(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x6c(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bitmap2_get@plt>
  mov    %eax,-0x68(%rbp)
  cmpl   $0xffffffff,-0x68(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <bitmap2_debug@plt>
  mov    %rbx,%rsp
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void test_bitmap2_120() {
  int n = 120;
  char bm_storage[bitmap2_size(n)];
  struct bitmap2 *bm_s = (struct bitmap2 *)&bm_storage;
  struct bitmap2 *bm = bitmap2_create(bm_s, n);
  n = bitmap2_len(bm);
  assert(n == 128);
  assert(bm == bm_s);
  size_t idx = bitmap2_set_first_free(bm);
  assert(idx == 1);
  bitmap2_clear(bm, 0);
  for (int i = 0; i < n - 1; ++i) {
    int b = bitmap2_get(bm, i);
    assert(b == 0);
    bitmap2_set(bm, i);
    b = bitmap2_get(bm, i);
    assert(b != 0);
  }
  idx = bitmap2_set_first_free(bm);
  assert(idx == (size_t)n);
  idx = bitmap2_set_first_free(bm);
  assert(idx == 0);
  int b = bitmap2_get(bm, 0);
  assert(b == 1);
  b = bitmap2_get(bm, n - 1);
  assert(b == 1);
  bitmap2_clear(bm, n - 1);
  b = bitmap2_get(bm, n - 1);
  assert(b == 0);
  b = bitmap2_get(bm, n);
  assert(b == -1);
  bitmap2_debug(bm);
}
```