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

```asm
<primary>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <match@plt>
  test   %eax,%eax
  je     L59
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <heir1@plt>
  mov    %eax,-0x24(%rbp)
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <needbrack@plt>
  mov    -0x24(%rbp),%eax
  jmp    L111
L59:
  lea    -0x13(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <symname@plt>
  test   %eax,%eax
  je     L141
  lea    -0x13(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <findloc@plt>
  cltq
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L6
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <getloc@plt>
  mov    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  movzbl (%rax),%eax
  mov    -0x38(%rbp),%rdx
  add    $0x4,%rdx
  movsbl %al,%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%rax
  add    $0xb,%rax
  movzbl (%rax),%eax
  cmp    $0x3,%al
  jne    L80
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movl   $0x2,(%rax)
L80:
  mov    -0x20(%rbp),%rax
  add    $0xb,%rax
  movzbl (%rax),%eax
  cmp    $0x2,%al
  jne    L24
  mov    $0x0,%eax
  jmp    L111
L24:
  mov    $0x1,%eax
  jmp    L111
L6:
  lea    -0x13(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <findglb@plt>
  cltq
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L5
  mov    -0x20(%rbp),%rax
  add    $0xb,%rax
  movzbl (%rax),%eax
  cmp    $0x4,%al
  je     L5
  mov    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movl   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0xb,%rax
  movzbl (%rax),%eax
  cmp    $0x2,%al
  je     L139
  mov    $0x1,%eax
  jmp    L111
L139:
  mov    $0x0,%eax
  call   <immed@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outname@plt>
  mov    $0x0,%eax
  call   <nl@plt>
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  movzbl (%rax),%eax
  mov    -0x38(%rbp),%rdx
  add    $0x4,%rdx
  movsbl %al,%eax
  mov    %eax,(%rdx)
  mov    $0x0,%eax
  jmp    L111
L5:
  lea    -0x13(%rbp),%rax
  mov    $0x1,%r8d
  mov    $0x0,%ecx
  mov    $0x2,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <addglb@plt>
  cltq
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movl   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L111
L141:
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <constant@plt>
  test   %eax,%eax
  je     L113
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  movl   $0x0,(%rax)
  mov    (%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  jmp    L111
L113:
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <error@plt>
  mov    $0x0,%eax
  call   <immed@plt>
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <outdec@plt>
  mov    $0x0,%eax
  call   <nl@plt>
  mov    $0x0,%eax
  call   <junk@plt>
  mov    $0x0,%eax
L111:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L39
  call   <__stack_chk_fail@plt>
L39:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D22
type_guessed: string
name: read_data
arguments: label: D1
type_guessed: string
name: read_data
arguments: label: D29
type_guessed: string

tool: D22: (

tool: D1: )

tool: D29: invalid expression

assistant: ```c
primary(lval) int *lval;
{
  char *ptr, sname[11];
  int num[1];
  int k;
  if (match("(")) {
    k = heir1(lval);
    needbrack(")");
    return k;
  }
  if (symname(sname)) {
    if (ptr = findloc(sname)) {
      getloc(ptr);
      lval[0] = ptr;
      lval[1] = ptr[12];
      if (ptr[11] == 3)
        lval[1] = 2;
      if (ptr[11] == 2)
        return 0;
      else
        return 1;
    }
    if (ptr = findglb(sname))
      if (ptr[11] != 4) {
        lval[0] = ptr;
        lval[1] = 0;
        if (ptr[11] != 2)
          return 1;
        immed();
        outname(ptr);
        nl();
        lval[1] = ptr[12];
        return 0;
      }
    ptr = addglb(sname, 4, 2, 0, 1);
    lval[0] = ptr;
    lval[1] = 0;
    return 0;
  }
  if (constant(num))
    return (lval[0] = lval[1] = 0);
  else {
    error("invalid expression");
    immed();
    outdec(0);
    nl();
    junk();
    return 0;
  }
}
```