user: Converte this assembly snippet into its equivalent C code:

```asm
<PERM>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %edi,-0x74(%rbp)
  mov    %esi,-0x78(%rbp)
  mov    %edx,-0x7c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x74(%rbp)
  js     L93
  cmpl   $0x0,-0x78(%rbp)
  js     L93
  cmpl   $0x0,-0x7c(%rbp)
  js     L93
  mov    $0x1,%eax
  jmp    L25
L93:
  mov    $0x0,%eax
L25:
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x68(%rbp)
  jmp    L46
L27:
  mov    -0x68(%rbp),%eax
  mov    -0x74(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%eax
  cltq
  mov    %edx,-0x60(%rbp,%rax,4)
  addl   $0x1,-0x68(%rbp)
L46:
  cmpl   $0x4,-0x68(%rbp)
  jle    L27
  movl   $0x0,-0x68(%rbp)
  jmp    L60
L48:
  cmpl   $0x8,-0x68(%rbp)
  jg     L40
  mov    -0x68(%rbp),%eax
  mov    -0x7c(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%eax
  cltq
  mov    %edx,-0x40(%rbp,%rax,4)
  jmp    L14
L40:
  mov    -0x68(%rbp),%eax
  sub    $0x9,%eax
  mov    -0x78(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  and    $0x1,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%eax
  cltq
  mov    %edx,-0x40(%rbp,%rax,4)
L14:
  addl   $0x1,-0x68(%rbp)
L60:
  cmpl   $0xd,-0x68(%rbp)
  jle    L48
  mov    -0xc(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x8,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x4,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x10(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0xc,%rdx
  lea    -0x60(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x14(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0xc,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x4,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x18(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x10,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x8,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x1c(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0xc,%rdx
  lea    -0x60(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x20(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x10,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x4,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x24(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x10,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0xc,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x28(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x8,%rdx
  lea    -0x60(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x2c(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0xc,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x4,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x30(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x10,%rdx
  lea    -0x60(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x34(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x10,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0xc,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x38(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x8,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x4,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x3c(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0xc,%rdx
  lea    -0x60(%rbp),%rcx
  add    $0x8,%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x40(%rbp),%eax
  lea    -0x60(%rbp),%rdx
  add    $0x4,%rdx
  lea    -0x60(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <BFLY@plt>
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0x5c(%rbp),%eax
  add    %eax,%eax
  and    $0x2,%eax
  add    %eax,-0x64(%rbp)
  mov    -0x58(%rbp),%eax
  shl    $0x2,%eax
  and    $0x4,%eax
  add    %eax,-0x64(%rbp)
  mov    -0x54(%rbp),%eax
  shl    $0x3,%eax
  and    $0x8,%eax
  add    %eax,-0x64(%rbp)
  mov    -0x50(%rbp),%eax
  shl    $0x4,%eax
  and    $0x10,%eax
  add    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

assistant: ```c
int PERM(int ip1, int ip2, int ip3) {
  int z[5], p[14], op;
  int i;
  assert(ip1 >= 0 && ip2 >= 0 && ip3 >= 0);
  for (i = 0; i < 5; i++)
    z[i] = (ip1 >> i) & 0x1;
  for (i = 0; i < 14; i++) {
    if (i < 9)
      p[i] = ((ip3 >> i) & 0x1);
    else
      p[i] = (ip2 >> (i - 9)) & 0x1;
  }
  BFLY(p[13], &z[1], &z[2]);
  BFLY(p[12], &z[0], &z[3]);
  BFLY(p[11], &z[1], &z[3]);
  BFLY(p[10], &z[2], &z[4]);
  BFLY(p[9], &z[0], &z[3]);
  BFLY(p[8], &z[1], &z[4]);
  BFLY(p[7], &z[3], &z[4]);
  BFLY(p[6], &z[0], &z[2]);
  BFLY(p[5], &z[1], &z[3]);
  BFLY(p[4], &z[0], &z[4]);
  BFLY(p[3], &z[3], &z[4]);
  BFLY(p[2], &z[1], &z[2]);
  BFLY(p[1], &z[2], &z[3]);
  BFLY(p[0], &z[0], &z[1]);
  op = z[0];
  op = op + ((z[1] << 1) & 0x02);
  op = op + ((z[2] << 2) & 0x04);
  op = op + ((z[3] << 3) & 0x08);
  op = op + ((z[4] << 4) & 0x10);
  return (op);
}
```