#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_serial(uint32_t *input_array, uint32_t input_array_size,
                      uint32_t max_digits_size, int debug) {
  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();
  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;
      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_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11ae <radixsort_serial+0x2e>
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    11e6 <radixsort_serial+0x66>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe26(%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,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    127f <radixsort_serial+0xff>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    126c <radixsort_serial+0xec>
mov    -0xa8(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1237 <radixsort_serial+0xb7>
jmp    1271 <radixsort_serial+0xf1>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1224 <radixsort_serial+0xa4>
cmpl   $0x0,-0x14(%rbp)
jle    12a3 <radixsort_serial+0x123>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xd7f(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    12b9 <radixsort_serial+0x139>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1344 <radixsort_serial+0x1c4>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1331 <radixsort_serial+0x1b1>
mov    -0x24(%rbp),%edi
call   1050 <p@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cltd
idivl  -0x18(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xa8(%rbp),%rax
mov    %edx,-0x1c(%rbp)
movslq -0x24(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12d3 <radixsort_serial+0x153>
jmp    1336 <radixsort_serial+0x1b6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12c0 <radixsort_serial+0x140>
cmpl   $0x0,-0x14(%rbp)
jle    1368 <radixsort_serial+0x1e8>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xce0(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    137e <radixsort_serial+0x1fe>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13f9 <radixsort_serial+0x279>
movl   $0x1,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jge    13e6 <radixsort_serial+0x266>
mov    -0xa8(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x28,%rcx,%rdx
mov    %rax,%rcx
add    %rdx,%rcx
mov    -0x20(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x24(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1398 <radixsort_serial+0x218>
jmp    13eb <radixsort_serial+0x26b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1385 <radixsort_serial+0x205>
cmpl   $0x2,-0x14(%rbp)
jle    149c <radixsort_serial+0x31c>
lea    0xc56(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1497 <radixsort_serial+0x317>
mov    -0x24(%rbp),%esi
lea    0xc5e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jge    147b <radixsort_serial+0x2fb>
mov    -0xa8(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xc2b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    143c <radixsort_serial+0x2bc>
lea    0xb97(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1418 <radixsort_serial+0x298>
jmp    149c <radixsort_serial+0x31c>
cmpl   $0x0,-0x14(%rbp)
jle    14c0 <radixsort_serial+0x340>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xbdd(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jle    14d6 <radixsort_serial+0x356>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    161c <radixsort_serial+0x49c>
mov    -0x24(%rbp),%edi
call   1050 <p@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1567 <radixsort_serial+0x3e7>
mov    -0xa8(%rbp),%rcx
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
cltd
idivl  -0x18(%rbp)
mov    $0xa,%esi
cltd
idiv   %esi
mov    %edx,-0x4c(%rbp)
movslq -0x24(%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 -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x38(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    14fd <radixsort_serial+0x37d>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    159e <radixsort_serial+0x41e>
mov    -0x38(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    156e <radixsort_serial+0x3ee>
cmpl   $0x2,-0x14(%rbp)
jle    1609 <radixsort_serial+0x489>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
lea    0xaf6(%rip),%rsi
call   10a0 <sprintf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15fb <radixsort_serial+0x47b>
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    15c8 <radixsort_serial+0x448>
lea    0xab7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    160e <radixsort_serial+0x48e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14dd <radixsort_serial+0x35d>
cmpl   $0x0,-0x14(%rbp)
jle    1640 <radixsort_serial+0x4c0>
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x30(%rbp),%xmm0
lea    0xa85(%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_serial>:
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_serial+0x32>
xor    %eax,%eax
call   1060 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
jmp    11e2 <radixsort_serial+0x32>
mov    -0x2c(%rbp),%edi
mov    $0x4,%esi
call   10a0 <calloc@plt>
test   %rax,%rax
je     1853 <radixsort_serial+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_serial+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_serial+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_serial+0x143>
xor    %r12d,%r12d
mov    -0x60(%rbp),%r13
jmp    129a <radixsort_serial+0xea>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    -0x58(%rbp),%r12
je     12f3 <radixsort_serial+0x143>
cmpl   $0x0,-0x30(%rbp)
jle    1290 <radixsort_serial+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_serial+0x100>
jmp    1290 <radixsort_serial+0xe0>
mov    -0x44(%rbp),%r12d
test   %r12d,%r12d
jle    1322 <radixsort_serial+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_serial+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_serial+0x1a0>
cmp    $0x2,%r12d
jle    14c9 <radixsort_serial+0x319>
lea    0xd05(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%r14b
cmpl   $0x0,-0x30(%rbp)
jle    14cc <radixsort_serial+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_serial+0x220>
mov    -0x2c(%rbp),%ebx
mov    $0x1,%r14b
mov    -0x44(%rbp),%r12d
test   %r12d,%r12d
jg     14d1 <radixsort_serial+0x321>
jmp    14f7 <radixsort_serial+0x347>
cmp    $0x3,%r12d
jl     1842 <radixsort_serial+0x692>
lea    0xbfc(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%r14b
test   %r12d,%r12d
jg     14d1 <radixsort_serial+0x321>
jmp    14f7 <radixsort_serial+0x347>
xor    %r14d,%r14d
test   %r12d,%r12d
jle    14f7 <radixsort_serial+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_serial+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_serial+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_serial+0x65c>
mov    %rdi,-0x78(%rbp)
call   1070 <p@plt>
mov    -0x58(%rbp),%r10
test   %ebx,%ebx
mov    -0x50(%rbp),%r9
jle    17c0 <radixsort_serial+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_serial+0x450>
mov    -0x2c(%rbp),%ebx
test   %ebx,%ebx
jle    17c0 <radixsort_serial+0x610>
cmp    $0x8,%ebx
setb   %al
or     -0x31(%rbp),%al
je     166b <radixsort_serial+0x4bb>
xor    %eax,%eax
jmp    174c <radixsort_serial+0x59c>
cmpq   $0x18,-0xa8(%rbp)
18
jae    1680 <radixsort_serial+0x4d0>
xor    %eax,%eax
mov    -0x70(%rbp),%rsi
jmp    16fb <radixsort_serial+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_serial+0x4e0>
cmpq   $0x0,-0xa0(%rbp)
je     173d <radixsort_serial+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_serial+0x570>
mov    -0xb0(%rbp),%rcx
mov    %rcx,%rax
cmp    %r10,%rcx
je     17c0 <radixsort_serial+0x610>
mov    %rax,%rcx
not    %rcx
add    %r10,%rcx
mov    -0xb8(%rbp),%rdx
test   %rdx,%rdx
je     1783 <radixsort_serial+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_serial+0x5c0>
cmp    $0x3,%rcx
jb     17c0 <radixsort_serial+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_serial+0x5e0>
test   %r14b,%r14b
je     15c3 <radixsort_serial+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_serial+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_serial+0x640>
jmp    15b0 <radixsort_serial+0x400>
cmpl   $0x0,-0x44(%rbp)
jle    182c <radixsort_serial+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_serial+0x321>
jmp    14f7 <radixsort_serial+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_serial(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca [80 x i8]
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%20 = load i32, i32* %8
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %4
%23 = call double (...) @omp_get_wtime()
store double %23, double* %13
br label %24
24: ; preds = %22, %4
%25 = load i32, i32* %6
%26 = call i64 @calloc(i32 %25, i32 4)
%27 = inttoptr i64 %26 to i32*
store i32* %27, i32** %14
%28 = load i32*, i32** %14
%29 = icmp ne i32* %28, null
br i1 %29, label %34, label %30
30: ; preds = %24
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %24
%35 = load i32, i32* %7
%36 = zext i32 %35 to i64
%37 = call i8* @llvm.stacksave()
store i8* %37, i8** %15
%38 = alloca [10 x i32], i64 %36
store i64 %36, i64* %16
store i32 0, i32* %12
br label %39
39: ; preds = %58, %34
%40 = load i32, i32* %12
%41 = load i32, i32* %7
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %61
43: ; preds = %39
store i32 0, i32* %10
br label %44
44: ; preds = %54, %43
%45 = load i32, i32* %10
%46 = icmp slt i32 %45, 10
br i1 %46, label %47, label %57
47: ; preds = %44
%48 = load i32, i32* %12
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %38, i64 %49
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %50, i64 0, i64 %52
store i32 0, i32* %53
br label %54
54: ; preds = %47
%55 = load i32, i32* %10
%56 = add nsw i32 %55, 1
store i32 %56, i32* %10
br label %44
57: ; preds = %44
br label %58
58: ; preds = %57
%59 = load i32, i32* %12
%60 = add nsw i32 %59, 1
store i32 %60, i32* %12
br label %39
61: ; preds = %39
%62 = load i32, i32* %8
%63 = icmp sgt i32 %62, 0
br i1 %63, label %64, label %69
64: ; preds = %61
%65 = call double (...) @omp_get_wtime()
%66 = load double, double* %13
%67 = fsub double %65, %66
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), double %67)
br label %69
69: ; preds = %64, %61
%70 = load i32, i32* %8
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call double (...) @omp_get_wtime()
store double %73, double* %13
br label %74
74: ; preds = %72, %69
store i32 0, i32* %11
br label %75
75: ; preds = %107, %74
%76 = load i32, i32* %11
%77 = load i32, i32* %6
%78 = icmp slt i32 %76, %77
br i1 %78, label %79, label %110
79: ; preds = %75
store i32 0, i32* %12
br label %80
80: ; preds = %103, %79
%81 = load i32, i32* %12
%82 = load i32, i32* %7
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %106
84: ; preds = %80
%85 = load i32, i32* %12
%86 = call i32 @p(i32 %85)
store i32 %86, i32* %9
%87 = load i32*, i32** %5
%88 = load i32, i32* %11
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i32, i32* %87, i64 %89
%91 = load i32, i32* %90
%92 = load i32, i32* %9
%93 = sdiv i32 %91, %92
%94 = srem i32 %93, 10
store i32 %94, i32* %10
%95 = load i32, i32* %12
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [10 x i32], [10 x i32]* %38, i64 %96
%98 = load i32, i32* %10
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [10 x i32], [10 x i32]* %97, i64 0, i64 %99
%101 = load i32, i32* %100
%102 = add nsw i32 %101, 1
store i32 %102, i32* %100
br label %103
103: ; preds = %84
%104 = load i32, i32* %12
%105 = add nsw i32 %104, 1
store i32 %105, i32* %12
br label %80
106: ; preds = %80
br label %107
107: ; preds = %106
%108 = load i32, i32* %11
%109 = add nsw i32 %108, 1
store i32 %109, i32* %11
br label %75
110: ; preds = %75
%111 = load i32, i32* %8
%112 = icmp sgt i32 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %110
%114 = call double (...) @omp_get_wtime()
%115 = load double, double* %13
%116 = fsub double %114, %115
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %116)
br label %118
118: ; preds = %113, %110
%119 = load i32, i32* %8
%120 = icmp sgt i32 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %118
%122 = call double (...) @omp_get_wtime()
store double %122, double* %13
br label %123
123: ; preds = %121, %118
store i32 0, i32* %12
br label %124
124: ; preds = %153, %123
%125 = load i32, i32* %12
%126 = load i32, i32* %7
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %156
128: ; preds = %124
store i32 1, i32* %11
br label %129
129: ; preds = %149, %128
%130 = load i32, i32* %11
%131 = icmp slt i32 %130, 10
br i1 %131, label %132, label %152
132: ; preds = %129
%133 = load i32, i32* %12
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [10 x i32], [10 x i32]* %38, i64 %134
%136 = load i32, i32* %11
%137 = sub nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [10 x i32], [10 x i32]* %135, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = load i32, i32* %12
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [10 x i32], [10 x i32]* %38, i64 %142
%144 = load i32, i32* %11
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [10 x i32], [10 x i32]* %143, i64 0, i64 %145
%147 = load i32, i32* %146
%148 = add nsw i32 %147, %140
store i32 %148, i32* %146
br label %149
149: ; preds = %132
%150 = load i32, i32* %11
%151 = add nsw i32 %150, 1
store i32 %151, i32* %11
br label %129
152: ; preds = %129
br label %153
153: ; preds = %152
%154 = load i32, i32* %12
%155 = add nsw i32 %154, 1
store i32 %155, i32* %12
br label %124
156: ; preds = %124
%157 = load i32, i32* %8
%158 = icmp sgt i32 %157, 2
br i1 %158, label %159, label %189
159: ; preds = %156
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %12
br label %161
161: ; preds = %185, %159
%162 = load i32, i32* %12
%163 = load i32, i32* %7
%164 = icmp slt i32 %162, %163
br i1 %164, label %165, label %188
165: ; preds = %161
%166 = load i32, i32* %12
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %166)
store i32 0, i32* %11
br label %168
168: ; preds = %180, %165
%169 = load i32, i32* %11
%170 = icmp slt i32 %169, 10
br i1 %170, label %171, label %183
171: ; preds = %168
%172 = load i32, i32* %12
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [10 x i32], [10 x i32]* %38, i64 %173
%175 = load i32, i32* %11
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [10 x i32], [10 x i32]* %174, i64 0, i64 %176
%178 = load i32, i32* %177
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %178)
br label %180
180: ; preds = %171
%181 = load i32, i32* %11
%182 = add nsw i32 %181, 1
store i32 %182, i32* %11
br label %168
183: ; preds = %168
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %185
185: ; preds = %183
%186 = load i32, i32* %12
%187 = add nsw i32 %186, 1
store i32 %187, i32* %12
br label %161
188: ; preds = %161
br label %189
189: ; preds = %188, %156
%190 = load i32, i32* %8
%191 = icmp sgt i32 %190, 0
br i1 %191, label %192, label %197
192: ; preds = %189
%193 = call double (...) @omp_get_wtime()
%194 = load double, double* %13
%195 = fsub double %193, %194
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), double %195)
br label %197
197: ; preds = %192, %189
%198 = load i32, i32* %8
%199 = icmp sgt i32 %198, 0
br i1 %199, label %200, label %202
200: ; preds = %197
%201 = call double (...) @omp_get_wtime()
store double %201, double* %13
br label %202
202: ; preds = %200, %197
store i32 0, i32* %12
br label %203
203: ; preds = %288, %202
%204 = load i32, i32* %12
%205 = load i32, i32* %7
%206 = icmp slt i32 %204, %205
br i1 %206, label %207, label %291
207: ; preds = %203
%208 = load i32, i32* %12
%209 = call i32 @p(i32 %208)
store i32 %209, i32* %9
%210 = load i32, i32* %6
%211 = sub nsw i32 %210, 1
store i32 %211, i32* %11
br label %212
212: ; preds = %241, %207
%213 = load i32, i32* %11
%214 = icmp sge i32 %213, 0
br i1 %214, label %215, label %244
215: ; preds = %212
%216 = load i32*, i32** %5
%217 = load i32, i32* %11
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i32, i32* %216, i64 %218
%220 = load i32, i32* %219
%221 = load i32, i32* %9
%222 = sdiv i32 %220, %221
%223 = srem i32 %222, 10
store i32 %223, i32* %17
%224 = load i32, i32* %12
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds [10 x i32], [10 x i32]* %38, i64 %225
%227 = load i32, i32* %17
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [10 x i32], [10 x i32]* %226, i64 0, i64 %228
%230 = load i32, i32* %229
%231 = add nsw i32 %230, -1
store i32 %231, i32* %229
store i32 %231, i32* %18
%232 = load i32*, i32** %5
%233 = load i32, i32* %11
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds i32, i32* %232, i64 %234
%236 = load i32, i32* %235
%237 = load i32*, i32** %14
%238 = load i32, i32* %18
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds i32, i32* %237, i64 %239
store i32 %236, i32* %240
br label %241
241: ; preds = %215
%242 = load i32, i32* %11
%243 = add nsw i32 %242, -1
store i32 %243, i32* %11
br label %212
244: ; preds = %212
store i32 0, i32* %11
br label %245
245: ; preds = %259, %244
%246 = load i32, i32* %11
%247 = load i32, i32* %6
%248 = icmp slt i32 %246, %247
br i1 %248, label %249, label %262
249: ; preds = %245
%250 = load i32*, i32** %14
%251 = load i32, i32* %11
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i32, i32* %250, i64 %252
%254 = load i32, i32* %253
%255 = load i32*, i32** %5
%256 = load i32, i32* %11
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds i32, i32* %255, i64 %257
store i32 %254, i32* %258
br label %259
259: ; preds = %249
%260 = load i32, i32* %11
%261 = add nsw i32 %260, 1
store i32 %261, i32* %11
br label %245
262: ; preds = %245
%263 = load i32, i32* %8
%264 = icmp sgt i32 %263, 2
br i1 %264, label %265, label %287
265: ; preds = %262
%266 = getelementptr inbounds [80 x i8], [80 x i8]* %19, i64 0, i64 0
%267 = load i32, i32* %7
%268 = add nsw i32 %267, 1
%269 = call i32 @sprintf(i8* %266, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %268)
store i32 0, i32* %11
br label %270
270: ; preds = %282, %265
%271 = load i32, i32* %11
%272 = load i32, i32* %6
%273 = icmp slt i32 %271, %272
br i1 %273, label %274, label %285
274: ; preds = %270
%275 = getelementptr inbounds [80 x i8], [80 x i8]* %19, i64 0, i64 0
%276 = load i32*, i32** %5
%277 = load i32, i32* %11
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds i32, i32* %276, i64 %278
%280 = load i32, i32* %279
%281 = call i32 (i8*, ...) @printf(i8* %275, i32 %280)
br label %282
282: ; preds = %274
%283 = load i32, i32* %11
%284 = add nsw i32 %283, 1
store i32 %284, i32* %11
br label %270
285: ; preds = %270
%286 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %287
287: ; preds = %285, %262
br label %288
288: ; preds = %287
%289 = load i32, i32* %12
%290 = add nsw i32 %289, 1
store i32 %290, i32* %12
br label %203
291: ; preds = %203
%292 = load i32, i32* %8
%293 = icmp sgt i32 %292, 0
br i1 %293, label %294, label %299
294: ; preds = %291
%295 = call double (...) @omp_get_wtime()
%296 = load double, double* %13
%297 = fsub double %295, %296
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), double %297)
br label %299
299: ; preds = %294, %291
%300 = load i32*, i32** %14
%301 = call i32 @cfree(i32* %300)
%302 = load i8*, i8** %15
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_serial(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [80 x i8]
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call double (...) @omp_get_wtime()
br label %9
9: ; preds = %7, %4
%10 = phi double [ %8, %7 ], [ undef, %4 ]
%11 = tail call i64 @calloc(i32 %1, i32 4)
%12 = inttoptr i64 %11 to i32*
%13 = inttoptr i64 %11 to i8*
%14 = icmp eq i64 %11, 0
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 (...) @abort()
unreachable
19: ; preds = %9
%20 = zext i32 %2 to i64
%21 = alloca [10 x i32], i64 %20
%22 = icmp sgt i32 %2, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = bitcast [10 x i32]* %21 to i8*
%25 = mul nuw nsw i64 %20, 40
br label %26
26: ; preds = %23, %19
br i1 %6, label %27, label %32
27: ; preds = %26
%28 = tail call double (...) @omp_get_wtime()
%29 = fsub double %28, %10
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), double %29)
%31 = tail call double (...) @omp_get_wtime()
br label %32
32: ; preds = %26, %27
%33 = phi double [ %31, %27 ], [ %10, %26 ]
%34 = icmp sgt i32 %1, 0
br i1 %34, label %35, label %57
35: ; preds = %32
%36 = zext i32 %1 to i64
br label %37
37: ; preds = %35, %54
%38 = phi i64 [ 0, %35 ], [ %55, %54 ]
br i1 %22, label %39, label %54
39: ; preds = %37
%40 = getelementptr inbounds i32, i32* %0, i64 %38
br label %41
41: ; preds = %39, %41
%42 = phi i64 [ 0, %39 ], [ %52, %41 ]
%43 = trunc i64 %42 to i32
%44 = tail call i32 @p(i32 %43)
%45 = load i32, i32* %40
%46 = sdiv i32 %45, %44
%47 = srem i32 %46, 10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %42, i64 %48
%50 = load i32, i32* %49
%51 = add nsw i32 %50, 1
store i32 %51, i32* %49
%52 = add nuw nsw i64 %42, 1
%53 = icmp eq i64 %52, %20
br i1 %53, label %54, label %41
54: ; preds = %41, %37
%55 = add nuw nsw i64 %38, 1
%56 = icmp eq i64 %55, %36
br i1 %56, label %57, label %37
57: ; preds = %54, %32
br i1 %6, label %58, label %63
58: ; preds = %57
%59 = tail call double (...) @omp_get_wtime()
%60 = fsub double %59, %33
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %60)
%62 = tail call double (...) @omp_get_wtime()
br label %63
63: ; preds = %57, %58
%64 = phi double [ %62, %58 ], [ %33, %57 ]
br i1 %22, label %65, label %100
65: ; preds = %63, %65
%66 = phi i64 [ %96, %65 ], [ 0, %63 ]
%67 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 0
%68 = load i32, i32* %67
%69 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 1
%70 = load i32, i32* %69
%71 = add nsw i32 %70, %68
store i32 %71, i32* %69
%72 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 2
%73 = load i32, i32* %72
%74 = add nsw i32 %73, %71
store i32 %74, i32* %72
%75 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 3
%76 = load i32, i32* %75
%77 = add nsw i32 %76, %74
store i32 %77, i32* %75
%78 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 4
%79 = load i32, i32* %78
%80 = add nsw i32 %79, %77
store i32 %80, i32* %78
%81 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 5
%82 = load i32, i32* %81
%83 = add nsw i32 %82, %80
store i32 %83, i32* %81
%84 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 6
%85 = load i32, i32* %84
%86 = add nsw i32 %85, %83
store i32 %86, i32* %84
%87 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 7
%88 = load i32, i32* %87
%89 = add nsw i32 %88, %86
store i32 %89, i32* %87
%90 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 8
%91 = load i32, i32* %90
%92 = add nsw i32 %91, %89
store i32 %92, i32* %90
%93 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %66, i64 9
%94 = load i32, i32* %93
%95 = add nsw i32 %94, %92
store i32 %95, i32* %93
%96 = add nuw nsw i64 %66, 1
%97 = icmp eq i64 %96, %20
br i1 %97, label %98, label %65
98: ; preds = %65
%99 = icmp sgt i32 %3, 2
br i1 %99, label %104, label %143
100: ; preds = %63
%101 = icmp sgt i32 %3, 2
br i1 %101, label %102, label %143
102: ; preds = %100
%103 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.11, i64 0, i64 0))
br label %143
104: ; preds = %98
%105 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.11, i64 0, i64 0))
br i1 %22, label %106, label %143
106: ; preds = %104, %106
%107 = phi i64 [ %141, %106 ], [ 0, %104 ]
%108 = trunc i64 %107 to i32
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %108)
%110 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 0
%111 = load i32, i32* %110
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %111)
%113 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 1
%114 = load i32, i32* %113
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %114)
%116 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 2
%117 = load i32, i32* %116
%118 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %117)
%119 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 3
%120 = load i32, i32* %119
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %120)
%122 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 4
%123 = load i32, i32* %122
%124 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %123)
%125 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 5
%126 = load i32, i32* %125
%127 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %126)
%128 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 6
%129 = load i32, i32* %128
%130 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %129)
%131 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 7
%132 = load i32, i32* %131
%133 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %132)
%134 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 8
%135 = load i32, i32* %134
%136 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %135)
%137 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %107, i64 9
%138 = load i32, i32* %137
%139 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %138)
%140 = tail call i32 @putchar(i32 10)
%141 = add nuw nsw i64 %107, 1
%142 = icmp eq i64 %141, %20
br i1 %142, label %143, label %106
143: ; preds = %106, %102, %100, %104, %98
%144 = phi i1 [ false, %100 ], [ true, %104 ], [ false, %98 ], [ true, %102 ], [ true, %106 ]
br i1 %6, label %145, label %150
145: ; preds = %143
%146 = tail call double (...) @omp_get_wtime()
%147 = fsub double %146, %64
%148 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), double %147)
%149 = tail call double (...) @omp_get_wtime()
br label %150
150: ; preds = %143, %145
%151 = phi double [ %149, %145 ], [ %64, %143 ]
br i1 %22, label %152, label %316
152: ; preds = %150
%153 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%154 = add nuw nsw i32 %2, 1
%155 = zext i32 %1 to i64
%156 = getelementptr i32, i32* %0, i64 %155
%157 = bitcast i32* %156 to i8*
%158 = getelementptr i32, i32* %12, i64 %155
%159 = and i64 %155, 4294967288
%160 = add nsw i64 %159, -8
%161 = lshr exact i64 %160, 3
%162 = add nuw nsw i64 %161, 1
%163 = icmp ult i32 %1, 8
%164 = icmp ugt i32* %158, %0
%165 = icmp ult i8* %13, %157
%166 = and i1 %164, %165
%167 = and i64 %155, 4294967288
%168 = and i64 %162, 3
%169 = icmp ult i64 %160, 24
%170 = and i64 %162, 4611686018427387900
%171 = icmp eq i64 %168, 0
%172 = icmp eq i64 %167, %155
%173 = and i64 %155, 3
%174 = icmp eq i64 %173, 0
br label %175
175: ; preds = %152, %313
%176 = phi i64 [ 0, %152 ], [ %314, %313 ]
%177 = trunc i64 %176 to i32
%178 = tail call i32 @p(i32 %177)
br i1 %34, label %267, label %301
179: ; preds = %267
br i1 %34, label %180, label %301
180: ; preds = %179
%181 = select i1 %163, i1 true, i1 %166
br i1 %181, label %251, label %182
182: ; preds = %180
br i1 %169, label %232, label %183
183: ; preds = %182, %183
%184 = phi i64 [ %229, %183 ], [ 0, %182 ]
%185 = phi i64 [ %230, %183 ], [ 0, %182 ]
%186 = getelementptr inbounds i32, i32* %12, i64 %184
%187 = bitcast i32* %186 to <4 x i32>*
%188 = load <4 x i32>, <4 x i32>* %187
%189 = getelementptr inbounds i32, i32* %186, i64 4
%190 = bitcast i32* %189 to <4 x i32>*
%191 = load <4 x i32>, <4 x i32>* %190
%192 = getelementptr inbounds i32, i32* %0, i64 %184
%193 = bitcast i32* %192 to <4 x i32>*
store <4 x i32> %188, <4 x i32>* %193
%194 = getelementptr inbounds i32, i32* %192, i64 4
%195 = bitcast i32* %194 to <4 x i32>*
store <4 x i32> %191, <4 x i32>* %195
%196 = or i64 %184, 8
%197 = getelementptr inbounds i32, i32* %12, i64 %196
%198 = bitcast i32* %197 to <4 x i32>*
%199 = load <4 x i32>, <4 x i32>* %198
%200 = getelementptr inbounds i32, i32* %197, i64 4
%201 = bitcast i32* %200 to <4 x i32>*
%202 = load <4 x i32>, <4 x i32>* %201
%203 = getelementptr inbounds i32, i32* %0, i64 %196
%204 = bitcast i32* %203 to <4 x i32>*
store <4 x i32> %199, <4 x i32>* %204
%205 = getelementptr inbounds i32, i32* %203, i64 4
%206 = bitcast i32* %205 to <4 x i32>*
store <4 x i32> %202, <4 x i32>* %206
%207 = or i64 %184, 16
%208 = getelementptr inbounds i32, i32* %12, i64 %207
%209 = bitcast i32* %208 to <4 x i32>*
%210 = load <4 x i32>, <4 x i32>* %209
%211 = getelementptr inbounds i32, i32* %208, i64 4
%212 = bitcast i32* %211 to <4 x i32>*
%213 = load <4 x i32>, <4 x i32>* %212
%214 = getelementptr inbounds i32, i32* %0, i64 %207
%215 = bitcast i32* %214 to <4 x i32>*
store <4 x i32> %210, <4 x i32>* %215
%216 = getelementptr inbounds i32, i32* %214, i64 4
%217 = bitcast i32* %216 to <4 x i32>*
store <4 x i32> %213, <4 x i32>* %217
%218 = or i64 %184, 24
%219 = getelementptr inbounds i32, i32* %12, i64 %218
%220 = bitcast i32* %219 to <4 x i32>*
%221 = load <4 x i32>, <4 x i32>* %220
%222 = getelementptr inbounds i32, i32* %219, i64 4
%223 = bitcast i32* %222 to <4 x i32>*
%224 = load <4 x i32>, <4 x i32>* %223
%225 = getelementptr inbounds i32, i32* %0, i64 %218
%226 = bitcast i32* %225 to <4 x i32>*
store <4 x i32> %221, <4 x i32>* %226
%227 = getelementptr inbounds i32, i32* %225, i64 4
%228 = bitcast i32* %227 to <4 x i32>*
store <4 x i32> %224, <4 x i32>* %228
%229 = add nuw i64 %184, 32
%230 = add i64 %185, 4
%231 = icmp eq i64 %230, %170
br i1 %231, label %232, label %183
232: ; preds = %183, %182
%233 = phi i64 [ 0, %182 ], [ %229, %183 ]
br i1 %171, label %250, label %234
234: ; preds = %232, %234
%235 = phi i64 [ %247, %234 ], [ %233, %232 ]
%236 = phi i64 [ %248, %234 ], [ 0, %232 ]
%237 = getelementptr inbounds i32, i32* %12, i64 %235
%238 = bitcast i32* %237 to <4 x i32>*
%239 = load <4 x i32>, <4 x i32>* %238
%240 = getelementptr inbounds i32, i32* %237, i64 4
%241 = bitcast i32* %240 to <4 x i32>*
%242 = load <4 x i32>, <4 x i32>* %241
%243 = getelementptr inbounds i32, i32* %0, i64 %235
%244 = bitcast i32* %243 to <4 x i32>*
store <4 x i32> %239, <4 x i32>* %244
%245 = getelementptr inbounds i32, i32* %243, i64 4
%246 = bitcast i32* %245 to <4 x i32>*
store <4 x i32> %242, <4 x i32>* %246
%247 = add nuw i64 %235, 8
%248 = add i64 %236, 1
%249 = icmp eq i64 %248, %168
br i1 %249, label %250, label %234
250: ; preds = %234, %232
br i1 %172, label %301, label %251
251: ; preds = %180, %250
%252 = phi i64 [ 0, %180 ], [ %167, %250 ]
%253 = xor i64 %252, -1
%254 = add nsw i64 %253, %155
br i1 %174, label %264, label %255
255: ; preds = %251, %255
%256 = phi i64 [ %261, %255 ], [ %252, %251 ]
%257 = phi i64 [ %262, %255 ], [ 0, %251 ]
%258 = getelementptr inbounds i32, i32* %12, i64 %256
%259 = load i32, i32* %258
%260 = getelementptr inbounds i32, i32* %0, i64 %256
store i32 %259, i32* %260
%261 = add nuw nsw i64 %256, 1
%262 = add i64 %257, 1
%263 = icmp eq i64 %262, %173
br i1 %263, label %264, label %255
264: ; preds = %255, %251
%265 = phi i64 [ %252, %251 ], [ %261, %255 ]
%266 = icmp ult i64 %254, 3
br i1 %266, label %301, label %282
267: ; preds = %175, %267
%268 = phi i64 [ %269, %267 ], [ %155, %175 ]
%269 = add nsw i64 %268, -1
%270 = and i64 %269, 4294967295
%271 = getelementptr inbounds i32, i32* %0, i64 %270
%272 = load i32, i32* %271
%273 = sdiv i32 %272, %178
%274 = srem i32 %273, 10
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %176, i64 %275
%277 = load i32, i32* %276
%278 = add nsw i32 %277, -1
store i32 %278, i32* %276
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds i32, i32* %12, i64 %279
store i32 %272, i32* %280
%281 = icmp sgt i64 %268, 1
br i1 %281, label %267, label %179
282: ; preds = %264, %282
%283 = phi i64 [ %299, %282 ], [ %265, %264 ]
%284 = getelementptr inbounds i32, i32* %12, i64 %283
%285 = load i32, i32* %284
%286 = getelementptr inbounds i32, i32* %0, i64 %283
store i32 %285, i32* %286
%287 = add nuw nsw i64 %283, 1
%288 = getelementptr inbounds i32, i32* %12, i64 %287
%289 = load i32, i32* %288
%290 = getelementptr inbounds i32, i32* %0, i64 %287
store i32 %289, i32* %290
%291 = add nuw nsw i64 %283, 2
%292 = getelementptr inbounds i32, i32* %12, i64 %291
%293 = load i32, i32* %292
%294 = getelementptr inbounds i32, i32* %0, i64 %291
store i32 %293, i32* %294
%295 = add nuw nsw i64 %283, 3
%296 = getelementptr inbounds i32, i32* %12, i64 %295
%297 = load i32, i32* %296
%298 = getelementptr inbounds i32, i32* %0, i64 %295
store i32 %297, i32* %298
%299 = add nuw nsw i64 %283, 4
%300 = icmp eq i64 %299, %155
br i1 %300, label %301, label %282
301: ; preds = %264, %282, %250, %175, %179
br i1 %144, label %302, label %313
302: ; preds = %301
%303 = call i32 @sprintf(i8* %153, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %154)
br i1 %34, label %304, label %311
304: ; preds = %302, %304
%305 = phi i64 [ %309, %304 ], [ 0, %302 ]
%306 = getelementptr inbounds i32, i32* %0, i64 %305
%307 = load i32, i32* %306
%308 = call i32 (i8*, ...) @printf(i8* %153, i32 %307)
%309 = add nuw nsw i64 %305, 1
%310 = icmp eq i64 %309, %155
br i1 %310, label %311, label %304
311: ; preds = %304, %302
%312 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %313
313: ; preds = %301, %311
%314 = add nuw nsw i64 %176, 1
%315 = icmp eq i64 %314, %20
br i1 %315, label %316, label %175
316: ; preds = %313, %150
br i1 %6, label %317, label %321
317: ; preds = %316
%318 = tail call double (...) @omp_get_wtime()
%319 = fsub double %318, %151
%320 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), double %319)
br label %321
321: ; preds = %317, %316
%322 = tail call i32 @cfree(i32* %12)
ret void
}