void assign_class_by_pam(int N_X, int K, double **EDM_LT_pam, int *center_id,
                         int *class_id) {
  int i;
  double *dys, *radus, *damer, *avsyl, *ttsyl, *obj;
  int *nsend, *nrepr, *nelem, *nisol;
  radus = allocate_double_1D(N_X);
  damer = allocate_double_1D(N_X);
  avsyl = allocate_double_1D(N_X);
  ttsyl = allocate_double_1D(1);
  obj = allocate_double_1D(2);
  nsend = allocate_int_1D(N_X);
  nrepr = allocate_int_1D(N_X);
  nelem = allocate_int_1D(N_X);
  nisol = allocate_int_1D(1);
  dys = EDM_LT_pam[0] - 1;
  for (i = 0; i < N_X; i++) {
    nsend[i] = nrepr[i] = nelem[i] = class_id[i] = 0;
    radus[i] = damer[i] = avsyl[i] = 0;
  }
  for (i = 0; i < K; i++) {
    center_id[i] = 0;
  }
  ttsyl[0] = 0;
  obj[0] = obj[1] = 0;
  nisol[0] = 1;
  phyclust_pam(N_X, K, dys, nsend, nrepr, nelem, radus, damer, avsyl, ttsyl,
               obj, center_id, class_id, nisol);
  for (i = 0; i < N_X; i++) {
    class_id[i]--;
  }
  for (i = 0; i < K; i++) {
    center_id[i]--;
  }
  free(radus);
  free(damer);
  free(avsyl);
  free(ttsyl);
  free(obj);
  free(nsend);
  free(nrepr);
  free(nelem);
  free(nisol);
}


x86 assembly (clang, -O0):
<assign_class_by_pam>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %edi,-0x2c(%rbp)
mov    %esi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x0,%al
call   1060 <allocate_double_1D@plt>
cltq
mov    %rax,-0x60(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x0,%al
call   1060 <allocate_double_1D@plt>
cltq
mov    %rax,-0x68(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x0,%al
call   1060 <allocate_double_1D@plt>
cltq
mov    %rax,-0x70(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <allocate_double_1D@plt>
cltq
mov    %rax,-0x78(%rbp)
mov    $0x2,%edi
mov    $0x0,%al
call   1060 <allocate_double_1D@plt>
cltq
mov    %rax,-0x80(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x0,%al
call   1050 <allocate_int_1D@plt>
cltq
mov    %rax,-0x88(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x0,%al
call   1050 <allocate_int_1D@plt>
cltq
mov    %rax,-0x90(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x0,%al
call   1050 <allocate_int_1D@plt>
cltq
mov    %rax,-0x98(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <allocate_int_1D@plt>
cltq
mov    %rax,-0xa0(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12ad <assign_class_by_pam+0x16d>
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x98(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x90(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x88(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x70(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x60(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    121e <assign_class_by_pam+0xde>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    12dd <assign_class_by_pam+0x19d>
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12b4 <assign_class_by_pam+0x174>
mov    -0x78(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x80(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x80(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0xa0(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x58(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x90(%rbp),%r8
mov    -0x98(%rbp),%r9
mov    -0x60(%rbp),%r13
mov    -0x68(%rbp),%r12
mov    -0x70(%rbp),%r15
mov    -0x78(%rbp),%r14
mov    -0x80(%rbp),%rbx
mov    -0x40(%rbp),%r11
mov    -0x48(%rbp),%r10
mov    -0xa0(%rbp),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
mov    $0x0,%al
call   1040 <phyclust_pam@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13ae <assign_class_by_pam+0x26e>
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1383 <assign_class_by_pam+0x243>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    13e0 <assign_class_by_pam+0x2a0>
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0xffffffff,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13b5 <assign_class_by_pam+0x275>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa0(%rbp),%rdi
call   1030 <free@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_class_by_pam>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8,%r15
mov    %rcx,%r13
mov    %rdx,0x8(%rsp)
mov    %esi,0x4(%rsp)
mov    %edi,%r12d
xor    %eax,%eax
call   1070 <allocate_double_1D@plt>
cltq
mov    %rax,0x28(%rsp)
mov    %r12d,%edi
xor    %eax,%eax
call   1070 <allocate_double_1D@plt>
cltq
mov    %rax,0x48(%rsp)
mov    %r12d,%edi
xor    %eax,%eax
call   1070 <allocate_double_1D@plt>
cltq
mov    %rax,0x20(%rsp)
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <allocate_double_1D@plt>
mov    %eax,0x18(%rsp)
mov    $0x2,%edi
xor    %eax,%eax
call   1070 <allocate_double_1D@plt>
mov    %eax,0x10(%rsp)
mov    %r12d,%edi
xor    %eax,%eax
call   1060 <allocate_int_1D@plt>
movslq %eax,%r14
mov    %r12d,%edi
xor    %eax,%eax
call   1060 <allocate_int_1D@plt>
movslq %eax,%rbx
mov    %r12d,%edi
xor    %eax,%eax
call   1060 <allocate_int_1D@plt>
movslq %eax,%rbp
mov    $0x1,%edi
xor    %eax,%eax
call   1060 <allocate_int_1D@plt>
mov    %rbx,%r8
mov    %r14,%rcx
mov    0x20(%rsp),%r10
mov    0x48(%rsp),%rbx
mov    0x28(%rsp),%r14
mov    0x8(%rsp),%rdx
mov    (%rdx),%r9
mov    %r12d,%edi
mov    %r12d,0x34(%rsp)
test   %r12d,%r12d
jle    1270 <assign_class_by_pam+0x120>
lea    0x0(,%rdi,4),%rsi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movl   $0x0,(%r15,%rdx,1)
movl   $0x0,0x0(%rbp,%rdx,1)
movl   $0x0,(%r8,%rdx,1)
movl   $0x0,(%rcx,%rdx,1)
movq   $0x0,(%r10,%rdx,2)
movq   $0x0,(%rbx,%rdx,2)
movq   $0x0,(%r14,%rdx,2)
add    $0x4,%rdx
cmp    %rdx,%rsi
jne    1230 <assign_class_by_pam+0xe0>
mov    %rdi,0x58(%rsp)
mov    %rbp,0x40(%rsp)
movslq 0x18(%rsp),%rdx
mov    %rdx,0x8(%rsp)
movslq 0x10(%rsp),%rdx
mov    %rdx,0x10(%rsp)
cltq
mov    %rax,0x18(%rsp)
add    $0xfffffffffffffff8,%r9
mov    0x4(%rsp),%esi
mov    %esi,%r12d
test   %esi,%esi
mov    %r8,0x38(%rsp)
jle    12da <assign_class_by_pam+0x18a>
lea    0x0(,%r12,4),%rdx
mov    %r13,%rdi
xor    %esi,%esi
mov    %rcx,%rbp
mov    %r9,%r14
call   1040 <memset@plt>
mov    %r14,%r9
mov    0x4(%rsp),%esi
mov    0x38(%rsp),%r8
mov    %rbp,%rcx
mov    0x20(%rsp),%r10
mov    0x28(%rsp),%r14
mov    0x8(%rsp),%rax
movq   $0x0,(%rax)
pxor   %xmm0,%xmm0
mov    0x10(%rsp),%rbp
movdqu %xmm0,0x0(%rbp)
mov    0x18(%rsp),%r11
movl   $0x1,(%r11)
mov    %r12,0x50(%rsp)
mov    0x34(%rsp),%r12d
mov    %r12d,%edi
mov    %r9,%rdx
mov    %rcx,0x60(%rsp)
mov    0x40(%rsp),%r9
xor    %eax,%eax
push   %r11
push   %r15
push   %r13
push   %rbp
push   0x28(%rsp)
push   %r10
push   %rbx
push   %r14
call   1050 <phyclust_pam@plt>
add    $0x40,%rsp
test   %r12d,%r12d
mov    0x50(%rsp),%rbp
mov    0x58(%rsp),%rdi
jle    140e <assign_class_by_pam+0x2be>
cmp    $0x8,%r12d
jae    1355 <assign_class_by_pam+0x205>
xor    %eax,%eax
jmp    1400 <assign_class_by_pam+0x2b0>
mov    %edi,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rcx
mov    %rcx,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     1560 <assign_class_by_pam+0x410>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
pcmpeqd %xmm0,%xmm0
nop
movdqu (%r15,%rcx,4),%xmm1
movdqu 0x10(%r15,%rcx,4),%xmm2
movdqu 0x20(%r15,%rcx,4),%xmm3
movdqu 0x30(%r15,%rcx,4),%xmm4
paddd  %xmm0,%xmm1
paddd  %xmm0,%xmm2
movdqu %xmm1,(%r15,%rcx,4)
movdqu %xmm2,0x10(%r15,%rcx,4)
paddd  %xmm0,%xmm3
paddd  %xmm0,%xmm4
movdqu %xmm3,0x20(%r15,%rcx,4)
movdqu %xmm4,0x30(%r15,%rcx,4)
add    $0x10,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1380 <assign_class_by_pam+0x230>
test   $0x1,%dl
je     13fb <assign_class_by_pam+0x2ab>
movdqu (%r15,%rcx,4),%xmm0
movdqu 0x10(%r15,%rcx,4),%xmm1
pcmpeqd %xmm2,%xmm2
paddd  %xmm2,%xmm0
paddd  %xmm2,%xmm1
movdqu %xmm0,(%r15,%rcx,4)
movdqu %xmm1,0x10(%r15,%rcx,4)
cmp    %rdi,%rax
je     140e <assign_class_by_pam+0x2be>
addl   $0xffffffff,(%r15,%rax,4)
add    $0x1,%rax
cmp    %rax,%rdi
jne    1400 <assign_class_by_pam+0x2b0>
mov    0x4(%rsp),%eax
test   %eax,%eax
mov    0x28(%rsp),%rdi
mov    0x40(%rsp),%rbx
jle    14ff <assign_class_by_pam+0x3af>
cmp    $0x8,%eax
jae    1430 <assign_class_by_pam+0x2e0>
xor    %eax,%eax
jmp    14f0 <assign_class_by_pam+0x3a0>
mov    %ebp,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rcx
mov    %rcx,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     1570 <assign_class_by_pam+0x420>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
pcmpeqd %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movdqu 0x0(%r13,%rcx,4),%xmm1
movdqu 0x10(%r13,%rcx,4),%xmm2
movdqu 0x20(%r13,%rcx,4),%xmm3
movdqu 0x30(%r13,%rcx,4),%xmm4
paddd  %xmm0,%xmm1
paddd  %xmm0,%xmm2
movdqu %xmm1,0x0(%r13,%rcx,4)
movdqu %xmm2,0x10(%r13,%rcx,4)
paddd  %xmm0,%xmm3
paddd  %xmm0,%xmm4
movdqu %xmm3,0x20(%r13,%rcx,4)
movdqu %xmm4,0x30(%r13,%rcx,4)
add    $0x10,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1460 <assign_class_by_pam+0x310>
test   $0x1,%dl
je     14df <assign_class_by_pam+0x38f>
movdqu 0x0(%r13,%rcx,4),%xmm0
movdqu 0x10(%r13,%rcx,4),%xmm1
pcmpeqd %xmm2,%xmm2
paddd  %xmm2,%xmm0
paddd  %xmm2,%xmm1
movdqu %xmm0,0x0(%r13,%rcx,4)
movdqu %xmm1,0x10(%r13,%rcx,4)
cmp    %rbp,%rax
je     14ff <assign_class_by_pam+0x3af>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addl   $0xffffffff,0x0(%r13,%rax,4)
add    $0x1,%rax
cmp    %rax,%rbp
jne    14f0 <assign_class_by_pam+0x3a0>
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x60(%rsp),%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
xor    %ecx,%ecx
test   $0x1,%dl
jne    13d5 <assign_class_by_pam+0x285>
jmp    13fb <assign_class_by_pam+0x2ab>
xor    %ecx,%ecx
test   $0x1,%dl
jne    14b7 <assign_class_by_pam+0x367>
jmp    14df <assign_class_by_pam+0x38f>

LLVM IR (-O0):
define void @assign_class_by_pam(i32 %0, i32 %1, double** %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double**
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store double** %2, double*** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%22 = load i32, i32* %6
%23 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to double*
store double* %25, double** %13
%26 = load i32, i32* %6
%27 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 %26)
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to double*
store double* %29, double** %14
%30 = load i32, i32* %6
%31 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 %30)
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to double*
store double* %33, double** %15
%34 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 1)
%35 = sext i32 %34 to i64
%36 = inttoptr i64 %35 to double*
store double* %36, double** %16
%37 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 2)
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to double*
store double* %39, double** %17
%40 = load i32, i32* %6
%41 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 %40)
%42 = sext i32 %41 to i64
%43 = inttoptr i64 %42 to i32*
store i32* %43, i32** %18
%44 = load i32, i32* %6
%45 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 %44)
%46 = sext i32 %45 to i64
%47 = inttoptr i64 %46 to i32*
store i32* %47, i32** %19
%48 = load i32, i32* %6
%49 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 %48)
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i32*
store i32* %51, i32** %20
%52 = call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 1)
%53 = sext i32 %52 to i64
%54 = inttoptr i64 %53 to i32*
store i32* %54, i32** %21
%55 = load double**, double*** %8
%56 = getelementptr inbounds double*, double** %55, i64 0
%57 = load double*, double** %56
%58 = getelementptr inbounds double, double* %57, i64 -1
store double* %58, double** %12
store i32 0, i32* %11
br label %59
59: ; preds = %92, %5
%60 = load i32, i32* %11
%61 = load i32, i32* %6
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %95
63: ; preds = %59
%64 = load i32*, i32** %10
%65 = load i32, i32* %11
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %64, i64 %66
store i32 0, i32* %67
%68 = load i32*, i32** %20
%69 = load i32, i32* %11
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %68, i64 %70
store i32 0, i32* %71
%72 = load i32*, i32** %19
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %72, i64 %74
store i32 0, i32* %75
%76 = load i32*, i32** %18
%77 = load i32, i32* %11
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %76, i64 %78
store i32 0, i32* %79
%80 = load double*, double** %15
%81 = load i32, i32* %11
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
store double 0.000000e+00, double* %83
%84 = load double*, double** %14
%85 = load i32, i32* %11
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
store double 0.000000e+00, double* %87
%88 = load double*, double** %13
%89 = load i32, i32* %11
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
store double 0.000000e+00, double* %91
br label %92
92: ; preds = %63
%93 = load i32, i32* %11
%94 = add nsw i32 %93, 1
store i32 %94, i32* %11
br label %59
95: ; preds = %59
store i32 0, i32* %11
br label %96
96: ; preds = %105, %95
%97 = load i32, i32* %11
%98 = load i32, i32* %7
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %108
100: ; preds = %96
%101 = load i32*, i32** %9
%102 = load i32, i32* %11
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %101, i64 %103
store i32 0, i32* %104
br label %105
105: ; preds = %100
%106 = load i32, i32* %11
%107 = add nsw i32 %106, 1
store i32 %107, i32* %11
br label %96
108: ; preds = %96
%109 = load double*, double** %16
%110 = getelementptr inbounds double, double* %109, i64 0
store double 0.000000e+00, double* %110
%111 = load double*, double** %17
%112 = getelementptr inbounds double, double* %111, i64 1
store double 0.000000e+00, double* %112
%113 = load double*, double** %17
%114 = getelementptr inbounds double, double* %113, i64 0
store double 0.000000e+00, double* %114
%115 = load i32*, i32** %21
%116 = getelementptr inbounds i32, i32* %115, i64 0
store i32 1, i32* %116
%117 = load i32, i32* %6
%118 = load i32, i32* %7
%119 = load double*, double** %12
%120 = load i32*, i32** %18
%121 = load i32*, i32** %19
%122 = load i32*, i32** %20
%123 = load double*, double** %13
%124 = load double*, double** %14
%125 = load double*, double** %15
%126 = load double*, double** %16
%127 = load double*, double** %17
%128 = load i32*, i32** %9
%129 = load i32*, i32** %10
%130 = load i32*, i32** %21
%131 = call i32 (i32, i32, double*, i32*, i32*, i32*, double*, double*, double*, double*, double*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @phyclust_pam to i32 (i32, i32, double*, i32*, i32*, i32*, double*, double*, double*, double*, double*, i32*, i32*, i32*, ...)*)(i32 %117, i32 %118, double* %119, i32* %120, i32* %121, i32* %122, double* %123, double* %124, double* %125, double* %126, double* %127, i32* %128, i32* %129, i32* %130)
store i32 0, i32* %11
br label %132
132: ; preds = %143, %108
%133 = load i32, i32* %11
%134 = load i32, i32* %6
%135 = icmp slt i32 %133, %134
br i1 %135, label %136, label %146
136: ; preds = %132
%137 = load i32*, i32** %10
%138 = load i32, i32* %11
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %137, i64 %139
%141 = load i32, i32* %140
%142 = add nsw i32 %141, -1
store i32 %142, i32* %140
br label %143
143: ; preds = %136
%144 = load i32, i32* %11
%145 = add nsw i32 %144, 1
store i32 %145, i32* %11
br label %132
146: ; preds = %132
store i32 0, i32* %11
br label %147
147: ; preds = %158, %146
%148 = load i32, i32* %11
%149 = load i32, i32* %7
%150 = icmp slt i32 %148, %149
br i1 %150, label %151, label %161
151: ; preds = %147
%152 = load i32*, i32** %9
%153 = load i32, i32* %11
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i32, i32* %152, i64 %154
%156 = load i32, i32* %155
%157 = add nsw i32 %156, -1
store i32 %157, i32* %155
br label %158
158: ; preds = %151
%159 = load i32, i32* %11
%160 = add nsw i32 %159, 1
store i32 %160, i32* %11
br label %147
161: ; preds = %147
%162 = load double*, double** %13
%163 = bitcast double* %162 to i8*
%164 = load double*, double** %14
%165 = bitcast double* %164 to i8*
%166 = load double*, double** %15
%167 = bitcast double* %166 to i8*
%168 = load double*, double** %16
%169 = bitcast double* %168 to i8*
%170 = load double*, double** %17
%171 = bitcast double* %170 to i8*
%172 = load i32*, i32** %18
%173 = bitcast i32* %172 to i8*
%174 = load i32*, i32** %19
%175 = bitcast i32* %174 to i8*
%176 = load i32*, i32** %20
%177 = bitcast i32* %176 to i8*
%178 = load i32*, i32** %21
%179 = bitcast i32* %178 to i8*
ret void
}

LLVM IR (-O2):
define void @assign_class_by_pam(i32 %0, i32 %1, double** nocapture %2, i32* %3, i32* %4) {
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 %0)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to double*
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 %0)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to double*
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 %0)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to double*
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 1)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to double*
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_double_1D to i32 (i32, ...)*)(i32 2)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to double*
%22 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 %0)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 %0)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 %0)
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @allocate_int_1D to i32 (i32, ...)*)(i32 1)
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
%34 = load double*, double** %2
%35 = getelementptr inbounds double, double* %34, i64 -1
%36 = icmp sgt i32 %0, 0
br i1 %36, label %37, label %39
37: ; preds = %5
%38 = zext i32 %0 to i64
br label %44
39: ; preds = %44, %5
%40 = icmp sgt i32 %1, 0
br i1 %40, label %41, label %55
41: ; preds = %39
%42 = zext i32 %1 to i64
%43 = shl nuw nsw i64 %42, 2
br label %55
44: ; preds = %37, %44
%45 = phi i64 [ 0, %37 ], [ %53, %44 ]
%46 = getelementptr inbounds i32, i32* %4, i64 %45
store i32 0, i32* %46
%47 = getelementptr inbounds i32, i32* %30, i64 %45
store i32 0, i32* %47
%48 = getelementptr inbounds i32, i32* %27, i64 %45
store i32 0, i32* %48
%49 = getelementptr inbounds i32, i32* %24, i64 %45
store i32 0, i32* %49
%50 = getelementptr inbounds double, double* %15, i64 %45
store double 0.000000e+00, double* %50
%51 = getelementptr inbounds double, double* %12, i64 %45
store double 0.000000e+00, double* %51
%52 = getelementptr inbounds double, double* %9, i64 %45
store double 0.000000e+00, double* %52
%53 = add nuw nsw i64 %45, 1
%54 = icmp eq i64 %53, %38
br i1 %54, label %39, label %44
55: ; preds = %41, %39
store double 0.000000e+00, double* %18
%56 = inttoptr i64 %20 to i8*
store i32 1, i32* %33
%57 = tail call i32 (i32, i32, double*, i32*, i32*, i32*, double*, double*, double*, double*, double*, i32*, i32*, i32*, ...) bitcast (i32 (...)* @phyclust_pam to i32 (i32, i32, double*, i32*, i32*, i32*, double*, double*, double*, double*, double*, i32*, i32*, i32*, ...)*)(i32 %0, i32 %1, double* %35, i32* %24, i32* %27, i32* %30, double* %9, double* %12, double* %15, double* %18, double* %21, i32* %3, i32* %4, i32* %33)
br i1 %36, label %58, label %115
58: ; preds = %55
%59 = zext i32 %0 to i64
%60 = icmp ult i32 %0, 8
br i1 %60, label %113, label %61
61: ; preds = %58
%62 = and i64 %59, 4294967288
%63 = add nsw i64 %62, -8
%64 = lshr exact i64 %63, 3
%65 = add nuw nsw i64 %64, 1
%66 = and i64 %65, 1
%67 = icmp eq i64 %63, 0
br i1 %67, label %97, label %68
68: ; preds = %61
%69 = and i64 %65, 4611686018427387902
br label %70
70: ; preds = %70, %68
%71 = phi i64 [ 0, %68 ], [ %94, %70 ]
%72 = phi i64 [ 0, %68 ], [ %95, %70 ]
%73 = getelementptr inbounds i32, i32* %4, i64 %71
%74 = bitcast i32* %73 to <4 x i32>*
%75 = load <4 x i32>, <4 x i32>* %74
%76 = getelementptr inbounds i32, i32* %73, i64 4
%77 = bitcast i32* %76 to <4 x i32>*
%78 = load <4 x i32>, <4 x i32>* %77
%79 = add nsw <4 x i32> %75, <i32 -1, i32 -1, i32 -1, i32 -1>
%80 = add nsw <4 x i32> %78, <i32 -1, i32 -1, i32 -1, i32 -1>
%81 = bitcast i32* %73 to <4 x i32>*
store <4 x i32> %79, <4 x i32>* %81
%82 = bitcast i32* %76 to <4 x i32>*
store <4 x i32> %80, <4 x i32>* %82
%83 = or i64 %71, 8
%84 = getelementptr inbounds i32, i32* %4, i64 %83
%85 = bitcast i32* %84 to <4 x i32>*
%86 = load <4 x i32>, <4 x i32>* %85
%87 = getelementptr inbounds i32, i32* %84, i64 4
%88 = bitcast i32* %87 to <4 x i32>*
%89 = load <4 x i32>, <4 x i32>* %88
%90 = add nsw <4 x i32> %86, <i32 -1, i32 -1, i32 -1, i32 -1>
%91 = add nsw <4 x i32> %89, <i32 -1, i32 -1, i32 -1, i32 -1>
%92 = bitcast i32* %84 to <4 x i32>*
store <4 x i32> %90, <4 x i32>* %92
%93 = bitcast i32* %87 to <4 x i32>*
store <4 x i32> %91, <4 x i32>* %93
%94 = add nuw i64 %71, 16
%95 = add i64 %72, 2
%96 = icmp eq i64 %95, %69
br i1 %96, label %97, label %70
97: ; preds = %70, %61
%98 = phi i64 [ 0, %61 ], [ %94, %70 ]
%99 = icmp eq i64 %66, 0
br i1 %99, label %111, label %100
100: ; preds = %97
%101 = getelementptr inbounds i32, i32* %4, i64 %98
%102 = bitcast i32* %101 to <4 x i32>*
%103 = load <4 x i32>, <4 x i32>* %102
%104 = getelementptr inbounds i32, i32* %101, i64 4
%105 = bitcast i32* %104 to <4 x i32>*
%106 = load <4 x i32>, <4 x i32>* %105
%107 = add nsw <4 x i32> %103, <i32 -1, i32 -1, i32 -1, i32 -1>
%108 = add nsw <4 x i32> %106, <i32 -1, i32 -1, i32 -1, i32 -1>
%109 = bitcast i32* %101 to <4 x i32>*
store <4 x i32> %107, <4 x i32>* %109
%110 = bitcast i32* %104 to <4 x i32>*
store <4 x i32> %108, <4 x i32>* %110
br label %111
111: ; preds = %97, %100
%112 = icmp eq i64 %62, %59
br i1 %112, label %115, label %113
113: ; preds = %58, %111
%114 = phi i64 [ 0, %58 ], [ %62, %111 ]
br label %173
115: ; preds = %173, %111, %55
br i1 %40, label %116, label %187
116: ; preds = %115
%117 = zext i32 %1 to i64
%118 = icmp ult i32 %1, 8
br i1 %118, label %171, label %119
119: ; preds = %116
%120 = and i64 %117, 4294967288
%121 = add nsw i64 %120, -8
%122 = lshr exact i64 %121, 3
%123 = add nuw nsw i64 %122, 1
%124 = and i64 %123, 1
%125 = icmp eq i64 %121, 0
br i1 %125, label %155, label %126
126: ; preds = %119
%127 = and i64 %123, 4611686018427387902
br label %128
128: ; preds = %128, %126
%129 = phi i64 [ 0, %126 ], [ %152, %128 ]
%130 = phi i64 [ 0, %126 ], [ %153, %128 ]
%131 = getelementptr inbounds i32, i32* %3, i64 %129
%132 = bitcast i32* %131 to <4 x i32>*
%133 = load <4 x i32>, <4 x i32>* %132
%134 = getelementptr inbounds i32, i32* %131, i64 4
%135 = bitcast i32* %134 to <4 x i32>*
%136 = load <4 x i32>, <4 x i32>* %135
%137 = add nsw <4 x i32> %133, <i32 -1, i32 -1, i32 -1, i32 -1>
%138 = add nsw <4 x i32> %136, <i32 -1, i32 -1, i32 -1, i32 -1>
%139 = bitcast i32* %131 to <4 x i32>*
store <4 x i32> %137, <4 x i32>* %139
%140 = bitcast i32* %134 to <4 x i32>*
store <4 x i32> %138, <4 x i32>* %140
%141 = or i64 %129, 8
%142 = getelementptr inbounds i32, i32* %3, i64 %141
%143 = bitcast i32* %142 to <4 x i32>*
%144 = load <4 x i32>, <4 x i32>* %143
%145 = getelementptr inbounds i32, i32* %142, i64 4
%146 = bitcast i32* %145 to <4 x i32>*
%147 = load <4 x i32>, <4 x i32>* %146
%148 = add nsw <4 x i32> %144, <i32 -1, i32 -1, i32 -1, i32 -1>
%149 = add nsw <4 x i32> %147, <i32 -1, i32 -1, i32 -1, i32 -1>
%150 = bitcast i32* %142 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %150
%151 = bitcast i32* %145 to <4 x i32>*
store <4 x i32> %149, <4 x i32>* %151
%152 = add nuw i64 %129, 16
%153 = add i64 %130, 2
%154 = icmp eq i64 %153, %127
br i1 %154, label %155, label %128
155: ; preds = %128, %119
%156 = phi i64 [ 0, %119 ], [ %152, %128 ]
%157 = icmp eq i64 %124, 0
br i1 %157, label %169, label %158
158: ; preds = %155
%159 = getelementptr inbounds i32, i32* %3, i64 %156
%160 = bitcast i32* %159 to <4 x i32>*
%161 = load <4 x i32>, <4 x i32>* %160
%162 = getelementptr inbounds i32, i32* %159, i64 4
%163 = bitcast i32* %162 to <4 x i32>*
%164 = load <4 x i32>, <4 x i32>* %163
%165 = add nsw <4 x i32> %161, <i32 -1, i32 -1, i32 -1, i32 -1>
%166 = add nsw <4 x i32> %164, <i32 -1, i32 -1, i32 -1, i32 -1>
%167 = bitcast i32* %159 to <4 x i32>*
store <4 x i32> %165, <4 x i32>* %167
%168 = bitcast i32* %162 to <4 x i32>*
store <4 x i32> %166, <4 x i32>* %168
br label %169
169: ; preds = %155, %158
%170 = icmp eq i64 %120, %117
br i1 %170, label %187, label %171
171: ; preds = %116, %169
%172 = phi i64 [ 0, %116 ], [ %120, %169 ]
br label %180
173: ; preds = %113, %173
%174 = phi i64 [ %178, %173 ], [ %114, %113 ]
%175 = getelementptr inbounds i32, i32* %4, i64 %174
%176 = load i32, i32* %175
%177 = add nsw i32 %176, -1
store i32 %177, i32* %175
%178 = add nuw nsw i64 %174, 1
%179 = icmp eq i64 %178, %59
br i1 %179, label %115, label %173
180: ; preds = %171, %180
%181 = phi i64 [ %185, %180 ], [ %172, %171 ]
%182 = getelementptr inbounds i32, i32* %3, i64 %181
%183 = load i32, i32* %182
%184 = add nsw i32 %183, -1
store i32 %184, i32* %182
%185 = add nuw nsw i64 %181, 1
%186 = icmp eq i64 %185, %117
br i1 %186, label %187, label %180
187: ; preds = %180, %169, %115
%188 = inttoptr i64 %8 to i8*
tail call void @free(i8* %188)
%189 = inttoptr i64 %11 to i8*
tail call void @free(i8* %189)
%190 = inttoptr i64 %14 to i8*
tail call void @free(i8* %190)
%191 = inttoptr i64 %17 to i8*
tail call void @free(i8* %191)
%192 = inttoptr i64 %20 to i8*
tail call void @free(i8* %192)
%193 = inttoptr i64 %23 to i8*
tail call void @free(i8* %193)
%194 = inttoptr i64 %26 to i8*
tail call void @free(i8* %194)
%195 = inttoptr i64 %29 to i8*
tail call void @free(i8* %195)
%196 = inttoptr i64 %32 to i8*
tail call void @free(i8* %196)
ret void
}