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

```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    D6(%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    L12
L15:
  cmpl   $0x2,-0x34(%rbp)
  je     L51
  cmpl   $0x4,-0x34(%rbp)
  je     L25
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L74
L51:
  cmpl   $0x0,-0x38(%rbp)
  je     L66
  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    L74
L66:
  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    L74
L25:
  cmpl   $0x0,-0x38(%rbp)
  je     L42
  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    L34
L42:
  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)
L34:
  nop
L74:
  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)
L12:
  cmpl   $0x0,-0x18(%rbp)
  jg     L15
  cmpl   $0x0,-0x18(%rbp)
  je     L75
  mov    $0x0,%eax
  jmp    L82
L75:
  mov    $0x1,%eax
L82:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L86
  call   <__stack_chk_fail@plt>
L86:
  leave
  ret
```

assistant: ```c
bool outEx(unsigned char *data, int inOffset, int size, int intSize, bool 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 false;
  else
    return true;
}
```