user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<calculate_sunrise>:
  endbr64
  push   %r15
  movq   %xmm0,%r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %edx,%ebp
  mov    %ecx,%edx
  push   %rbx
  mov    %esi,%ebx
  mov    %ebp,%esi
  mov    %ebx,%edi
  sub    $0x38,%rsp
  movsd  %xmm1,(%rsp)
  movsd  %xmm2,0x28(%rsp)
  call   <calculate_day_of_year@plt>
  movsd  (%rsp),%xmm1
  movapd %xmm1,%xmm4
  divsd  D141(%rip),%xmm4
  movsd  %xmm4,0x10(%rsp)
  test   %r14d,%r14d
  je     L36
  movsd  D28(%rip),%xmm0
  subsd  %xmm4,%xmm0
L34:
  pxor   %xmm1,%xmm1
  divsd  D215(%rip),%xmm0
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  movsd  D7(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm0,0x8(%rsp)
  subsd  D96(%rip),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  D33(%rip),%xmm0
  movsd  (%rsp),%xmm1
  addsd  %xmm1,%xmm0
  addsd  %xmm1,%xmm1
  movsd  %xmm0,(%rsp)
  movapd %xmm1,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  D106(%rip),%xmm0
  mov    $0x168,%esi
  xor    %edi,%edi
  addsd  (%rsp),%xmm0
  addsd  D3(%rip),%xmm0
  call   <adjust_to_range@plt>
  movsd  %xmm0,0x18(%rsp)
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <tan@plt>
  mulsd  D199(%rip),%xmm0
  call   <atan@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  pxor   %xmm0,%xmm0
  mov    $0x168,%esi
  xor    %edi,%edi
  cvtsi2sd %eax,%xmm0
  call   <adjust_to_range@plt>
  movsd  0x18(%rsp),%xmm1
  movsd  %xmm0,(%rsp)
  movapd %xmm1,%xmm6
  divsd  D152(%rip),%xmm6
  movapd %xmm6,%xmm0
  call   <floor@plt>
  movsd  (%rsp),%xmm0
  divsd  D152(%rip),%xmm0
  mov    %eax,%r13d
  call   <floor@plt>
  imul   $0x5a,%r13d,%r13d
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  imul   $0x5a,%eax,%eax
  movsd  0x18(%rsp),%xmm1
  cvtsi2sd %r13d,%xmm0
  cvtsi2sd %eax,%xmm2
  subsd  %xmm2,%xmm0
  addsd  (%rsp),%xmm0
  divsd  D141(%rip),%xmm0
  movsd  %xmm0,0x20(%rsp)
  movapd %xmm1,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  movsd  D118(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x18(%rsp)
  call   <asin@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movsd  %xmm0,(%rsp)
  movsd  D178(%rip),%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movq   %xmm0,%r13
  movq   %r15,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  movsd  0x18(%rsp),%xmm1
  movq   %r13,%xmm7
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm7
  movq   %r15,%xmm0
  movq   %xmm7,%r13
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movsd  (%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  movq   %r13,%xmm0
  divsd  %xmm1,%xmm0
  comisd D97(%rip),%xmm0
  jbe    L72
  test   %r14d,%r14d
  jne    L69
  movsd  D224(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L69
L22:
  call   <acos@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L71:
  movsd  0x8(%rsp),%xmm1
  mov    $0x18,%esi
  xor    %edi,%edi
  sub    $0x1,%ebp
  mulsd  D23(%rip),%xmm1
  divsd  D141(%rip),%xmm0
  addsd  0x20(%rsp),%xmm0
  sub    $0x76c,%r12d
  subsd  %xmm1,%xmm0
  subsd  D49(%rip),%xmm0
  subsd  0x10(%rsp),%xmm0
  call   <adjust_to_range@plt>
  addsd  0x28(%rsp),%xmm0
  mov    $0x18,%esi
  mov    $0x1,%edi
  movq   %xmm0,%r13
  call   <calloc@plt>
  movd   %ebp,%xmm7
  movd   %ebx,%xmm0
  mov    %r12d,0x8(%rax)
  punpckldq %xmm7,%xmm0
  mov    %rax,%r14
  movq   %xmm0,(%rax)
  movq   %r13,%xmm0
  call   <floor@plt>
  pxor   %xmm1,%xmm1
  movq   %r13,%xmm0
  cvtsi2sd %eax,%xmm1
  mov    %eax,0xc(%r14)
  subsd  %xmm1,%xmm0
  mulsd  D157(%rip),%xmm0
  movsd  %xmm0,(%rsp)
  call   <floor@plt>
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %eax,%xmm1
  mov    %eax,0x10(%r14)
  subsd  %xmm1,%xmm0
  mulsd  D157(%rip),%xmm0
  call   <floor@plt>
  mov    %eax,0x14(%r14)
L8:
  add    $0x38,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L36:
  movsd  D56(%rip),%xmm0
  subsd  0x10(%rsp),%xmm0
  jmp    L34
  nopl   0x0(%rax,%rax,1)
L72:
  movsd  D224(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L70
  test   %r14d,%r14d
  je     L69
L99:
  call   <acos@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  pxor   %xmm0,%xmm0
  mov    %eax,%r8d
  mov    $0x168,%eax
  sub    %r8d,%eax
  cvtsi2sd %eax,%xmm0
  jmp    L71
  nop
L69:
  xor    %r14d,%r14d
  jmp    L8
  nopl   (%rax)
L70:
  test   %r14d,%r14d
  jne    L99
  jmp    L22
```

tool_calls: name: extract_symbolic_data
arguments: label: D141
type_infered: f64
name: extract_symbolic_data
arguments: label: D28
type_infered: byte[8]
name: extract_symbolic_data
arguments: label: D215
type_infered: byte[8]
name: extract_symbolic_data
arguments: label: D7
type_infered: f64
name: extract_symbolic_data
arguments: label: D96
type_infered: f64
name: extract_symbolic_data
arguments: label: D33
type_infered: f64
name: extract_symbolic_data
arguments: label: D106
type_infered: f64
name: extract_symbolic_data
arguments: label: D3
type_infered: f64
name: extract_symbolic_data
arguments: label: D199
type_infered: f64
name: extract_symbolic_data
arguments: label: D152
type_infered: f64
name: extract_symbolic_data
arguments: label: D118
type_infered: f64
name: extract_symbolic_data
arguments: label: D178
type_infered: f64
name: extract_symbolic_data
arguments: label: D97
type_infered: byte[16]
name: extract_symbolic_data
arguments: label: D224
type_infered: byte[8]
name: extract_symbolic_data
arguments: label: D23
type_infered: f64
name: extract_symbolic_data
arguments: label: D49
type_infered: f64
name: extract_symbolic_data
arguments: label: D157
type_infered: byte[8]
name: extract_symbolic_data
arguments: label: D56
type_infered: byte[8]

tool: D141: 15

tool: {"D28": [0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x40]}

tool: {"D215": [0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40]}

tool: D7: 0.9856

tool: D96: 3.289

tool: D33: 1.916

tool: D106: 0.02

tool: D3: 282.634

tool: D199: 0.91764

tool: D152: 90

tool: D118: 0.39782

tool: D178: 90.83333333333333

tool: {"D97": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: {"D224": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D23: 0.06571

tool: D49: 6.622

tool: {"D157": [0x00,0x00,0x00,0x00,0x00,0x00,0x4e,0x40]}

tool: {"D56": [0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x40]}

assistant: ```c
struct tm *calculate_sunrise(bool sunrise, int day, int month, int year, double latitude, double longitude, double local_offset) {
  int day_of_year = calculate_day_of_year(day, month, year);
  double zenith = 90.83333333333333;
  double lngHour = longitude / 15;
  double t;
  if (sunrise) {
    t = day_of_year + ((6 - lngHour) / 24);
  } else {
    t = day_of_year + ((18 - lngHour) / 24);
  }
  double M = (0.9856 * t) - 3.289;
  double L = M + (1.916 * sin(to_radian(M))) + (0.020 * sin(to_radian(2 * M))) + 282.634;
  L = adjust_to_range(L, 0, 360);
  double RA = to_degree(atan(0.91764 * tan(to_radian(L))));
  RA = adjust_to_range(RA, 0, 360);
  double Lquadrant = (floor(L / 90)) * 90;
  double RAquadrant = (floor(RA / 90)) * 90;
  RA = RA + (Lquadrant - RAquadrant);
  RA = RA / 15;
  double sinDec = 0.39782 * sin(to_radian(L));
  double cosDec = cos(asin(sinDec));
  double cosH = (cos(to_radian(zenith)) - (sinDec * sin(to_radian(latitude)))) / (cosDec * cos(to_radian(latitude)));
  if ((cosH > 1) && sunrise) {
    return NULL;
  } else if ((cosH < -1) && !sunrise) {
    return NULL;
  }
  double H;
  if (sunrise) {
    H = 360 - to_degree(acos(cosH));
  } else {
    H = to_degree(acos(cosH));
  }
  H = H / 15;
  double T = H + RA - (0.06571 * t) - 6.622;
  double UTC = T - lngHour;
  UTC = adjust_to_range(UTC, 0, 24);
  double localT = UTC + local_offset;
  struct tm *time = calloc(1, sizeof(struct tm));
  time->tm_mday = day;
  time->tm_mon = month - 1;
  time->tm_year = year - 1900;
  time->tm_hour = floor(localT);
  localT -= time->tm_hour;
  localT *= 60;
  time->tm_min = floor(localT);
  localT -= time->tm_min;
  localT *= 60;
  time->tm_sec = floor(localT);
  return time;
}
```