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

```asm
<get_level>:
  endbr64
  movzbl 0xd(%rsi),%ecx
  mov    %rsi,%rdx
  mov    %rdi,%rax
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rdi,%rsi,1),%esi
  sar    %cl,%esi
  movzbl 0xc(%rdx),%ecx
  add    %esi,%esi
  mov    %ecx,%edi
  and    $0x7,%ecx
  and    $0x2,%esi
  shr    $0x3,%dil
  add    $0x1,%edi
  movzbl %dil,%edi
  movzbl (%rax,%rdi,1),%edi
  sar    %cl,%edi
  movzbl 0xb(%rdx),%ecx
  and    $0x1,%edi
  or     %esi,%edi
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    %edi,%edi
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rax,%rsi,1),%esi
  sar    %cl,%esi
  movzbl 0xa(%rdx),%ecx
  and    $0x1,%esi
  or     %edi,%esi
  mov    %ecx,%edi
  and    $0x7,%ecx
  shr    $0x3,%dil
  add    %esi,%esi
  add    $0x1,%edi
  movzbl %dil,%edi
  movzbl (%rax,%rdi,1),%edi
  sar    %cl,%edi
  movzbl 0x9(%rdx),%ecx
  and    $0x1,%edi
  or     %esi,%edi
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    %edi,%edi
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rax,%rsi,1),%esi
  sar    %cl,%esi
  movzbl 0x8(%rdx),%ecx
  and    $0x1,%esi
  or     %edi,%esi
  mov    %ecx,%edi
  and    $0x7,%ecx
  shr    $0x3,%dil
  add    %esi,%esi
  add    $0x1,%edi
  movzbl %dil,%edi
  movzbl (%rax,%rdi,1),%edi
  sar    %cl,%edi
  movzbl 0x7(%rdx),%ecx
  and    $0x1,%edi
  or     %esi,%edi
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    %edi,%edi
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rax,%rsi,1),%esi
  sar    %cl,%esi
  movzbl 0x6(%rdx),%ecx
  and    $0x1,%esi
  or     %edi,%esi
  mov    %ecx,%edi
  and    $0x7,%ecx
  shr    $0x3,%dil
  add    %esi,%esi
  add    $0x1,%edi
  movzbl %dil,%edi
  movzbl (%rax,%rdi,1),%edi
  sar    %cl,%edi
  movzbl 0x5(%rdx),%ecx
  and    $0x1,%edi
  or     %esi,%edi
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    %edi,%edi
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rax,%rsi,1),%esi
  sar    %cl,%esi
  movzbl 0x4(%rdx),%ecx
  and    $0x1,%esi
  or     %edi,%esi
  mov    %ecx,%edi
  shr    $0x3,%dil
  add    %esi,%esi
  add    $0x1,%edi
  and    $0x7,%ecx
  movzbl %dil,%edi
  movzbl (%rax,%rdi,1),%edi
  sar    %cl,%edi
  movzbl 0x3(%rdx),%ecx
  and    $0x1,%edi
  or     %esi,%edi
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    %edi,%edi
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rax,%rsi,1),%esi
  sar    %cl,%esi
  movzbl 0x2(%rdx),%ecx
  and    $0x1,%esi
  or     %edi,%esi
  mov    %ecx,%edi
  and    $0x7,%ecx
  shr    $0x3,%dil
  add    %esi,%esi
  add    $0x1,%edi
  movzbl %dil,%edi
  movzbl (%rax,%rdi,1),%edi
  sar    %cl,%edi
  movzbl 0x1(%rdx),%ecx
  and    $0x1,%edi
  or     %esi,%edi
  mov    %ecx,%esi
  and    $0x7,%ecx
  shr    $0x3,%sil
  add    %edi,%edi
  add    $0x1,%esi
  movzbl %sil,%esi
  movzbl (%rax,%rsi,1),%esi
  sar    %cl,%esi
  movzbl (%rdx),%ecx
  and    $0x1,%esi
  mov    %ecx,%edx
  and    $0x7,%ecx
  or     %edi,%esi
  shr    $0x3,%dl
  add    %esi,%esi
  add    $0x1,%edx
  movzbl %dl,%edx
  movzbl (%rax,%rdx,1),%eax
  sar    %cl,%eax
  and    $0x1,%eax
  or     %esi,%eax
  ret
```

assistant: ```c
int get_level(unsigned char pkt[32], const unsigned char mask[14]) {
  int i, byte, offset, level;
  level = 0;
  for (i = 13; i >= 0; --i) {
    level <<= 1;
    byte = (mask[i] / 8) + 1;
    offset = mask[i] % 8;
    level |= (pkt[byte] >> offset) & 1;
  }
  return level;
}
```