user: Please show me the C implementation that matches the assembly code listed below:

```asm
<testQueryPlanning>:
  endbr64
  push   %r13
  lea    D164(%rip),%rdi
  lea    D240(%rip),%r13
  push   %r12
  push   %rbp
  lea    D269(%rip),%rbp
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L109
  lea    D105(%rip),%rdi
  call   <puts@plt>
L92:
  mov    %r12,%rdi
  lea    D138(%rip),%r13
  call   <free@plt>
  mov    %rbp,%rdi
  lea    D263(%rip),%rbp
  call   <free_ast_node@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L19
  lea    D54(%rip),%rdi
  call   <puts@plt>
L124:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  lea    D189(%rip),%rbp
  call   <free_ast_node@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L9
  lea    D124(%rip),%rdi
  call   <puts@plt>
L41:
  mov    %r12,%rdi
  lea    D98(%rip),%r13
  call   <free@plt>
  mov    %rbp,%rdi
  lea    D84(%rip),%rbp
  call   <free_ast_node@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L133
  lea    D24(%rip),%rdi
  call   <puts@plt>
L69:
  mov    %r12,%rdi
  lea    D160(%rip),%r13
  call   <free@plt>
  mov    %rbp,%rdi
  lea    D37(%rip),%rbp
  call   <free_ast_node@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L26
  lea    D137(%rip),%rdi
  call   <puts@plt>
L65:
  mov    %r12,%rdi
  lea    D191(%rip),%r13
  call   <free@plt>
  mov    %rbp,%rdi
  lea    D127(%rip),%rbp
  call   <free_ast_node@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L10
  lea    D116(%rip),%rdi
  call   <puts@plt>
L106:
  mov    %r12,%rdi
  lea    D167(%rip),%r13
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free_ast_node@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %eax,%edi
  call   <parse_string@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <streamline_query@plt>
  xor    %esi,%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <ast_to_string@plt>
  mov    %r13,%rsi
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L131
  lea    D65(%rip),%rdi
  call   <puts@plt>
L88:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1160 <free_ast_node@plt>
  xchg   %ax,%ax
L109:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D33(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L92
  nopl   0x0(%rax,%rax,1)
L131:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D175(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L88
  nopl   0x0(%rax,%rax,1)
L10:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D85(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L106
  nopl   0x0(%rax,%rax,1)
L26:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D231(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L65
  nopl   0x0(%rax,%rax,1)
L133:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D261(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L69
  nopl   0x0(%rax,%rax,1)
L9:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D183(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L19:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D245(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L124
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D164
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D240
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D269
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D105
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D138
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D263
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D54
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D189
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D124
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D98
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D84
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D24
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D160
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D37
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D137
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D191
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D127
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D116
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D167
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D65
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D33
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D175
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D85
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D231
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D261
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D183
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D245
type_infered: string

tool: D164: Starting Query Planning Tests..

tool: D240: (b|bb?)c

tool: D269: a*(b|b?bb?)c

tool: D105: Test 1 Passed.

tool: D138: (bc|d)

tool: D263: a*(bc|d)+

tool: D54: Test 2 Passed.

tool: D189: a*(bc|d)b?

tool: D124: Test 3 Passed.

tool: D98: (cd|fg?)h

tool: D84: a?(b*cd|e?fg?)h

tool: D24: Test 4 Passed.

tool: D160: cd

tool: D37: a*b?cd(e*|f)g?

tool: D137: Test 5 Passed.

tool: D191: abc

tool: D127: a+bc+

tool: D116: Test 6 Passed.

tool: D167: ab*c

tool: D65: Test 7 Passed.

tool: D33: Test 1 Failed: %s compared to %s


tool: D175: Test 7 Failed: %s compared to %s


tool: D85: Test 6 Failed: %s compared to %s


tool: D231: Test 5 Failed: %s compared to %s


tool: D261: Test 4 Failed: %s compared to %s


tool: D183: Test 3 Failed: %s compared to %s


tool: D245: Test 2 Failed: %s compared to %s


assistant: ```c
void testQueryPlanning(void) {
  printf("Starting Query Planning Tests..\n");
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "a*(b|b?bb?)c";
    char *valid = "(b|bb?)c";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 1 Passed.\n");
    } else {
      printf("Test 1 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "a*(bc|d)+";
    char *valid = "(bc|d)";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 2 Passed.\n");
    } else {
      printf("Test 2 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "a*(bc|d)b?";
    char *valid = "(bc|d)";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 3 Passed.\n");
    } else {
      printf("Test 3 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "a?(b*cd|e?fg?)h";
    char *valid = "(cd|fg?)h";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 4 Passed.\n");
    } else {
      printf("Test 4 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "a*b?cd(e*|f)g?";
    char *valid = "cd";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 5 Passed.\n");
    } else {
      printf("Test 5 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "a+bc+";
    char *valid = "abc";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 6 Passed.\n");
    } else {
      printf("Test 6 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
  {
    struct ast_node *result;
    char *stringResult;
    char *query1 = "ab*c";
    char *valid = "ab*c";
    result = parse_string(strlen(query1), query1);
    streamline_query(result);
    stringResult = ast_to_string(result, 0, 0);
    if (0 == strcmp(stringResult, valid)) {
      printf("Test 7 Passed.\n");
    } else {
      printf("Test 7 Failed: %s compared to %s\n", stringResult, valid);
      exit(1);
    }
    free(stringResult);
    free_ast_node(result);
  }
}
```