user: What would the C source look like for the assembly code provided here:

```asm
<calculate_sunrise>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%ebx
  mov    %esi,%r15d
  mov    %edx,%r12d
  mov    %ecx,%ebp
  movsd  %xmm0,0x8(%rsp)
  movq   %xmm1,%r13
  movsd  %xmm2,0x28(%rsp)
  mov    %ecx,%edx
  mov    %r12d,%esi
  mov    %r15d,%edi
  call   <calculate_day_of_year@plt>
  movq   %r13,%xmm6
  divsd  D195(%rip),%xmm6
  movsd  %xmm6,0x18(%rsp)
  test   %ebx,%ebx
  je     L11
  movsd  D103(%rip),%xmm0
  subsd  %xmm6,%xmm0
  divsd  D58(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rsp)
L56:
  movsd  0x10(%rsp),%xmm0
  mulsd  D92(%rip),%xmm0
  subsd  D130(%rip),%xmm0
  movsd  %xmm0,(%rsp)
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  D188(%rip),%xmm0
  movapd %xmm0,%xmm7
  movsd  (%rsp),%xmm3
  addsd  %xmm3,%xmm7
  movsd  %xmm7,(%rsp)
  movapd %xmm3,%xmm0
  addsd  %xmm3,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  D221(%rip),%xmm0
  addsd  (%rsp),%xmm0
  addsd  D5(%rip),%xmm0
  mov    $0x168,%esi
  mov    $0x0,%edi
  call   <adjust_to_range@plt>
  movq   %xmm0,%r13
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <tan@plt>
  mulsd  D37(%rip),%xmm0
  call   <atan@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    $0x168,%esi
  mov    $0x0,%edi
  call   <adjust_to_range@plt>
  movsd  %xmm0,(%rsp)
  movq   %r13,%xmm0
  divsd  D227(%rip),%xmm0
  call   <floor@plt>
  mov    %eax,%r14d
  movsd  (%rsp),%xmm0
  divsd  D227(%rip),%xmm0
  call   <floor@plt>
  imul   $0x5a,%r14d,%r14d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r14d,%xmm0
  imul   $0x5a,%eax,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  addsd  (%rsp),%xmm0
  divsd  D195(%rip),%xmm0
  movsd  %xmm0,0x20(%rsp)
  movq   %r13,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  D117(%rip),%xmm0
  movsd  %xmm0,(%rsp)
  call   <asin@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movq   %xmm0,%r14
  movsd  D229(%rip),%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movq   %xmm0,%r13
  movsd  0x8(%rsp),%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  (%rsp),%xmm0
  movq   %r13,%xmm4
  subsd  %xmm0,%xmm4
  movq   %xmm4,%r13
  movsd  0x8(%rsp),%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movq   %r14,%xmm1
  mulsd  %xmm0,%xmm1
  movq   %r13,%xmm0
  divsd  %xmm1,%xmm0
  test   %ebx,%ebx
  je     L72
  comisd D142(%rip),%xmm0
  ja     L1
L72:
  test   %ebx,%ebx
  jne    L50
  movsd  D219(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L27
L50:
  test   %ebx,%ebx
  je     L16
  call   <acos@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  mov    %eax,%edx
  mov    $0x168,%eax
  sub    %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L60:
  divsd  D195(%rip),%xmm0
  addsd  0x20(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  mulsd  D137(%rip),%xmm1
  subsd  %xmm1,%xmm0
  subsd  D70(%rip),%xmm0
  subsd  0x18(%rsp),%xmm0
  mov    $0x18,%esi
  mov    $0x0,%edi
  call   <adjust_to_range@plt>
  addsd  0x28(%rsp),%xmm0
  movq   %xmm0,%rbx
  mov    $0x18,%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %rax,%r13
  mov    %r15d,(%rax)
  sub    $0x1,%r12d
  mov    %r12d,0x4(%rax)
  sub    $0x76c,%ebp
  mov    %ebp,0x8(%rax)
  movq   %rbx,%xmm0
  call   <floor@plt>
  mov    %eax,0xc(%r13)
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movq   %rbx,%xmm1
  subsd  %xmm0,%xmm1
  mulsd  D196(%rip),%xmm1
  movq   %xmm1,%rbx
  movapd %xmm1,%xmm0
  call   <floor@plt>
  mov    %eax,0x10(%r13)
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movq   %rbx,%xmm0
  subsd  %xmm1,%xmm0
  mulsd  D196(%rip),%xmm0
  call   <floor@plt>
  mov    %eax,0x14(%r13)
L10:
  mov    %r13,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  movsd  D81(%rip),%xmm0
  subsd  0x18(%rsp),%xmm0
  divsd  D58(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rsp)
  jmp    L56
L16:
  call   <acos@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  jmp    L60
L1:
  mov    $0x0,%r13d
  jmp    L10
L27:
  mov    $0x0,%r13d
  jmp    L10
```

tool_calls: name: parse_data
arguments: tag: D195
type_guessed: f64
name: parse_data
arguments: tag: D103
type_guessed: byte[8]
name: parse_data
arguments: tag: D58
type_guessed: byte[8]
name: parse_data
arguments: tag: D92
type_guessed: f64
name: parse_data
arguments: tag: D130
type_guessed: f64
name: parse_data
arguments: tag: D188
type_guessed: f64
name: parse_data
arguments: tag: D221
type_guessed: f64
name: parse_data
arguments: tag: D5
type_guessed: f64
name: parse_data
arguments: tag: D37
type_guessed: f64
name: parse_data
arguments: tag: D227
type_guessed: f64
name: parse_data
arguments: tag: D117
type_guessed: f64
name: parse_data
arguments: tag: D229
type_guessed: f64
name: parse_data
arguments: tag: D142
type_guessed: byte[16]
name: parse_data
arguments: tag: D219
type_guessed: byte[8]
name: parse_data
arguments: tag: D137
type_guessed: f64
name: parse_data
arguments: tag: D70
type_guessed: f64
name: parse_data
arguments: tag: D196
type_guessed: byte[8]
name: parse_data
arguments: tag: D81
type_guessed: byte[8]

tool: D195: 15

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

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

tool: D92: 0.9856

tool: D130: 3.289

tool: D188: 1.916

tool: D221: 0.02

tool: D5: 282.634

tool: D37: 0.91764

tool: D227: 90

tool: D117: 0.39782

tool: D229: 90.83333333333333

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

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

tool: D137: 0.06571

tool: D70: 6.622

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

tool: {"D81": [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;
}
```