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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x49000(%rsp),%r11
L39:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L39
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x128,-0x49404(%rbp)
  lea    -0x493f0(%rbp),%rax
  mov    %rax,-0x49400(%rbp)
  movl   $0x0,-0x4940c(%rbp)
  jmp    L35
L90:
  mov    -0x4940c(%rbp),%eax
  cltq
  movb   $0x0,-0x493f0(%rbp,%rax,1)
  addl   $0x1,-0x4940c(%rbp)
L35:
  cmpl   $0x493df,-0x4940c(%rbp)
  jle    L90
  lea    D7(%rip),%rax
  mov    %rax,-0x493f8(%rbp)
  movl   $0x0,-0x49408(%rbp)
  jmp    L20
L155:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L84
  mov    -0x49400(%rbp),%rax
  movzbl (%rax),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x49400(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L118
L84:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L55
  mov    -0x49400(%rbp),%rax
  movzbl (%rax),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    -0x49400(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L118
L55:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3c,%al
  jne    L99
  subq   $0x1,-0x49400(%rbp)
  jmp    L118
L99:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3e,%al
  jne    L185
  addq   $0x1,-0x49400(%rbp)
  jmp    L118
L185:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L105
  mov    -0x49400(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
  jmp    L118
L105:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L188
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    -0x49400(%rbp),%rdx
  mov    %al,(%rdx)
  jmp    L118
L188:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  jne    L77
  mov    -0x49400(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L118
  movl   $0x1,-0x49410(%rbp)
  jmp    L292
L206:
  addl   $0x1,-0x49408(%rbp)
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  jne    L148
  addl   $0x1,-0x49410(%rbp)
L148:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L292
  subl   $0x1,-0x49410(%rbp)
L292:
  cmpl   $0x0,-0x49410(%rbp)
  je     L118
  mov    -0x49408(%rbp),%eax
  cmp    -0x49404(%rbp),%eax
  jl     L206
  jmp    L118
L77:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L118
  mov    -0x49400(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L118
  movl   $0x1,-0x49410(%rbp)
  jmp    L167
L168:
  subl   $0x1,-0x49408(%rbp)
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L117
  addl   $0x1,-0x49410(%rbp)
L117:
  mov    -0x49408(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x493f8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  jne    L167
  subl   $0x1,-0x49410(%rbp)
L167:
  cmpl   $0x0,-0x49410(%rbp)
  jne    L168
L118:
  addl   $0x1,-0x49408(%rbp)
L20:
  cmpl   $0x127,-0x49408(%rbp)
  jle    L155
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L132
  call   <__stack_chk_fail@plt>
L132:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D7
type: string

tool: D7: >++++++++++>>>+>+[>>>+[-[<<<<<[+<<<<<]>>[[-]>[<<+>+>-]<[>+<-]<[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>[-]>>>>+>+<<<<<<-[>+<-]]]]]]]]]]]>[<+>-]+>>>>>]<<<<<[<<<<<]>>>>>>>[>>>>>]++[-<<<<<]>>>>>>-]+>>>>>]<[>++<-]<<<<[<[>+<-]<<<<]>>[->[-]++++++[<++++++++>-]>>>>]<<<<<[<[>+>+<<-]>.<<<<<]>.>>>>]

assistant: ```c
int main() {
  int fsize = 296, parens;
  char mem[300000], *ptr = mem;
  for (int i = 0; i < 300000; i++)
    mem[i] = 0;
  char *str = ">++++++++++>>>+>+[>>>+[-[<<<<<[+<<<<<]>>[[-]>[<<+>+>-]<[>+<-]<[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>[-]>>>>+>+<<<<<<-[>+<-]]]]]]]]]]]>[<+>-]+>>>>>]<<<<<[<<<<<]>>>>>>>[>>>>>]++[-<<<<<]>>>>>>-]+>>>>>]<[>++<-]<<<<[<[>+<-]<<<<]>>[->[-]++++++[<++++++++>-]>>>>]<<<<<[<[>+>+<<-]>.<<<<<]>.>>>>]";
  for (int i = 0; i < 296; i++) {
    if (str[i] == '+') {
      ++*ptr;
    } else if (str[i] == '-') {
      --*ptr;
    } else if (str[i] == '<') {
      ptr--;
    } else if (str[i] == '>') {
      ptr++;
    } else if (str[i] == '.') {
      putchar(*ptr);
    } else if (str[i] == ',') {
      *ptr = getchar();
    } else if (str[i] == '[') {
      if (*ptr == 0) {
        parens = 1;
        while (parens != 0 && i < fsize) {
          i++;
          if (str[i] == '[')
            parens++;
          if (str[i] == ']')
            parens--;
        }
      }
    } else if (str[i] == ']') {
      if (*ptr != 0) {
        parens = 1;
        while (parens != 0) {
          i--;
          if (str[i] == ']')
            parens++;
          if (str[i] == '[')
            parens--;
        }
      }
    }
  }
  return 0;
}
```