#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 UINT32_MAX;
int atoi(char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ cfree(int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int omp_get_num_procs();
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ radixsort_parallel(int *, int, int, int, int);
int rand();
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int strtoul(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  uint32_t i, *input, num_of_values = 1000, max_value = 0, tmp_value = 0;
  int value_lenght = 5, max_digits_size = 0;
  double start_time;
  char str[10] = {0};
  int chunksize = 1;
  int debug = 0;
  char layout[80];
  if (argc >= 2) {
    num_of_values = strtoul(argv[1], NULL, 10);
    if (num_of_values < 0 || num_of_values > UINT32_MAX)
      num_of_values = 1000;
  }
  if (argc >= 3) {
    value_lenght = atoi(argv[2]);
    if (value_lenght < 0 || value_lenght > 10)
      value_lenght = 5;
  }
  if (argc >= 4) {
    int tmp_debug;
    if ((tmp_debug = atoi(argv[3])) > 0) {
      debug = tmp_debug;
    }
  }
  if (argc >= 5) {
    int tmp_chunk;
    if ((tmp_chunk = atoi(argv[4])) > 0) {
      chunksize = tmp_chunk;
    }
  }
  if (debug > 0) {
    printf("DEBUG LEVEL: %i\n", debug);
    printf("CHUNKSIZE  : %i\n", chunksize);
    printf("THREADS    : %i\n", omp_get_num_procs());
  }
  if (debug > 0)
    start_time = omp_get_wtime();
  input = (uint32_t *)calloc(num_of_values, sizeof(uint32_t));
  if (!input) {
    fprintf(stderr, "ERROR: not enough memory!\n");
    return 1;
  }
  if (debug > 0) {
    printf("INPUT ALLOCATION\t\t\t%lf\n", omp_get_wtime() - start_time);
  }
  if (debug > 0)
    start_time = omp_get_wtime();
  for (i = 0; i < value_lenght; i++)
    str[i] = '9';
  srand(time(NULL));
  for (i = 0; i < num_of_values; i++) {
    input[i] = rand() % strtoul(str, NULL, 10) + 1;
    if (max_value < input[i])
      max_value = input[i];
  }
  if (debug > 0) {
    printf("RANDOM GENERATION\t\t\t%lf\n", omp_get_wtime() - start_time);
  }
  if (debug > 0)
    start_time = omp_get_wtime();
  tmp_value = max_value;
  while ((tmp_value /= 10) > 0)
    max_digits_size++;
  max_digits_size++;
  if (debug > 0) {
    printf("CALCULATION OF K\t\t\t%lf\n", omp_get_wtime() - start_time);
  }
  if (debug > 1) {
    sprintf(layout, "%%%iu\n", max_digits_size + 1);
    for (i = 0; i < num_of_values; i++)
      printf(layout, input[i]);
  }
  if (debug > 0)
    printf("START RADIX SORTING\n");
  start_time = omp_get_wtime();
  radixsort_parallel(input, num_of_values, max_digits_size, debug, chunksize);
  if (debug > 0)
    printf("K\t\tN\tTIME\n");
  printf("%i\t%8u\t%f\n", max_digits_size, num_of_values,
         omp_get_wtime() - start_time);
  if (debug > 1) {
    sprintf(layout, "%%%iu\n", max_digits_size + 1);
    for (i = 0; i < num_of_values; i++)
      printf(layout, input[i]);
  }
  int not_ordered = 0;
  for (i = 1; i < num_of_values; i++) {
    if (input[i] < input[i - 1]) {
      not_ordered = 1;
      break;
    }
  }
  if (not_ordered) {
    printf("ORDERED CHECK: FAIL!\n");
  } else {
    if (debug > 0)
      printf("ORDERED CHECK: PASS\n");
  }
  cfree(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x5,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x4a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
movl   $0x1,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1285 <main+0xa5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10c0 <strtoul@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1279 <main+0x99>
mov    -0x24(%rbp),%eax
mov    0x2d87(%rip),%rcx
cmp    (%rcx),%eax
jle    1280 <main+0xa0>
movl   $0x3e8,-0x24(%rbp)
jmp    1285 <main+0xa5>
cmpl   $0x3,-0x8(%rbp)
jl     12bf <main+0xdf>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jl     12b3 <main+0xd3>
cmpl   $0xa,-0x30(%rbp)
jle    12ba <main+0xda>
movl   $0x5,-0x30(%rbp)
jmp    12bf <main+0xdf>
cmpl   $0x4,-0x8(%rbp)
jl     12f3 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xb4(%rbp)
cmp    $0x0,%eax
jle    12ee <main+0x10e>
mov    -0xb4(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    12f3 <main+0x113>
cmpl   $0x5,-0x8(%rbp)
jl     1327 <main+0x147>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xb8(%rbp)
cmp    $0x0,%eax
jle    1322 <main+0x142>
mov    -0xb8(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    1327 <main+0x147>
cmpl   $0x0,-0x54(%rbp)
jle    136a <main+0x18a>
mov    -0x54(%rbp),%esi
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x50(%rbp),%esi
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <omp_get_num_procs@plt>
mov    %eax,%esi
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x54(%rbp)
jle    1380 <main+0x1a0>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13bd <main+0x1dd>
mov    0x2c35(%rip),%rax
mov    (%rax),%edi
lea    0xc87(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173e <main+0x55e>
cmpl   $0x0,-0x54(%rbp)
jle    13e1 <main+0x201>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xc74(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x54(%rbp)
jle    13f7 <main+0x217>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1421 <main+0x241>
movslq -0x14(%rbp),%rax
movb   $0x39,-0x4a(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13fe <main+0x21e>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14b1 <main+0x2d1>
mov    $0x0,%al
call   1100 <rand@plt>
mov    %eax,-0xc0(%rbp)
lea    -0x4a(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10c0 <strtoul@plt>
mov    %eax,%ecx
mov    -0xc0(%rbp),%eax
cltd
idiv   %ecx
add    $0x1,%edx
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    149e <main+0x2be>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
jmp    14a3 <main+0x2c3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1438 <main+0x258>
cmpl   $0x0,-0x54(%rbp)
jle    14d5 <main+0x2f5>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xb98(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x54(%rbp)
jle    14eb <main+0x30b>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jle    1516 <main+0x336>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14f1 <main+0x311>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x54(%rbp)
jle    1543 <main+0x363>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xb43(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x54(%rbp)
jle    15a5 <main+0x3c5>
lea    -0xb0(%rbp),%rdi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xb36(%rip),%rsi
call   10f0 <sprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    15a0 <main+0x3c0>
lea    -0xb0(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    156d <main+0x38d>
jmp    15a5 <main+0x3c5>
cmpl   $0x0,-0x54(%rbp)
jle    15bd <main+0x3dd>
lea    0xae8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    -0x50(%rbp),%r8d
call   1040 <radixsort_parallel@plt>
cmpl   $0x0,-0x54(%rbp)
jle    15f7 <main+0x417>
lea    0xac3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0xc8(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
mov    -0xc8(%rbp),%esi
mov    -0xc4(%rbp),%edx
subsd  -0x40(%rbp),%xmm0
lea    0xa96(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x54(%rbp)
jle    1691 <main+0x4b1>
lea    -0xb0(%rbp),%rdi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xa4a(%rip),%rsi
call   10f0 <sprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    168c <main+0x4ac>
lea    -0xb0(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1659 <main+0x479>
jmp    1691 <main+0x4b1>
movl   $0x0,-0xbc(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    16f1 <main+0x511>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    16de <main+0x4fe>
movl   $0x1,-0xbc(%rbp)
jmp    16f1 <main+0x511>
jmp    16e3 <main+0x503>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    16a2 <main+0x4c2>
cmpl   $0x0,-0xbc(%rbp)
je     1711 <main+0x531>
lea    0x9c4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    172e <main+0x54e>
cmpl   $0x0,-0x54(%rbp)
jle    1729 <main+0x549>
lea    0x9bd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    172e <main+0x54e>
mov    -0x20(%rbp),%rdi
call   10d0 <cfree@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movw   $0x0,0x28(%rsp)
movq   $0x0,0x20(%rsp)
mov    $0x3e8,%ebx
mov    $0x5,%r14d
cmp    $0x2,%edi
jl     1349 <main+0x159>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    0x2db7(%rip),%rcx
cmp    (%rcx),%eax
mov    $0x3e8,%ecx
mov    %eax,%ebx
cmovg  %ecx,%ebx
test   %eax,%eax
cmovs  %ecx,%ebx
cmp    $0x2,%ebp
je     1349 <main+0x159>
mov    0x10(%r15),%rdi
call   10f0 <atoi@plt>
cmp    $0xb,%eax
mov    $0x5,%r14d
cmovb  %eax,%r14d
cmp    $0x4,%ebp
jb     1349 <main+0x159>
mov    0x18(%r15),%rdi
call   10f0 <atoi@plt>
xor    %r13d,%r13d
test   %eax,%eax
mov    %eax,0x4(%rsp)
cmovns %eax,%r13d
mov    $0x1,%r12d
cmp    $0x4,%ebp
je     12b0 <main+0xc0>
mov    0x20(%r15),%rdi
call   10f0 <atoi@plt>
test   %eax,%eax
mov    $0x1,%r12d
cmovg  %eax,%r12d
cmpl   $0x0,0x4(%rsp)
jle    15c3 <main+0x3d3>
lea    0xd3e(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd3e(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10b0 <omp_get_num_procs@plt>
lea    0xd37(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
test   %rax,%rax
je     15e4 <main+0x3f4>
mov    %rax,%r13
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  0x8(%rsp),%xmm0
lea    0xd21(%rip),%rdi
mov    $0x1,%al
mov    %eax,0x8(%rsp)
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,0x10(%rsp)
jmp    1377 <main+0x187>
mov    %ebx,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
test   %rax,%rax
je     15e4 <main+0x3f4>
mov    %rax,%r13
movl   $0x0,0x8(%rsp)
mov    $0x1,%r12d
movl   $0x0,0x4(%rsp)
mov    %r12d,0x18(%rsp)
test   %r14d,%r14d
je     1393 <main+0x1a3>
mov    %r14d,%edx
lea    0x20(%rsp),%rdi
mov    $0x39,%esi
call   1070 <memset@plt>
xor    %r15d,%r15d
xor    %edi,%edi
call   10c0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    %ebx,%r14d
mov    %ebx,0x1c(%rsp)
test   %ebx,%ebx
je     13f7 <main+0x207>
lea    0x20(%rsp),%rbp
xor    %r12d,%r12d
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1110 <rand@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10d0 <strtoul@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
lea    0x1(%rdx),%eax
mov    %eax,0x0(%r13,%r12,4)
cmp    %edx,%r15d
cmovle %eax,%r15d
add    $0x1,%r12
cmp    %r12,%r14
jne    13c0 <main+0x1d0>
cmpb   $0x0,0x8(%rsp)
je     1422 <main+0x232>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  0x10(%rsp),%xmm0
lea    0xc54(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
jmp    1428 <main+0x238>
movsd  0x10(%rsp),%xmm0
mov    $0x1,%ebp
cmp    $0xa,%r15d
jl     1457 <main+0x267>
mov    $0x1,%ebp
mov    $0xcccccccd,%eax
nopl   (%rax)
mov    %r15d,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    $0x1,%ebp
cmp    $0x63,%r15d
mov    %ecx,%r15d
ja     1440 <main+0x250>
cmpb   $0x0,0x8(%rsp)
mov    0x1c(%rsp),%r12d
je     1484 <main+0x294>
xor    %eax,%eax
movsd  %xmm0,0x10(%rsp)
call   1040 <omp_get_wtime@plt>
subsd  0x10(%rsp),%xmm0
lea    0xc02(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     14c8 <main+0x2d8>
lea    0x1(%rbp),%edx
lea    0xc02(%rip),%rsi
lea    0x30(%rsp),%rdi
call   1100 <sprintf@plt>
test   %r12d,%r12d
je     14c8 <main+0x2d8>
lea    0x30(%rsp),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    14b0 <main+0x2c0>
cmpb   $0x0,0x8(%rsp)
je     14db <main+0x2eb>
lea    0xc06(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r13,%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    0x4(%rsp),%ecx
mov    0x18(%rsp),%r8d
call   1050 <radixsort_parallel@plt>
cmpb   $0x0,0x8(%rsp)
je     1511 <main+0x321>
lea    0xbc6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  0x10(%rsp),%xmm0
lea    0xb79(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     1578 <main+0x388>
add    $0x1,%ebp
lea    0xb55(%rip),%rsi
lea    0x30(%rsp),%rdi
mov    %ebp,%edx
call   1100 <sprintf@plt>
test   %r12d,%r12d
je     15a4 <main+0x3b4>
lea    0x30(%rsp),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1560 <main+0x370>
cmp    $0x2,%r12d
jl     15a4 <main+0x3b4>
mov    0x0(%r13),%eax
mov    $0x1,%ecx
lea    0xb2f(%rip),%rdi
xchg   %ax,%ax
mov    %eax,%edx
mov    0x0(%r13,%rcx,4),%eax
cmp    %edx,%eax
jl     15b2 <main+0x3c2>
add    $0x1,%rcx
cmp    %rcx,%r14
jne    1590 <main+0x3a0>
cmpb   $0x0,0x8(%rsp)
je     15b7 <main+0x3c7>
lea    0xaf7(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   10e0 <cfree@plt>
xor    %eax,%eax
jmp    15fe <main+0x40e>
mov    %ebx,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
test   %rax,%rax
je     15e4 <main+0x3f4>
mov    %rax,%r13
movl   $0x0,0x8(%rsp)
jmp    136f <main+0x17f>
mov    0x29ed(%rip),%rax
mov    (%rax),%edi
lea    0xa3f(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@UINT32_MAX = global i32 0
@.str = [17 x i8] c"DEBUG LEVEL: %i\0A\00"
@.str.1 = [17 x i8] c"CHUNKSIZE : %i\0A\00"
@.str.2 = [17 x i8] c"THREADS : %i\0A\00"
@stderr = global i32 0
@.str.3 = [27 x i8] c"ERROR: not enough memory!\0A\00"
@.str.4 = [24 x i8] c"INPUT ALLOCATION\09\09\09%lf\0A\00"
@.str.5 = [25 x i8] c"RANDOM GENERATION\09\09\09%lf\0A\00"
@.str.6 = [24 x i8] c"CALCULATION OF K\09\09\09%lf\0A\00"
@.str.7 = [7 x i8] c"%%%iu\0A\00"
@.str.10 = [11 x i8] c"%i\09%8u\09%f\0A\00"
@str = [20 x i8] c"ORDERED CHECK: PASS\00"
@str.13 = [21 x i8] c"ORDERED CHECK: FAIL!\00"
@str.14 = [10 x i8] c"K\09\09N\09TIME\00"
@str.15 = [20 x i8] c"START RADIX SORTING\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = alloca [80 x i8]
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %52
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strtoul(i8* nocapture %11, i32* null, i32 10)
%13 = icmp slt i32 %12, 0
%14 = load i32, i32* @UINT32_MAX
%15 = icmp sgt i32 %12, %14
%16 = select i1 %13, i1 true, i1 %15
%17 = select i1 %16, i32 1000, i32 %12
%18 = icmp eq i32 %0, 2
br i1 %18, label %52, label %19
19: ; preds = %9
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32 @atoi(i8* %21)
%23 = icmp ugt i32 %22, 10
%24 = select i1 %23, i32 5, i32 %22
%25 = icmp ugt i32 %0, 3
br i1 %25, label %26, label %52
26: ; preds = %19
%27 = getelementptr inbounds i8*, i8** %1, i64 3
%28 = load i8*, i8** %27
%29 = tail call i32 @atoi(i8* %28)
%30 = icmp sgt i32 %29, 0
%31 = select i1 %30, i32 %29, i32 0
%32 = icmp eq i32 %0, 4
br i1 %32, label %39, label %33
33: ; preds = %26
%34 = getelementptr inbounds i8*, i8** %1, i64 4
%35 = load i8*, i8** %34
%36 = tail call i32 @atoi(i8* %35)
%37 = icmp sgt i32 %36, 1
%38 = select i1 %37, i32 %36, i32 1
br label %39
39: ; preds = %33, %26
%40 = phi i32 [ %38, %33 ], [ 1, %26 ]
br i1 %30, label %41, label %49
41: ; preds = %39
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %31)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%44 = tail call i32 (...) @omp_get_num_procs()
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = tail call double (...) @omp_get_wtime()
%47 = tail call i64 @calloc(i32 %17, i32 4)
%48 = icmp eq i64 %47, 0
br i1 %48, label %57, label %60
49: ; preds = %39
%50 = tail call i64 @calloc(i32 %17, i32 4)
%51 = icmp eq i64 %50, 0
br i1 %51, label %57, label %65
52: ; preds = %19, %9, %2
%53 = phi i32 [ %24, %19 ], [ 5, %9 ], [ 5, %2 ]
%54 = phi i32 [ %17, %19 ], [ %17, %9 ], [ 1000, %2 ]
%55 = tail call i64 @calloc(i32 %54, i32 4)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %65
57: ; preds = %49, %52, %41
%58 = load i32, i32* @stderr
%59 = tail call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %175
60: ; preds = %41
%61 = tail call double (...) @omp_get_wtime()
%62 = fsub double %61, %46
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %62)
%64 = tail call double (...) @omp_get_wtime()
br label %65
65: ; preds = %49, %52, %60
%66 = phi i1 [ true, %60 ], [ false, %52 ], [ false, %49 ]
%67 = phi i32 [ %40, %60 ], [ 1, %52 ], [ %40, %49 ]
%68 = phi i32 [ %24, %60 ], [ %53, %52 ], [ %24, %49 ]
%69 = phi i32 [ %17, %60 ], [ %54, %52 ], [ %17, %49 ]
%70 = phi i32 [ %29, %60 ], [ 0, %52 ], [ 0, %49 ]
%71 = phi i64 [ %47, %60 ], [ %55, %52 ], [ %50, %49 ]
%72 = phi double [ %64, %60 ], [ undef, %52 ], [ undef, %49 ]
%73 = inttoptr i64 %71 to i32*
%74 = icmp eq i32 %68, 0
br i1 %74, label %77, label %75
75: ; preds = %65
%76 = zext i32 %68 to i64
br label %77
77: ; preds = %75, %65
%78 = tail call i32 @time(i32* null)
%79 = tail call i32 @srand(i32 %78)
%80 = icmp eq i32 %69, 0
br i1 %80, label %95, label %81
81: ; preds = %77
%82 = zext i32 %69 to i64
br label %83
83: ; preds = %81, %83
%84 = phi i64 [ 0, %81 ], [ %93, %83 ]
%85 = phi i32 [ 0, %81 ], [ %92, %83 ]
%86 = tail call i32 (...) @rand()
%87 = call i32 @strtoul(i8* nocapture %6, i32* null, i32 10)
%88 = srem i32 %86, %87
%89 = add nsw i32 %88, 1
%90 = getelementptr inbounds i32, i32* %73, i64 %84
store i32 %89, i32* %90
%91 = icmp sgt i32 %85, %88
%92 = select i1 %91, i32 %85, i32 %89
%93 = add nuw nsw i64 %84, 1
%94 = icmp eq i64 %93, %82
br i1 %94, label %95, label %83
95: ; preds = %83, %77
%96 = phi i32 [ 0, %77 ], [ %92, %83 ]
br i1 %66, label %97, label %102
97: ; preds = %95
%98 = tail call double (...) @omp_get_wtime()
%99 = fsub double %98, %72
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), double %99)
%101 = tail call double (...) @omp_get_wtime()
br label %102
102: ; preds = %95, %97
%103 = phi double [ %101, %97 ], [ %72, %95 ]
%104 = icmp sgt i32 %96, 9
br i1 %104, label %105, label %111
105: ; preds = %102, %105
%106 = phi i32 [ %109, %105 ], [ 1, %102 ]
%107 = phi i32 [ %108, %105 ], [ %96, %102 ]
%108 = udiv i32 %107, 10
%109 = add i32 %106, 1
%110 = icmp ugt i32 %107, 99
br i1 %110, label %105, label %111
111: ; preds = %105, %102
%112 = phi i32 [ 1, %102 ], [ %109, %105 ]
br i1 %66, label %113, label %117
113: ; preds = %111
%114 = tail call double (...) @omp_get_wtime()
%115 = fsub double %114, %103
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %115)
br label %117
117: ; preds = %113, %111
%118 = icmp sgt i32 %70, 1
br i1 %118, label %119, label %131
119: ; preds = %117
%120 = add nsw i32 %112, 1
%121 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %120)
br i1 %80, label %131, label %122
122: ; preds = %119
%123 = zext i32 %69 to i64
br label %124
124: ; preds = %122, %124
%125 = phi i64 [ 0, %122 ], [ %129, %124 ]
%126 = getelementptr inbounds i32, i32* %73, i64 %125
%127 = load i32, i32* %126
%128 = call i32 (i8*, ...) @printf(i8* %7, i32 %127)
%129 = add nuw nsw i64 %125, 1
%130 = icmp eq i64 %129, %123
br i1 %130, label %131, label %124
131: ; preds = %124, %119, %117
br i1 %66, label %132, label %134
132: ; preds = %131
%133 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.15, i64 0, i64 0))
br label %134
134: ; preds = %132, %131
%135 = tail call double (...) @omp_get_wtime()
%136 = tail call i32 @radixsort_parallel(i32* %73, i32 %69, i32 %112, i32 %70, i32 %67)
br i1 %66, label %137, label %139
137: ; preds = %134
%138 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i64 0, i64 0))
br label %139
139: ; preds = %137, %134
%140 = tail call double (...) @omp_get_wtime()
%141 = fsub double %140, %135
%142 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 %112, i32 %69, double %141)
br i1 %118, label %143, label %155
143: ; preds = %139
%144 = add nsw i32 %112, 1
%145 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %144)
br i1 %80, label %169, label %146
146: ; preds = %143
%147 = zext i32 %69 to i64
br label %148
148: ; preds = %146, %148
%149 = phi i64 [ 0, %146 ], [ %153, %148 ]
%150 = getelementptr inbounds i32, i32* %73, i64 %149
%151 = load i32, i32* %150
%152 = call i32 (i8*, ...) @printf(i8* %7, i32 %151)
%153 = add nuw nsw i64 %149, 1
%154 = icmp eq i64 %153, %147
br i1 %154, label %155, label %148
155: ; preds = %148, %139
%156 = icmp sgt i32 %69, 1
br i1 %156, label %157, label %169
157: ; preds = %155
%158 = zext i32 %69 to i64
%159 = load i32, i32* %73
br label %162
160: ; preds = %162
%161 = icmp eq i64 %168, %158
br i1 %161, label %169, label %162
162: ; preds = %157, %160
%163 = phi i32 [ %159, %157 ], [ %166, %160 ]
%164 = phi i64 [ 1, %157 ], [ %168, %160 ]
%165 = getelementptr inbounds i32, i32* %73, i64 %164
%166 = load i32, i32* %165
%167 = icmp slt i32 %166, %163
%168 = add nuw nsw i64 %164, 1
br i1 %167, label %170, label %160
169: ; preds = %160, %143, %155
br i1 %66, label %170, label %173
170: ; preds = %162, %169
%171 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0), %169 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.13, i64 0, i64 0), %162 ]
%172 = tail call i32 @puts(i8* dereferenceable(1) %171)
br label %173
173: ; preds = %170, %169
%174 = tail call i32 @cfree(i32* %73)
br label %175
175: ; preds = %173, %57
%176 = phi i32 [ 0, %173 ], [ 1, %57 ]
ret i32 %176
}