#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ counting_sort(int *, int *, int *, int);
int getVal(int, size_t);
scalar_t__ pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int srcdata[10] = {838, 458, 977, 286, 842, 882, 817, 434, 557, 611};
  int testdata[10];
  int rtndata[10];
  int digit = 3;
  size_t idx, jdx;
  printf("The test data is:\n");
  for (idx = 0; idx < 10; idx++) {
    printf("%zu\t,%d,\n", idx, srcdata[idx]);
  }
  for (jdx = 0; jdx < digit; jdx++) {
    for (idx = 0; idx < 10; idx++) {
      testdata[idx] = getVal(srcdata[idx], jdx);
    }
    printf("For the %zuth digit sorting:\n", jdx);
    counting_sort(srcdata, testdata, rtndata, 10);
    for (idx = 0; idx < 10; idx++) {
      srcdata[idx] = rtndata[idx];
      printf("%zu\t,%d,\n", idx, rtndata[idx]);
    }
  }
  printf("For the final sorted data:\n");
  for (idx = 0; idx < 10; idx++) {
    printf("%zu\t,%d,\n", idx, srcdata[idx]);
  }
  printf("....%d\n", (int)pow(10, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x3,-0x94(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0xa0(%rbp)
cmpq   $0xa,-0xa0(%rbp)
0a
jae    11df <main+0x8f>
mov    -0xa0(%rbp),%rsi
mov    -0xa0(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    119a <main+0x4a>
movq   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
movslq -0x94(%rbp),%rcx
cmp    %rcx,%rax
jae    130b <main+0x1bb>
movq   $0x0,-0xa0(%rbp)
cmpq   $0xa,-0xa0(%rbp)
0a
jae    1255 <main+0x105>
mov    -0xa0(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
mov    -0xa8(%rbp),%rsi
call   1060 <getVal@plt>
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    120c <main+0xbc>
mov    -0xa8(%rbp),%rsi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    $0xa,%ecx
call   1040 <counting_sort@plt>
movq   $0x0,-0xa0(%rbp)
cmpq   $0xa,-0xa0(%rbp)
0a
jae    12ef <main+0x19f>
mov    -0xa0(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
mov    -0xa0(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0xa0(%rbp),%rsi
mov    -0xa0(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%edx
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    128e <main+0x13e>
jmp    12f4 <main+0x1a4>
mov    -0xa8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa8(%rbp)
jmp    11ea <main+0x9a>
lea    0xd51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0xa0(%rbp)
cmpq   $0xa,-0xa0(%rbp)
0a
jae    1369 <main+0x219>
mov    -0xa0(%rbp),%rsi
mov    -0xa0(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1324 <main+0x1d4>
mov    $0xa,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
mov    %eax,%esi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    0xeb8(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe91(%rip),%rbx
mov    $0x346,%r14d
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x346,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%esi
mov    %rbx,%rdi
mov    $0x1ca,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%esi
mov    %rbx,%rdi
mov    $0x3d1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%esi
mov    %rbx,%rdi
mov    $0x11e,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x4,%esi
mov    %rbx,%rdi
mov    $0x34a,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x5,%esi
mov    %rbx,%rdi
mov    $0x372,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6,%esi
mov    %rbx,%rdi
mov    $0x331,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x7,%esi
mov    %rbx,%rdi
mov    $0x1b2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x8,%esi
mov    %rbx,%rdi
mov    $0x22d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x9,%esi
mov    %rbx,%rdi
mov    $0x263,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r15
lea    0x60(%rsp),%r12
lea    0x30(%rsp),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x60(%rsp)
mov    0x4(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x64(%rsp)
mov    0x8(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x68(%rsp)
mov    0xc(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x6c(%rsp)
mov    0x10(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x70(%rsp)
mov    0x14(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x74(%rsp)
mov    0x18(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x78(%rsp)
mov    0x1c(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x7c(%rsp)
mov    0x20(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x80(%rsp)
mov    0x24(%rsp),%edi
mov    %rbp,%rsi
call   1060 <getVal@plt>
mov    %eax,0x84(%rsp)
lea    0xd06(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    $0xa,%ecx
call   1050 <counting_sort@plt>
mov    0x30(%rsp),%edx
mov    %edx,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%edx
mov    %edx,0x4(%rsp)
mov    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%edx
mov    %edx,0x8(%rsp)
mov    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp),%edx
mov    %edx,0xc(%rsp)
mov    $0x3,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rsp),%edx
mov    %edx,0x10(%rsp)
mov    $0x4,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%rsp),%edx
mov    %edx,0x14(%rsp)
mov    $0x5,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rsp),%edx
mov    %edx,0x18(%rsp)
mov    $0x6,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rsp),%edx
mov    %edx,0x1c(%rsp)
mov    $0x7,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rsp),%edx
mov    %edx,0x20(%rsp)
mov    $0x8,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x54(%rsp),%edx
mov    %edx,0x24(%rsp)
mov    $0x9,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%rbp
je     143e <main+0x2ee>
mov    (%rsp),%r14d
add    $0x1,%rbp
jmp    1280 <main+0x130>
lea    0xc25(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%edx
lea    0xbd4(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edx
mov    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
mov    $0x2,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    $0x3,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    $0x4,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%edx
mov    $0x5,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%edx
mov    $0x6,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%edx
mov    $0x7,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%edx
mov    $0x8,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%edx
mov    $0x9,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x3,%esi
call   1070 <pow@plt>
lea    0xb2f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.srcdata = [10 x i32] [i32 838, i32 458, i32 977, i32 286, i32 842, i32 882, i32 817, i32 434, i32 557, i32 611]
@.str = [19 x i8] c"The test data is:\0A\00"
@.str.1 = [10 x i8] c"%zu\09,%d,\0A\00"
@.str.2 = [30 x i8] c"For the %zuth digit sorting:\0A\00"
@.str.3 = [28 x i8] c"For the final sorted data:\0A\00"
@.str.4 = [8 x i8] c"....%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
%8 = bitcast [10 x i32]* %2 to i8*
store i32 3, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %6
br label %10
10: ; preds = %19, %0
%11 = load i64, i64* %6
%12 = icmp ult i64 %11, 10
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i64, i64* %6
%15 = load i64, i64* %6
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %14, i32 %17)
br label %19
19: ; preds = %13
%20 = load i64, i64* %6
%21 = add i64 %20, 1
store i64 %21, i64* %6
br label %10
22: ; preds = %10
store i64 0, i64* %7
br label %23
23: ; preds = %68, %22
%24 = load i64, i64* %7
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = icmp ult i64 %24, %26
br i1 %27, label %28, label %71
28: ; preds = %23
store i64 0, i64* %6
br label %29
29: ; preds = %40, %28
%30 = load i64, i64* %6
%31 = icmp ult i64 %30, 10
br i1 %31, label %32, label %43
32: ; preds = %29
%33 = load i64, i64* %6
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i64, i64* %7
%37 = call i32 @getVal(i32 %35, i64 %36)
%38 = load i64, i64* %6
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %38
store i32 %37, i32* %39
br label %40
40: ; preds = %32
%41 = load i64, i64* %6
%42 = add i64 %41, 1
store i64 %42, i64* %6
br label %29
43: ; preds = %29
%44 = load i64, i64* %7
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i64 %44)
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%49 = call i32 @counting_sort(i32* %46, i32* %47, i32* %48, i32 10)
store i64 0, i64* %6
br label %50
50: ; preds = %64, %43
%51 = load i64, i64* %6
%52 = icmp ult i64 %51, 10
br i1 %52, label %53, label %67
53: ; preds = %50
%54 = load i64, i64* %6
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = load i64, i64* %6
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %57
store i32 %56, i32* %58
%59 = load i64, i64* %6
%60 = load i64, i64* %6
%61 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %59, i32 %62)
br label %64
64: ; preds = %53
%65 = load i64, i64* %6
%66 = add i64 %65, 1
store i64 %66, i64* %6
br label %50
67: ; preds = %50
br label %68
68: ; preds = %67
%69 = load i64, i64* %7
%70 = add i64 %69, 1
store i64 %70, i64* %7
br label %23
71: ; preds = %23
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
store i64 0, i64* %6
br label %73
73: ; preds = %82, %71
%74 = load i64, i64* %6
%75 = icmp ult i64 %74, 10
br i1 %75, label %76, label %85
76: ; preds = %73
%77 = load i64, i64* %6
%78 = load i64, i64* %6
%79 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %77, i32 %80)
br label %82
82: ; preds = %76
%83 = load i64, i64* %6
%84 = add i64 %83, 1
store i64 %84, i64* %6
br label %73
85: ; preds = %73
%86 = call i64 @pow(i32 10, i32 3)
%87 = trunc i64 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %87)
ret i32 0
}

LLVM IR (-O2):
@__const.main.srcdata = [10 x i32] [i32 838, i32 458, i32 977, i32 286, i32 842, i32 882, i32 817, i32 434, i32 557, i32 611]
@.str.1 = [10 x i8] c"%zu\09,%d,\0A\00"
@.str.2 = [30 x i8] c"For the %zuth digit sorting:\0A\00"
@.str.4 = [8 x i8] c"....%d\0A\00"
@str = [18 x i8] c"The test data is:\00"
@str.5 = [27 x i8] c"For the final sorted data:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [10 x i32]* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 0, i32 838)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 1, i32 458)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 2, i32 977)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 3, i32 286)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 4, i32 842)
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 5, i32 882)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 6, i32 817)
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 7, i32 434)
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 8, i32 557)
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 9, i32 611)
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
br label %48
48: ; preds = %94, %0
%49 = phi i32 [ 838, %0 ], [ %95, %94 ]
%50 = phi i64 [ 0, %0 ], [ %92, %94 ]
%51 = call i32 @getVal(i32 %49, i64 %50)
store i32 %51, i32* %28
%52 = load i32, i32* %10
%53 = call i32 @getVal(i32 %52, i64 %50)
store i32 %53, i32* %30
%54 = load i32, i32* %12
%55 = call i32 @getVal(i32 %54, i64 %50)
store i32 %55, i32* %31
%56 = load i32, i32* %14
%57 = call i32 @getVal(i32 %56, i64 %50)
store i32 %57, i32* %32
%58 = load i32, i32* %16
%59 = call i32 @getVal(i32 %58, i64 %50)
store i32 %59, i32* %33
%60 = load i32, i32* %18
%61 = call i32 @getVal(i32 %60, i64 %50)
store i32 %61, i32* %34
%62 = load i32, i32* %20
%63 = call i32 @getVal(i32 %62, i64 %50)
store i32 %63, i32* %35
%64 = load i32, i32* %22
%65 = call i32 @getVal(i32 %64, i64 %50)
store i32 %65, i32* %36
%66 = load i32, i32* %24
%67 = call i32 @getVal(i32 %66, i64 %50)
store i32 %67, i32* %37
%68 = load i32, i32* %26
%69 = call i32 @getVal(i32 %68, i64 %50)
store i32 %69, i32* %38
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i64 %50)
%71 = call i32 @counting_sort(i32* %8, i32* %28, i32* %29, i32 10)
%72 = load i32, i32* %29
store i32 %72, i32* %8
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 0, i32 %72)
%74 = load i32, i32* %39
store i32 %74, i32* %10
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 1, i32 %74)
%76 = load i32, i32* %40
store i32 %76, i32* %12
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 2, i32 %76)
%78 = load i32, i32* %41
store i32 %78, i32* %14
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 3, i32 %78)
%80 = load i32, i32* %42
store i32 %80, i32* %16
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 4, i32 %80)
%82 = load i32, i32* %43
store i32 %82, i32* %18
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 5, i32 %82)
%84 = load i32, i32* %44
store i32 %84, i32* %20
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 6, i32 %84)
%86 = load i32, i32* %45
store i32 %86, i32* %22
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 7, i32 %86)
%88 = load i32, i32* %46
store i32 %88, i32* %24
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 8, i32 %88)
%90 = load i32, i32* %47
store i32 %90, i32* %26
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 9, i32 %90)
%92 = add nuw nsw i64 %50, 1
%93 = icmp eq i64 %92, 3
br i1 %93, label %96, label %94
94: ; preds = %48
%95 = load i32, i32* %8
br label %48
96: ; preds = %48
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%98 = load i32, i32* %8
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 0, i32 %98)
%100 = load i32, i32* %10
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 1, i32 %100)
%102 = load i32, i32* %12
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 2, i32 %102)
%104 = load i32, i32* %14
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 3, i32 %104)
%106 = load i32, i32* %16
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 4, i32 %106)
%108 = load i32, i32* %18
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 5, i32 %108)
%110 = load i32, i32* %20
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 6, i32 %110)
%112 = load i32, i32* %22
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 7, i32 %112)
%114 = load i32, i32* %24
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 8, i32 %114)
%116 = load i32, i32* %26
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 9, i32 %116)
%118 = call i64 @pow(i32 10, i32 3)
%119 = trunc i64 %118 to i32
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %119)
ret i32 0
}