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

```asm
<testQueryPlanning>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  lea    D247(%rip),%rdi
  call   <puts@plt>
  lea    D284(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%rbp
  lea    D212(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L96
  lea    D323(%rip),%rdi
  call   <puts@plt>
L33:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  lea    D53(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%rbp
  lea    D81(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L102
  lea    D60(%rip),%rdi
  call   <puts@plt>
L129:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  lea    D277(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%rbp
  lea    D81(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L60
  lea    D256(%rip),%rdi
  call   <puts@plt>
L62:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  lea    D18(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%rbp
  lea    D168(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L87
  lea    D165(%rip),%rdi
  call   <puts@plt>
L16:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  lea    D345(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%rbp
  lea    D67(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L97
  lea    D207(%rip),%rdi
  call   <puts@plt>
L43:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  lea    D185(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbx,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%rbp
  lea    D325(%rip),%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L92
  lea    D153(%rip),%rdi
  call   <puts@plt>
L2:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  lea    D80(%rip),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  mov    %rbp,%rsi
  call   <parse_string@plt>
  mov    %rax,%rbx
  mov    %rax,%rdi
  call   <streamline_query@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <ast_to_string@plt>
  mov    %rax,%r12
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L54
  lea    D73(%rip),%rdi
  call   <puts@plt>
L71:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free_ast_node@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L96:
  lea    D212(%rip),%rdx
  mov    %rbp,%rsi
  lea    D57(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L33
L102:
  lea    D81(%rip),%rdx
  mov    %rbp,%rsi
  lea    D318(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L129
L60:
  lea    D81(%rip),%rdx
  mov    %rbp,%rsi
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L62
L87:
  lea    D168(%rip),%rdx
  mov    %rbp,%rsi
  lea    D87(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L16
L97:
  lea    D67(%rip),%rdx
  mov    %rbp,%rsi
  lea    D56(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L43
L92:
  lea    D325(%rip),%rdx
  mov    %rbp,%rsi
  lea    D251(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L2
L54:
  lea    D80(%rip),%rdx
  mov    %r12,%rsi
  lea    D62(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L71
```

tool_calls: name: retrieve_data
arguments: data_tag: D247
type_infered: string
name: retrieve_data
arguments: data_tag: D284
type_infered: string
name: retrieve_data
arguments: data_tag: D212
type_infered: string
name: retrieve_data
arguments: data_tag: D323
type_infered: string
name: retrieve_data
arguments: data_tag: D53
type_infered: string
name: retrieve_data
arguments: data_tag: D81
type_infered: string
name: retrieve_data
arguments: data_tag: D60
type_infered: string
name: retrieve_data
arguments: data_tag: D277
type_infered: string
name: retrieve_data
arguments: data_tag: D256
type_infered: string
name: retrieve_data
arguments: data_tag: D18
type_infered: string
name: retrieve_data
arguments: data_tag: D168
type_infered: string
name: retrieve_data
arguments: data_tag: D165
type_infered: string
name: retrieve_data
arguments: data_tag: D345
type_infered: string
name: retrieve_data
arguments: data_tag: D67
type_infered: string
name: retrieve_data
arguments: data_tag: D207
type_infered: string
name: retrieve_data
arguments: data_tag: D185
type_infered: string
name: retrieve_data
arguments: data_tag: D325
type_infered: string
name: retrieve_data
arguments: data_tag: D153
type_infered: string
name: retrieve_data
arguments: data_tag: D80
type_infered: string
name: retrieve_data
arguments: data_tag: D73
type_infered: string
name: retrieve_data
arguments: data_tag: D57
type_infered: string
name: retrieve_data
arguments: data_tag: D318
type_infered: string
name: retrieve_data
arguments: data_tag: D47
type_infered: string
name: retrieve_data
arguments: data_tag: D87
type_infered: string
name: retrieve_data
arguments: data_tag: D56
type_infered: string
name: retrieve_data
arguments: data_tag: D251
type_infered: string
name: retrieve_data
arguments: data_tag: D62
type_infered: string

tool: D247: Starting Query Planning Tests..

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

tool: D212: (b|bb?)c

tool: D323: Test 1 Passed.

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

tool: D81: (bc|d)

tool: D60: Test 2 Passed.

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

tool: D256: Test 3 Passed.

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

tool: D168: (cd|fg?)h

tool: D165: Test 4 Passed.

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

tool: D67: cd

tool: D207: Test 5 Passed.

tool: D185: a+bc+

tool: D325: abc

tool: D153: Test 6 Passed.

tool: D80: ab*c

tool: D73: Test 7 Passed.

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


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


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


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


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


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


tool: D62: Test 7 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);
  }
}
```