// File: /workspace/github_c_makefile_star2_O0/mmayer[P]pcal/src/pcal.c
// Function: recalc_paper_parameters
void recalc_paper_parameters (int paper_size_idx)
{
   page_dim_short_axis_pts = paper_info[paper_size_idx].page_dim_short_axis_pts;
   page_dim_long_axis_pts = paper_info[paper_size_idx].page_dim_long_axis_pts;
   
   daybox_width_pts = paper_info[paper_size_idx].daybox_width_pts;
   daybox_height_pts = paper_info[paper_size_idx].daybox_height_pts;
   
   xsval_pgm = ysval_pgm = (double)page_dim_short_axis_pts / (double)page_dim_long_axis_pts;
   xtval_pgm = (page_dim_long_axis_pts - (7 * daybox_width_pts)) / 2;
   
   if ((rotate == PORTRAIT) && do_whole_year) {
      ytval_pgm = page_dim_short_axis_pts + TOP_OF_CAL_BOXES_PTS + 
         6 * (daybox_height_pts - paper_info[paper_size_idx].daybox_height_pts);
   }
   else if ((rotate == PORTRAIT) && !do_whole_year) {
      /* 
       * Copied from the 'ReadMe' file for v4.6:
       * 
       *    The date box height for single-month portrait-mode calendars has
       *    been expanded from 80 points to 117.  If you prefer the original
       *    date box proportions (basically a scaled-down landscape-mode
       *    calendar), compile with -DORIG_BOX_HEIGHT.
       */
#ifndef ORIG_BOX_HEIGHT
      daybox_height_pts = (page_dim_long_axis_pts - DEFAULT_MARGIN_BOTTOM_PTS + 
                           TOP_OF_CAL_BOXES_PTS) / 6 / ysval_pgm;
#endif
      ytval_pgm = (page_dim_long_axis_pts + TOP_OF_CAL_BOXES_PTS) / ysval_pgm;
   }
   else {   /* landscape mode */
      xsval_pgm = ysval_pgm = 1.0;
      ytval_pgm = TOP_OF_CAL_BOXES_PTS;
   }
   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x298be(%rip), %rax     # 0x2fa00
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, 0x2c826(%rip)     # 0x32978
movslq -0x4(%rbp), %rcx
leaq 0x298a3(%rip), %rax     # 0x2fa00
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, 0x2c80f(%rip)     # 0x3297c
movslq -0x4(%rbp), %rcx
leaq 0x29888(%rip), %rax     # 0x2fa00
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, 0x2c7f8(%rip)     # 0x32980
movslq -0x4(%rbp), %rcx
leaq 0x2986d(%rip), %rax     # 0x2fa00
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, 0x2c7e1(%rip)     # 0x32984
cvtsi2sdl 0x2c7cd(%rip), %xmm0 # 0x32978
cvtsi2sdl 0x2c7c9(%rip), %xmm1 # 0x3297c
divsd %xmm1, %xmm0
movsd %xmm0, 0x2c7c9(%rip)    # 0x32988
movsd %xmm0, 0x2c7c9(%rip)    # 0x32990
movl 0x2c7af(%rip), %eax     # 0x3297c
imull $0x7, 0x2c7ac(%rip), %ecx # 0x32980
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x2c7b4(%rip)     # 0x32998
cmpl $0x0, 0x28039(%rip)     # 0x2e224
jne 0x622a
cmpl $0x0, 0x2c550(%rip)     # 0x32744
je 0x622a
movl 0x2c77c(%rip), %eax     # 0x32978
addl $-0x55, %eax
movl 0x2c77f(%rip), %ecx     # 0x32984
movslq -0x4(%rbp), %rsi
leaq 0x297f0(%rip), %rdx     # 0x2fa00
imulq $0x18, %rsi, %rsi
addq %rsi, %rdx
subl 0x14(%rdx), %ecx
imull $0x6, %ecx, %ecx
addl %ecx, %eax
movl %eax, 0x2c777(%rip)     # 0x3299c
jmp 0x62b3
cmpl $0x0, 0x27ff3(%rip)     # 0x2e224
jne 0x6287
cmpl $0x0, 0x2c50a(%rip)     # 0x32744
jne 0x6287
movl 0x2c73a(%rip), %eax     # 0x3297c
subl $0x2e, %eax
addl $-0x55, %eax
movl $0x6, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm0
divsd 0x2c72c(%rip), %xmm0    # 0x32988
cvttsd2si %xmm0, %eax
movl %eax, 0x2c71e(%rip)     # 0x32984
movl 0x2c710(%rip), %eax     # 0x3297c
addl $-0x55, %eax
cvtsi2sd %eax, %xmm0
divsd 0x2c70d(%rip), %xmm0    # 0x32988
cvttsd2si %xmm0, %eax
movl %eax, 0x2c717(%rip)     # 0x3299c
jmp 0x62b1
movsd 0x14d79(%rip), %xmm0    # 0x1b008
movsd %xmm0, 0x2c6f1(%rip)    # 0x32988
movsd 0x14d69(%rip), %xmm0    # 0x1b008
movsd %xmm0, 0x2c6e9(%rip)    # 0x32990
movl $0xffffffab, 0x2c6eb(%rip) # imm = 0xFFFFFFAB
jmp 0x62b3
popq %rbp
retq
nopw %cs:(%rax,%rax)