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

```asm
<convert>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    %rdi,%rsi
  lea    D153(%rip),%rdi
  push   %rbx
  sub    $0x168,%rsp
  movss  %xmm0,0x4(%rsp)
  movss  %xmm1,0x8(%rsp)
  movss  %xmm2,0xc(%rsp)
  movss  %xmm3,0x10(%rsp)
  movss  %xmm4,0x14(%rsp)
  movss  %xmm5,0x18(%rsp)
  movss  %xmm6,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  mov    %rbp,%rsi
  call   <printf@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  jle    L129
  cltq
  lea    D201(%rip),%rsi
  lea    -0x4(%r12,%rax,1),%r13
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L104
  mov    %r13,%rdi
  lea    D73(%rip),%rsi
  mov    $0x2,%r13d
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L129
L118:
  mov    %r12,%rdi
  lea    D5(%rip),%rsi
  lea    D14(%rip),%r14
  call   <fopen@plt>
  mov    %rbp,%rdi
  lea    D247(%rip),%rsi
  lea    0x50(%rsp),%rbx
  mov    %rax,%r12
  lea    D150(%rip),%r15
  call   <fopen@plt>
  mov    %r14,%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <fprintf@plt>
  lea    D193(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D190(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D203(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  nopl   (%rax)
L43:
  mov    %r12,%rdx
  mov    $0xff,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L40
  cmp    $0x1,%r13d
  je     L30
  cmpb   $0x46,0x50(%rsp)
  jne    L43
  cmpb   $0x20,0x51(%rsp)
  jne    L43
  lea    0x34(%rsp),%rcx
  lea    0x30(%rsp),%rdx
  sub    $0x8,%rsp
  mov    %rbx,%rdi
  lea    0x4c(%rsp),%rax
  lea    D126(%rip),%rsi
  push   %rax
  lea    0x5c(%rsp),%rax
  push   %rax
  lea    0x60(%rsp),%rax
  push   %rax
  lea    0x58(%rsp),%rax
  push   %rax
  lea    0x68(%rsp),%rax
  push   %rax
  lea    0x6c(%rsp),%r9
  lea    0x5c(%rsp),%r8
  call   <sscanf@plt>
  movss  0x60(%rsp),%xmm3
  movss  0x6c(%rsp),%xmm6
  movss  0x78(%rsp),%xmm0
  xorps  D59(%rip),%xmm3
  xorps  D59(%rip),%xmm6
  xorps  D59(%rip),%xmm0
  movss  0x74(%rsp),%xmm1
  movss  0x68(%rsp),%xmm5
  movss  %xmm3,0x60(%rsp)
  movss  0x5c(%rsp),%xmm2
  movss  %xmm6,0x6c(%rsp)
  movss  %xmm0,0x78(%rsp)
  add    $0x30,%rsp
L3:
  movss  0x4(%rsp),%xmm10
  movss  0x8(%rsp),%xmm9
  sub    $0x20,%rsp
  mov    %rbp,%rdi
  movss  0x60(%rsp),%xmm7
  movss  0x54(%rsp),%xmm4
  mulss  %xmm10,%xmm0
  movss  0x30(%rsp),%xmm12
  movss  0x6c(%rsp),%xmm8
  mulss  %xmm9,%xmm7
  movss  0x34(%rsp),%xmm11
  mulss  %xmm10,%xmm6
  mulss  %xmm10,%xmm5
  mulss  %xmm9,%xmm4
  addss  %xmm12,%xmm0
  mulss  %xmm10,%xmm3
  mulss  %xmm10,%xmm2
  addss  %xmm11,%xmm7
  mulss  %xmm9,%xmm8
  addss  %xmm12,%xmm6
  movss  %xmm0,0x8(%rsp)
  movaps %xmm1,%xmm0
  movss  0x2c(%rsp),%xmm1
  mulss  %xmm10,%xmm0
  addss  %xmm11,%xmm4
  addss  %xmm1,%xmm5
  addss  %xmm12,%xmm3
  addss  %xmm1,%xmm2
  addss  %xmm11,%xmm8
  addss  %xmm1,%xmm0
  movss  0x3c(%rsp),%xmm1
  movss  %xmm8,0x10(%rsp)
  movss  %xmm0,(%rsp)
  movss  0x38(%rsp),%xmm0
  call   <write_terrain_triangle@plt>
  add    $0x20,%rsp
  jmp    L43
  nop
L104:
  mov    $0x1,%r13d
  jmp    L118
  nopl   0x0(%rax,%rax,1)
L30:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  jle    L43
  lea    0x34(%rsp),%rcx
  lea    0x2c(%rsp),%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  sub    $0x8,%rsp
  lea    0x50(%rsp),%rax
  push   %rax
  lea    0x5c(%rsp),%rax
  push   %rax
  lea    0x5c(%rsp),%rax
  push   %rax
  lea    0x5c(%rsp),%rax
  push   %rax
  lea    0x68(%rsp),%rax
  push   %rax
  lea    0x68(%rsp),%r9
  lea    0x60(%rsp),%r8
  call   <sscanf@plt>
  movss  0x74(%rsp),%xmm0
  movss  0x5c(%rsp),%xmm2
  movss  0x68(%rsp),%xmm5
  movss  0x60(%rsp),%xmm3
  movss  0x6c(%rsp),%xmm6
  movaps %xmm0,%xmm1
  xorps  D59(%rip),%xmm2
  movss  0x78(%rsp),%xmm0
  xorps  D59(%rip),%xmm5
  xorps  D59(%rip),%xmm1
  xorps  D59(%rip),%xmm3
  movss  %xmm2,0x5c(%rsp)
  xorps  D59(%rip),%xmm6
  xorps  D59(%rip),%xmm0
  movss  %xmm5,0x68(%rsp)
  movss  %xmm1,0x74(%rsp)
  movss  %xmm3,0x60(%rsp)
  movss  %xmm6,0x6c(%rsp)
  movss  %xmm0,0x78(%rsp)
  add    $0x30,%rsp
  jmp    L3
L40:
  lea    D130(%rip),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <fprintf@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D208(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D20(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L12:
  mov    0x158(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L41
  add    $0x168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L129:
  lea    D146(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L12
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D153
type_guessed: string
name: read_data
arguments: data_label: D75
type_guessed: string
name: read_data
arguments: data_label: D201
type_guessed: string
name: read_data
arguments: data_label: D73
type_guessed: string
name: read_data
arguments: data_label: D5
type_guessed: string
name: read_data
arguments: data_label: D14
type_guessed: string
name: read_data
arguments: data_label: D247
type_guessed: string
name: read_data
arguments: data_label: D150
type_guessed: string
name: read_data
arguments: data_label: D193
type_guessed: string
name: read_data
arguments: data_label: D190
type_guessed: string
name: read_data
arguments: data_label: D203
type_guessed: string
name: read_data
arguments: data_label: D126
type_guessed: string
name: read_data
arguments: data_label: D59
type_guessed: byte[16]
name: read_data
arguments: data_label: D130
type_guessed: string
name: read_data
arguments: data_label: D208
type_guessed: string
name: read_data
arguments: data_label: D20
type_guessed: string
name: read_data
arguments: data_label: D1
type_guessed: string
name: read_data
arguments: data_label: D146
type_guessed: string

tool: D153: Input  File Name: %s


tool: D75: Output File Name: %s


tool: D201: .raw

tool: D73: .cad

tool: D5: ra

tool: D14: {


tool: D247: wa

tool: D150: %f %f %f %f %f %f %f %f %f

tool: D193:  "classname" "worldspawn"


tool: D190:  "message" "No Name"


tool: D203:  "worldtype" "0"


tool: D126: F %f %f %f %f %f %f %f %f %f

tool: {"D59": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D130: }


tool: D208:  "classname" "info_player_start"


tool: D20:  "origin" "0 0 0"


tool: D1:  "angle" "360"


tool: D146: ERROR: input file type should be .raw or .cad

assistant: ```c
int convert(char *in, char *out, float hscale, float vscale, float xoff, float yoff, float zoff, float floor, float quark) {
  FILE *i, *o;
  int length, type = 0;
  char str[256];
  float ax, ay, az, bx, by, bz, cx, cy, cz;
  printf("Input  File Name: %s\n", in);
  printf("Output File Name: %s\n", out);
  length = strlen(in);
  if (length < 5)
    type = 0;
  else if (strcmp(in + (length - 4), ".raw") == 0)
    type = 1;
  else if (strcmp(in + (length - 4), ".cad") == 0)
    type = 2;
  if (type == 0) {
    printf("ERROR: input file type should be .raw or .cad\n");
    return 1;
  }
  i = fopen(in, "ra");
  o = fopen(out, "wa");
  fprintf(o, "{\n");
  fprintf(o, " \"classname\" \"worldspawn\"\n");
  fprintf(o, " \"message\" \"No Name\"\n");
  fprintf(o, " \"worldtype\" \"0\"\n");
  while (1) {
    if (fgets(str, 255, i) == NULL)
      break;
    if (type == 1) {
      if (strlen(str) < 5)
        continue;
      sscanf(str, "%f %f %f %f %f %f %f %f %f", &ax, &az, &ay, &bx, &bz, &by, &cx, &cz, &cy);
      ax *= -1;
      bx *= -1;
      cx *= -1;
      ay *= -1;
      by *= -1;
      cy *= -1;
    }
    if (type == 2) {
      if (str[0] != 'F' || str[1] != ' ')
        continue;
      sscanf(str, "F %f %f %f %f %f %f %f %f %f", &ay, &az, &ax, &by, &bz, &bx, &cy, &cz, &cx);
      ay *= -1;
      by *= -1;
      cy *= -1;
    }
    write_terrain_triangle(o, floor, quark, ax * hscale + xoff, ay * hscale + yoff, az * vscale + zoff, bx * hscale + xoff, by * hscale + yoff, bz * vscale + zoff, cx * hscale + xoff, cy * hscale + yoff, cz * vscale + zoff);
  }
  fprintf(o, "}\n");
  fprintf(o, "{\n");
  fprintf(o, " \"classname\" \"info_player_start\"\n");
  fprintf(o, " \"origin\" \"0 0 0\"\n");
  fprintf(o, " \"angle\" \"360\"\n");
  fprintf(o, "}\n");
  fclose(i);
  fclose(o);
  return 0;
}
```