#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 atoi(char *);
int /*<<< orphan*/ fr_shellsort_double_i_(double *, size_t *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double *vrandr(int, int, int);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  for (int i = 0; i < argc; ++i)
    printf("argv[%d]: %s   ", i, argv[i]);
  putchar('\n');
  printf("breaking ties with average rank\n");
  int max = atoi(argv[1]);
  int n = atoi(argv[2]);
  printf("random vector:  max: %d   n: %d\n", max, n);
  double *x = vrandr(10, max, n);
  size_t *indx = (size_t *)malloc(n * sizeof(size_t));
  for (size_t i = 0; i < n; ++i)
    indx[i] = i;
  printf("before fr_shellsort_double_i_: x[] and indx[]\n");
  for (int i = 0; i < n; ++i)
    printf("%.0f   ", x[i]);
  putchar('\n');
  for (int i = 0; i < n; ++i)
    printf("%d    ", indx[i]);
  putchar('\n');
  fr_shellsort_double_i_(x, indx, n);
  printf("after fr_shellsort_double_i_: x[] and indx[]\n");
  for (int i = 0; i < n; ++i)
    printf("%.0f   ", x[i]);
  putchar('\n');
  for (int i = 0; i < n; ++i)
    printf("%d    ", indx[i]);
  putchar('\n');
  double *ranks = (double *)malloc(n * sizeof(double));
  double b = x[indx[0]];
  int ib = 0;
  int i;
  for (i = 1; i < n; ++i) {
    if (x[indx[i]] != b) {
      if (ib < i - 1) {
        double rnk = (i - 1 + ib + 2) / 2.0;
        for (int j = ib; j <= i - 1; ++j)
          ranks[indx[j]] = rnk;
      } else {
        ranks[indx[ib]] = ib + 1;
      }
      b = x[indx[i]];
      ib = i;
    }
  }
  if (ib == i - 1)
    ranks[indx[ib]] = i;
  else {
    double rnk = (i - 1 + ib + 2) / 2.0;
    for (int j = ib; j <= i - 1; ++j)
      ranks[indx[j]] = rnk;
  }
  printf("after average ranking: x[] and indx[]\n");
  for (int i = 0; i < n; ++i)
    printf(" %.0f  ", x[i]);
  putchar('\n');
  for (int i = 0; i < n; ++i)
    printf("%.1f  ", ranks[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e7 <main+0x67>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b0 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    $0xa,%edi
call   1090 <vrandr@plt>
mov    %rax,-0x28(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
jae    1294 <main+0x114>
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1262 <main+0xe2>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12de <main+0x15e>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xdc0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12a9 <main+0x129>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1323 <main+0x1a3>
mov    -0x30(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12ef <main+0x16f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <fr_shellsort_double_i_@plt>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1387 <main+0x207>
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd17(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1352 <main+0x1d2>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13cc <main+0x24c>
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xcda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1398 <main+0x218>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x1,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    150b <main+0x38b>
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x60(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x58(%rbp),%xmm0
jne    1443 <main+0x2c3>
jp     1443 <main+0x2c3>
jmp    14f8 <main+0x378>
mov    -0x5c(%rbp),%eax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    14b9 <main+0x339>
mov    -0x60(%rbp),%eax
sub    $0x1,%eax
add    -0x5c(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  0xb94(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     14b4 <main+0x334>
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x6c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    147b <main+0x2fb>
jmp    14d8 <main+0x358>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    -0x50(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x5c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x60(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x5c(%rbp)
jmp    14fd <main+0x37d>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    140c <main+0x28c>
mov    -0x5c(%rbp),%eax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    153b <main+0x3bb>
cvtsi2sdl -0x60(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x5c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15a0 <main+0x420>
mov    -0x60(%rbp),%eax
sub    $0x1,%eax
add    -0x5c(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  0xaad(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    -0x60(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     159b <main+0x41b>
movsd  -0x78(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x30(%rbp),%rcx
movslq -0x7c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1562 <main+0x3e2>
jmp    15a0 <main+0x420>
lea    0xb1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    15ea <main+0x46a>
mov    -0x28(%rbp),%rax
movslq -0x80(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xb18(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    15b5 <main+0x435>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    163f <main+0x4bf>
mov    -0x50(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xad1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    15fe <main+0x47e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
test   %ebp,%ebp
jle    11d9 <main+0x49>
mov    %ebp,%ebx
lea    0xedd(%rip),%r14
xor    %ebp,%ebp
nopl   (%rax)
mov    (%r15,%rbp,8),%rdx
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11c0 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xefd(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%r15),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%r15),%rdi
call   10b0 <atoi@plt>
mov    %eax,%r14d
lea    0xe9b(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   10a0 <vrandr@plt>
mov    %rax,%r15
lea    0x0(,%r14,8),%ebp
mov    %ebp,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
test   %r14d,%r14d
mov    %ebp,0x4(%rsp)
je     1255 <main+0xc5>
movslq %r14d,%rax
cmp    $0x4,%r14d
jae    1266 <main+0xd6>
xor    %ecx,%ecx
jmp    13c0 <main+0x230>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
jmp    144c <main+0x2bc>
mov    %rax,%rcx
and    $0xfffffffffffffffc,%rcx
lea    -0x4(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%edx
and    $0x3,%edx
cmp    $0xc,%rdi
jae    1296 <main+0x106>
movdqa 0xd71(%rip),%xmm0
xor    %edi,%edi
jmp    1368 <main+0x1d8>
and    $0xfffffffffffffffc,%rsi
movdqa 0xd5e(%rip),%xmm0
xor    %edi,%edi
movdqa 0xd63(%rip),%xmm8
movdqa 0xd6a(%rip),%xmm9
movdqa 0xd71(%rip),%xmm10
movdqa 0xd79(%rip),%xmm4
movdqa 0xd81(%rip),%xmm5
movdqa 0xd89(%rip),%xmm6
movdqa 0xd91(%rip),%xmm7
movdqa 0xd99(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm2
paddq  %xmm8,%xmm2
movdqu %xmm0,(%rbx,%rdi,8)
movdqu %xmm2,0x10(%rbx,%rdi,8)
movdqa %xmm0,%xmm2
paddq  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddq  %xmm10,%xmm3
movdqu %xmm2,0x20(%rbx,%rdi,8)
movdqu %xmm3,0x30(%rbx,%rdi,8)
movdqa %xmm0,%xmm2
paddq  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddq  %xmm5,%xmm3
movdqu %xmm2,0x40(%rbx,%rdi,8)
movdqu %xmm3,0x50(%rbx,%rdi,8)
movdqa %xmm0,%xmm2
paddq  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddq  %xmm7,%xmm3
movdqu %xmm2,0x60(%rbx,%rdi,8)
movdqu %xmm3,0x70(%rbx,%rdi,8)
add    $0x10,%rdi
paddq  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rsi
jne    12f0 <main+0x160>
test   %rdx,%rdx
je     13b0 <main+0x220>
lea    (%rbx,%rdi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%rdx
xor    %edi,%edi
movdqa 0xc8d(%rip),%xmm1
movdqa 0xc95(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm3
paddq  %xmm1,%xmm3
movdqu %xmm0,-0x10(%rsi,%rdi,1)
movdqu %xmm3,(%rsi,%rdi,1)
paddq  %xmm2,%xmm0
add    $0x20,%rdi
cmp    %rdi,%rdx
jne    1390 <main+0x200>
cmp    %rax,%rcx
je     13cd <main+0x23d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    13c0 <main+0x230>
lea    0xd33(%rip),%rdi
call   1040 <puts@plt>
test   %r14d,%r14d
jle    144c <main+0x2bc>
mov    %r14d,%r13d
xor    %ebp,%ebp
lea    0xcdf(%rip),%r12
nopw   0x0(%rax,%rax,1)
movq   (%r15,%rbp,8),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    13f0 <main+0x260>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
jle    1456 <main+0x2c6>
lea    0xcb2(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1430 <main+0x2a0>
mov    $0x1,%bpl
jmp    1458 <main+0x2c8>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1070 <fr_shellsort_double_i_@plt>
lea    0xcbe(%rip),%rdi
call   1040 <puts@plt>
test   %bpl,%bpl
mov    %ebp,(%rsp)
je     14f9 <main+0x369>
mov    %r14d,%r12d
xor    %r13d,%r13d
lea    0xc38(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movq   (%r15,%r13,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r12
jne    14a0 <main+0x310>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpb   $0x0,(%rsp)
je     1503 <main+0x373>
lea    0xc01(%rip),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,8),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    14e0 <main+0x350>
jmp    1503 <main+0x373>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
cmp    $0x2,%r14d
jl     1629 <main+0x499>
mov    (%rbx),%rax
movsd  (%r15,%rax,8),%xmm1
mov    %r14d,%r8d
xor    %esi,%esi
mov    $0x1,%edx
movsd  0xb52(%rip),%xmm0
xor    %r9d,%r9d
jmp    157e <main+0x3ee>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rax),%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mov    (%rbx,%rax,8),%rax
movsd  %xmm1,0x0(%rbp,%rax,8)
movsd  (%r15,%r11,8),%xmm1
mov    %edx,%r9d
add    $0x1,%rdx
add    $0x1,%rsi
cmp    %r8,%rdx
je     1633 <main+0x4a3>
mov    (%rbx,%rdx,8),%r11
movsd  (%r15,%r11,8),%xmm2
ucomisd %xmm1,%xmm2
jne    1590 <main+0x400>
jnp    156d <main+0x3dd>
lea    -0x1(%rdx),%rdi
movslq %r9d,%rax
cmp    %rax,%rdi
jle    1550 <main+0x3c0>
add    %eax,%edi
add    $0x2,%edi
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
mov    %edx,%edi
sub    %r9d,%edi
mov    %rsi,%r10
sub    %rax,%r10
test   $0x3,%dil
je     15e4 <main+0x454>
mov    %edx,%ecx
sub    %r9b,%cl
movzbl %cl,%edi
and    $0x3,%edi
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rax,8),%rcx
movsd  %xmm1,0x0(%rbp,%rcx,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdi
jne    15d0 <main+0x440>
cmp    $0x3,%r10
jb     1564 <main+0x3d4>
xchg   %ax,%ax
mov    (%rbx,%rax,8),%rcx
movsd  %xmm1,0x0(%rbp,%rcx,8)
mov    0x8(%rbx,%rax,8),%rcx
movsd  %xmm1,0x0(%rbp,%rcx,8)
mov    0x10(%rbx,%rax,8),%rcx
movsd  %xmm1,0x0(%rbp,%rcx,8)
mov    0x18(%rbx,%rax,8),%rcx
movsd  %xmm1,0x0(%rbp,%rcx,8)
add    $0x4,%rax
cmp    %rax,%rdx
jne    15f0 <main+0x460>
jmp    1564 <main+0x3d4>
mov    $0x1,%eax
xor    %r9d,%r9d
jmp    1636 <main+0x4a6>
mov    %r14d,%eax
mov    (%rsp),%r13d
lea    -0x1(%rax),%ecx
cmp    %ecx,%r9d
jne    165b <main+0x4cb>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movslq %r9d,%rax
mov    (%rbx,%rax,8),%rax
movsd  %xmm0,0x0(%rbp,%rax,8)
jmp    16f4 <main+0x564>
cmp    %eax,%r9d
jge    16f4 <main+0x564>
add    %r9d,%ecx
add    $0x2,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xa17(%rip),%xmm0
movslq %r9d,%rcx
movslq %eax,%rdx
sub    %r9d,%eax
mov    %rcx,%rsi
not    %rsi
add    %rdx,%rsi
and    $0x3,%rax
je     16b4 <main+0x524>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rcx,8),%rdi
movsd  %xmm0,0x0(%rbp,%rdi,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rax
jne    16a0 <main+0x510>
cmp    $0x3,%rsi
jb     16f4 <main+0x564>
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rcx,8),%rax
movsd  %xmm0,0x0(%rbp,%rax,8)
mov    0x8(%rbx,%rcx,8),%rax
movsd  %xmm0,0x0(%rbp,%rax,8)
mov    0x10(%rbx,%rcx,8),%rax
movsd  %xmm0,0x0(%rbp,%rax,8)
mov    0x18(%rbx,%rcx,8),%rax
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    16c0 <main+0x530>
lea    0xa67(%rip),%rdi
call   1040 <puts@plt>
test   %r13b,%r13b
je     177b <main+0x5eb>
mov    %r14d,%r12d
xor    %ebx,%ebx
lea    0x9c7(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1720 <main+0x590>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r13b,%r13b
je     1785 <main+0x5f5>
xor    %ebx,%ebx
lea    0x98f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1760 <main+0x5d0>
jmp    1785 <main+0x5f5>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"argv[%d]: %s \00"
@.str.1 = [33 x i8] c"breaking ties with average rank\0A\00"
@.str.2 = [33 x i8] c"random vector: max: %d n: %d\0A\00"
@.str.3 = [47 x i8] c"before fr_shellsort_double_i_: x[] and indx[]\0A\00"
@.str.4 = [8 x i8] c"%.0f \00"
@.str.5 = [7 x i8] c"%d \00"
@.str.6 = [46 x i8] c"after fr_shellsort_double_i_: x[] and indx[]\0A\00"
@.str.7 = [39 x i8] c"after average ranking: x[] and indx[]\0A\00"
@.str.8 = [8 x i8] c" %.0f \00"
@.str.9 = [7 x i8] c"%.1f \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca i64*
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double*
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca double
%21 = alloca i32
%22 = alloca double
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = call i32 @time(i32* null)
%27 = call i32 @srand(i32 %26)
store i32 0, i32* %6
br label %28
28: ; preds = %40, %2
%29 = load i32, i32* %6
%30 = load i32, i32* %4
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %43
32: ; preds = %28
%33 = load i32, i32* %6
%34 = load i8**, i8*** %5
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %33, i8* %38)
br label %40
40: ; preds = %32
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %28
43: ; preds = %28
%44 = call i32 @putchar(i8 signext 10)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32 @atoi(i8* %48)
store i32 %49, i32* %7
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
store i32 %53, i32* %8
%54 = load i32, i32* %7
%55 = load i32, i32* %8
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %55)
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = call double* @vrandr(i32 10, i32 %57, i32 %58)
store double* %59, double** %9
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = mul i64 %61, 8
%63 = trunc i64 %62 to i32
%64 = call i64 @malloc(i32 %63)
%65 = inttoptr i64 %64 to i64*
store i64* %65, i64** %10
store i64 0, i64* %11
br label %66
66: ; preds = %76, %43
%67 = load i64, i64* %11
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = icmp ult i64 %67, %69
br i1 %70, label %71, label %79
71: ; preds = %66
%72 = load i64, i64* %11
%73 = load i64*, i64** %10
%74 = load i64, i64* %11
%75 = getelementptr inbounds i64, i64* %73, i64 %74
store i64 %72, i64* %75
br label %76
76: ; preds = %71
%77 = load i64, i64* %11
%78 = add i64 %77, 1
store i64 %78, i64* %11
br label %66
79: ; preds = %66
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %12
br label %81
81: ; preds = %92, %79
%82 = load i32, i32* %12
%83 = load i32, i32* %8
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %95
85: ; preds = %81
%86 = load double*, double** %9
%87 = load i32, i32* %12
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
%90 = load double, double* %89
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %90)
br label %92
92: ; preds = %85
%93 = load i32, i32* %12
%94 = add nsw i32 %93, 1
store i32 %94, i32* %12
br label %81
95: ; preds = %81
%96 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %13
br label %97
97: ; preds = %108, %95
%98 = load i32, i32* %13
%99 = load i32, i32* %8
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %111
101: ; preds = %97
%102 = load i64*, i64** %10
%103 = load i32, i32* %13
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i64, i64* %102, i64 %104
%106 = load i64, i64* %105
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 %106)
br label %108
108: ; preds = %101
%109 = load i32, i32* %13
%110 = add nsw i32 %109, 1
store i32 %110, i32* %13
br label %97
111: ; preds = %97
%112 = call i32 @putchar(i8 signext 10)
%113 = load double*, double** %9
%114 = load i64*, i64** %10
%115 = load i32, i32* %8
%116 = call i32 @fr_shellsort_double_i_(double* %113, i64* %114, i32 %115)
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %14
br label %118
118: ; preds = %129, %111
%119 = load i32, i32* %14
%120 = load i32, i32* %8
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %132
122: ; preds = %118
%123 = load double*, double** %9
%124 = load i32, i32* %14
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
%127 = load double, double* %126
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %127)
br label %129
129: ; preds = %122
%130 = load i32, i32* %14
%131 = add nsw i32 %130, 1
store i32 %131, i32* %14
br label %118
132: ; preds = %118
%133 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %15
br label %134
134: ; preds = %145, %132
%135 = load i32, i32* %15
%136 = load i32, i32* %8
%137 = icmp slt i32 %135, %136
br i1 %137, label %138, label %148
138: ; preds = %134
%139 = load i64*, i64** %10
%140 = load i32, i32* %15
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i64, i64* %139, i64 %141
%143 = load i64, i64* %142
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 %143)
br label %145
145: ; preds = %138
%146 = load i32, i32* %15
%147 = add nsw i32 %146, 1
store i32 %147, i32* %15
br label %134
148: ; preds = %134
%149 = call i32 @putchar(i8 signext 10)
%150 = load i32, i32* %8
%151 = sext i32 %150 to i64
%152 = mul i64 %151, 8
%153 = trunc i64 %152 to i32
%154 = call i64 @malloc(i32 %153)
%155 = inttoptr i64 %154 to double*
store double* %155, double** %16
%156 = load double*, double** %9
%157 = load i64*, i64** %10
%158 = getelementptr inbounds i64, i64* %157, i64 0
%159 = load i64, i64* %158
%160 = getelementptr inbounds double, double* %156, i64 %159
%161 = load double, double* %160
store double %161, double* %17
store i32 0, i32* %18
store i32 1, i32* %19
br label %162
162: ; preds = %231, %148
%163 = load i32, i32* %19
%164 = load i32, i32* %8
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %234
166: ; preds = %162
%167 = load double*, double** %9
%168 = load i64*, i64** %10
%169 = load i32, i32* %19
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i64, i64* %168, i64 %170
%172 = load i64, i64* %171
%173 = getelementptr inbounds double, double* %167, i64 %172
%174 = load double, double* %173
%175 = load double, double* %17
%176 = fcmp une double %174, %175
br i1 %176, label %177, label %230
177: ; preds = %166
%178 = load i32, i32* %18
%179 = load i32, i32* %19
%180 = sub nsw i32 %179, 1
%181 = icmp slt i32 %178, %180
br i1 %181, label %182, label %209
182: ; preds = %177
%183 = load i32, i32* %19
%184 = sub nsw i32 %183, 1
%185 = load i32, i32* %18
%186 = add nsw i32 %184, %185
%187 = add nsw i32 %186, 2
%188 = sitofp i32 %187 to double
%189 = fdiv double %188, 2.000000e+00
store double %189, double* %20
%190 = load i32, i32* %18
store i32 %190, i32* %21
br label %191
191: ; preds = %205, %182
%192 = load i32, i32* %21
%193 = load i32, i32* %19
%194 = sub nsw i32 %193, 1
%195 = icmp sle i32 %192, %194
br i1 %195, label %196, label %208
196: ; preds = %191
%197 = load double, double* %20
%198 = load double*, double** %16
%199 = load i64*, i64** %10
%200 = load i32, i32* %21
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i64, i64* %199, i64 %201
%203 = load i64, i64* %202
%204 = getelementptr inbounds double, double* %198, i64 %203
store double %197, double* %204
br label %205
205: ; preds = %196
%206 = load i32, i32* %21
%207 = add nsw i32 %206, 1
store i32 %207, i32* %21
br label %191
208: ; preds = %191
br label %220
209: ; preds = %177
%210 = load i32, i32* %18
%211 = add nsw i32 %210, 1
%212 = sitofp i32 %211 to double
%213 = load double*, double** %16
%214 = load i64*, i64** %10
%215 = load i32, i32* %18
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds i64, i64* %214, i64 %216
%218 = load i64, i64* %217
%219 = getelementptr inbounds double, double* %213, i64 %218
store double %212, double* %219
br label %220
220: ; preds = %209, %208
%221 = load double*, double** %9
%222 = load i64*, i64** %10
%223 = load i32, i32* %19
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds i64, i64* %222, i64 %224
%226 = load i64, i64* %225
%227 = getelementptr inbounds double, double* %221, i64 %226
%228 = load double, double* %227
store double %228, double* %17
%229 = load i32, i32* %19
store i32 %229, i32* %18
br label %230
230: ; preds = %220, %166
br label %231
231: ; preds = %230
%232 = load i32, i32* %19
%233 = add nsw i32 %232, 1
store i32 %233, i32* %19
br label %162
234: ; preds = %162
%235 = load i32, i32* %18
%236 = load i32, i32* %19
%237 = sub nsw i32 %236, 1
%238 = icmp eq i32 %235, %237
br i1 %238, label %239, label %249
239: ; preds = %234
%240 = load i32, i32* %19
%241 = sitofp i32 %240 to double
%242 = load double*, double** %16
%243 = load i64*, i64** %10
%244 = load i32, i32* %18
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds i64, i64* %243, i64 %245
%247 = load i64, i64* %246
%248 = getelementptr inbounds double, double* %242, i64 %247
store double %241, double* %248
br label %276
249: ; preds = %234
%250 = load i32, i32* %19
%251 = sub nsw i32 %250, 1
%252 = load i32, i32* %18
%253 = add nsw i32 %251, %252
%254 = add nsw i32 %253, 2
%255 = sitofp i32 %254 to double
%256 = fdiv double %255, 2.000000e+00
store double %256, double* %22
%257 = load i32, i32* %18
store i32 %257, i32* %23
br label %258
258: ; preds = %272, %249
%259 = load i32, i32* %23
%260 = load i32, i32* %19
%261 = sub nsw i32 %260, 1
%262 = icmp sle i32 %259, %261
br i1 %262, label %263, label %275
263: ; preds = %258
%264 = load double, double* %22
%265 = load double*, double** %16
%266 = load i64*, i64** %10
%267 = load i32, i32* %23
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i64, i64* %266, i64 %268
%270 = load i64, i64* %269
%271 = getelementptr inbounds double, double* %265, i64 %270
store double %264, double* %271
br label %272
272: ; preds = %263
%273 = load i32, i32* %23
%274 = add nsw i32 %273, 1
store i32 %274, i32* %23
br label %258
275: ; preds = %258
br label %276
276: ; preds = %275, %239
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %24
br label %278
278: ; preds = %289, %276
%279 = load i32, i32* %24
%280 = load i32, i32* %8
%281 = icmp slt i32 %279, %280
br i1 %281, label %282, label %292
282: ; preds = %278
%283 = load double*, double** %9
%284 = load i32, i32* %24
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds double, double* %283, i64 %285
%287 = load double, double* %286
%288 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), double %287)
br label %289
289: ; preds = %282
%290 = load i32, i32* %24
%291 = add nsw i32 %290, 1
store i32 %291, i32* %24
br label %278
292: ; preds = %278
%293 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %25
br label %294
294: ; preds = %305, %292
%295 = load i32, i32* %25
%296 = load i32, i32* %8
%297 = icmp slt i32 %295, %296
br i1 %297, label %298, label %308
298: ; preds = %294
%299 = load double*, double** %16
%300 = load i32, i32* %25
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds double, double* %299, i64 %301
%303 = load double, double* %302
%304 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), double %303)
br label %305
305: ; preds = %298
%306 = load i32, i32* %25
%307 = add nsw i32 %306, 1
store i32 %307, i32* %25
br label %294
308: ; preds = %294
%309 = call i32 @putchar(i8 signext 10)
%310 = load i32, i32* %3
ret i32 %310
}

LLVM IR (-O2):
@.str = [16 x i8] c"argv[%d]: %s \00"
@.str.2 = [33 x i8] c"random vector: max: %d n: %d\0A\00"
@.str.4 = [8 x i8] c"%.0f \00"
@.str.5 = [7 x i8] c"%d \00"
@.str.8 = [8 x i8] c" %.0f \00"
@.str.9 = [7 x i8] c"%.1f \00"
@str = [32 x i8] c"breaking ties with average rank\00"
@str.10 = [46 x i8] c"before fr_shellsort_double_i_: x[] and indx[]\00"
@str.11 = [45 x i8] c"after fr_shellsort_double_i_: x[] and indx[]\00"
@str.12 = [38 x i8] c"after average ranking: x[] and indx[]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %92
8: ; preds = %92, %2
%9 = tail call i32 @putchar(i8 signext 10)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %16)
%18 = tail call double* @vrandr(i32 10, i32 %13, i32 %16)
%19 = shl i32 %16, 3
%20 = tail call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i64*
%22 = icmp eq i32 %16, 0
br i1 %22, label %23, label %25
23: ; preds = %8
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.10, i64 0, i64 0))
br label %121
25: ; preds = %8
%26 = sext i32 %16 to i64
%27 = icmp ult i32 %16, 4
br i1 %27, label %90, label %28
28: ; preds = %25
%29 = and i64 %26, -4
%30 = add nsw i64 %29, -4
%31 = lshr exact i64 %30, 2
%32 = add nuw nsw i64 %31, 1
%33 = and i64 %32, 3
%34 = icmp ult i64 %30, 12
br i1 %34, label %71, label %35
35: ; preds = %28
%36 = and i64 %32, 9223372036854775804
br label %37
37: ; preds = %37, %35
%38 = phi i64 [ 0, %35 ], [ %67, %37 ]
%39 = phi <2 x i64> [ <i64 0, i64 1>, %35 ], [ %68, %37 ]
%40 = phi i64 [ 0, %35 ], [ %69, %37 ]
%41 = add <2 x i64> %39, <i64 2, i64 2>
%42 = getelementptr inbounds i64, i64* %21, i64 %38
%43 = bitcast i64* %42 to <2 x i64>*
store <2 x i64> %39, <2 x i64>* %43
%44 = getelementptr inbounds i64, i64* %42, i64 2
%45 = bitcast i64* %44 to <2 x i64>*
store <2 x i64> %41, <2 x i64>* %45
%46 = or i64 %38, 4
%47 = add <2 x i64> %39, <i64 4, i64 4>
%48 = add <2 x i64> %39, <i64 6, i64 6>
%49 = getelementptr inbounds i64, i64* %21, i64 %46
%50 = bitcast i64* %49 to <2 x i64>*
store <2 x i64> %47, <2 x i64>* %50
%51 = getelementptr inbounds i64, i64* %49, i64 2
%52 = bitcast i64* %51 to <2 x i64>*
store <2 x i64> %48, <2 x i64>* %52
%53 = or i64 %38, 8
%54 = add <2 x i64> %39, <i64 8, i64 8>
%55 = add <2 x i64> %39, <i64 10, i64 10>
%56 = getelementptr inbounds i64, i64* %21, i64 %53
%57 = bitcast i64* %56 to <2 x i64>*
store <2 x i64> %54, <2 x i64>* %57
%58 = getelementptr inbounds i64, i64* %56, i64 2
%59 = bitcast i64* %58 to <2 x i64>*
store <2 x i64> %55, <2 x i64>* %59
%60 = or i64 %38, 12
%61 = add <2 x i64> %39, <i64 12, i64 12>
%62 = add <2 x i64> %39, <i64 14, i64 14>
%63 = getelementptr inbounds i64, i64* %21, i64 %60
%64 = bitcast i64* %63 to <2 x i64>*
store <2 x i64> %61, <2 x i64>* %64
%65 = getelementptr inbounds i64, i64* %63, i64 2
%66 = bitcast i64* %65 to <2 x i64>*
store <2 x i64> %62, <2 x i64>* %66
%67 = add nuw i64 %38, 16
%68 = add <2 x i64> %39, <i64 16, i64 16>
%69 = add nuw i64 %40, 4
%70 = icmp eq i64 %69, %36
br i1 %70, label %71, label %37
71: ; preds = %37, %28
%72 = phi i64 [ 0, %28 ], [ %67, %37 ]
%73 = phi <2 x i64> [ <i64 0, i64 1>, %28 ], [ %68, %37 ]
%74 = icmp eq i64 %33, 0
br i1 %74, label %88, label %75
75: ; preds = %71, %75
%76 = phi i64 [ %84, %75 ], [ %72, %71 ]
%77 = phi <2 x i64> [ %85, %75 ], [ %73, %71 ]
%78 = phi i64 [ %86, %75 ], [ 0, %71 ]
%79 = add <2 x i64> %77, <i64 2, i64 2>
%80 = getelementptr inbounds i64, i64* %21, i64 %76
%81 = bitcast i64* %80 to <2 x i64>*
store <2 x i64> %77, <2 x i64>* %81
%82 = getelementptr inbounds i64, i64* %80, i64 2
%83 = bitcast i64* %82 to <2 x i64>*
store <2 x i64> %79, <2 x i64>* %83
%84 = add nuw i64 %76, 4
%85 = add <2 x i64> %77, <i64 4, i64 4>
%86 = add i64 %78, 1
%87 = icmp eq i64 %86, %33
br i1 %87, label %88, label %75
88: ; preds = %75, %71
%89 = icmp eq i64 %29, %26
br i1 %89, label %100, label %90
90: ; preds = %25, %88
%91 = phi i64 [ 0, %25 ], [ %29, %88 ]
br label %105
92: ; preds = %6, %92
%93 = phi i64 [ 0, %6 ], [ %98, %92 ]
%94 = getelementptr inbounds i8*, i8** %1, i64 %93
%95 = load i8*, i8** %94
%96 = trunc i64 %93 to i32
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %96, i8* %95)
%98 = add nuw nsw i64 %93, 1
%99 = icmp eq i64 %98, %7
br i1 %99, label %8, label %92
100: ; preds = %105, %88
%101 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.10, i64 0, i64 0))
%102 = icmp sgt i32 %16, 0
br i1 %102, label %103, label %121
103: ; preds = %100
%104 = zext i32 %16 to i64
br label %114
105: ; preds = %90, %105
%106 = phi i64 [ %108, %105 ], [ %91, %90 ]
%107 = getelementptr inbounds i64, i64* %21, i64 %106
store i64 %106, i64* %107
%108 = add nuw i64 %106, 1
%109 = icmp eq i64 %108, %26
br i1 %109, label %100, label %105
110: ; preds = %114
%111 = tail call i32 @putchar(i8 signext 10)
br i1 %102, label %112, label %123
112: ; preds = %110
%113 = zext i32 %16 to i64
br label %132
114: ; preds = %103, %114
%115 = phi i64 [ 0, %103 ], [ %119, %114 ]
%116 = getelementptr inbounds double, double* %18, i64 %115
%117 = load double, double* %116
%118 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %117)
%119 = add nuw nsw i64 %115, 1
%120 = icmp eq i64 %119, %104
br i1 %120, label %110, label %114
121: ; preds = %100, %23
%122 = tail call i32 @putchar(i8 signext 10)
br label %123
123: ; preds = %132, %121, %110
%124 = phi i1 [ false, %110 ], [ false, %121 ], [ true, %132 ]
%125 = tail call i32 @putchar(i8 signext 10)
%126 = tail call i32 @fr_shellsort_double_i_(double* %18, i64* %21, i32 %16)
%127 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.11, i64 0, i64 0))
br i1 %124, label %130, label %128
128: ; preds = %123
%129 = tail call i32 @putchar(i8 signext 10)
br label %150
130: ; preds = %123
%131 = zext i32 %16 to i64
br label %143
132: ; preds = %112, %132
%133 = phi i64 [ 0, %112 ], [ %137, %132 ]
%134 = getelementptr inbounds i64, i64* %21, i64 %133
%135 = load i64, i64* %134
%136 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 %135)
%137 = add nuw nsw i64 %133, 1
%138 = icmp eq i64 %137, %113
br i1 %138, label %123, label %132
139: ; preds = %143
%140 = tail call i32 @putchar(i8 signext 10)
br i1 %124, label %141, label %150
141: ; preds = %139
%142 = zext i32 %16 to i64
br label %160
143: ; preds = %130, %143
%144 = phi i64 [ 0, %130 ], [ %148, %143 ]
%145 = getelementptr inbounds double, double* %18, i64 %144
%146 = load double, double* %145
%147 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %146)
%148 = add nuw nsw i64 %144, 1
%149 = icmp eq i64 %148, %131
br i1 %149, label %139, label %143
150: ; preds = %160, %128, %139
%151 = tail call i32 @putchar(i8 signext 10)
%152 = tail call i64 @malloc(i32 %19)
%153 = inttoptr i64 %152 to double*
%154 = icmp sgt i32 %16, 1
br i1 %154, label %155, label %237
155: ; preds = %150
%156 = load i64, i64* %21
%157 = getelementptr inbounds double, double* %18, i64 %156
%158 = load double, double* %157
%159 = zext i32 %16 to i64
br label %167
160: ; preds = %141, %160
%161 = phi i64 [ 0, %141 ], [ %165, %160 ]
%162 = getelementptr inbounds i64, i64* %21, i64 %161
%163 = load i64, i64* %162
%164 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i64 %163)
%165 = add nuw nsw i64 %161, 1
%166 = icmp eq i64 %165, %142
br i1 %166, label %150, label %160
167: ; preds = %155, %231
%168 = phi i64 [ 0, %155 ], [ %236, %231 ]
%169 = phi i64 [ 1, %155 ], [ %234, %231 ]
%170 = phi i32 [ 0, %155 ], [ %233, %231 ]
%171 = phi double [ %158, %155 ], [ %232, %231 ]
%172 = getelementptr inbounds i64, i64* %21, i64 %169
%173 = load i64, i64* %172
%174 = getelementptr inbounds double, double* %18, i64 %173
%175 = load double, double* %174
%176 = fcmp une double %175, %171
br i1 %176, label %177, label %231
177: ; preds = %167
%178 = add nsw i64 %169, -1
%179 = sext i32 %170 to i64
%180 = icmp sgt i64 %178, %179
br i1 %180, label %181, label %222
181: ; preds = %177
%182 = add i32 %170, 2
%183 = trunc i64 %178 to i32
%184 = add i32 %182, %183
%185 = sitofp i32 %184 to double
%186 = fmul double %185, 5.000000e-01
%187 = sub i64 %169, %179
%188 = sub i64 %168, %179
%189 = and i64 %187, 3
%190 = icmp eq i64 %189, 0
br i1 %190, label %200, label %191
191: ; preds = %181, %191
%192 = phi i64 [ %197, %191 ], [ %179, %181 ]
%193 = phi i64 [ %198, %191 ], [ 0, %181 ]
%194 = getelementptr inbounds i64, i64* %21, i64 %192
%195 = load i64, i64* %194
%196 = getelementptr inbounds double, double* %153, i64 %195
store double %186, double* %196
%197 = add nsw i64 %192, 1
%198 = add i64 %193, 1
%199 = icmp eq i64 %198, %189
br i1 %199, label %200, label %191
200: ; preds = %191, %181
%201 = phi i64 [ %179, %181 ], [ %197, %191 ]
%202 = icmp ult i64 %188, 3
br i1 %202, label %228, label %203
203: ; preds = %200, %203
%204 = phi i64 [ %220, %203 ], [ %201, %200 ]
%205 = getelementptr inbounds i64, i64* %21, i64 %204
%206 = load i64, i64* %205
%207 = getelementptr inbounds double, double* %153, i64 %206
store double %186, double* %207
%208 = add nsw i64 %204, 1
%209 = getelementptr inbounds i64, i64* %21, i64 %208
%210 = load i64, i64* %209
%211 = getelementptr inbounds double, double* %153, i64 %210
store double %186, double* %211
%212 = add nsw i64 %204, 2
%213 = getelementptr inbounds i64, i64* %21, i64 %212
%214 = load i64, i64* %213
%215 = getelementptr inbounds double, double* %153, i64 %214
store double %186, double* %215
%216 = add nsw i64 %204, 3
%217 = getelementptr inbounds i64, i64* %21, i64 %216
%218 = load i64, i64* %217
%219 = getelementptr inbounds double, double* %153, i64 %218
store double %186, double* %219
%220 = add nsw i64 %204, 4
%221 = icmp eq i64 %220, %169
br i1 %221, label %228, label %203
222: ; preds = %177
%223 = add nsw i32 %170, 1
%224 = sitofp i32 %223 to double
%225 = getelementptr inbounds i64, i64* %21, i64 %179
%226 = load i64, i64* %225
%227 = getelementptr inbounds double, double* %153, i64 %226
store double %224, double* %227
br label %228
228: ; preds = %200, %203, %222
%229 = load double, double* %174
%230 = trunc i64 %169 to i32
br label %231
231: ; preds = %167, %228
%232 = phi double [ %229, %228 ], [ %171, %167 ]
%233 = phi i32 [ %230, %228 ], [ %170, %167 ]
%234 = add nuw nsw i64 %169, 1
%235 = icmp eq i64 %234, %159
%236 = add i64 %168, 1
br i1 %235, label %237, label %167
237: ; preds = %231, %150
%238 = phi i32 [ 0, %150 ], [ %233, %231 ]
%239 = phi i32 [ 1, %150 ], [ %16, %231 ]
%240 = add nsw i32 %239, -1
%241 = icmp eq i32 %238, %240
br i1 %241, label %242, label %248
242: ; preds = %237
%243 = sitofp i32 %239 to double
%244 = sext i32 %238 to i64
%245 = getelementptr inbounds i64, i64* %21, i64 %244
%246 = load i64, i64* %245
%247 = getelementptr inbounds double, double* %153, i64 %246
store double %243, double* %247
br label %293
248: ; preds = %237
%249 = add i32 %238, 2
%250 = add i32 %249, %240
%251 = sitofp i32 %250 to double
%252 = fmul double %251, 5.000000e-01
%253 = icmp slt i32 %238, %239
br i1 %253, label %254, label %293
254: ; preds = %248
%255 = sext i32 %238 to i64
%256 = sext i32 %239 to i64
%257 = sub nsw i64 %256, %255
%258 = xor i64 %255, -1
%259 = add nsw i64 %258, %256
%260 = and i64 %257, 3
%261 = icmp eq i64 %260, 0
br i1 %261, label %271, label %262
262: ; preds = %254, %262
%263 = phi i64 [ %268, %262 ], [ %255, %254 ]
%264 = phi i64 [ %269, %262 ], [ 0, %254 ]
%265 = getelementptr inbounds i64, i64* %21, i64 %263
%266 = load i64, i64* %265
%267 = getelementptr inbounds double, double* %153, i64 %266
store double %252, double* %267
%268 = add nsw i64 %263, 1
%269 = add i64 %264, 1
%270 = icmp eq i64 %269, %260
br i1 %270, label %271, label %262
271: ; preds = %262, %254
%272 = phi i64 [ %255, %254 ], [ %268, %262 ]
%273 = icmp ult i64 %259, 3
br i1 %273, label %293, label %274
274: ; preds = %271, %274
%275 = phi i64 [ %291, %274 ], [ %272, %271 ]
%276 = getelementptr inbounds i64, i64* %21, i64 %275
%277 = load i64, i64* %276
%278 = getelementptr inbounds double, double* %153, i64 %277
store double %252, double* %278
%279 = add nsw i64 %275, 1
%280 = getelementptr inbounds i64, i64* %21, i64 %279
%281 = load i64, i64* %280
%282 = getelementptr inbounds double, double* %153, i64 %281
store double %252, double* %282
%283 = add nsw i64 %275, 2
%284 = getelementptr inbounds i64, i64* %21, i64 %283
%285 = load i64, i64* %284
%286 = getelementptr inbounds double, double* %153, i64 %285
store double %252, double* %286
%287 = add nsw i64 %275, 3
%288 = getelementptr inbounds i64, i64* %21, i64 %287
%289 = load i64, i64* %288
%290 = getelementptr inbounds double, double* %153, i64 %289
store double %252, double* %290
%291 = add nsw i64 %275, 4
%292 = icmp eq i64 %291, %256
br i1 %292, label %293, label %274
293: ; preds = %271, %274, %248, %242
%294 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.12, i64 0, i64 0))
br i1 %124, label %297, label %295
295: ; preds = %293
%296 = tail call i32 @putchar(i8 signext 10)
br label %310
297: ; preds = %293
%298 = zext i32 %16 to i64
br label %303
299: ; preds = %303
%300 = tail call i32 @putchar(i8 signext 10)
br i1 %124, label %301, label %310
301: ; preds = %299
%302 = zext i32 %16 to i64
br label %312
303: ; preds = %297, %303
%304 = phi i64 [ 0, %297 ], [ %308, %303 ]
%305 = getelementptr inbounds double, double* %18, i64 %304
%306 = load double, double* %305
%307 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), double %306)
%308 = add nuw nsw i64 %304, 1
%309 = icmp eq i64 %308, %298
br i1 %309, label %299, label %303
310: ; preds = %312, %295, %299
%311 = tail call i32 @putchar(i8 signext 10)
ret i32 0
312: ; preds = %301, %312
%313 = phi i64 [ 0, %301 ], [ %317, %312 ]
%314 = getelementptr inbounds double, double* %153, i64 %313
%315 = load double, double* %314
%316 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), double %315)
%317 = add nuw nsw i64 %313, 1
%318 = icmp eq i64 %317, %302
br i1 %318, label %310, label %312
}