// File: /workspace/github_c_makefile_star2_O0/ddrown[P]pretend-ntp/ntp_msg.c
// Function: print_ntp
void print_ntp(const struct ntp_msg *m, const struct timespec *send, const struct timespec *recv) {
  struct timespec recv_time, trans_time;

  if(m->leap < sizeof(ntp_leap_str)/sizeof(char *)) {
    printf("leap = %s\n", ntp_leap_str[m->leap]);
  } else {
    printf("leap = %u\n", m->leap);
  }
  printf("version = %u\n", m->version);
  if(m->mode < sizeof(ntp_mode_str)/sizeof(char *)) {
    printf("mode = %s\n", ntp_mode_str[m->mode]);
  } else {
    printf("mode = %u\n", m->mode);
  }
  printf("stratum = %u\n", m->stratum);
  printf("poll = %u\n", m->poll);
  printf("precision = %d\n", m->precision);
  printf("delay = %u.%06u\n", ntohs(m->delay), ntp_frac_to_us(m->delay_fb));
  printf("dispersion = %u.%06u\n", ntohs(m->dispersion), ntp_frac_to_us(m->dispersion_fb));
  printf("ident = %u\n", ntohl(m->ident));
  printf("ref_time = %u.%09u\n", ntp_s_to_unixtime(m->ref_time), ntp_frac_to_ns(m->ref_time_fb));
  printf("org_time = %u.%09u\n", ntp_s_to_unixtime(m->org_time), ntp_frac_to_ns(m->org_time_fb));

  recv_time.tv_sec = ntp_s_to_unixtime(m->recv_time);
  recv_time.tv_nsec = ntp_frac_to_ns(m->recv_time_fb);
  printf("recv_time = ");
  print_t(&recv_time);
  if(send != NULL) {
    printf(" ");
    print_diff_ts(&recv_time, send);
  }
  printf("\n");

  trans_time.tv_sec = ntp_s_to_unixtime(m->trans_time);
  trans_time.tv_nsec = ntp_frac_to_ns(m->trans_time_fb);
  printf("trans_time = ");
  print_t(&trans_time);
  if(recv != NULL) {
    printf(" ");
    print_diff_ts(&trans_time, recv);
  }
  printf("\n");

  printf("proc time = ");
  print_diff_ts(&trans_time, &recv_time);
  printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movb (%rax), %al
shrb $0x6, %al
movzbl %al, %eax
cmpq $0x4, %rax
jae 0x1aaf
movq -0x8(%rbp), %rax
movb (%rax), %al
shrb $0x6, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x3645(%rip), %rax      # 0x50e0
movq (%rax,%rcx,8), %rsi
leaq 0x1717(%rip), %rdi      # 0x31bd
movb $0x0, %al
callq 0x1070
jmp 0x1ac9
movq -0x8(%rbp), %rax
movb (%rax), %al
shrb $0x6, %al
movzbl %al, %esi
leaq 0x1706(%rip), %rdi      # 0x31c8
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movb (%rax), %al
shrb $0x3, %al
andb $0x7, %al
movzbl %al, %esi
leaq 0x16f5(%rip), %rdi      # 0x31d3
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movb (%rax), %al
andb $0x7, %al
movzbl %al, %eax
cmpq $0x8, %rax
jae 0x1b1e
movq -0x8(%rbp), %rax
movb (%rax), %al
andb $0x7, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x35f6(%rip), %rax      # 0x5100
movq (%rax,%rcx,8), %rsi
leaq 0x16cc(%rip), %rdi      # 0x31e1
movb $0x0, %al
callq 0x1070
jmp 0x1b37
movq -0x8(%rbp), %rax
movb (%rax), %al
andb $0x7, %al
movzbl %al, %esi
leaq 0x16bc(%rip), %rdi      # 0x31ec
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %esi
leaq 0x16b1(%rip), %rdi      # 0x31f7
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %esi
leaq 0x16a9(%rip), %rdi      # 0x3205
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movsbl 0x3(%rax), %esi
leaq 0x169e(%rip), %rdi      # 0x3210
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x1100
movzwl %ax, %eax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x6(%rax), %edi
callq 0x1a20
movl -0x48(%rbp), %esi
movzwl %ax, %edx
leaq 0x167a(%rip), %rdi      # 0x3220
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x1100
movzwl %ax, %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x1a20
movl -0x44(%rbp), %esi
movzwl %ax, %edx
leaq 0x1657(%rip), %rdi      # 0x3231
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x1180
movl %eax, %esi
leaq 0x1651(%rip), %rdi      # 0x3247
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x1930
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
callq 0x19e0
movl -0x40(%rbp), %esi
movl %eax, %edx
leaq 0x162f(%rip), %rdi      # 0x3253
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x1930
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %edi
callq 0x19e0
movl -0x3c(%rbp), %esi
movl %eax, %edx
leaq 0x1615(%rip), %rdi      # 0x3267
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x1930
movl %eax, %eax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %edi
callq 0x19e0
movl %eax, %eax
movq %rax, -0x20(%rbp)
leaq 0x15f7(%rip), %rdi      # 0x327b
movb $0x0, %al
callq 0x1070
leaq -0x28(%rbp), %rdi
callq 0x2070
cmpq $0x0, -0x10(%rbp)
je 0x1cb6
leaq 0x15ff(%rip), %rdi      # 0x32a1
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x2160
leaq 0x1408(%rip), %rdi      # 0x30c5
movb $0x0, %al
callq 0x1070
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x1930
movl %eax, %eax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x19e0
movl %eax, %eax
movq %rax, -0x30(%rbp)
leaq 0x1599(%rip), %rdi      # 0x3288
movb $0x0, %al
callq 0x1070
leaq -0x38(%rbp), %rdi
callq 0x2070
cmpq $0x0, -0x18(%rbp)
je 0x1d21
leaq 0x1594(%rip), %rdi      # 0x32a1
movb $0x0, %al
callq 0x1070
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x2160
leaq 0x139d(%rip), %rdi      # 0x30c5
movb $0x0, %al
callq 0x1070
leaq 0x1560(%rip), %rdi      # 0x3296
movb $0x0, %al
callq 0x1070
leaq -0x38(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2160
leaq 0x1374(%rip), %rdi      # 0x30c5
movb $0x0, %al
callq 0x1070
addq $0x50, %rsp
popq %rbp
retq
nop