user: 这段汇编代码用C语言表示是什么样的？

```asm
<CalcFrameLength>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  mov    (%r8),%esi
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%r15
  mov    0x40(%rsp),%r13
  mov    0x48(%rsp),%ebx
  mov    %edx,-0x4(%rsp)
  mov    %ecx,-0x8(%rsp)
  cmp    $0xffffffff,%esi
  je     L161
  mov    (%r15),%r10d
  cmp    $0xffffffff,%r10d
  je     L121
  mov    %edi,%ebp
  test   %edi,%edi
  jle    L178
  lea    -0x1(%rdi),%r14d
  mov    %esi,%ecx
  xor    %edi,%edi
  xor    %r11d,%r11d
  shl    $0x2,%r14
  jmp    L28
  nopl   0x0(%rax,%rax,1)
L93:
  mov    0x4(%r8,%rdi,1),%ecx
  add    $0x4,%rdi
L28:
  mov    %ebx,%eax
  cltd
  idivl  (%r9,%rdi,1)
  imul   %ecx,%eax
  imul   %r12d,%eax
  add    %eax,%r11d
  cmp    %rdi,%r14
  jne    L93
  mov    -0x8(%rsp),%edx
  xor    %eax,%eax
  test   %edx,%edx
  jne    L171
L153:
  mov    -0x4(%rsp),%ebx
  imul   %r12d,%ebx
  cmp    $0xb,%ebx
  jle    L161
  test   %ebp,%ebp
  jle    L72
  mov    %r12d,%r11d
  lea    -0x1(%rbp),%r12d
  sub    $0xc,%ebx
  xor    %ecx,%ecx
  imul   %eax,%r11d
  shl    $0x2,%r12
  xor    %ebp,%ebp
  xor    %edi,%edi
  jmp    L119
L67:
  mov    0x4(%r8,%rcx,1),%esi
  mov    0x4(%r15,%rcx,1),%r10d
  add    $0x4,%rcx
L119:
  mov    %r11d,%eax
  cltd
  idivl  (%r9,%rcx,1)
  imul   %esi,%eax
  add    %eax,%edi
  mov    %ebx,%eax
  cltd
  idivl  0x0(%r13,%rcx,1)
  imul   %r10d,%eax
  add    %eax,%ebp
  cmp    %r12,%rcx
  jne    L67
  add    %ebp,%edi
L52:
  mov    -0x8(%rsp),%eax
  shl    $0x3,%eax
  cmp    %edi,%eax
  jg     L161
  test   %edi,%edi
  lea    0x7(%rdi),%r10d
  cmovns %edi,%r10d
  sar    $0x3,%r10d
L121:
  pop    %rbx
  mov    %r10d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L171:
  lea    0x0(,%rdx,8),%eax
  cltd
  idiv   %r11d
  mov    %eax,%r11d
  test   %edx,%edx
  je     L130
  lea    0x1(%rax),%r11d
  mov    %r11d,%eax
  imul   %ebx,%eax
  sub    %eax,-0x4(%rsp)
  jmp    L153
L15:
  mov    -0x8(%rsp),%eax
  xor    %ecx,%ecx
  shl    $0x3,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r11d
L130:
  mov    %ebx,%eax
  imul   %r11d,%eax
  sub    %eax,-0x4(%rsp)
  jmp    L153
  nopl   0x0(%rax,%rax,1)
L178:
  mov    -0x8(%rsp),%eax
  test   %eax,%eax
  jne    L15
  xor    %eax,%eax
  jmp    L153
  nopw   0x0(%rax,%rax,1)
L72:
  xor    %edi,%edi
  jmp    L52
L161:
  mov    $0xffffffff,%r10d
  jmp    L121
```

assistant: ```c
int CalcFrameLength(int NumLevels, int GrossBitsPerCell, int NumCells, int BytesA, int *pNumeratorsA, int *pDenominatorsA, int *pNumeratorsB, int *pDenominatorsB, int LCM) {
  int NumCellsA, NumCellsB;
  int NetBitsA, NetBitsB;
  int TotalNetBits;
  int NumLCMA;
  int l;
  int BitsPerLCM = 0;
  if (pNumeratorsA[0] == -1 || pNumeratorsB[0] == -1)
    return -1;
  for (l = 0; l < NumLevels; l++) {
    BitsPerLCM += LCM / pDenominatorsA[l] * pNumeratorsA[l] * GrossBitsPerCell;
  }
  if (BytesA != 0) {
    NumLCMA = 8 * BytesA / BitsPerLCM;
    if ((8 * BytesA) % BitsPerLCM != 0) {
      NumLCMA++;
    }
  } else
    NumLCMA = 0;
  NumCellsA = NumLCMA * LCM;
  NumCellsB = NumCells - NumCellsA;
  if (GrossBitsPerCell * NumCellsB - 12 < 0)
    return -1;
  NetBitsA = 0;
  NetBitsB = 0;
  for (l = 0; l < NumLevels; l++) {
    NetBitsA += GrossBitsPerCell * NumCellsA / pDenominatorsA[l] * pNumeratorsA[l];
    NetBitsB += (GrossBitsPerCell * NumCellsB - 12) / pDenominatorsB[l] * pNumeratorsB[l];
  }
  TotalNetBits = NetBitsA + NetBitsB;
  if (TotalNetBits < 8 * BytesA)
    return -1;
  else
    return (TotalNetBits / 8);
}
```