user: Demonstrate the C code that generates the assembly output below:

```asm
<calculate_sunrise>:
  endbr64
  push   %r15
  movq   %xmm0,%r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %edi,%r13d
  mov    %r14d,%edi
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %edx,%ebx
  mov    %ecx,%edx
  mov    %ebx,%esi
  sub    $0x38,%rsp
  movsd  %xmm1,(%rsp)
  movsd  %xmm2,0x28(%rsp)
  call   <calculate_day_of_year@plt>
  movsd  (%rsp),%xmm1
  movapd %xmm1,%xmm4
  divsd  D47(%rip),%xmm4
  movsd  %xmm4,0x10(%rsp)
  test   %r13d,%r13d
  je     L76
  pxor   %xmm1,%xmm1
  movsd  D35(%rip),%xmm0
  cvtsi2sd %eax,%xmm1
  subsd  %xmm4,%xmm0
  divsd  D107(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
L88:
  movsd  0x8(%rsp),%xmm1
  mulsd  D215(%rip),%xmm1
  subsd  D30(%rip),%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  mulsd  D94(%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  D189(%rip),%xmm0
  mov    $0x168,%esi
  xor    %edi,%edi
  addsd  (%rsp),%xmm0
  addsd  D118(%rip),%xmm0
  call   <adjust_to_range@plt>
  movsd  %xmm0,0x18(%rsp)
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <tan@plt>
  mulsd  D62(%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  D97(%rip),%xmm6
  movapd %xmm6,%xmm0
  call   <floor@plt>
  movsd  (%rsp),%xmm0
  divsd  D97(%rip),%xmm0
  mov    %eax,%r12d
  call   <floor@plt>
  imul   $0x5a,%r12d,%r12d
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  imul   $0x5a,%eax,%eax
  movsd  0x18(%rsp),%xmm1
  cvtsi2sd %r12d,%xmm0
  cvtsi2sd %eax,%xmm2
  subsd  %xmm2,%xmm0
  addsd  (%rsp),%xmm0
  divsd  D47(%rip),%xmm0
  movsd  %xmm0,0x20(%rsp)
  movapd %xmm1,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  movsd  D95(%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  D61(%rip),%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movq   %xmm0,%r12
  movq   %r15,%xmm0
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <sin@plt>
  movsd  0x18(%rsp),%xmm1
  movq   %r12,%xmm7
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm7
  movq   %r15,%xmm0
  movq   %xmm7,%r12
  call   <to_radian@plt>
  mov    %eax,%edi
  call   <cos@plt>
  movsd  (%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  movq   %r12,%xmm0
  divsd  %xmm1,%xmm0
  comisd D139(%rip),%xmm0
  jbe    L24
  test   %r13d,%r13d
  jne    L90
  movsd  D99(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L90
L34:
  call   <acos@plt>
  mov    %eax,%edi
  call   <to_degree@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L35:
  movsd  0x8(%rsp),%xmm1
  mov    $0x18,%esi
  xor    %edi,%edi
  sub    $0x1,%ebx
  mulsd  D72(%rip),%xmm1
  divsd  D47(%rip),%xmm0
  addsd  0x20(%rsp),%xmm0
  sub    $0x76c,%ebp
  subsd  %xmm1,%xmm0
  subsd  D7(%rip),%xmm0
  subsd  0x10(%rsp),%xmm0
  call   <adjust_to_range@plt>
  addsd  0x28(%rsp),%xmm0
  mov    $0x18,%esi
  mov    $0x1,%edi
  movq   %xmm0,%r12
  call   <calloc@plt>
  movq   %r12,%xmm0
  mov    %r14d,(%rax)
  mov    %rax,%r13
  mov    %ebx,0x4(%rax)
  mov    %ebp,0x8(%rax)
  call   <floor@plt>
  pxor   %xmm1,%xmm1
  movq   %r12,%xmm0
  cvtsi2sd %eax,%xmm1
  mov    %eax,0xc(%r13)
  subsd  %xmm1,%xmm0
  mulsd  D131(%rip),%xmm0
  movsd  %xmm0,(%rsp)
  call   <floor@plt>
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %eax,%xmm1
  mov    %eax,0x10(%r13)
  subsd  %xmm1,%xmm0
  mulsd  D131(%rip),%xmm0
  call   <floor@plt>
  mov    %eax,0x14(%r13)
L9:
  add    $0x38,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L76:
  pxor   %xmm1,%xmm1
  movsd  D74(%rip),%xmm0
  subsd  0x10(%rsp),%xmm0
  divsd  D107(%rip),%xmm0
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L88
  nopl   (%rax)
L24:
  movsd  D99(%rip),%xmm1
  comisd %xmm0,%xmm1
  jbe    L44
  test   %r13d,%r13d
  je     L90
L26:
  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    L35
  nop
L90:
  xor    %r13d,%r13d
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L44:
  test   %r13d,%r13d
  jne    L26
  jmp    L34
```

tool_calls: name: read_data
arguments: label: D47
data_type: f64
name: read_data
arguments: label: D35
data_type: byte[8]
name: read_data
arguments: label: D107
data_type: byte[8]
name: read_data
arguments: label: D215
data_type: f64
name: read_data
arguments: label: D30
data_type: f64
name: read_data
arguments: label: D94
data_type: f64
name: read_data
arguments: label: D189
data_type: f64
name: read_data
arguments: label: D118
data_type: f64
name: read_data
arguments: label: D62
data_type: f64
name: read_data
arguments: label: D97
data_type: f64
name: read_data
arguments: label: D95
data_type: f64
name: read_data
arguments: label: D61
data_type: f64
name: read_data
arguments: label: D139
data_type: byte[16]
name: read_data
arguments: label: D99
data_type: byte[8]
name: read_data
arguments: label: D72
data_type: f64
name: read_data
arguments: label: D7
data_type: f64
name: read_data
arguments: label: D131
data_type: byte[8]
name: read_data
arguments: label: D74
data_type: byte[8]

tool: D47: 15

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

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

tool: D215: 0.9856

tool: D30: 3.289

tool: D94: 1.916

tool: D189: 0.02

tool: D118: 282.634

tool: D62: 0.91764

tool: D97: 90

tool: D95: 0.39782

tool: D61: 90.83333333333333

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

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

tool: D72: 0.06571

tool: D7: 6.622

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

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