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

```asm
<Create_Campaign>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <Create_Campaign_File@plt>
  mov    %rax,%r14
  mov    $0x0,%eax
  test   %r14,%r14
  jne    L21
L188:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L83
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  lea    0x10(%rsp),%r12
  mov    %r12,0x8(%rsp)
  mov    $0x14,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    $0x0,%eax
  call   <Create_Campaign_Start_Point@plt>
  mov    %eax,%ebp
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,2),%ecx
  sub    %ecx,%eax
  mov    %r12,%r13
  mov    %eax,0x4(%rsp)
  lea    0x3(%rax),%r15d
  mov    $0x0,%ebx
  lea    0x2(%rax),%eax
  mov    %eax,(%rsp)
  jmp    L23
L218:
  test   %ebx,%ebx
  jle    L42
  cmp    %eax,-0x4(%r12)
  jne    L42
L240:
  mov    $0x0,%eax
  call   <rand@plt>
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%edx
  sub    %edx,%eax
  add    $0x1,%eax
  test   %ebx,%ebx
  jne    L218
  cmp    %eax,%ebp
  je     L240
  jmp    L218
L42:
  mov    %eax,(%r12)
  add    $0x1,%ebx
  add    $0x4,%r12
  cmp    %r15d,%ebx
  je     L278
L23:
  cmp    %ebx,(%rsp)
  jle    L240
  mov    $0x0,%eax
  call   <rand@plt>
  test   $0x1,%al
  je     L240
  mov    $0x6,%eax
  jmp    L42
L278:
  mov    0x4(%rsp),%eax
  lea    0x2(%rax),%eax
  mov    0x8(%rsp),%rsi
  lea    0x4(%rsi,%rax,4),%r15
  mov    $0x0,%r12d
  movl   $0x1,(%rsp)
  jmp    L144
L232:
  mov    0x4(%r13),%edi
  call   <Create_Campaign_Pickup_Objective@plt>
  mov    %rax,%rbx
  movl   $0x0,(%rsp)
  jmp    L103
L11:
  mov    0x10(%rsp),%edi
  call   <Create_Campaign_Description@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L221
  mov    %rax,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <free@plt>
L221:
  mov    $0x0,%eax
  call   <Create_Campaign_Weather@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L116
  mov    %rax,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <free@plt>
L116:
  mov    $0x0,%eax
  call   <Create_Campaign_Scenery@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L262
  mov    %rax,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <free@plt>
L262:
  mov    $0x0,%eax
  call   <Place_Campaign_Ship@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L258
  mov    %rax,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <free@plt>
L258:
  mov    %ebp,%edi
  call   <Get_Location_Symbol@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L22
  mov    %rax,%rdx
  lea    D38(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L22
L173:
  add    $0x4,%r13
  mov    $0x1,%r12d
  cmp    %r13,%r15
  je     L31
L144:
  mov    0x0(%r13),%edi
  cmp    $0x6,%edi
  je     L232
  mov    0x4(%r13),%esi
  call   <Create_Campaign_Arrive_Objective@plt>
  mov    %rax,%rbx
L103:
  test   %r12d,%r12d
  je     L11
L22:
  test   %rbx,%rbx
  je     L173
  mov    %rbx,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L173
L31:
  lea    0x10(%rsp),%rsi
  mov    %ebp,%edi
  call   <Place_Campaign_Humans@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L229
  mov    %rax,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <free@plt>
L229:
  mov    (%rsp),%edi
  call   <Create_Campaign_Aircraft@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L117
  mov    %rax,%rdx
  lea    D29(%rip),%rsi
  mov    %r14,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <free@plt>
L117:
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L188
L83:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D29
type: string
name: extract_symbolic_data
arguments: data_label: D38
type: string

tool: D29: %s


tool: D38: mission_begin_at %s


assistant: ```c
int Create_Campaign() {
  FILE *camp_file;
  char *objective_string, *temp_string;
  int start_point;
  int objective_type, all_arrivals = 1;
  int number_of_objectives;
  int done_description = 0;
  int destination[5];
  int count;
  camp_file = Create_Campaign_File();
  if (!camp_file)
    return 0;
  memset(destination, 0, 5 * sizeof(int));
  start_point = Create_Campaign_Start_Point();
  number_of_objectives = (rand() % 3) + 3;
  count = 0;
  while (count < number_of_objectives) {
    if (count < (number_of_objectives - 1))
      objective_type = rand() % 2;
    else
      objective_type = 0;
    if (objective_type == 0) {
      int done;
      int temp_place;
      do {
        temp_place = (rand() % 5) + 1;
        if ((count == 0) && (temp_place == start_point))
          done = 0;
        else if ((count > 0) && (temp_place == destination[count - 1]))
          done = 0;
        else
          done = 1;
      } while (!done);
      destination[count] = temp_place;
    } else
      destination[count] = 6;
    count++;
  }
  count = 0;
  while (count < number_of_objectives) {
    if (destination[count] == 6) {
      objective_string = Create_Campaign_Pickup_Objective(destination[count + 1]);
      all_arrivals = 0;
    } else
      objective_string = Create_Campaign_Arrive_Objective(destination[count], destination[count + 1]);
    if (!done_description) {
      temp_string = Create_Campaign_Description(destination[0]);
      if (temp_string) {
        fprintf(camp_file, "%s\n", temp_string);
        free(temp_string);
      }
      temp_string = Create_Campaign_Weather();
      if (temp_string) {
        fprintf(camp_file, "%s\n", temp_string);
        free(temp_string);
      }
      temp_string = Create_Campaign_Scenery();
      if (temp_string) {
        fprintf(camp_file, "%s\n", temp_string);
        free(temp_string);
      }
      temp_string = Place_Campaign_Ship();
      if (temp_string) {
        fprintf(camp_file, "%s\n", temp_string);
        free(temp_string);
      }
      temp_string = Get_Location_Symbol(start_point);
      if (temp_string) {
        fprintf(camp_file, "mission_begin_at %s\n", temp_string);
        free(temp_string);
      }
      done_description = 1;
    }
    if (objective_string) {
      fprintf(camp_file, "%s\n", objective_string);
      free(objective_string);
    }
    count++;
  }
  temp_string = Place_Campaign_Humans(start_point, destination);
  if (temp_string) {
    fprintf(camp_file, "%s\n", temp_string);
    free(temp_string);
  }
  temp_string = Create_Campaign_Aircraft(all_arrivals);
  if (temp_string) {
    fprintf(camp_file, "%s\n", temp_string);
    free(temp_string);
  }
  fclose(camp_file);
  return 1;
}
```