#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ calloc(int, int);
int /*<<< orphan*/ cfree(int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
double omp_get_wtime();
int p(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
void radixsort_parallel(uint32_t *input_array, uint32_t input_array_size,
                        uint32_t max_digits_size, int debug, int chunksize) {
  uint32_t digit;
  int f, i, j;
  double start_time;
  if (debug > 0)
    start_time = omp_get_wtime();
  uint32_t *tmp = (uint32_t *)calloc(input_array_size, sizeof(uint32_t));
  if (!tmp) {
    fprintf(stderr, "ERROR: not enough memory!\n");
    abort();
  }
  int shared_buckets[max_digits_size][10];
  for (j = 0; j < max_digits_size; j++) {
    for (f = 0; f < 10; f++)
      shared_buckets[j][f] = 0;
  }
  if (debug > 0) {
    printf("  1) ALLOCATE MEM, INIT BUCKETS\t\t%lf\n",
           omp_get_wtime() - start_time);
  }
  if (debug > 0)
    start_time = omp_get_wtime();
#pragma omp parallel for private(digit, j, i, f) schedule(dynamic, chunksize)
  for (i = 0; i < input_array_size; i++) {
    for (j = 0; j < max_digits_size; j++) {
      digit = p(j);
      f = input_array[i] / digit % 10;
#pragma omp atomic
      shared_buckets[j][f]++;
    }
  }
  if (debug > 0) {
    printf("  2) CREATION OF BUCKETS\t\t%lf\n", omp_get_wtime() - start_time);
  }
  if (debug > 0)
    start_time = omp_get_wtime();
  for (j = 0; j < max_digits_size; j++) {
    for (i = 1; i < 10; i++)
      shared_buckets[j][i] += shared_buckets[j][i - 1];
  }
  if (debug > 2) {
    printf("   [0]\t[1]\t\[2]\t[3]\t[4]\t[5]\t[6]\t[7]\t[8]\t[9]\n");
    for (j = 0; j < max_digits_size; j++) {
      printf("%i  ", j);
      for (i = 0; i < 10; i++)
        printf(" %i\t", shared_buckets[j][i]);
      printf("\n");
    }
  }
  if (debug > 0) {
    printf("  3) SUMMING BUCKETS\t\t\t%lf\n", omp_get_wtime() - start_time);
  }
  if (debug > 0)
    start_time = omp_get_wtime();
  for (j = 0; j < max_digits_size; j++) {
    digit = p(j);
    for (i = input_array_size - 1; i >= 0; i--) {
      int unit = input_array[i] / digit % 10;
      int pos = --shared_buckets[j][unit];
      tmp[pos] = input_array[i];
    }
    for (i = 0; i < input_array_size; i++)
      input_array[i] = tmp[i];
    if (debug > 2) {
      char layout[80];
      sprintf(layout, "%%%iu\n", max_digits_size + 1);
      for (i = 0; i < input_array_size; i++)
        printf(layout, input_array[i]);
      printf("***\n");
    }
  }
  if (debug > 0) {
    printf("4-5) USING BUCKETS AND COPYING\t\t%lf\n",
           omp_get_wtime() - start_time);
  }
  cfree(tmp);
}


x86 assembly (clang, -O0):
<radixsort_parallel>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11b2 <radixsort_parallel+0x32>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11ea <radixsort_parallel+0x6a>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
lea    0xe22(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    (%rax,%rax,4),%rcx
lea    0xf(,%rcx,8),%rdx
movabs $0x7ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1283 <radixsort_parallel+0x103>
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jge    1270 <radixsort_parallel+0xf0>
mov    -0xa8(%rbp),%rax
movslq -0x28(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    123b <radixsort_parallel+0xbb>
jmp    1275 <radixsort_parallel+0xf5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1228 <radixsort_parallel+0xa8>
cmpl   $0x0,-0x14(%rbp)
jle    12a7 <radixsort_parallel+0x127>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xd7b(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    12bd <radixsort_parallel+0x13d>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1348 <radixsort_parallel+0x1c8>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1335 <radixsort_parallel+0x1b5>
mov    -0x28(%rbp),%edi
call   1050 <p@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cltd
idivl  -0x1c(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xa8(%rbp),%rax
mov    %edx,-0x20(%rbp)
movslq -0x28(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12d7 <radixsort_parallel+0x157>
jmp    133a <radixsort_parallel+0x1ba>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12c4 <radixsort_parallel+0x144>
cmpl   $0x0,-0x14(%rbp)
jle    136c <radixsort_parallel+0x1ec>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xcdc(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    1382 <radixsort_parallel+0x202>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13fd <radixsort_parallel+0x27d>
movl   $0x1,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    13ea <radixsort_parallel+0x26a>
mov    -0xa8(%rbp),%rax
movslq -0x28(%rbp),%rcx
imul   $0x28,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x28(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    139c <radixsort_parallel+0x21c>
jmp    13ef <radixsort_parallel+0x26f>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1389 <radixsort_parallel+0x209>
cmpl   $0x2,-0x14(%rbp)
jle    14a0 <radixsort_parallel+0x320>
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    149b <radixsort_parallel+0x31b>
mov    -0x28(%rbp),%esi
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    147f <radixsort_parallel+0x2ff>
mov    -0xa8(%rbp),%rax
movslq -0x28(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc27(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1440 <radixsort_parallel+0x2c0>
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    141c <radixsort_parallel+0x29c>
jmp    14a0 <radixsort_parallel+0x320>
cmpl   $0x0,-0x14(%rbp)
jle    14c4 <radixsort_parallel+0x344>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xbd9(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    14da <radixsort_parallel+0x35a>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1620 <radixsort_parallel+0x4a0>
mov    -0x28(%rbp),%edi
call   1050 <p@plt>
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     156b <radixsort_parallel+0x3eb>
mov    -0xa8(%rbp),%rcx
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
cltd
idivl  -0x1c(%rbp)
mov    $0xa,%esi
cltd
idiv   %esi
mov    %edx,-0x4c(%rbp)
movslq -0x28(%rbp),%rax
imul   $0x28,%rax,%rax
add    %rax,%rcx
movslq -0x4c(%rbp),%rdx
mov    (%rcx,%rdx,4),%eax
add    $0xffffffff,%eax
mov    %eax,(%rcx,%rdx,4)
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x38(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1501 <radixsort_parallel+0x381>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15a2 <radixsort_parallel+0x422>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1572 <radixsort_parallel+0x3f2>
cmpl   $0x2,-0x14(%rbp)
jle    160d <radixsort_parallel+0x48d>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
lea    0xaf2(%rip),%rsi
call   10a0 <sprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15ff <radixsort_parallel+0x47f>
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15cc <radixsort_parallel+0x44c>
lea    0xab3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1612 <radixsort_parallel+0x492>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    14e1 <radixsort_parallel+0x361>
cmpl   $0x0,-0x14(%rbp)
jle    1644 <radixsort_parallel+0x4c4>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xa81(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x38(%rbp),%rdi
call   1090 <cfree@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixsort_parallel>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %ecx,%r14d
mov    %edx,-0x30(%rbp)
mov    %esi,-0x2c(%rbp)
mov    %rdi,%r15
test   %ecx,%ecx
jle    11e2 <radixsort_parallel+0x32>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
jmp    11e2 <radixsort_parallel+0x32>
mov    -0x2c(%rbp),%edi
mov    $0x4,%esi
call   10a0 <calloc@plt>
test   %rax,%rax
je     1853 <radixsort_parallel+0x6a3>
mov    %rax,%r12
mov    -0x30(%rbp),%edx
mov    %edx,%ebx
lea    (%rbx,%rbx,4),%rax
lea    0xf(,%rax,8),%rax
movabs $0x7ffffffff0,%rcx
and    %rax,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
test   %edx,%edx
mov    %rdi,-0x50(%rbp)
jle    123d <radixsort_parallel+0x8d>
lea    0x0(,%rbx,8),%rax
lea    (%rax,%rax,4),%rdx
xor    %esi,%esi
call   1090 <memset@plt>
test   %r14d,%r14d
mov    %r14d,-0x44(%rbp)
mov    %rbx,-0x60(%rbp)
mov    %r12,-0x80(%rbp)
jle    1274 <radixsort_parallel+0xc4>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xdba(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x58(%rbp)
test   %eax,%eax
jle    12f3 <radixsort_parallel+0x143>
xor    %r12d,%r12d
mov    -0x60(%rbp),%r13
jmp    129a <radixsort_parallel+0xea>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    -0x58(%rbp),%r12
je     12f3 <radixsort_parallel+0x143>
cmpl   $0x0,-0x30(%rbp)
jle    1290 <radixsort_parallel+0xe0>
mov    -0x50(%rbp),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1070 <p@plt>
mov    %eax,%ecx
mov    (%r15,%r12,4),%eax
cltd
idiv   %ecx
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cltq
addl   $0x1,(%r14,%rax,4)
add    $0x1,%rbx
add    $0x28,%r14
cmp    %rbx,%r13
jne    12b0 <radixsort_parallel+0x100>
jmp    1290 <radixsort_parallel+0xe0>
mov    -0x44(%rbp),%r12d
test   %r12d,%r12d
jle    1322 <radixsort_parallel+0x172>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xd32(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%ebx
cmpl   $0x0,-0x30(%rbp)
mov    -0x80(%rbp),%r13
mov    -0x50(%rbp),%rsi
jle    14a9 <radixsort_parallel+0x2f9>
mov    -0x60(%rbp),%rax
lea    0x0(,%rax,8),%rax
lea    (%rax,%rax,4),%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    0x4(%rsi,%rcx,1),%edx
add    (%rsi,%rcx,1),%edx
mov    %edx,0x4(%rsi,%rcx,1)
add    0x8(%rsi,%rcx,1),%edx
mov    %edx,0x8(%rsi,%rcx,1)
add    0xc(%rsi,%rcx,1),%edx
mov    %edx,0xc(%rsi,%rcx,1)
add    0x10(%rsi,%rcx,1),%edx
mov    %edx,0x10(%rsi,%rcx,1)
add    0x14(%rsi,%rcx,1),%edx
mov    %edx,0x14(%rsi,%rcx,1)
add    0x18(%rsi,%rcx,1),%edx
mov    %edx,0x18(%rsi,%rcx,1)
add    0x1c(%rsi,%rcx,1),%edx
mov    %edx,0x1c(%rsi,%rcx,1)
add    0x20(%rsi,%rcx,1),%edx
mov    %edx,0x20(%rsi,%rcx,1)
add    %edx,0x24(%rsi,%rcx,1)
add    $0x28,%rcx
cmp    %rcx,%rax
jne    1350 <radixsort_parallel+0x1a0>
cmp    $0x2,%r12d
jle    14c9 <radixsort_parallel+0x319>
lea    0xd05(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%r14b
cmpl   $0x0,-0x30(%rbp)
jle    14cc <radixsort_parallel+0x31c>
mov    -0x50(%rbp),%rax
lea    0x24(%rax),%r12
xor    %ebx,%ebx
nopl   (%rax)
lea    0xc89(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x24(%r12),%esi
lea    0xc79(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x20(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x1c(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x18(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x14(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x10(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0xc(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x8(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    -0x4(%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r12),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0x28,%r12
cmp    %rbx,-0x60(%rbp)
jne    13d0 <radixsort_parallel+0x220>
mov    -0x2c(%rbp),%ebx
mov    $0x1,%r14b
mov    -0x44(%rbp),%r12d
test   %r12d,%r12d
jg     14d1 <radixsort_parallel+0x321>
jmp    14f7 <radixsort_parallel+0x347>
cmp    $0x3,%r12d
jl     1842 <radixsort_parallel+0x692>
lea    0xbfc(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%r14b
test   %r12d,%r12d
jg     14d1 <radixsort_parallel+0x321>
jmp    14f7 <radixsort_parallel+0x347>
xor    %r14d,%r14d
test   %r12d,%r12d
jle    14f7 <radixsort_parallel+0x347>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xb86(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x58(%rbp),%rdx
cmpl   $0x0,-0x30(%rbp)
jle    180c <radixsort_parallel+0x65c>
addl   $0x1,-0x30(%rbp)
lea    (%r15,%rdx,4),%rax
lea    0x0(,%rdx,4),%rcx
add    %r13,%rcx
mov    %edx,%esi
and    $0xfffffff8,%esi
mov    %rsi,-0xb0(%rbp)
add    $0xfffffffffffffff8,%rsi
mov    %rsi,-0xa8(%rbp)
shr    $0x3,%rsi
add    $0x1,%rsi
cmp    %r15,%rcx
seta   %cl
cmp    %rax,%r13
setb   %al
and    %cl,%al
mov    %al,-0x31(%rbp)
mov    %esi,%eax
and    $0x3,%eax
and    $0xfffffffffffffffc,%rsi
mov    %rsi,-0x88(%rbp)
mov    %edx,%ecx
and    $0x3,%ecx
mov    %rcx,-0xb8(%rbp)
lea    0x1(%rdx),%rcx
mov    %rcx,-0xc0(%rbp)
lea    0x10(%r15),%rcx
mov    %rcx,-0x98(%rbp)
mov    %r13,%rcx
add    $0x10,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rax,-0xa0(%rbp)
shl    $0x5,%rax
mov    %rax,-0x70(%rbp)
lea    -0x110(%rbp),%r12
xor    %edi,%edi
mov    %r14d,-0x64(%rbp)
jmp    15d5 <radixsort_parallel+0x425>
cs nopw 0x0(%rax,%rax,1)
lea    0xafb(%rip),%rdi
call   1050 <puts@plt>
mov    -0x2c(%rbp),%ebx
mov    -0x64(%rbp),%r14d
mov    -0x78(%rbp),%rdi
add    $0x1,%rdi
cmp    -0x60(%rbp),%rdi
je     180c <radixsort_parallel+0x65c>
mov    %rdi,-0x78(%rbp)
call   1070 <p@plt>
mov    -0x58(%rbp),%r10
test   %ebx,%ebx
mov    -0x50(%rbp),%r9
jle    17c0 <radixsort_parallel+0x610>
mov    %eax,%r8d
mov    -0xc0(%rbp),%rdi
mov    -0x78(%rbp),%r11
nopl   0x0(%rax)
lea    -0x2(%rdi),%eax
mov    (%r15,%rax,4),%esi
mov    %esi,%eax
cltd
idiv   %r8d
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rbx
shr    $0x3f,%rbx
sar    $0x22,%rdx
add    %ebx,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%eax
cltq
lea    (%r11,%r11,4),%rdx
lea    (%r9,%rdx,8),%rdx
movslq (%rdx,%rax,4),%rbx
lea    -0x1(%rbx),%rcx
mov    %ecx,(%rdx,%rax,4)
mov    %esi,-0x4(%r13,%rbx,4)
add    $0xffffffffffffffff,%rdi
cmp    $0x1,%rdi
jg     1600 <radixsort_parallel+0x450>
mov    -0x2c(%rbp),%ebx
test   %ebx,%ebx
jle    17c0 <radixsort_parallel+0x610>
cmp    $0x8,%ebx
setb   %al
or     -0x31(%rbp),%al
je     166b <radixsort_parallel+0x4bb>
xor    %eax,%eax
jmp    174c <radixsort_parallel+0x59c>
cmpq   $0x18,-0xa8(%rbp)
18
jae    1680 <radixsort_parallel+0x4d0>
xor    %eax,%eax
mov    -0x70(%rbp),%rsi
jmp    16fb <radixsort_parallel+0x54b>
mov    -0x88(%rbp),%rcx
xor    %eax,%eax
mov    -0x70(%rbp),%rsi
nopl   (%rax)
movups 0x0(%r13,%rax,4),%xmm0
movups 0x10(%r13,%rax,4),%xmm1
movups %xmm0,(%r15,%rax,4)
movups %xmm1,0x10(%r15,%rax,4)
movups 0x20(%r13,%rax,4),%xmm0
movups 0x30(%r13,%rax,4),%xmm1
movups %xmm0,0x20(%r15,%rax,4)
movups %xmm1,0x30(%r15,%rax,4)
movups 0x40(%r13,%rax,4),%xmm0
movups 0x50(%r13,%rax,4),%xmm1
movups %xmm0,0x40(%r15,%rax,4)
movups %xmm1,0x50(%r15,%rax,4)
movupd 0x60(%r13,%rax,4),%xmm0
movups 0x70(%r13,%rax,4),%xmm1
movupd %xmm0,0x60(%r15,%rax,4)
movups %xmm1,0x70(%r15,%rax,4)
add    $0x20,%rax
add    $0xfffffffffffffffc,%rcx
jne    1690 <radixsort_parallel+0x4e0>
cmpq   $0x0,-0xa0(%rbp)
je     173d <radixsort_parallel+0x58d>
mov    -0x98(%rbp),%rcx
lea    (%rcx,%rax,4),%rcx
mov    -0x90(%rbp),%rdx
lea    (%rdx,%rax,4),%rax
xor    %edx,%edx
nopl   (%rax)
movupd -0x10(%rax,%rdx,1),%xmm0
movups (%rax,%rdx,1),%xmm1
movupd %xmm0,-0x10(%rcx,%rdx,1)
movups %xmm1,(%rcx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rsi
jne    1720 <radixsort_parallel+0x570>
mov    -0xb0(%rbp),%rcx
mov    %rcx,%rax
cmp    %r10,%rcx
je     17c0 <radixsort_parallel+0x610>
mov    %rax,%rcx
not    %rcx
add    %r10,%rcx
mov    -0xb8(%rbp),%rdx
test   %rdx,%rdx
je     1783 <radixsort_parallel+0x5d3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%rax,4),%esi
mov    %esi,(%r15,%rax,4)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1770 <radixsort_parallel+0x5c0>
cmp    $0x3,%rcx
jb     17c0 <radixsort_parallel+0x610>
nopl   0x0(%rax)
mov    0x0(%r13,%rax,4),%ecx
mov    %ecx,(%r15,%rax,4)
mov    0x4(%r13,%rax,4),%ecx
mov    %ecx,0x4(%r15,%rax,4)
mov    0x8(%r13,%rax,4),%ecx
mov    %ecx,0x8(%r15,%rax,4)
mov    0xc(%r13,%rax,4),%ecx
mov    %ecx,0xc(%r15,%rax,4)
add    $0x4,%rax
cmp    %rax,%r10
jne    1790 <radixsort_parallel+0x5e0>
test   %r14b,%r14b
je     15c3 <radixsort_parallel+0x413>
mov    %r12,%rdi
lea    0x8b3(%rip),%rsi
mov    -0x30(%rbp),%edx
mov    %r10,%r14
call   10d0 <sprintf@plt>
test   %ebx,%ebx
jle    15b0 <radixsort_parallel+0x400>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    17f0 <radixsort_parallel+0x640>
jmp    15b0 <radixsort_parallel+0x400>
cmpl   $0x0,-0x44(%rbp)
jle    182c <radixsort_parallel+0x67c>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0x868(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    %r13,%rdi
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <cfree@plt>
xor    %r14d,%r14d
test   %r12d,%r12d
jg     14d1 <radixsort_parallel+0x321>
jmp    14f7 <radixsort_parallel+0x347>
mov    0x2786(%rip),%rax
mov    (%rax),%edi
lea    0x79d(%rip),%rsi
call   10b0 <fprintf@plt>
xor    %eax,%eax
call   1040 <abort@plt>

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

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