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

```asm
<Camellia_cfb128_encrypt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L71
  cmpq   $0x0,-0x20(%rbp)
  je     L71
  cmpq   $0x0,-0x30(%rbp)
  je     L71
  cmpq   $0x0,-0x38(%rbp)
  je     L71
  cmpq   $0x0,-0x40(%rbp)
  je     L71
  mov    $0x1,%eax
  jmp    L11
L71:
  mov    $0x0,%eax
L11:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,0x10(%rbp)
  je     L115
  jmp    L4
L2:
  cmpl   $0x0,-0xc(%rbp)
  jne    L117
  mov    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Camellia_encrypt@plt>
L117:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%esi
  mov    -0xc(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  xor    %ecx,%esi
  mov    %esi,%edx
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%ecx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    D12(%rip),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,-0xc(%rbp)
L4:
  mov    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  test   %rax,%rax
  jne    L2
  jmp    L36
L93:
  cmpl   $0x0,-0xc(%rbp)
  jne    L43
  mov    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Camellia_encrypt@plt>
L43:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%esi
  mov    -0xc(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  xor    %ecx,%esi
  mov    %esi,%edx
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  movzbl -0xd(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    D12(%rip),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,-0xc(%rbp)
L115:
  mov    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  test   %rax,%rax
  jne    L93
L36:
  mov    -0xc(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, const unsigned long length, const CAMELLIA_KEY *key, unsigned char *ivec, int *num, const int enc) {
  unsigned int n;
  unsigned long l = length;
  unsigned char c;
  assert(in && out && key && ivec && num);
  n = *num;
  if (enc) {
    while (l--) {
      if (n == 0) {
        Camellia_encrypt(ivec, ivec, key);
      }
      ivec[n] = *(out++) = *(in++) ^ ivec[n];
      n = (n + 1) % CAMELLIA_BLOCK_SIZE;
    }
  } else {
    while (l--) {
      if (n == 0) {
        Camellia_encrypt(ivec, ivec, key);
      }
      c = *(in);
      *(out++) = *(in++) ^ ivec[n];
      ivec[n] = c;
      n = (n + 1) % CAMELLIA_BLOCK_SIZE;
    }
  }
  *num = n;
}
```