user: What is the c source code of the assembly code below?

```asm
<outEx>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  mov    %r8d,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D3(%rip),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    0x10(%rbp),%esi
  mov    %rax,%rdi
  call   <fseek@plt>
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L96
L114:
  cmpl   $0x2,-0x34(%rbp)
  je     L92
  cmpl   $0x4,-0x34(%rbp)
  je     L107
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L26
L92:
  cmpl   $0x0,-0x38(%rbp)
  je     L82
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L26
L82:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %edx,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L26
L107:
  cmpl   $0x0,-0x38(%rbp)
  je     L44
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L50
L44:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  or     %edx,%eax
  mov    %eax,-0x1c(%rbp)
L50:
  nop
L26:
  mov    -0x40(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  lea    -0x1c(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  sub    %eax,-0x18(%rbp)
L96:
  cmpl   $0x0,-0x18(%rbp)
  jg     L114
  cmpl   $0x0,-0x18(%rbp)
  je     L99
  mov    $0x0,%eax
  jmp    L78
L99:
  mov    $0x1,%eax
L78:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

assistant: ```c
int outEx(unsigned char *data, int inOffset, int size, int intSize, int swap, FILE *fout, int outOffset) {
  unsigned char *s;
  int remain, l;
  unsigned int v;
  fseek(fout, outOffset, SEEK_SET);
  s = data + inOffset;
  remain = size;
  while (remain > 0) {
    switch (intSize) {
    default:
      v = s[0];
      break;
    case 2:
      if (swap)
        v = (s[0] << 8) | (s[1] << 0);
      else
        v = (s[0] << 0) | (s[1] << 8);
      break;
    case 4:
      if (swap)
        v = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | (s[3] << 0);
      else
        v = (s[0] << 0) | (s[1] << 8) | (s[2] << 16) | (s[3] << 24);
      break;
    }
    l = fwrite(&v, 1, intSize, fout);
    s += l;
    remain -= l;
  }
  if (remain != 0)
    return 0;
  else
    return 1;
}
```