#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 *);
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ radixsort_serial(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 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 (debug > 0)
    printf("DEBUG LEVEL: %i\n", debug);
  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_serial(input, num_of_values, max_digits_size, debug);
  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    $0xc0,%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   1050 <memset@plt>
movl   $0x0,-0x50(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     126e <main+0x9e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1262 <main+0x92>
mov    -0x24(%rbp),%eax
mov    0x2d9e(%rip),%rcx
cmp    (%rcx),%eax
jle    1269 <main+0x99>
movl   $0x3e8,-0x24(%rbp)
jmp    126e <main+0x9e>
cmpl   $0x3,-0x8(%rbp)
jl     12a8 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jl     129c <main+0xcc>
cmpl   $0xa,-0x30(%rbp)
jle    12a3 <main+0xd3>
movl   $0x5,-0x30(%rbp)
jmp    12a8 <main+0xd8>
cmpl   $0x4,-0x8(%rbp)
jl     12dc <main+0x10c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xa4(%rbp)
cmp    $0x0,%eax
jle    12d7 <main+0x107>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    12dc <main+0x10c>
cmpl   $0x0,-0x50(%rbp)
jle    12f7 <main+0x127>
mov    -0x50(%rbp),%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x50(%rbp)
jle    130d <main+0x13d>
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    134a <main+0x17a>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
lea    0xcd8(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16c7 <main+0x4f7>
cmpl   $0x0,-0x50(%rbp)
jle    136e <main+0x19e>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xcc5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x50(%rbp)
jle    1384 <main+0x1b4>
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    13ae <main+0x1de>
movslq -0x14(%rbp),%rax
movb   $0x39,-0x4a(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    138b <main+0x1bb>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    143e <main+0x26e>
mov    $0x0,%al
call   10f0 <rand@plt>
mov    %eax,-0xac(%rbp)
lea    -0x4a(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   10b0 <strtoul@plt>
mov    %eax,%ecx
mov    -0xac(%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    142b <main+0x25b>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
jmp    1430 <main+0x260>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13c5 <main+0x1f5>
cmpl   $0x0,-0x50(%rbp)
jle    1462 <main+0x292>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xbe9(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x50(%rbp)
jle    1478 <main+0x2a8>
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    14a3 <main+0x2d3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    147e <main+0x2ae>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x50(%rbp)
jle    14d0 <main+0x300>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
subsd  -0x40(%rbp),%xmm0
lea    0xb94(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x50(%rbp)
jle    1532 <main+0x362>
lea    -0xa0(%rbp),%rdi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xb87(%rip),%rsi
call   10e0 <sprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    152d <main+0x35d>
lea    -0xa0(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14fa <main+0x32a>
jmp    1532 <main+0x362>
cmpl   $0x0,-0x50(%rbp)
jle    154a <main+0x37a>
lea    0xb39(%rip),%rdi
mov    $0x0,%al
call   1040 <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    -0x50(%rbp),%ecx
call   1060 <radixsort_serial@plt>
cmpl   $0x0,-0x50(%rbp)
jle    1580 <main+0x3b0>
lea    0xb18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
mov    -0xb4(%rbp),%esi
mov    -0xb0(%rbp),%edx
subsd  -0x40(%rbp),%xmm0
lea    0xaeb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x50(%rbp)
jle    161a <main+0x44a>
lea    -0xa0(%rbp),%rdi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xa9f(%rip),%rsi
call   10e0 <sprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1615 <main+0x445>
lea    -0xa0(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    15e2 <main+0x412>
jmp    161a <main+0x44a>
movl   $0x0,-0xa8(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    167a <main+0x4aa>
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    1667 <main+0x497>
movl   $0x1,-0xa8(%rbp)
jmp    167a <main+0x4aa>
jmp    166c <main+0x49c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    162b <main+0x45b>
cmpl   $0x0,-0xa8(%rbp)
je     169a <main+0x4ca>
lea    0xa19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16b7 <main+0x4e7>
cmpl   $0x0,-0x50(%rbp)
jle    16b2 <main+0x4e2>
lea    0xa12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    16b7 <main+0x4e7>
mov    -0x20(%rbp),%rdi
call   10c0 <cfree@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%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     12db <main+0xfb>
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10c0 <strtoul@plt>
mov    0x2dc7(%rip),%rcx
cmp    (%rcx),%eax
mov    $0x3e8,%ecx
mov    %eax,%ebx
cmovg  %ecx,%ebx
test   %eax,%eax
cmovs  %ecx,%ebx
cmp    $0x2,%ebp
je     12db <main+0xfb>
mov    0x10(%r15),%rdi
call   10e0 <atoi@plt>
cmp    $0xb,%eax
mov    $0x5,%r14d
cmovb  %eax,%r14d
cmp    $0x4,%ebp
jb     12db <main+0xfb>
mov    0x18(%r15),%rdi
call   10e0 <atoi@plt>
test   %eax,%eax
jle    12db <main+0xfb>
mov    %eax,%ebp
lea    0xd84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
test   %rax,%rax
je     13a3 <main+0x1c3>
mov    %rax,%r13
mov    %ebp,0x4(%rsp)
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  0x10(%rsp),%xmm0
lea    0xd6a(%rip),%rdi
mov    $0x1,%bpl
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,0x8(%rsp)
jmp    12fd <main+0x11d>
mov    %ebx,%edi
mov    $0x4,%esi
call   1090 <calloc@plt>
test   %rax,%rax
je     13a3 <main+0x1c3>
mov    %rax,%r13
xor    %ebp,%ebp
movl   $0x0,0x4(%rsp)
mov    %ebp,0x10(%rsp)
test   %r14d,%r14d
je     1318 <main+0x138>
mov    %r14d,%edx
lea    0x20(%rsp),%rdi
mov    $0x39,%esi
call   1060 <memset@plt>
xor    %ebp,%ebp
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    %ebx,%r14d
mov    %ebx,0x1c(%rsp)
test   %ebx,%ebx
je     1375 <main+0x195>
lea    0x20(%rsp),%r12
xor    %r15d,%r15d
xor    %ebp,%ebp
nopl   (%rax)
xor    %eax,%eax
call   1100 <rand@plt>
mov    %eax,%ebx
mov    %r12,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10c0 <strtoul@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
lea    0x1(%rdx),%eax
mov    %eax,0x0(%r13,%r15,4)
cmp    %edx,%ebp
cmovle %eax,%ebp
add    $0x1,%r15
cmp    %r15,%r14
jne    1340 <main+0x160>
mov    0x10(%rsp),%r15d
test   %r15b,%r15b
je     13c2 <main+0x1e2>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  0x8(%rsp),%xmm0
lea    0xcb1(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
jmp    13c8 <main+0x1e8>
mov    0x2c2e(%rip),%rax
mov    (%rax),%edi
lea    0xc5e(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%eax
jmp    155f <main+0x37f>
movsd  0x8(%rsp),%xmm0
mov    $0x1,%ebx
cmp    $0xa,%ebp
jl     13f4 <main+0x214>
mov    $0x1,%ebx
mov    $0xcccccccd,%eax
nopl   0x0(%rax)
mov    %ebp,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    $0x1,%ebx
cmp    $0x63,%ebp
mov    %ecx,%ebp
ja     13e0 <main+0x200>
test   %r15b,%r15b
mov    0x1c(%rsp),%r15d
je     141f <main+0x23f>
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
call   1040 <omp_get_wtime@plt>
subsd  0x8(%rsp),%xmm0
lea    0xc45(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     1468 <main+0x288>
lea    0x1(%rbx),%edx
lea    0xc45(%rip),%rsi
lea    0x30(%rsp),%rdi
call   10f0 <sprintf@plt>
test   %r15d,%r15d
je     1468 <main+0x288>
lea    0x30(%rsp),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%r13,%rbp,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1450 <main+0x270>
mov    0x10(%rsp),%r12d
test   %r12b,%r12b
je     147e <main+0x29e>
lea    0xc41(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    0x4(%rsp),%ebp
mov    %ebp,%ecx
call   1070 <radixsort_serial@plt>
test   %r12b,%r12b
je     14af <main+0x2cf>
lea    0xc06(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  0x8(%rsp),%xmm0
lea    0xbb9(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    $0x1,%al
call   1050 <printf@plt>
cmp    $0x2,%ebp
jl     1518 <main+0x338>
add    $0x1,%ebx
lea    0xb97(%rip),%rsi
lea    0x30(%rsp),%rdi
mov    %ebx,%edx
call   10f0 <sprintf@plt>
test   %r15d,%r15d
je     1544 <main+0x364>
lea    0x30(%rsp),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1500 <main+0x320>
cmp    $0x2,%r15d
jl     1544 <main+0x364>
mov    0x0(%r13),%eax
mov    $0x1,%ecx
lea    0xb6d(%rip),%rdi
xchg   %ax,%ax
mov    %eax,%edx
mov    0x0(%r13,%rcx,4),%eax
cmp    %edx,%eax
jl     1550 <main+0x370>
add    $0x1,%rcx
cmp    %rcx,%r14
jne    1530 <main+0x350>
test   %r12b,%r12b
je     1555 <main+0x375>
lea    0xb37(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   10d0 <cfree@plt>
xor    %eax,%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"
@stderr = global i32 0
@.str.1 = [27 x i8] c"ERROR: not enough memory!\0A\00"
@.str.2 = [24 x i8] c"INPUT ALLOCATION\09\09\09%lf\0A\00"
@.str.3 = [25 x i8] c"RANDOM GENERATION\09\09\09%lf\0A\00"
@.str.4 = [24 x i8] c"CALCULATION OF K\09\09\09%lf\0A\00"
@.str.5 = [7 x i8] c"%%%iu\0A\00"
@.str.6 = [21 x i8] c"START RADIX SORTING\0A\00"
@.str.7 = [11 x i8] c"K\09\09N\09TIME\0A\00"
@.str.8 = [11 x i8] c"%i\09%8u\09%f\0A\00"
@.str.9 = [22 x i8] c"ORDERED CHECK: FAIL!\0A\00"
@.str.10 = [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 [80 x i8]
%17 = alloca i32
%18 = 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
%19 = bitcast [10 x i8]* %14 to i8*
store i32 0, i32* %15
%20 = load i32, i32* %4
%21 = icmp sge i32 %20, 2
br i1 %21, label %22, label %35
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strtoul(i8* %25, i32* null, i32 10)
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = icmp slt i32 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %22
%30 = load i32, i32* %8
%31 = load i32, i32* @UINT32_MAX
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %29, %22
store i32 1000, i32* %8
br label %34
34: ; preds = %33, %29
br label %35
35: ; preds = %34, %2
%36 = load i32, i32* %4
%37 = icmp sge i32 %36, 3
br i1 %37, label %38, label %50
38: ; preds = %35
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 @atoi(i8* %41)
store i32 %42, i32* %11
%43 = load i32, i32* %11
%44 = icmp slt i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %38
%46 = load i32, i32* %11
%47 = icmp sgt i32 %46, 10
br i1 %47, label %48, label %49
48: ; preds = %45, %38
store i32 5, i32* %11
br label %49
49: ; preds = %48, %45
br label %50
50: ; preds = %49, %35
%51 = load i32, i32* %4
%52 = icmp sge i32 %51, 4
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 3
%56 = load i8*, i8** %55
%57 = call i32 @atoi(i8* %56)
store i32 %57, i32* %17
%58 = icmp sgt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %53
%60 = load i32, i32* %17
store i32 %60, i32* %15
br label %61
61: ; preds = %59, %53
br label %62
62: ; preds = %61, %50
%63 = load i32, i32* %15
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i32, i32* %15
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %65, %62
%69 = load i32, i32* %15
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = call double (...) @omp_get_wtime()
store double %72, double* %13
br label %73
73: ; preds = %71, %68
%74 = load i32, i32* %8
%75 = call i64 @calloc(i32 %74, i32 4)
%76 = inttoptr i64 %75 to i32*
store i32* %76, i32** %7
%77 = load i32*, i32** %7
%78 = icmp ne i32* %77, null
br i1 %78, label %82, label %79
79: ; preds = %73
%80 = load i32, i32* @stderr
%81 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %280
82: ; preds = %73
%83 = load i32, i32* %15
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %90
85: ; preds = %82
%86 = call double (...) @omp_get_wtime()
%87 = load double, double* %13
%88 = fsub double %86, %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %88)
br label %90
90: ; preds = %85, %82
%91 = load i32, i32* %15
%92 = icmp sgt i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %90
%94 = call double (...) @omp_get_wtime()
store double %94, double* %13
br label %95
95: ; preds = %93, %90
store i32 0, i32* %6
br label %96
96: ; preds = %104, %95
%97 = load i32, i32* %6
%98 = load i32, i32* %11
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %107
100: ; preds = %96
%101 = load i32, i32* %6
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 %102
store i8 57, i8* %103
br label %104
104: ; preds = %100
%105 = load i32, i32* %6
%106 = add nsw i32 %105, 1
store i32 %106, i32* %6
br label %96
107: ; preds = %96
%108 = call i32 @time(i32* null)
%109 = call i32 @srand(i32 %108)
store i32 0, i32* %6
br label %110
110: ; preds = %138, %107
%111 = load i32, i32* %6
%112 = load i32, i32* %8
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %141
114: ; preds = %110
%115 = call i32 (...) @rand()
%116 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%117 = call i32 @strtoul(i8* %116, i32* null, i32 10)
%118 = srem i32 %115, %117
%119 = add nsw i32 %118, 1
%120 = load i32*, i32** %7
%121 = load i32, i32* %6
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i32, i32* %120, i64 %122
store i32 %119, i32* %123
%124 = load i32, i32* %9
%125 = load i32*, i32** %7
%126 = load i32, i32* %6
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32, i32* %125, i64 %127
%129 = load i32, i32* %128
%130 = icmp slt i32 %124, %129
br i1 %130, label %131, label %137
131: ; preds = %114
%132 = load i32*, i32** %7
%133 = load i32, i32* %6
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i32, i32* %132, i64 %134
%136 = load i32, i32* %135
store i32 %136, i32* %9
br label %137
137: ; preds = %131, %114
br label %138
138: ; preds = %137
%139 = load i32, i32* %6
%140 = add nsw i32 %139, 1
store i32 %140, i32* %6
br label %110
141: ; preds = %110
%142 = load i32, i32* %15
%143 = icmp sgt i32 %142, 0
br i1 %143, label %144, label %149
144: ; preds = %141
%145 = call double (...) @omp_get_wtime()
%146 = load double, double* %13
%147 = fsub double %145, %146
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), double %147)
br label %149
149: ; preds = %144, %141
%150 = load i32, i32* %15
%151 = icmp sgt i32 %150, 0
br i1 %151, label %152, label %154
152: ; preds = %149
%153 = call double (...) @omp_get_wtime()
store double %153, double* %13
br label %154
154: ; preds = %152, %149
%155 = load i32, i32* %9
store i32 %155, i32* %10
br label %156
156: ; preds = %160, %154
%157 = load i32, i32* %10
%158 = sdiv i32 %157, 10
store i32 %158, i32* %10
%159 = icmp sgt i32 %158, 0
br i1 %159, label %160, label %163
160: ; preds = %156
%161 = load i32, i32* %12
%162 = add nsw i32 %161, 1
store i32 %162, i32* %12
br label %156
163: ; preds = %156
%164 = load i32, i32* %12
%165 = add nsw i32 %164, 1
store i32 %165, i32* %12
%166 = load i32, i32* %15
%167 = icmp sgt i32 %166, 0
br i1 %167, label %168, label %173
168: ; preds = %163
%169 = call double (...) @omp_get_wtime()
%170 = load double, double* %13
%171 = fsub double %169, %170
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %171)
br label %173
173: ; preds = %168, %163
%174 = load i32, i32* %15
%175 = icmp sgt i32 %174, 1
br i1 %175, label %176, label %197
176: ; preds = %173
%177 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
%178 = load i32, i32* %12
%179 = add nsw i32 %178, 1
%180 = call i32 @sprintf(i8* %177, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %179)
store i32 0, i32* %6
br label %181
181: ; preds = %193, %176
%182 = load i32, i32* %6
%183 = load i32, i32* %8
%184 = icmp slt i32 %182, %183
br i1 %184, label %185, label %196
185: ; preds = %181
%186 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
%187 = load i32*, i32** %7
%188 = load i32, i32* %6
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32, i32* %187, i64 %189
%191 = load i32, i32* %190
%192 = call i32 (i8*, ...) @printf(i8* %186, i32 %191)
br label %193
193: ; preds = %185
%194 = load i32, i32* %6
%195 = add nsw i32 %194, 1
store i32 %195, i32* %6
br label %181
196: ; preds = %181
br label %197
197: ; preds = %196, %173
%198 = load i32, i32* %15
%199 = icmp sgt i32 %198, 0
br i1 %199, label %200, label %202
200: ; preds = %197
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %202
202: ; preds = %200, %197
%203 = call double (...) @omp_get_wtime()
store double %203, double* %13
%204 = load i32*, i32** %7
%205 = load i32, i32* %8
%206 = load i32, i32* %12
%207 = load i32, i32* %15
%208 = call i32 @radixsort_serial(i32* %204, i32 %205, i32 %206, i32 %207)
%209 = load i32, i32* %15
%210 = icmp sgt i32 %209, 0
br i1 %210, label %211, label %213
211: ; preds = %202
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %213
213: ; preds = %211, %202
%214 = load i32, i32* %12
%215 = load i32, i32* %8
%216 = call double (...) @omp_get_wtime()
%217 = load double, double* %13
%218 = fsub double %216, %217
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %214, i32 %215, double %218)
%220 = load i32, i32* %15
%221 = icmp sgt i32 %220, 1
br i1 %221, label %222, label %243
222: ; preds = %213
%223 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
%224 = load i32, i32* %12
%225 = add nsw i32 %224, 1
%226 = call i32 @sprintf(i8* %223, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %225)
store i32 0, i32* %6
br label %227
227: ; preds = %239, %222
%228 = load i32, i32* %6
%229 = load i32, i32* %8
%230 = icmp slt i32 %228, %229
br i1 %230, label %231, label %242
231: ; preds = %227
%232 = getelementptr inbounds [80 x i8], [80 x i8]* %16, i64 0, i64 0
%233 = load i32*, i32** %7
%234 = load i32, i32* %6
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds i32, i32* %233, i64 %235
%237 = load i32, i32* %236
%238 = call i32 (i8*, ...) @printf(i8* %232, i32 %237)
br label %239
239: ; preds = %231
%240 = load i32, i32* %6
%241 = add nsw i32 %240, 1
store i32 %241, i32* %6
br label %227
242: ; preds = %227
br label %243
243: ; preds = %242, %213
store i32 0, i32* %18
store i32 1, i32* %6
br label %244
244: ; preds = %263, %243
%245 = load i32, i32* %6
%246 = load i32, i32* %8
%247 = icmp slt i32 %245, %246
br i1 %247, label %248, label %266
248: ; preds = %244
%249 = load i32*, i32** %7
%250 = load i32, i32* %6
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds i32, i32* %249, i64 %251
%253 = load i32, i32* %252
%254 = load i32*, i32** %7
%255 = load i32, i32* %6
%256 = sub nsw i32 %255, 1
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds i32, i32* %254, i64 %257
%259 = load i32, i32* %258
%260 = icmp slt i32 %253, %259
br i1 %260, label %261, label %262
261: ; preds = %248
store i32 1, i32* %18
br label %266
262: ; preds = %248
br label %263
263: ; preds = %262
%264 = load i32, i32* %6
%265 = add nsw i32 %264, 1
store i32 %265, i32* %6
br label %244
266: ; preds = %261, %244
%267 = load i32, i32* %18
%268 = icmp ne i32 %267, 0
br i1 %268, label %269, label %271
269: ; preds = %266
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
br label %277
271: ; preds = %266
%272 = load i32, i32* %15
%273 = icmp sgt i32 %272, 0
br i1 %273, label %274, label %276
274: ; preds = %271
%275 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
br label %276
276: ; preds = %274, %271
br label %277
277: ; preds = %276, %269
%278 = load i32*, i32** %7
%279 = call i32 @cfree(i32* %278)
store i32 0, i32* %3
br label %280
280: ; preds = %277, %79
%281 = load i32, i32* %3
ret i32 %281
}

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