user: 下面的汇编指令对应的C源代码是什么：

```asm
<validate_and_optimize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L336
L85:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  jne    L190
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc(%rbp)
  jge    L158
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L158
  mov    $0x0,%eax
  jmp    L348
L158:
  addl   $0x1,-0x4(%rbp)
  jmp    L48
L190:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L80
  subl   $0x1,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L292
  mov    $0x0,%eax
  jmp    L348
L80:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L264
  movl   $0x1,-0x8(%rbp)
  jmp    L48
L264:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc(%rbp)
  jge    L328
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x3e,%eax
  je     L205
  cmp    $0x3e,%eax
  jg     L48
  cmp    $0x3c,%eax
  je     L31
  cmp    $0x3c,%eax
  jg     L48
  cmp    $0x2b,%eax
  je     L47
  cmp    $0x2d,%eax
  je     L123
  jmp    L48
L47:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L306
  mov    $0x0,%eax
  jmp    L348
L123:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L335
  mov    $0x0,%eax
  jmp    L348
L31:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3e,%al
  jne    L179
  mov    $0x0,%eax
  jmp    L348
L205:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3c,%al
  jne    L84
  mov    $0x0,%eax
  jmp    L348
L292:
  nop
  jmp    L48
L328:
  nop
  jmp    L48
L306:
  nop
  jmp    L48
L335:
  nop
  jmp    L48
L179:
  nop
  jmp    L48
L84:
  nop
L48:
  addl   $0x1,-0xc(%rbp)
L336:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L85
  cmpl   $0x0,-0x8(%rbp)
  je     L143
  cmpl   $0x0,-0x4(%rbp)
  je     L196
L143:
  mov    $0x0,%eax
  jmp    L348
L196:
  mov    $0x1,%eax
L348:
  pop    %rbp
  ret
```

assistant: ```c
int validate_and_optimize(char *program, int len) {
  int i, has_io = 0, nesting_level = 0;
  for (i = 0; i < len; i++) {
    if (program[i] == '[') {
      if ((i < len - 1) && program[i + 1] == ']')
        return 0;
      nesting_level++;
      continue;
    }
    if (program[i] == ']') {
      nesting_level--;
      if (nesting_level < 0) {
        return 0;
      }
      continue;
    }
    if (program[i] == '.') {
      has_io = 1;
      continue;
    }
    if (i < len - 1) {
      switch (program[i]) {
      case '+':
        if (program[i + 1] == '-')
          return 0;
        break;
      case '-':
        if (program[i + 1] == '+')
          return 0;
        break;
      case '<':
        if (program[i + 1] == '>')
          return 0;
        break;
      case '>':
        if (program[i + 1] == '<')
          return 0;
        break;
      default:;
      }
    }
  }
  if (!has_io || nesting_level)
    return 0;
  return 1;
}
```