user: 请从给定的汇编指令推导出C源代码：

```asm
<is_invalid_exclude>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L117
L12:
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jns    L156
  mov    $0x1,%eax
  jmp    L37
L156:
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  cmp    %rax,-0x20(%rbp)
  jg     L19
  mov    $0x1,%eax
  jmp    L37
L19:
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jns    L0
  mov    $0x1,%eax
  jmp    L37
L0:
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  cmp    %rax,-0x28(%rbp)
  jg     L132
  mov    $0x1,%eax
  jmp    L37
L132:
  cmpl   $0x0,-0x34(%rbp)
  je     L22
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jl     L22
  mov    $0x1,%eax
  jmp    L37
L22:
  cmpq   $0x0,-0x8(%rbp)
  jle    L157
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    -0x10(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jge    L187
  mov    $0x1,%eax
  jmp    L37
L187:
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    -0x10(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L157
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  shl    $0x4,%rax
  lea    -0x8(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jg     L157
  mov    $0x1,%eax
  jmp    L37
L157:
  addq   $0x1,-0x8(%rbp)
L117:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jl     L12
  mov    $0x0,%eax
L37:
  pop    %rbp
  ret
```

assistant: ```c
int is_invalid_exclude(long *exclude, long natom0, long natom1, long nexclude, int intra) {
  long iex;
  for (iex = 0; iex < nexclude; iex++) {
    if (exclude[2 * iex] < 0)
      return 1;
    if (exclude[2 * iex] >= natom0)
      return 1;
    if (exclude[2 * iex + 1] < 0)
      return 1;
    if (exclude[2 * iex + 1] >= natom1)
      return 1;
    if (intra) {
      if (exclude[2 * iex + 1] >= exclude[2 * iex])
        return 1;
    }
    if (iex > 0) {
      if (exclude[2 * iex] < exclude[2 * iex - 2])
        return 1;
      if (exclude[2 * iex] == exclude[2 * iex - 2]) {
        if (exclude[2 * iex + 1] <= exclude[2 * iex - 1])
          return 1;
      }
    }
  }
  return 0;
}
```