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

```asm
<MultiNomialAliasSetTable>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L196
L137:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movl   $0xfffffff7,(%rax)
  addl   $0x1,-0x18(%rbp)
L196:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L137
  movl   $0x0,-0x18(%rbp)
  jmp    L112
L103:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x24(%rbp),%xmm1
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L112:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L103
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L46
L136:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  D9(%rip),%xmm1
  comisd %xmm1,%xmm0
  jb     L161
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x1,(%rax)
  jmp    L60
L161:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0xff,(%rax)
  addl   $0x1,-0xc(%rbp)
L60:
  addl   $0x1,-0x18(%rbp)
L46:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L136
  movl   $0x0,-0x18(%rbp)
  jmp    L139
L54:
  movl   $0x0,-0x14(%rbp)
  jmp    L180
L6:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xff,%al
  je     L98
  addl   $0x1,-0x14(%rbp)
L180:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L6
  jmp    L152
L98:
  nop
L152:
  movl   $0x0,-0x10(%rbp)
  jmp    L5
L148:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1,%al
  je     L181
  addl   $0x1,-0x10(%rbp)
L5:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L148
  jmp    L49
L181:
  nop
L49:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  je     L12
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  movsd  D9(%rip),%xmm1
  subsd  %xmm2,%xmm1
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D9(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L78
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0xff,(%rax)
  addl   $0x1,-0xc(%rbp)
L78:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x18(%rbp)
L139:
  cmpl   $0x0,-0xc(%rbp)
  jg     L54
  jmp    L53
L12:
  nop
L53:
  mov    $0x0,%eax
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D9
datatype: byte[8]

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
int MultiNomialAliasSetTable(int ncat, double prob[], double F[], int L[], double space[]) {
  signed char *I = (signed char *)space;
  int i, j, k, nsmall;
  for (i = 0; i < ncat; i++)
    L[i] = -9;
  for (i = 0; i < ncat; i++)
    F[i] = ncat * prob[i];
  for (i = 0, nsmall = 0; i < ncat; i++) {
    if (F[i] >= 1)
      I[i] = 1;
    else {
      I[i] = -1;
      nsmall++;
    }
  }
  for (i = 0; nsmall > 0; i++) {
    for (j = 0; j < ncat; j++)
      if (I[j] == -1)
        break;
    for (k = 0; k < ncat; k++)
      if (I[k] == 1)
        break;
    if (k == ncat)
      break;
    L[j] = k;
    F[k] -= 1 - F[j];
    if (F[k] < 1) {
      I[k] = -1;
      nsmall++;
    }
    I[j] = 0;
    nsmall--;
  }
  return (0);
}
```