// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/pstricks.c
// Function: rangetest_plot_pstricks
void rangetest_plot_pstricks(double* ranks, int algorithmcount, char** algorithms, double critical_difference)
{
 FILE* outfile;
 char st[3];
 int i, j, oldj, leftcount = 0, rightcount = 0, maxcount, linecount;
 double algheight, axisheight, algwidth;
 outfile = fopen("image.txt", "w");
 if (!outfile)
   return;
 for (i = 0; i < algorithmcount; i++)
   if (ranks[i] < (1.0 + algorithmcount) / 2)
     leftcount++;
   else
     rightcount++;
 if (leftcount > rightcount)
   maxcount = leftcount;
 else
   maxcount = rightcount;
 leftcount = 0;
 rightcount = 0;
 clear_image();
 algheight = 0.5;
 algwidth = 1.0;
 axisheight = algheight * (maxcount + 1);
 write_image_header_pstricks(outfile, -2, -1, algorithmcount + algwidth, axisheight + algheight);
 write_line_pstricks(outfile, 0, axisheight, algorithmcount - 1, axisheight);
 for (i = 1; i <= algorithmcount; i++)
  {
   sprintf(st, "%d", i);
   write_string_pstricks(outfile, (i - 1), axisheight + .2, st, ALIGN_CENTER);
   write_line_pstricks(outfile, i - 1, axisheight - 0.1, i - 1, axisheight + 0.1);
  }
 for (i = 0; i < algorithmcount; i++)
  {
   if (ranks[i] < (1.0 + algorithmcount) / 2)
    {
     leftcount++;
     write_line_pstricks(outfile, (ranks[i] - 1) * algwidth, axisheight, (ranks[i] - 1) * algwidth, algheight * leftcount);
     write_line_pstricks(outfile, 0, algheight * leftcount, (ranks[i] - 1) * algwidth, algheight * leftcount);
     write_string_pstricks(outfile, -1.9, algheight * leftcount, algorithms[i], ALIGN_LEFT);
    }
   else
    {
     rightcount++;
     write_line_pstricks(outfile, (ranks[i] - 1) * algwidth, axisheight, (ranks[i] - 1) * algwidth, algheight * rightcount);
     write_line_pstricks(outfile, (ranks[i] - 1) * algwidth, algheight * rightcount, algorithmcount - .8, algheight * rightcount);
     write_string_pstricks(outfile, algorithmcount - .7, algheight * rightcount, algorithms[i], ALIGN_LEFT);
    }
  }
 qsort(ranks, algorithmcount, sizeof(double), sort_function_double_ascending);
 linecount = 1;
 oldj = 0;
 for (i = 0; i < algorithmcount - 1; i++)
  {
   j = i + 1;
   if (ranks[j] - ranks[i] < critical_difference)
     while (j < algorithmcount && ranks[j] - ranks[i] < critical_difference)
       j++;
   j--;
   if (i != j && j > oldj)
    {
     set_line_width_pstricks(outfile, 2.0);
     write_line_pstricks(outfile, (ranks[i] - 1) * algwidth - .1, axisheight - linecount * 0.15, (ranks[j] - 1) * algwidth + 0.1, axisheight - linecount * .15);
     set_line_width_pstricks(outfile, 1.0);
     linecount++;
    }
   oldj = j;
  }
 write_image_footer_pstricks(outfile);
 fclose(outfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movsd %xmm0, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
movl %esi, %ebx
movq %rdi, %r14
leaq 0x3291a(%rip), %rdi     # 0x98928
leaq 0x3587c(%rip), %rsi     # 0x9b891
callq 0x40f0
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x66465
cvtsi2sd %ebx, %xmm0
movsd 0x2f4ec(%rip), %xmm1    # 0x95520
movsd %xmm0, 0x30(%rsp)
addsd %xmm0, %xmm1
movsd 0x2fcda(%rip), %xmm0    # 0x95d20
movsd %xmm1, 0x8(%rsp)
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
xorl %eax, %eax
testl %ebx, %ebx
movl $0x0, %ecx
cmovgl %ebx, %ecx
movq %rcx, 0x10(%rsp)
xorl %ecx, %ecx
xorl %ebp, %ebp
movsd 0x28(%rsp), %xmm0
cmpq %rax, 0x10(%rsp)
je 0x66092
xorl %edx, %edx
xorl %esi, %esi
ucomisd (%r14,%rax,8), %xmm0
setbe %dl
seta %sil
addl %esi, %ecx
addl %edx, %ebp
incq %rax
jmp 0x66071
cmpl %ebp, %ecx
cmovgl %ecx, %ebp
xorl %eax, %eax
callq 0x2a510
incl %ebp
cvtsi2sd %ebp, %xmm3
movsd 0x2fc74(%rip), %xmm0    # 0x95d20
mulsd %xmm0, %xmm3
movsd %xmm3, 0x20(%rsp)
addsd %xmm0, %xmm3
movsd 0x319ae(%rip), %xmm0    # 0x97a70
movsd 0x2fce6(%rip), %xmm1    # 0x95db0
movq 0x18(%rsp), %r15
movq %r15, %rdi
movsd 0x8(%rsp), %xmm2
callq 0x6512f
leal -0x1(%rbx), %eax
movq %rax, 0x38(%rsp)
cvtsi2sd %eax, %xmm2
xorps %xmm0, %xmm0
movq %r15, %rdi
movsd 0x20(%rsp), %xmm1
movapd %xmm1, %xmm3
callq 0x650f6
movsd 0x31c8a(%rip), %xmm0    # 0x97d90
movsd 0x20(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x38c3a(%rip), %xmm0    # 0x9ed58
addsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x34a48(%rip), %xmm0    # 0x9ab78
addsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
pushq $0x1
popq %r13
leaq 0x65(%rsp), %r12
movq 0x10(%rsp), %rax
movl %eax, %ebp
movq 0x18(%rsp), %r15
subl $0x1, %ebp
jb 0x661b3
movq %r12, %rdi
leaq 0x3a9fb(%rip), %rsi     # 0xa0b59
movl %r13d, %edx
xorl %eax, %eax
callq 0x41b0
leal -0x1(%r13), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
leaq 0x38c30(%rip), %rsi     # 0x9edb0
movsd 0x40(%rsp), %xmm1
movq %r12, %rdx
movb $0x2, %al
callq 0x42e0
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
movapd %xmm0, %xmm2
movsd 0x68(%rsp), %xmm3
callq 0x650f6
incl %r13d
jmp 0x6614f
movsd 0x38ba5(%rip), %xmm1    # 0x9ed60
movsd 0x30(%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x40(%rsp)
addsd 0x38b95(%rip), %xmm0    # 0x9ed68
movsd %xmm0, 0x30(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
movsd 0x2fbc7(%rip), %xmm1    # 0x95db0
cmpq %r12, 0x10(%rsp)
je 0x662f7
movsd (%r14,%r12,8), %xmm0
movsd 0x28(%rsp), %xmm2
ucomisd %xmm0, %xmm2
addsd %xmm1, %xmm0
jbe 0x66278
incl %r13d
cvtsi2sd %r13d, %xmm3
mulsd 0x2fb06(%rip), %xmm3    # 0x95d20
movsd %xmm3, 0x8(%rsp)
movq 0x18(%rsp), %r15
movq %r15, %rdi
movsd 0x20(%rsp), %xmm1
movapd %xmm0, %xmm2
callq 0x650f6
movsd (%r14,%r12,8), %xmm2
addsd 0x2fb6b(%rip), %xmm2    # 0x95db0
xorpd %xmm0, %xmm0
movq %r15, %rdi
movsd 0x8(%rsp), %xmm1
movapd %xmm1, %xmm3
callq 0x650f6
movq 0x50(%rsp), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
leaq 0x38b12(%rip), %rsi     # 0x9ed80
movsd 0x38afa(%rip), %xmm0    # 0x9ed70
jmp 0x662e2
incl %ebp
cvtsi2sd %ebp, %xmm3
mulsd 0x2fa9a(%rip), %xmm3    # 0x95d20
movsd %xmm3, 0x8(%rsp)
movq 0x18(%rsp), %r15
movq %r15, %rdi
movsd 0x20(%rsp), %xmm1
movapd %xmm0, %xmm2
callq 0x650f6
movsd (%r14,%r12,8), %xmm0
addsd 0x2faff(%rip), %xmm0    # 0x95db0
movq %r15, %rdi
movsd 0x8(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movapd %xmm1, %xmm3
callq 0x650f6
movq 0x50(%rsp), %rax
movq (%rax,%r12,8), %rdx
movq %r15, %rdi
leaq 0x38aa4(%rip), %rsi     # 0x9ed80
movsd 0x30(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movb $0x2, %al
callq 0x42e0
incq %r12
jmp 0x661e1
movslq %ebx, %rsi
leaq -0x30f42(%rip), %rcx    # 0x353bf
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x4240
xorl %ebp, %ebp
movq 0x38(%rsp), %rsi
testl %esi, %esi
cmovlel %ebp, %esi
leaq 0x8(%r14), %rdi
pushq $0x1
popq %rax
movl %eax, 0x10(%rsp)
pushq $0x1
popq %r13
xorl %eax, %eax
movsd 0x48(%rsp), %xmm2
movq %r14, 0x58(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x18(%rsp), %r12
cmpl %r13d, %ebx
movl %r13d, %ecx
cmovgl %ebx, %ecx
cmpq %rsi, %rbp
je 0x66450
leaq 0x1(%rbp), %r15
movsd (%r14,%rbp,8), %xmm0
movsd 0x8(%r14,%rbp,8), %xmm1
subsd %xmm0, %xmm1
ucomisd %xmm1, %xmm2
movl %r15d, %r14d
jbe 0x66393
movl %ebp, %r14d
movq %rdi, %rdx
incl %r14d
cmpl %ebx, %r14d
jge 0x66390
movsd (%rdx), %xmm1
subsd %xmm0, %xmm1
addq $0x8, %rdx
ucomisd %xmm1, %xmm2
ja 0x66374
jmp 0x66393
movl %ecx, %r14d
decl %r14d
cmpq %r14, %rbp
sete %cl
cmpl %eax, %r14d
setle %al
orb %cl, %al
jne 0x66439
movq %rdi, 0x28(%rsp)
movq %r12, %rdi
movsd 0x2fc8e(%rip), %xmm0    # 0x96048
callq 0x65152
movq 0x58(%rsp), %rcx
movsd (%rcx,%rbp,8), %xmm0
movsd 0x2f9df(%rip), %xmm3    # 0x95db0
addsd %xmm3, %xmm0
addsd 0x3897b(%rip), %xmm0    # 0x9ed58
movl 0x10(%rsp), %ebp
cvtsi2sd %ebp, %xmm1
mulsd 0x3898b(%rip), %xmm1    # 0x9ed78
addsd 0x20(%rsp), %xmm1
movslq %r14d, %rax
movsd (%rcx,%rax,8), %xmm2
addsd %xmm3, %xmm2
addsd 0x34771(%rip), %xmm2    # 0x9ab78
movq %r12, %rdi
movapd %xmm1, %xmm3
callq 0x650f6
movq %r12, %rdi
movsd 0x2f102(%rip), %xmm0    # 0x95520
callq 0x65152
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movsd 0x48(%rsp), %xmm2
incl %ebp
movl %ebp, 0x10(%rsp)
incq %r13
addq $0x8, %rdi
movq %r15, %rbp
movl %r14d, %eax
movq 0x58(%rsp), %r14
jmp 0x6633e
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x6513d
movq %rbx, %rdi
callq 0x42a0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq