user: What would the C source look like for the assembly code provided here:

```asm
<CAST_cfb64_encrypt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r15
  mov    %rsi,%r12
  mov    %rdx,%r14
  mov    %rcx,0x8(%rsp)
  mov    %r8,%rbx
  mov    %r9,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    (%r9),%ebp
  cmpl   $0x0,0x80(%rsp)
  jne    L11
  mov    %rdi,%r13
  lea    0x20(%rsp),%rax
  mov    %rax,0x18(%rsp)
  test   %rdx,%rdx
  jne    L1
L109:
  mov    0x10(%rsp),%rax
  mov    %ebp,(%rax)
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L95
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  test   %rdx,%rdx
  je     L109
  mov    %rdi,%r13
  lea    0x20(%rsp),%rax
  mov    %rax,0x18(%rsp)
  jmp    L45
L79:
  add    $0x1,%r13
  movslq %ebp,%rax
  add    %rbx,%rax
  movzbl -0x1(%r13),%edx
  xor    (%rax),%dl
  add    $0x1,%r12
  mov    %dl,-0x1(%r12)
  mov    %dl,(%rax)
  add    $0x1,%ebp
  and    $0x7,%ebp
  mov    %r15,%rax
  sub    %r13,%rax
  add    %r14,%rax
  je     L109
L45:
  test   %ebp,%ebp
  jne    L79
  movzbl (%rbx),%edx
  shl    $0x18,%rdx
  movzbl 0x1(%rbx),%eax
  shl    $0x10,%rax
  or     %rdx,%rax
  movzbl 0x3(%rbx),%edx
  or     %rdx,%rax
  movzbl 0x2(%rbx),%edx
  shl    $0x8,%rdx
  or     %rdx,%rax
  mov    %rax,0x20(%rsp)
  movzbl 0x4(%rbx),%edx
  shl    $0x18,%rdx
  movzbl 0x5(%rbx),%eax
  shl    $0x10,%rax
  or     %rdx,%rax
  movzbl 0x7(%rbx),%edx
  or     %rdx,%rax
  movzbl 0x6(%rbx),%edx
  shl    $0x8,%rdx
  or     %rdx,%rax
  mov    %rax,0x28(%rsp)
  mov    0x8(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <CAST_encrypt@plt>
  mov    0x20(%rsp),%rax
  mov    %rax,%rdx
  shr    $0x18,%rdx
  mov    %dl,(%rbx)
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dl,0x1(%rbx)
  movzbl %ah,%ecx
  mov    %cl,0x2(%rbx)
  mov    %al,0x3(%rbx)
  mov    0x28(%rsp),%rax
  mov    %rax,%rdx
  shr    $0x18,%rdx
  mov    %dl,0x4(%rbx)
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dl,0x5(%rbx)
  movzbl %ah,%ecx
  mov    %cl,0x6(%rbx)
  mov    %al,0x7(%rbx)
  jmp    L79
L58:
  add    $0x1,%r13
  movzbl -0x1(%r13),%eax
  movslq %ebp,%rdx
  add    %rbx,%rdx
  movzbl (%rdx),%ecx
  mov    %al,(%rdx)
  add    $0x1,%r12
  xor    %ecx,%eax
  mov    %al,-0x1(%r12)
  add    $0x1,%ebp
  and    $0x7,%ebp
  mov    %r15,%rax
  sub    %r13,%rax
  add    %r14,%rax
  je     L109
L1:
  test   %ebp,%ebp
  jne    L58
  movzbl (%rbx),%edx
  shl    $0x18,%rdx
  movzbl 0x1(%rbx),%eax
  shl    $0x10,%rax
  or     %rdx,%rax
  movzbl 0x3(%rbx),%edx
  or     %rdx,%rax
  movzbl 0x2(%rbx),%edx
  shl    $0x8,%rdx
  or     %rdx,%rax
  mov    %rax,0x20(%rsp)
  movzbl 0x4(%rbx),%edx
  shl    $0x18,%rdx
  movzbl 0x5(%rbx),%eax
  shl    $0x10,%rax
  or     %rdx,%rax
  movzbl 0x7(%rbx),%edx
  or     %rdx,%rax
  movzbl 0x6(%rbx),%edx
  shl    $0x8,%rdx
  or     %rdx,%rax
  mov    %rax,0x28(%rsp)
  mov    0x8(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <CAST_encrypt@plt>
  mov    0x20(%rsp),%rax
  mov    %rax,%rdx
  shr    $0x18,%rdx
  mov    %dl,(%rbx)
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dl,0x1(%rbx)
  movzbl %ah,%ecx
  mov    %cl,0x2(%rbx)
  mov    %al,0x3(%rbx)
  mov    0x28(%rsp),%rax
  mov    %rax,%rdx
  shr    $0x18,%rdx
  mov    %dl,0x4(%rbx)
  mov    %rax,%rdx
  shr    $0x10,%rdx
  mov    %dl,0x5(%rbx)
  movzbl %ah,%ecx
  mov    %cl,0x6(%rbx)
  mov    %al,0x7(%rbx)
  jmp    L58
L95:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, const CAST_KEY *schedule, unsigned char *ivec, int *num, int enc) {
  CAST_LONG v0, v1, t;
  int n = *num;
  long l = length;
  CAST_LONG ti[2];
  unsigned char *iv, c, cc;
  iv = ivec;
  if (enc) {
    while (l--) {
      if (n == 0) {
        (v0 = ((unsigned long)(*((iv)++))) << 24L, v0 |= ((unsigned long)(*((iv)++))) << 16L, v0 |= ((unsigned long)(*((iv)++))) << 8L, v0 |= ((unsigned long)(*((iv)++))));
        ti[0] = v0;
        (v1 = ((unsigned long)(*((iv)++))) << 24L, v1 |= ((unsigned long)(*((iv)++))) << 16L, v1 |= ((unsigned long)(*((iv)++))) << 8L, v1 |= ((unsigned long)(*((iv)++))));
        ti[1] = v1;
        CAST_encrypt((CAST_LONG *)ti, schedule);
        iv = ivec;
        t = ti[0];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff), *((iv)++) = (unsigned char)(((t)) & 0xff));
        t = ti[1];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff), *((iv)++) = (unsigned char)(((t)) & 0xff));
        iv = ivec;
      }
      c = *(in++) ^ iv[n];
      *(out++) = c;
      iv[n] = c;
      n = (n + 1) & 0x07;
    }
  } else {
    while (l--) {
      if (n == 0) {
        (v0 = ((unsigned long)(*((iv)++))) << 24L, v0 |= ((unsigned long)(*((iv)++))) << 16L, v0 |= ((unsigned long)(*((iv)++))) << 8L, v0 |= ((unsigned long)(*((iv)++))));
        ti[0] = v0;
        (v1 = ((unsigned long)(*((iv)++))) << 24L, v1 |= ((unsigned long)(*((iv)++))) << 16L, v1 |= ((unsigned long)(*((iv)++))) << 8L, v1 |= ((unsigned long)(*((iv)++))));
        ti[1] = v1;
        CAST_encrypt((CAST_LONG *)ti, schedule);
        iv = ivec;
        t = ti[0];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff), *((iv)++) = (unsigned char)(((t)) & 0xff));
        t = ti[1];
        (*((iv)++) = (unsigned char)(((t) >> 24L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 16L) & 0xff), *((iv)++) = (unsigned char)(((t) >> 8L) & 0xff), *((iv)++) = (unsigned char)(((t)) & 0xff));
        iv = ivec;
      }
      cc = *(in++);
      c = iv[n];
      iv[n] = cc;
      *(out++) = c ^ cc;
      n = (n + 1) & 0x07;
    }
  }
  v0 = v1 = ti[0] = ti[1] = t = c = cc = 0;
  *num = n;
}
```