#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int calc_label_digits(int, int, float, float);
float calc_steps(float, float, float, float);
int ceil(float);
int floor(float);
int /*<<< orphan*/ g_label(char *);
int /*<<< orphan*/ g_lineto(int, float);
int /*<<< orphan*/ g_moveto(float, float);
int /*<<< orphan*/ g_select_viewport(int);
int /*<<< orphan*/ g_set_viewport(int, float, float, float, float);
int /*<<< orphan*/ g_set_world(int, float, int /*<<< orphan*/, float, float);
float get_label_ticks(float);
float get_long_ticks(float);
char *psnd_sprintf_temp(char *, float);
int /*<<< orphan*/ sprintf(char *, char *, int);
void psnd_paperplot_xaxis(int vp, int autoscale, char *axislabel, float minp,
                          float maxp, float ticks_ppm, float medium_ticks_ppm,
                          float long_ticks_ppm, float labels_ppm,
                          float off_axis, float off_label, float start_title,
                          float off_title, float ticklen1, float ticklen2,
                          float ticklen3, float width, float height, float vx1,
                          float vy1, float vx2, float vy2) {
  float tmp1, tmp2, off, steps_ppm;
  int n, labeldiv, tickdiv1, tickdiv2, tickdiv3;
  int start, stop, xdigits;
  char format[40];
  if (autoscale) {
    long_ticks_ppm = get_long_ticks(width);
    medium_ticks_ppm = long_ticks_ppm * 2;
    ticks_ppm = long_ticks_ppm * 10;
    labels_ppm = get_label_ticks(width);
  }
  steps_ppm =
      calc_steps(long_ticks_ppm, medium_ticks_ppm, ticks_ppm, labels_ppm);
  if (labels_ppm <= 0)
    labeldiv = 0;
  else
    labeldiv = ((int)(((steps_ppm / labels_ppm) < 0.0)
                          ? (ceil((steps_ppm / labels_ppm) - 0.5))
                          : (floor((steps_ppm / labels_ppm) + 0.5))));
  if (ticks_ppm <= 0)
    tickdiv1 = 0;
  else
    tickdiv1 = ((int)(((steps_ppm / ticks_ppm) < 0.0)
                          ? (ceil((steps_ppm / ticks_ppm) - 0.5))
                          : (floor((steps_ppm / ticks_ppm) + 0.5))));
  if (medium_ticks_ppm <= 0)
    tickdiv2 = 0;
  else
    tickdiv2 = ((int)(((steps_ppm / medium_ticks_ppm) < 0.0)
                          ? (ceil((steps_ppm / medium_ticks_ppm) - 0.5))
                          : (floor((steps_ppm / medium_ticks_ppm) + 0.5))));
  if (long_ticks_ppm <= 0)
    tickdiv3 = 0;
  else
    tickdiv3 = ((int)(((steps_ppm / long_ticks_ppm) < 0.0)
                          ? (ceil((steps_ppm / long_ticks_ppm) - 0.5))
                          : (floor((steps_ppm / long_ticks_ppm) + 0.5))));
  off = height - off_axis;
  tmp1 = minp * steps_ppm;
  tmp2 = maxp * steps_ppm;
  start = ceil((((tmp1) > (tmp2)) ? (tmp1) : (tmp2)));
  stop = floor((((tmp1) < (tmp2)) ? (tmp1) : (tmp2)));
  g_set_world(vp, tmp1, 0, tmp2, height);
  g_set_viewport(vp, vx1, vy1, vx2, vy2);
  g_select_viewport(vp);
  g_moveto(tmp1, off);
  g_lineto(tmp2, off);
  xdigits = calc_label_digits(start, stop, (float)labels_ppm, steps_ppm);
  sprintf(format, "%%.%df", xdigits);
  for (n = start; n >= stop; n--) {
    g_moveto(n, off);
    if (tickdiv3 && !(n % tickdiv3))
      g_lineto(n, off - ticklen3);
    else if (tickdiv2 && !(n % tickdiv2))
      g_lineto(n, off - ticklen2);
    else if (tickdiv1 && !(n % tickdiv1))
      g_lineto(n, off - ticklen1);
    if (labeldiv && !(n % labeldiv)) {
      char *label;
      g_moveto(n, off - off_label);
      label = psnd_sprintf_temp(format, (float)n / steps_ppm);
      g_label(label);
    }
  }
  if (axislabel) {
    g_moveto(start_title * steps_ppm, off - off_title);
    g_label(axislabel);
  }
}


x86 assembly (clang, -O0):
<psnd_paperplot_xaxis>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movss  0x60(%rbp),%xmm8
movss  0x58(%rbp),%xmm8
movss  0x50(%rbp),%xmm8
movss  0x48(%rbp),%xmm8
movss  0x40(%rbp),%xmm8
movss  0x38(%rbp),%xmm8
movss  0x30(%rbp),%xmm8
movss  0x28(%rbp),%xmm8
movss  0x20(%rbp),%xmm8
movss  0x18(%rbp),%xmm8
movss  0x10(%rbp),%xmm8
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
movss  %xmm4,-0x24(%rbp)
movss  %xmm5,-0x28(%rbp)
movss  %xmm6,-0x2c(%rbp)
movss  %xmm7,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12ab <psnd_paperplot_xaxis+0xcb>
movss  0x38(%rbp),%xmm0
call   1090 <get_long_ticks@plt>
movss  %xmm0,-0x24(%rbp)
movss  0xd84(%rip),%xmm0
mulss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xd6e(%rip),%xmm0
mulss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0x38(%rbp),%xmm0
call   10d0 <get_label_ticks@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x28(%rbp),%xmm3
call   1080 <calc_steps@plt>
movss  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x28(%rbp),%xmm0
jb     12e2 <psnd_paperplot_xaxis+0x102>
movl   $0x0,-0x48(%rbp)
jmp    135d <psnd_paperplot_xaxis+0x17d>
movss  -0x40(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    132b <psnd_paperplot_xaxis+0x14b>
movss  -0x40(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcf5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <ceil@plt>
mov    %eax,-0x9c(%rbp)
jmp    1354 <psnd_paperplot_xaxis+0x174>
movss  -0x40(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcc7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   10f0 <floor@plt>
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    %eax,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x1c(%rbp),%xmm0
jb     1376 <psnd_paperplot_xaxis+0x196>
movl   $0x0,-0x4c(%rbp)
jmp    13f1 <psnd_paperplot_xaxis+0x211>
movss  -0x40(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    13bf <psnd_paperplot_xaxis+0x1df>
movss  -0x40(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc61(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <ceil@plt>
mov    %eax,-0xa0(%rbp)
jmp    13e8 <psnd_paperplot_xaxis+0x208>
movss  -0x40(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc33(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   10f0 <floor@plt>
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
mov    %eax,-0x4c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x20(%rbp),%xmm0
jb     140a <psnd_paperplot_xaxis+0x22a>
movl   $0x0,-0x50(%rbp)
jmp    1485 <psnd_paperplot_xaxis+0x2a5>
movss  -0x40(%rbp),%xmm0
divss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1453 <psnd_paperplot_xaxis+0x273>
movss  -0x40(%rbp),%xmm0
divss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbcd(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <ceil@plt>
mov    %eax,-0xa4(%rbp)
jmp    147c <psnd_paperplot_xaxis+0x29c>
movss  -0x40(%rbp),%xmm0
divss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb9f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   10f0 <floor@plt>
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    %eax,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x24(%rbp),%xmm0
jb     149e <psnd_paperplot_xaxis+0x2be>
movl   $0x0,-0x54(%rbp)
jmp    1519 <psnd_paperplot_xaxis+0x339>
movss  -0x40(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    14e7 <psnd_paperplot_xaxis+0x307>
movss  -0x40(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb39(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <ceil@plt>
mov    %eax,-0xa8(%rbp)
jmp    1510 <psnd_paperplot_xaxis+0x330>
movss  -0x40(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb0b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   10f0 <floor@plt>
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
mov    %eax,-0x54(%rbp)
movss  0x40(%rbp),%xmm0
subss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x34(%rbp),%xmm0
ucomiss -0x38(%rbp),%xmm0
jbe    1567 <psnd_paperplot_xaxis+0x387>
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0xac(%rbp)
ff
jmp    1574 <psnd_paperplot_xaxis+0x394>
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0xac(%rbp)
ff
movss  -0xac(%rbp),%xmm0
ff
call   1040 <ceil@plt>
mov    %eax,-0x58(%rbp)
movss  -0x34(%rbp),%xmm1
movss  -0x38(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    15a9 <psnd_paperplot_xaxis+0x3c9>
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0xb0(%rbp)
ff
jmp    15b6 <psnd_paperplot_xaxis+0x3d6>
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0xb0(%rbp)
ff
movss  -0xb0(%rbp),%xmm0
ff
call   10f0 <floor@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x34(%rbp),%xmm0
movss  -0x38(%rbp),%xmm1
movss  0x40(%rbp),%xmm2
xor    %esi,%esi
call   10e0 <g_set_world@plt>
mov    -0x4(%rbp),%edi
movss  0x48(%rbp),%xmm0
movss  0x50(%rbp),%xmm1
movss  0x58(%rbp),%xmm2
movss  0x60(%rbp),%xmm3
call   10a0 <g_set_viewport@plt>
mov    -0x4(%rbp),%edi
call   1070 <g_select_viewport@plt>
movss  -0x34(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm1
call   1060 <g_moveto@plt>
cvttss2si -0x38(%rbp),%edi
movss  -0x3c(%rbp),%xmm0
call   1100 <g_lineto@plt>
mov    -0x58(%rbp),%edi
mov    -0x5c(%rbp),%esi
movss  -0x28(%rbp),%xmm0
movss  -0x40(%rbp),%xmm1
call   1050 <calc_label_digits@plt>
mov    %eax,-0x60(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x60(%rbp),%edx
lea    0x9c6(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x58(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jl     1772 <psnd_paperplot_xaxis+0x592>
cvtsi2ssl -0x44(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm1
call   1060 <g_moveto@plt>
cmpl   $0x0,-0x54(%rbp)
je     16a1 <psnd_paperplot_xaxis+0x4c1>
mov    -0x44(%rbp),%eax
cltd
idivl  -0x54(%rbp)
cmp    $0x0,%edx
jne    16a1 <psnd_paperplot_xaxis+0x4c1>
mov    -0x44(%rbp),%edi
movss  -0x3c(%rbp),%xmm0
subss  0x30(%rbp),%xmm0
call   1100 <g_lineto@plt>
jmp    1708 <psnd_paperplot_xaxis+0x528>
cmpl   $0x0,-0x50(%rbp)
je     16d2 <psnd_paperplot_xaxis+0x4f2>
mov    -0x44(%rbp),%eax
cltd
idivl  -0x50(%rbp)
cmp    $0x0,%edx
jne    16d2 <psnd_paperplot_xaxis+0x4f2>
mov    -0x44(%rbp),%edi
movss  -0x3c(%rbp),%xmm0
subss  0x28(%rbp),%xmm0
call   1100 <g_lineto@plt>
jmp    1703 <psnd_paperplot_xaxis+0x523>
cmpl   $0x0,-0x4c(%rbp)
je     16fe <psnd_paperplot_xaxis+0x51e>
mov    -0x44(%rbp),%eax
cltd
idivl  -0x4c(%rbp)
cmp    $0x0,%edx
jne    16fe <psnd_paperplot_xaxis+0x51e>
mov    -0x44(%rbp),%edi
movss  -0x3c(%rbp),%xmm0
subss  0x20(%rbp),%xmm0
call   1100 <g_lineto@plt>
jmp    1703 <psnd_paperplot_xaxis+0x523>
jmp    1708 <psnd_paperplot_xaxis+0x528>
cmpl   $0x0,-0x48(%rbp)
je     175f <psnd_paperplot_xaxis+0x57f>
mov    -0x44(%rbp),%eax
cltd
idivl  -0x48(%rbp)
cmp    $0x0,%edx
jne    175f <psnd_paperplot_xaxis+0x57f>
cvtsi2ssl -0x44(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm1
subss  -0x30(%rbp),%xmm1
call   1060 <g_moveto@plt>
lea    -0x90(%rbp),%rdi
cvtsi2ssl -0x44(%rbp),%xmm0
divss  -0x40(%rbp),%xmm0
call   1030 <psnd_sprintf_temp@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rdi
call   10c0 <g_label@plt>
jmp    1764 <psnd_paperplot_xaxis+0x584>
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
jmp    1655 <psnd_paperplot_xaxis+0x475>
cmpq   $0x0,-0x10(%rbp)
je     179f <psnd_paperplot_xaxis+0x5bf>
movss  0x10(%rbp),%xmm0
mulss  -0x40(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm1
subss  0x18(%rbp),%xmm1
call   1060 <g_moveto@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <g_label@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnd_paperplot_xaxis>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movss  %xmm7,0x1c(%rsp)
movss  %xmm6,0x20(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdx,0x28(%rsp)
mov    %edi,0x24(%rsp)
test   %esi,%esi
je     1263 <psnd_paperplot_xaxis+0x83>
movss  0xb8(%rsp),%xmm0
call   1090 <get_long_ticks@plt>
movss  %xmm0,(%rsp)
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x14(%rsp)
mulss  0xdc5(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xb8(%rsp),%xmm0
call   10d0 <get_label_ticks@plt>
movss  (%rsp),%xmm4
movss  0x10(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movaps %xmm0,%xmm5
movss  %xmm5,0x18(%rsp)
movss  %xmm4,(%rsp)
movaps %xmm4,%xmm0
movss  %xmm3,0x14(%rsp)
movaps %xmm3,%xmm1
movss  %xmm2,0x10(%rsp)
movaps %xmm5,%xmm3
call   1080 <calc_steps@plt>
movss  0x18(%rsp),%xmm1
movss  %xmm0,0x4(%rsp)
xor    %r14d,%r14d
xorps  %xmm2,%xmm2
ucomiss %xmm1,%xmm2
mov    $0x0,%ebp
jae    12d4 <psnd_paperplot_xaxis+0xf4>
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
ucomiss %xmm0,%xmm2
jbe    12c2 <psnd_paperplot_xaxis+0xe2>
addss  0xd4d(%rip),%xmm0
call   1040 <ceil@plt>
jmp    12cf <psnd_paperplot_xaxis+0xef>
addss  0xd3a(%rip),%xmm0
call   10f0 <floor@plt>
mov    %eax,%ebp
xorps  %xmm2,%xmm2
movss  0x10(%rsp),%xmm1
ucomiss %xmm1,%xmm2
jae    1310 <psnd_paperplot_xaxis+0x130>
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1300 <psnd_paperplot_xaxis+0x120>
addss  0xd0f(%rip),%xmm0
call   1040 <ceil@plt>
jmp    130d <psnd_paperplot_xaxis+0x12d>
addss  0xcfc(%rip),%xmm0
call   10f0 <floor@plt>
mov    %eax,%r14d
xor    %r13d,%r13d
xorps  %xmm2,%xmm2
movss  0x14(%rsp),%xmm1
ucomiss %xmm1,%xmm2
mov    $0x0,%ebx
jae    1356 <psnd_paperplot_xaxis+0x176>
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
ucomiss %xmm0,%xmm2
jbe    1344 <psnd_paperplot_xaxis+0x164>
addss  0xccb(%rip),%xmm0
call   1040 <ceil@plt>
jmp    1351 <psnd_paperplot_xaxis+0x171>
addss  0xcb8(%rip),%xmm0
call   10f0 <floor@plt>
mov    %eax,%ebx
xorps  %xmm2,%xmm2
mov    %ebp,0x10(%rsp)
mov    %r14d,0x14(%rsp)
movss  (%rsp),%xmm1
ucomiss %xmm1,%xmm2
jae    139a <psnd_paperplot_xaxis+0x1ba>
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    138a <psnd_paperplot_xaxis+0x1aa>
addss  0xc85(%rip),%xmm0
call   1040 <ceil@plt>
jmp    1397 <psnd_paperplot_xaxis+0x1b7>
addss  0xc72(%rip),%xmm0
call   10f0 <floor@plt>
mov    %eax,%r13d
movss  0xc0(%rsp),%xmm0
subss  0x20(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
movss  0xc(%rsp),%xmm2
mulss  %xmm0,%xmm2
movss  %xmm2,0xc(%rsp)
movss  0x8(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movaps %xmm2,%xmm0
maxss  %xmm1,%xmm0
call   1040 <ceil@plt>
mov    %eax,%r14d
movss  0xc(%rsp),%xmm0
minss  0x8(%rsp),%xmm0
call   10f0 <floor@plt>
mov    %eax,%r12d
mov    0x24(%rsp),%r15d
mov    %r15d,%edi
movss  0xc(%rsp),%xmm0
xor    %esi,%esi
movss  0x8(%rsp),%xmm1
movss  0xc0(%rsp),%xmm2
call   10e0 <g_set_world@plt>
mov    %r15d,%edi
movss  0xc8(%rsp),%xmm0
movss  0xd0(%rsp),%xmm1
movss  0xd8(%rsp),%xmm2
movss  0xe0(%rsp),%xmm3
call   10a0 <g_set_viewport@plt>
mov    %r15d,%edi
mov    %ebx,%ebp
call   1070 <g_select_viewport@plt>
movss  0xc(%rsp),%xmm0
movss  (%rsp),%xmm1
call   1060 <g_moveto@plt>
cvttss2si 0x8(%rsp),%edi
movss  (%rsp),%xmm0
call   1100 <g_lineto@plt>
mov    %r14d,%edi
mov    %r12d,%esi
movss  0x18(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1050 <calc_label_digits@plt>
lea    0xb7d(%rip),%rsi
lea    0x30(%rsp),%rdi
mov    %eax,%edx
call   10b0 <sprintf@plt>
cmp    %r12d,%r14d
mov    0x14(%rsp),%r15d
mov    0x10(%rsp),%ebx
jge    14ec <psnd_paperplot_xaxis+0x30c>
mov    0x28(%rsp),%rbx
test   %rbx,%rbx
je     14dd <psnd_paperplot_xaxis+0x2fd>
movss  0x4(%rsp),%xmm0
mulss  0x90(%rsp),%xmm0
movss  (%rsp),%xmm1
subss  0x98(%rsp),%xmm1
call   1060 <g_moveto@plt>
mov    %rbx,%rdi
call   10c0 <g_label@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movss  (%rsp),%xmm0
subss  0x1c(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
jmp    150c <psnd_paperplot_xaxis+0x32c>
nop
lea    -0x1(%r14),%eax
cmp    %r12d,%r14d
mov    %eax,%r14d
jle    14a9 <psnd_paperplot_xaxis+0x2c9>
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
movss  %xmm0,0x8(%rsp)
movss  (%rsp),%xmm1
call   1060 <g_moveto@plt>
test   %r13d,%r13d
je     153d <psnd_paperplot_xaxis+0x35d>
mov    %r14d,%eax
cltd
idiv   %r13d
movss  0xb0(%rsp),%xmm1
test   %edx,%edx
je     156d <psnd_paperplot_xaxis+0x38d>
test   %ebp,%ebp
je     1554 <psnd_paperplot_xaxis+0x374>
mov    %r14d,%eax
cltd
idiv   %ebp
movss  0xa8(%rsp),%xmm1
test   %edx,%edx
je     156d <psnd_paperplot_xaxis+0x38d>
test   %r15d,%r15d
je     157e <psnd_paperplot_xaxis+0x39e>
mov    %r14d,%eax
cltd
idiv   %r15d
movss  0xa0(%rsp),%xmm1
test   %edx,%edx
jne    157e <psnd_paperplot_xaxis+0x39e>
movss  (%rsp),%xmm0
subss  %xmm1,%xmm0
mov    %r14d,%edi
call   1100 <g_lineto@plt>
test   %ebx,%ebx
je     1500 <psnd_paperplot_xaxis+0x320>
mov    %r14d,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1500 <psnd_paperplot_xaxis+0x320>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1060 <g_moveto@plt>
movss  0x8(%rsp),%xmm0
divss  0x4(%rsp),%xmm0
lea    0x30(%rsp),%rdi
call   1030 <psnd_sprintf_temp@plt>
mov    %rax,%rdi
call   10c0 <g_label@plt>
jmp    1500 <psnd_paperplot_xaxis+0x320>

LLVM IR (-O0):
@.str = [7 x i8] c"%%.%df\00"
define void @psnd_paperplot_xaxis(i32 %0, i32 %1, i8* %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15, float %16, float %17, float %18, float %19, float %20, float %21) {
%23 = alloca i32
%24 = alloca i32
%25 = alloca i8*
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca float
%33 = alloca float
%34 = alloca float
%35 = alloca float
%36 = alloca float
%37 = alloca float
%38 = alloca float
%39 = alloca float
%40 = alloca float
%41 = alloca float
%42 = alloca float
%43 = alloca float
%44 = alloca float
%45 = alloca float
%46 = alloca float
%47 = alloca float
%48 = alloca float
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32
%53 = alloca i32
%54 = alloca i32
%55 = alloca i32
%56 = alloca i32
%57 = alloca [40 x i8]
%58 = alloca i8*
store i32 %0, i32* %23
store i32 %1, i32* %24
store i8* %2, i8** %25
store float %3, float* %26
store float %4, float* %27
store float %5, float* %28
store float %6, float* %29
store float %7, float* %30
store float %8, float* %31
store float %9, float* %32
store float %10, float* %33
store float %11, float* %34
store float %12, float* %35
store float %13, float* %36
store float %14, float* %37
store float %15, float* %38
store float %16, float* %39
store float %17, float* %40
store float %18, float* %41
store float %19, float* %42
store float %20, float* %43
store float %21, float* %44
%59 = load i32, i32* %24
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %70
61: ; preds = %22
%62 = load float, float* %39
%63 = call float @get_long_ticks(float %62)
store float %63, float* %30
%64 = load float, float* %30
%65 = fmul float %64, 2.000000e+00
store float %65, float* %29
%66 = load float, float* %30
%67 = fmul float %66, 1.000000e+01
store float %67, float* %28
%68 = load float, float* %39
%69 = call float @get_label_ticks(float %68)
store float %69, float* %31
br label %70
70: ; preds = %61, %22
%71 = load float, float* %30
%72 = load float, float* %29
%73 = load float, float* %28
%74 = load float, float* %31
%75 = call float @calc_steps(float %71, float %72, float %73, float %74)
store float %75, float* %48
%76 = load float, float* %31
%77 = fcmp ole float %76, 0.000000e+00
br i1 %77, label %78, label %79
78: ; preds = %70
store i32 0, i32* %50
br label %103
79: ; preds = %70
%80 = load float, float* %48
%81 = load float, float* %31
%82 = fdiv float %80, %81
%83 = fpext float %82 to double
%84 = fcmp olt double %83, 0.000000e+00
br i1 %84, label %85, label %93
85: ; preds = %79
%86 = load float, float* %48
%87 = load float, float* %31
%88 = fdiv float %86, %87
%89 = fpext float %88 to double
%90 = fsub double %89, 5.000000e-01
%91 = fptrunc double %90 to float
%92 = call i32 @ceil(float %91)
br label %101
93: ; preds = %79
%94 = load float, float* %48
%95 = load float, float* %31
%96 = fdiv float %94, %95
%97 = fpext float %96 to double
%98 = fadd double %97, 5.000000e-01
%99 = fptrunc double %98 to float
%100 = call i32 @floor(float %99)
br label %101
101: ; preds = %93, %85
%102 = phi i32 [ %92, %85 ], [ %100, %93 ]
store i32 %102, i32* %50
br label %103
103: ; preds = %101, %78
%104 = load float, float* %28
%105 = fcmp ole float %104, 0.000000e+00
br i1 %105, label %106, label %107
106: ; preds = %103
store i32 0, i32* %51
br label %131
107: ; preds = %103
%108 = load float, float* %48
%109 = load float, float* %28
%110 = fdiv float %108, %109
%111 = fpext float %110 to double
%112 = fcmp olt double %111, 0.000000e+00
br i1 %112, label %113, label %121
113: ; preds = %107
%114 = load float, float* %48
%115 = load float, float* %28
%116 = fdiv float %114, %115
%117 = fpext float %116 to double
%118 = fsub double %117, 5.000000e-01
%119 = fptrunc double %118 to float
%120 = call i32 @ceil(float %119)
br label %129
121: ; preds = %107
%122 = load float, float* %48
%123 = load float, float* %28
%124 = fdiv float %122, %123
%125 = fpext float %124 to double
%126 = fadd double %125, 5.000000e-01
%127 = fptrunc double %126 to float
%128 = call i32 @floor(float %127)
br label %129
129: ; preds = %121, %113
%130 = phi i32 [ %120, %113 ], [ %128, %121 ]
store i32 %130, i32* %51
br label %131
131: ; preds = %129, %106
%132 = load float, float* %29
%133 = fcmp ole float %132, 0.000000e+00
br i1 %133, label %134, label %135
134: ; preds = %131
store i32 0, i32* %52
br label %159
135: ; preds = %131
%136 = load float, float* %48
%137 = load float, float* %29
%138 = fdiv float %136, %137
%139 = fpext float %138 to double
%140 = fcmp olt double %139, 0.000000e+00
br i1 %140, label %141, label %149
141: ; preds = %135
%142 = load float, float* %48
%143 = load float, float* %29
%144 = fdiv float %142, %143
%145 = fpext float %144 to double
%146 = fsub double %145, 5.000000e-01
%147 = fptrunc double %146 to float
%148 = call i32 @ceil(float %147)
br label %157
149: ; preds = %135
%150 = load float, float* %48
%151 = load float, float* %29
%152 = fdiv float %150, %151
%153 = fpext float %152 to double
%154 = fadd double %153, 5.000000e-01
%155 = fptrunc double %154 to float
%156 = call i32 @floor(float %155)
br label %157
157: ; preds = %149, %141
%158 = phi i32 [ %148, %141 ], [ %156, %149 ]
store i32 %158, i32* %52
br label %159
159: ; preds = %157, %134
%160 = load float, float* %30
%161 = fcmp ole float %160, 0.000000e+00
br i1 %161, label %162, label %163
162: ; preds = %159
store i32 0, i32* %53
br label %187
163: ; preds = %159
%164 = load float, float* %48
%165 = load float, float* %30
%166 = fdiv float %164, %165
%167 = fpext float %166 to double
%168 = fcmp olt double %167, 0.000000e+00
br i1 %168, label %169, label %177
169: ; preds = %163
%170 = load float, float* %48
%171 = load float, float* %30
%172 = fdiv float %170, %171
%173 = fpext float %172 to double
%174 = fsub double %173, 5.000000e-01
%175 = fptrunc double %174 to float
%176 = call i32 @ceil(float %175)
br label %185
177: ; preds = %163
%178 = load float, float* %48
%179 = load float, float* %30
%180 = fdiv float %178, %179
%181 = fpext float %180 to double
%182 = fadd double %181, 5.000000e-01
%183 = fptrunc double %182 to float
%184 = call i32 @floor(float %183)
br label %185
185: ; preds = %177, %169
%186 = phi i32 [ %176, %169 ], [ %184, %177 ]
store i32 %186, i32* %53
br label %187
187: ; preds = %185, %162
%188 = load float, float* %40
%189 = load float, float* %32
%190 = fsub float %188, %189
store float %190, float* %47
%191 = load float, float* %26
%192 = load float, float* %48
%193 = fmul float %191, %192
store float %193, float* %45
%194 = load float, float* %27
%195 = load float, float* %48
%196 = fmul float %194, %195
store float %196, float* %46
%197 = load float, float* %45
%198 = load float, float* %46
%199 = fcmp ogt float %197, %198
br i1 %199, label %200, label %202
200: ; preds = %187
%201 = load float, float* %45
br label %204
202: ; preds = %187
%203 = load float, float* %46
br label %204
204: ; preds = %202, %200
%205 = phi float [ %201, %200 ], [ %203, %202 ]
%206 = call i32 @ceil(float %205)
store i32 %206, i32* %54
%207 = load float, float* %45
%208 = load float, float* %46
%209 = fcmp olt float %207, %208
br i1 %209, label %210, label %212
210: ; preds = %204
%211 = load float, float* %45
br label %214
212: ; preds = %204
%213 = load float, float* %46
br label %214
214: ; preds = %212, %210
%215 = phi float [ %211, %210 ], [ %213, %212 ]
%216 = call i32 @floor(float %215)
store i32 %216, i32* %55
%217 = load i32, i32* %23
%218 = load float, float* %45
%219 = load float, float* %46
%220 = load float, float* %40
%221 = call i32 @g_set_world(i32 %217, float %218, i32 0, float %219, float %220)
%222 = load i32, i32* %23
%223 = load float, float* %41
%224 = load float, float* %42
%225 = load float, float* %43
%226 = load float, float* %44
%227 = call i32 @g_set_viewport(i32 %222, float %223, float %224, float %225, float %226)
%228 = load i32, i32* %23
%229 = call i32 @g_select_viewport(i32 %228)
%230 = load float, float* %45
%231 = load float, float* %47
%232 = call i32 @g_moveto(float %230, float %231)
%233 = load float, float* %46
%234 = fptosi float %233 to i32
%235 = load float, float* %47
%236 = call i32 @g_lineto(i32 %234, float %235)
%237 = load i32, i32* %54
%238 = load i32, i32* %55
%239 = load float, float* %31
%240 = load float, float* %48
%241 = call i32 @calc_label_digits(i32 %237, i32 %238, float %239, float %240)
store i32 %241, i32* %56
%242 = getelementptr inbounds [40 x i8], [40 x i8]* %57, i64 0, i64 0
%243 = load i32, i32* %56
%244 = call i32 @sprintf(i8* %242, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %243)
%245 = load i32, i32* %54
store i32 %245, i32* %49
br label %246
246: ; preds = %322, %214
%247 = load i32, i32* %49
%248 = load i32, i32* %55
%249 = icmp sge i32 %247, %248
br i1 %249, label %250, label %325
250: ; preds = %246
%251 = load i32, i32* %49
%252 = sitofp i32 %251 to float
%253 = load float, float* %47
%254 = call i32 @g_moveto(float %252, float %253)
%255 = load i32, i32* %53
%256 = icmp ne i32 %255, 0
br i1 %256, label %257, label %268
257: ; preds = %250
%258 = load i32, i32* %49
%259 = load i32, i32* %53
%260 = srem i32 %258, %259
%261 = icmp ne i32 %260, 0
br i1 %261, label %268, label %262
262: ; preds = %257
%263 = load i32, i32* %49
%264 = load float, float* %47
%265 = load float, float* %38
%266 = fsub float %264, %265
%267 = call i32 @g_lineto(i32 %263, float %266)
br label %298
268: ; preds = %257, %250
%269 = load i32, i32* %52
%270 = icmp ne i32 %269, 0
br i1 %270, label %271, label %282
271: ; preds = %268
%272 = load i32, i32* %49
%273 = load i32, i32* %52
%274 = srem i32 %272, %273
%275 = icmp ne i32 %274, 0
br i1 %275, label %282, label %276
276: ; preds = %271
%277 = load i32, i32* %49
%278 = load float, float* %47
%279 = load float, float* %37
%280 = fsub float %278, %279
%281 = call i32 @g_lineto(i32 %277, float %280)
br label %297
282: ; preds = %271, %268
%283 = load i32, i32* %51
%284 = icmp ne i32 %283, 0
br i1 %284, label %285, label %296
285: ; preds = %282
%286 = load i32, i32* %49
%287 = load i32, i32* %51
%288 = srem i32 %286, %287
%289 = icmp ne i32 %288, 0
br i1 %289, label %296, label %290
290: ; preds = %285
%291 = load i32, i32* %49
%292 = load float, float* %47
%293 = load float, float* %36
%294 = fsub float %292, %293
%295 = call i32 @g_lineto(i32 %291, float %294)
br label %296
296: ; preds = %290, %285, %282
br label %297
297: ; preds = %296, %276
br label %298
298: ; preds = %297, %262
%299 = load i32, i32* %50
%300 = icmp ne i32 %299, 0
br i1 %300, label %301, label %321
301: ; preds = %298
%302 = load i32, i32* %49
%303 = load i32, i32* %50
%304 = srem i32 %302, %303
%305 = icmp ne i32 %304, 0
br i1 %305, label %321, label %306
306: ; preds = %301
%307 = load i32, i32* %49
%308 = sitofp i32 %307 to float
%309 = load float, float* %47
%310 = load float, float* %33
%311 = fsub float %309, %310
%312 = call i32 @g_moveto(float %308, float %311)
%313 = getelementptr inbounds [40 x i8], [40 x i8]* %57, i64 0, i64 0
%314 = load i32, i32* %49
%315 = sitofp i32 %314 to float
%316 = load float, float* %48
%317 = fdiv float %315, %316
%318 = call i8* @psnd_sprintf_temp(i8* %313, float %317)
store i8* %318, i8** %58
%319 = load i8*, i8** %58
%320 = call i32 @g_label(i8* %319)
br label %321
321: ; preds = %306, %301, %298
br label %322
322: ; preds = %321
%323 = load i32, i32* %49
%324 = add nsw i32 %323, -1
store i32 %324, i32* %49
br label %246
325: ; preds = %246
%326 = load i8*, i8** %25
%327 = icmp ne i8* %326, null
br i1 %327, label %328, label %338
328: ; preds = %325
%329 = load float, float* %34
%330 = load float, float* %48
%331 = fmul float %329, %330
%332 = load float, float* %47
%333 = load float, float* %35
%334 = fsub float %332, %333
%335 = call i32 @g_moveto(float %331, float %334)
%336 = load i8*, i8** %25
%337 = call i32 @g_label(i8* %336)
br label %338
338: ; preds = %328, %325
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%%.%df\00"
define void @psnd_paperplot_xaxis(i32 %0, i32 %1, i8* %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15, float %16, float %17, float %18, float %19, float %20, float %21) {
%23 = alloca [40 x i8]
%24 = getelementptr inbounds [40 x i8], [40 x i8]* %23, i64 0, i64 0
%25 = icmp eq i32 %1, 0
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = tail call float @get_long_ticks(float %16)
%28 = fmul float %27, 2.000000e+00
%29 = fmul float %27, 1.000000e+01
%30 = tail call float @get_label_ticks(float %16)
br label %31
31: ; preds = %26, %22
%32 = phi float [ %30, %26 ], [ %8, %22 ]
%33 = phi float [ %27, %26 ], [ %7, %22 ]
%34 = phi float [ %28, %26 ], [ %6, %22 ]
%35 = phi float [ %29, %26 ], [ %5, %22 ]
%36 = tail call float @calc_steps(float %33, float %34, float %35, float %32)
%37 = fcmp ugt float %32, 0.000000e+00
br i1 %37, label %38, label %47
38: ; preds = %31
%39 = fdiv float %36, %32
%40 = fcmp olt float %39, 0.000000e+00
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = fadd float %39, -5.000000e-01
%43 = tail call i32 @ceil(float %42)
br label %47
44: ; preds = %38
%45 = fadd float %39, 5.000000e-01
%46 = tail call i32 @floor(float %45)
br label %47
47: ; preds = %41, %44, %31
%48 = phi i32 [ 0, %31 ], [ %43, %41 ], [ %46, %44 ]
%49 = fcmp ugt float %35, 0.000000e+00
br i1 %49, label %50, label %59
50: ; preds = %47
%51 = fdiv float %36, %35
%52 = fcmp olt float %51, 0.000000e+00
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = fadd float %51, -5.000000e-01
%55 = tail call i32 @ceil(float %54)
br label %59
56: ; preds = %50
%57 = fadd float %51, 5.000000e-01
%58 = tail call i32 @floor(float %57)
br label %59
59: ; preds = %53, %56, %47
%60 = phi i32 [ 0, %47 ], [ %55, %53 ], [ %58, %56 ]
%61 = fcmp ugt float %34, 0.000000e+00
br i1 %61, label %62, label %71
62: ; preds = %59
%63 = fdiv float %36, %34
%64 = fcmp olt float %63, 0.000000e+00
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = fadd float %63, -5.000000e-01
%67 = tail call i32 @ceil(float %66)
br label %71
68: ; preds = %62
%69 = fadd float %63, 5.000000e-01
%70 = tail call i32 @floor(float %69)
br label %71
71: ; preds = %65, %68, %59
%72 = phi i32 [ 0, %59 ], [ %67, %65 ], [ %70, %68 ]
%73 = fcmp ugt float %33, 0.000000e+00
br i1 %73, label %74, label %83
74: ; preds = %71
%75 = fdiv float %36, %33
%76 = fcmp olt float %75, 0.000000e+00
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = fadd float %75, -5.000000e-01
%79 = tail call i32 @ceil(float %78)
br label %83
80: ; preds = %74
%81 = fadd float %75, 5.000000e-01
%82 = tail call i32 @floor(float %81)
br label %83
83: ; preds = %77, %80, %71
%84 = phi i32 [ 0, %71 ], [ %79, %77 ], [ %82, %80 ]
%85 = fsub float %17, %9
%86 = fmul float %36, %3
%87 = fmul float %36, %4
%88 = fcmp ogt float %86, %87
%89 = select i1 %88, float %86, float %87
%90 = tail call i32 @ceil(float %89)
%91 = fcmp olt float %86, %87
%92 = select i1 %91, float %86, float %87
%93 = tail call i32 @floor(float %92)
%94 = tail call i32 @g_set_world(i32 %0, float %86, i32 0, float %87, float %17)
%95 = tail call i32 @g_set_viewport(i32 %0, float %18, float %19, float %20, float %21)
%96 = tail call i32 @g_select_viewport(i32 %0)
%97 = tail call i32 @g_moveto(float %86, float %85)
%98 = fptosi float %87 to i32
%99 = tail call i32 @g_lineto(i32 %98, float %85)
%100 = tail call i32 @calc_label_digits(i32 %90, i32 %93, float %32, float %36)
%101 = call i32 @sprintf(i8* %24, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %100)
%102 = icmp slt i32 %90, %93
br i1 %102, label %140, label %103
103: ; preds = %83
%104 = icmp eq i32 %84, 0
%105 = icmp eq i32 %72, 0
%106 = icmp eq i32 %60, 0
%107 = icmp eq i32 %48, 0
%108 = fsub float %85, %10
br label %109
109: ; preds = %103, %137
%110 = phi i32 [ %90, %103 ], [ %138, %137 ]
%111 = sitofp i32 %110 to float
%112 = call i32 @g_moveto(float %111, float %85)
br i1 %104, label %116, label %113
113: ; preds = %109
%114 = srem i32 %110, %84
%115 = icmp eq i32 %114, 0
br i1 %115, label %124, label %116
116: ; preds = %113, %109
br i1 %105, label %120, label %117
117: ; preds = %116
%118 = srem i32 %110, %72
%119 = icmp eq i32 %118, 0
br i1 %119, label %124, label %120
120: ; preds = %117, %116
br i1 %106, label %128, label %121
121: ; preds = %120
%122 = srem i32 %110, %60
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %128
124: ; preds = %121, %117, %113
%125 = phi float [ %15, %113 ], [ %14, %117 ], [ %13, %121 ]
%126 = fsub float %85, %125
%127 = call i32 @g_lineto(i32 %110, float %126)
br label %128
128: ; preds = %124, %121, %120
br i1 %107, label %137, label %129
129: ; preds = %128
%130 = srem i32 %110, %48
%131 = icmp eq i32 %130, 0
br i1 %131, label %132, label %137
132: ; preds = %129
%133 = call i32 @g_moveto(float %111, float %108)
%134 = fdiv float %111, %36
%135 = call i8* @psnd_sprintf_temp(i8* %24, float %134)
%136 = call i32 @g_label(i8* %135)
br label %137
137: ; preds = %128, %129, %132
%138 = add nsw i32 %110, -1
%139 = icmp sgt i32 %110, %93
br i1 %139, label %109, label %140
140: ; preds = %137, %83
%141 = icmp eq i8* %2, null
br i1 %141, label %147, label %142
142: ; preds = %140
%143 = fmul float %36, %11
%144 = fsub float %85, %12
%145 = call i32 @g_moveto(float %143, float %144)
%146 = call i32 @g_label(i8* %2)
br label %147
147: ; preds = %142, %140
ret void
}