user: 请将以下的汇编代码转换成C语言代码:

```asm
<swi_gen_filename>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  cmp    $0xa,%edi
  jg     L164
  cmp    $0x1,%edi
  jg     L7
  test   %edi,%edi
  je     L7
  cmp    $0x1,%edi
  jne    L21
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <strcpy@plt>
  movsd  0x8(%rsp),%xmm0
L168:
  comisd D39(%rip),%xmm0
  lea    0x18(%rsp),%rcx
  lea    0x14(%rsp),%rdx
  lea    0x1c(%rsp),%rsi
  lea    0x20(%rsp),%r8
  jae    L152
  xor    %edi,%edi
  call   <swe_revjul@plt>
L91:
  movslq 0x1c(%rsp),%rbx
  mov    %rbx,%rax
  imul   $0x51eb851f,%rbx,%rbx
  cltd
  sar    $0x25,%rbx
  sub    %edx,%ebx
  test   %eax,%eax
  js     L50
  imul   $0xaaaaaaab,%ebx,%eax
  add    $0x2aaaaaaa,%eax
  ror    %eax
  cmp    $0x2aaaaaaa,%eax
  jbe    L161
  cs nopw 0x0(%rax,%rax,1)
L146:
  sub    $0x1,%ebx
L130:
  imul   $0xaaaaaaab,%ebx,%eax
  add    $0x2aaaaaaa,%eax
  ror    %eax
  cmp    $0x2aaaaaaa,%eax
  ja     L146
  test   %ebx,%ebx
  js     L157
L161:
  lea    D80(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L166:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %ebx,%edx
  lea    D60(%rip),%rcx
  lea    D71(%rip),%rsi
  neg    %edx
  cltq
  cmovs  %ebx,%edx
  lea    0x0(%rbp,%rax,1),%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L164:
  lea    -0xc(%rdi),%eax
  cmp    $0x5,%eax
  ja     L39
  lea    D123(%rip),%rsi
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <strcpy@plt>
  movsd  0x8(%rsp),%xmm0
  jmp    L168
  nopl   0x0(%rax)
L152:
  mov    $0x1,%edi
  call   <swe_revjul@plt>
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L50:
  imul   $0xc28f5c29,%eax,%eax
  add    $0x51eb850,%eax
  ror    $0x2,%eax
  cmp    $0x28f5c28,%eax
  jbe    L130
  sub    $0x1,%ebx
  imul   $0xaaaaaaab,%ebx,%eax
  add    $0x2aaaaaaa,%eax
  ror    %eax
  cmp    $0x2aaaaaaa,%eax
  ja     L146
  nopl   0x0(%rax)
L157:
  lea    D107(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L166
  nopl   0x0(%rax)
L7:
  lea    D129(%rip),%rsi
  mov    %rbp,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <strcpy@plt>
  movsd  0x8(%rsp),%xmm0
  jmp    L168
L39:
  cmp    $0x1adb0,%edi
  lea    D112(%rip),%rsi
  lea    D53(%rip),%rax
  cmovge %rax,%rsi
L92:
  lea    -0x2710(%rdi),%r8d
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  movslq %r8d,%rdx
  mov    %r8d,%eax
  add    $0x38,%rsp
  mov    %rbp,%rdi
  imul   $0x10624dd3,%rdx,%rdx
  sar    $0x1f,%eax
  pop    %rbx
  pop    %rbp
  lea    D60(%rip),%r9
  lea    D21(%rip),%rcx
  sar    $0x26,%rdx
  sub    %eax,%edx
  xor    %eax,%eax
  jmp    10f0 <sprintf@plt>
L41:
  call   <__stack_chk_fail@plt>
L21:
  lea    D112(%rip),%rsi
  jmp    L92
```

tool_calls: name: disassemble_data
arguments: data_label: D45
type: string
name: disassemble_data
arguments: data_label: D39
type: f64
name: disassemble_data
arguments: data_label: D80
type: string
name: disassemble_data
arguments: data_label: D60
type: string
name: disassemble_data
arguments: data_label: D71
type: string
name: disassemble_data
arguments: data_label: D123
type: string
name: disassemble_data
arguments: data_label: D107
type: string
name: disassemble_data
arguments: data_label: D129
type: string
name: disassemble_data
arguments: data_label: D112
type: string
name: disassemble_data
arguments: data_label: D53
type: string
name: disassemble_data
arguments: data_label: D21
type: string

tool: D45: semo

tool: D39: 2305447.5

tool: D80: _

tool: D60: se1

tool: D71: %02d.%s

tool: D123: seas

tool: D107: m

tool: D129: sepl

tool: D112: ast%d%sse%05d.%s

tool: D53: ast%d%ss%06d.%s

tool: D21: /

assistant: ```c
void swi_gen_filename(double tjd, int ipli, char *fname) {
  int icty;
  int ncties = (int)6.0;
  short gregflag;
  int jmon, jday, jyear, sgn;
  double jut;
  char *sform;
  switch (ipli) {
  case 1:
    strcpy(fname, "semo");
    break;
  case 0:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  case 7:
  case 8:
  case 9:
  case 10:
    strcpy(fname, "sepl");
    break;
  case 14:
  case 15:
  case 16:
  case 17:
  case 12:
  case 13:
    strcpy(fname, "seas");
    break;
  default:
    sform = "ast%d%sse%05d.%s";
    if (ipli - 10000 > 99999)
      sform = "ast%d%ss%06d.%s";
    sprintf(fname, sform, (ipli - 10000) / 1000, "/", ipli - 10000, "se1");
    return;
  }
  if (tjd >= 2305447.5) {
    gregflag = 1;
    swe_revjul(tjd, gregflag, &jyear, &jmon, &jday, &jut);
  } else {
    gregflag = 0;
    swe_revjul(tjd, gregflag, &jyear, &jmon, &jday, &jut);
  }
  if (jyear < 0)
    sgn = -1;
  else
    sgn = 1;
  icty = jyear / 100;
  if (sgn < 0 && jyear % 100 != 0)
    icty -= 1;
  while (icty % ncties != 0)
    icty--;
  if (icty < 0)
    strcat(fname, "m");
  else
    strcat(fname, "_");
  icty = abs(icty);
  sprintf(fname + strlen(fname), "%02d.%s", icty, "se1");
}
```