user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  movq   $0x0,(%rsp)
  jmp    L35
  nop
L47:
  movsbl %al,%esi
  mov    %rbx,%rdi
  call   <append@plt>
L35:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0xa,%al
  jne    L47
  lea    D5(%rip),%r13
  lea    D32(%rip),%r12
  mov    %rsp,%r14
  nopw   0x0(%rax,%rax,1)
L165:
  mov    (%rsp),%rdi
  call   <length@plt>
  sub    $0x2,%eax
  mov    %eax,%ebp
  js     L94
  mov    $0x1,%r15d
  cs nopw 0x0(%rax,%rax,1)
L9:
  mov    (%rsp),%rdi
  xor    %ebx,%ebx
  call   <show@plt>
  test   %ebp,%ebp
  je     L130
  nop
L63:
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <printf@plt>
  cmp    %ebp,%ebx
  jne    L63
L130:
  mov    %r13,%rdi
  call   <printf@plt>
  mov    (%rsp),%rdi
  mov    %ebp,%esi
  call   <valueAt@plt>
  cmp    $0x28,%al
  je     L178
L151:
  mov    (%rsp),%rdi
  mov    %ebp,%esi
  call   <valueAt@plt>
  cmp    $0x5b,%al
  je     L90
  mov    (%rsp),%rdi
  mov    %ebp,%esi
  call   <valueAt@plt>
  cmp    $0x7b,%al
  je     L75
L154:
  sub    $0x1,%ebp
  jns    L9
  test   %r15d,%r15d
  je     L165
L94:
  mov    (%rsp),%rdi
  call   <show@plt>
  mov    (%rsp),%rdi
  call   <length@plt>
  test   %eax,%eax
  jne    L142
  lea    D13(%rip),%rdi
  call   <printf@plt>
L158:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L49
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L178:
  lea    0x1(%rbp),%ebx
  mov    (%rsp),%rdi
  mov    %ebx,%esi
  call   <valueAt@plt>
  cmp    $0x29,%al
  jne    L151
L51:
  mov    %ebx,%esi
  mov    %r14,%rdi
  xor    %r15d,%r15d
  call   <deleteAt@plt>
  mov    %ebp,%esi
  mov    %r14,%rdi
  sub    $0x1,%ebp
  call   <deleteAt@plt>
  jmp    L154
  nopl   (%rax)
L90:
  lea    0x1(%rbp),%ebx
  mov    (%rsp),%rdi
  mov    %ebx,%esi
  call   <valueAt@plt>
  cmp    $0x5d,%al
  je     L51
  mov    (%rsp),%rdi
  mov    %ebp,%esi
  call   <valueAt@plt>
  cmp    $0x7b,%al
  jne    L154
L75:
  lea    0x1(%rbp),%ebx
  mov    (%rsp),%rdi
  mov    %ebx,%esi
  call   <valueAt@plt>
  cmp    $0x7d,%al
  jne    L154
  jmp    L51
L142:
  lea    D28(%rip),%rdi
  call   <printf@plt>
  jmp    L158
L49:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D5
type_infered: string
name: retrieve_data
arguments: label: D32
type_infered: string
name: retrieve_data
arguments: label: D13
type_infered: string
name: retrieve_data
arguments: label: D28
type_infered: string

tool: D5: ^^


tool: D32:  

tool: D13: correct


tool: D28: wrong


assistant: ```c
int main(void) {
  struct string_node *head = NULL;
  char c;
  int is_break;
  int i, j;
  while ((c = getchar()) != '\n') {
    append(&head, c);
  }
  while (1) {
    is_break = 1;
    for (i = length(head) - 2; 0 <= i; i--) {
      show(head);
      for (j = 0; j < i; j++) {
        printf(" ");
      }
      printf("^^\n");
      if ((valueAt(head, i) == '(' && valueAt(head, i + 1) == ')') || (valueAt(head, i) == '[' && valueAt(head, i + 1) == ']') || (valueAt(head, i) == '{' && valueAt(head, i + 1) == '}')) {
        deleteAt(&head, i + 1);
        deleteAt(&head, i);
        is_break = 0;
        i--;
      }
    }
    if (is_break)
      break;
  }
  show(head);
  if (length(head) == 0) {
    printf("correct\n");
  } else {
    printf("wrong\n");
  }
  return 0;
}
```