#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*/ assign_class_id_compute_total_cost(int, int, double **,
                                                      int *, int *, double *);
int /*<<< orphan*/ classify_unique_by_EDM(int, int, double **, int, int *,
                                          int *, int *, int *);
int /*<<< orphan*/ srswor(int, int, int *);
void assign_class_unique_by_k_medoids(int N_X_org, int K, double **EDM, int N_X,
                                      int *map_X_to_X_org, int *center_id,
                                      int *class_id) {
  int max_kmed_iter = 1000;
  int i, n_X_org, k;
  int new_center_id[K], new_class_id[N_X_org];
  double total_cost = 0.0, new_total_cost = 0.0;
  srswor(N_X, K, center_id);
  for (k = 0; k < K; k++) {
    center_id[k] = map_X_to_X_org[center_id[k]];
  }
  assign_class_id_compute_total_cost(N_X_org, K, EDM, center_id, class_id,
                                     &total_cost);
  for (i = 0; i < max_kmed_iter; i++) {
    classify_unique_by_EDM(N_X_org, K, EDM, N_X, map_X_to_X_org, center_id,
                           class_id, new_center_id);
    assign_class_id_compute_total_cost(N_X_org, K, EDM, new_center_id,
                                       new_class_id, &new_total_cost);
    if (new_total_cost < total_cost) {
      total_cost = new_total_cost;
      for (k = 0; k < K; k++) {
        center_id[k] = new_center_id[k];
      }
      for (n_X_org = 0; n_X_org < N_X_org; n_X_org++) {
        class_id[n_X_org] = new_class_id[n_X_org];
      }
    } else {
      break;
    }
  }
  for (n_X_org = 0; n_X_org < N_X_org; n_X_org++) {
    for (k = 0; k < K; k++) {
      if (class_id[n_X_org] == center_id[k]) {
        class_id[n_X_org] = k;
        break;
      }
    }
  }
}


x86 assembly (clang, -O0):
<assign_class_unique_by_k_medoids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x3e8,-0x2c(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1030 <srswor@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11fd <assign_class_unique_by_k_medoids+0xcd>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11c5 <assign_class_unique_by_k_medoids+0x95>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x10(%rbp),%r8
lea    -0x58(%rbp),%r9
call   1040 <assign_class_id_compute_total_cost@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1322 <assign_class_unique_by_k_medoids+0x1f2>
mov    -0x70(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%r10
sub    $0x10,%rsp
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <classify_unique_by_EDM@plt>
mov    -0x70(%rbp),%rcx
mov    -0x68(%rbp),%r8
add    $0x10,%rsp
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    -0x60(%rbp),%r9
call   1040 <assign_class_id_compute_total_cost@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    130a <assign_class_unique_by_k_medoids+0x1da>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12ce <assign_class_unique_by_k_medoids+0x19e>
mov    -0x70(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    129e <assign_class_unique_by_k_medoids+0x16e>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1305 <assign_class_unique_by_k_medoids+0x1d5>
mov    -0x68(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12d5 <assign_class_unique_by_k_medoids+0x1a5>
jmp    130f <assign_class_unique_by_k_medoids+0x1df>
jmp    1322 <assign_class_unique_by_k_medoids+0x1f2>
jmp    1314 <assign_class_unique_by_k_medoids+0x1e4>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    121f <assign_class_unique_by_k_medoids+0xef>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    139d <assign_class_unique_by_k_medoids+0x26d>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    138a <assign_class_unique_by_k_medoids+0x25a>
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x38(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1377 <assign_class_unique_by_k_medoids+0x247>
mov    -0x38(%rbp),%edx
mov    0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    138a <assign_class_unique_by_k_medoids+0x25a>
jmp    137c <assign_class_unique_by_k_medoids+0x24c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    133c <assign_class_unique_by_k_medoids+0x20c>
jmp    138f <assign_class_unique_by_k_medoids+0x25f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1329 <assign_class_unique_by_k_medoids+0x1f9>
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_class_unique_by_k_medoids>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%rbx
mov    %r8,%r12
mov    %rdx,-0x50(%rbp)
mov    %esi,%r14d
mov    %esi,%eax
mov    %rsp,%rdx
mov    %rax,-0x38(%rbp)
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,-0x60(%rbp)
mov    %rdx,%rsp
mov    %edi,-0x2c(%rbp)
mov    %edi,%r15d
mov    %rsp,%rdx
lea    0xf(,%r15,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,-0x58(%rbp)
mov    %rdx,%rsp
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x68(%rbp)
mov    %ecx,-0x48(%rbp)
mov    %ecx,%edi
mov    %r9,%rdx
call   1030 <srswor@plt>
test   %r14d,%r14d
jle    1244 <assign_class_unique_by_k_medoids+0x104>
mov    -0x38(%rbp),%rdx
lea    -0x1(%rdx),%rcx
mov    %edx,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    11d9 <assign_class_unique_by_k_medoids+0x99>
xor    %ecx,%ecx
jmp    121b <assign_class_unique_by_k_medoids+0xdb>
and    $0xfffffffc,%edx
xor    %ecx,%ecx
xchg   %ax,%ax
movslq (%rbx,%rcx,4),%rsi
mov    (%r12,%rsi,4),%esi
mov    %esi,(%rbx,%rcx,4)
movslq 0x4(%rbx,%rcx,4),%rsi
mov    (%r12,%rsi,4),%esi
mov    %esi,0x4(%rbx,%rcx,4)
movslq 0x8(%rbx,%rcx,4),%rsi
mov    (%r12,%rsi,4),%esi
mov    %esi,0x8(%rbx,%rcx,4)
movslq 0xc(%rbx,%rcx,4),%rsi
mov    (%r12,%rsi,4),%esi
mov    %esi,0xc(%rbx,%rcx,4)
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    11e0 <assign_class_unique_by_k_medoids+0xa0>
test   %rax,%rax
je     1244 <assign_class_unique_by_k_medoids+0x104>
lea    (%rbx,%rcx,4),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movslq (%rcx,%rdx,4),%rsi
mov    (%r12,%rsi,4),%esi
mov    %esi,(%rcx,%rdx,4)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1230 <assign_class_unique_by_k_medoids+0xf0>
mov    %r12,-0x88(%rbp)
lea    -0x40(%rbp),%r9
mov    -0x2c(%rbp),%edi
mov    %r14d,%esi
mov    -0x50(%rbp),%rdx
mov    %rbx,%rcx
mov    0x10(%rbp),%r8
call   1050 <assign_class_id_compute_total_cost@plt>
mov    -0x38(%rbp),%rax
lea    0x0(,%rax,4),%rax
mov    %rax,-0x80(%rbp)
mov    %r15,-0x70(%rbp)
lea    0x0(,%r15,4),%rax
mov    %rax,-0x78(%rbp)
movl   $0x3e8,-0x44(%rbp)
mov    -0x2c(%rbp),%r13d
mov    -0x60(%rbp),%r15
jmp    12aa <assign_class_unique_by_k_medoids+0x16a>
cs nopw 0x0(%rax,%rax,1)
addl   $0xffffffff,-0x44(%rbp)
je     133b <assign_class_unique_by_k_medoids+0x1fb>
mov    %r13d,%edi
mov    %r14d,%esi
mov    %r14d,%r12d
mov    -0x50(%rbp),%r14
mov    %r14,%rdx
mov    -0x48(%rbp),%ecx
mov    -0x88(%rbp),%r8
mov    %rbx,%r9
push   %r15
push   0x10(%rbp)
call   1060 <classify_unique_by_EDM@plt>
add    $0x10,%rsp
mov    %r13d,%edi
mov    %r12d,%esi
mov    %r14,%rdx
mov    %r12d,%r14d
mov    %r15,%rcx
mov    -0x58(%rbp),%r8
lea    -0x68(%rbp),%r9
call   1050 <assign_class_id_compute_total_cost@plt>
movsd  -0x68(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
ucomisd %xmm0,%xmm1
jbe    133b <assign_class_unique_by_k_medoids+0x1fb>
movsd  %xmm0,-0x40(%rbp)
test   %r14d,%r14d
jle    131b <assign_class_unique_by_k_medoids+0x1db>
mov    %rbx,%rdi
mov    -0x60(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   1040 <memcpy@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    12a0 <assign_class_unique_by_k_medoids+0x160>
mov    0x10(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x78(%rbp),%rdx
call   1040 <memcpy@plt>
jmp    12a0 <assign_class_unique_by_k_medoids+0x160>
cmpl   $0x0,-0x2c(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x38(%rbp),%rdi
jle    1380 <assign_class_unique_by_k_medoids+0x240>
xor    %eax,%eax
jmp    1360 <assign_class_unique_by_k_medoids+0x220>
nopl   (%rax)
mov    0x10(%rbp),%rdx
mov    %ecx,(%rdx,%rax,4)
add    $0x1,%rax
cmp    %rsi,%rax
je     1380 <assign_class_unique_by_k_medoids+0x240>
test   %r14d,%r14d
jle    1357 <assign_class_unique_by_k_medoids+0x217>
mov    0x10(%rbp),%rcx
mov    (%rcx,%rax,4),%edx
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    (%rbx,%rcx,4),%edx
je     1350 <assign_class_unique_by_k_medoids+0x210>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1370 <assign_class_unique_by_k_medoids+0x230>
jmp    1357 <assign_class_unique_by_k_medoids+0x217>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @assign_class_unique_by_k_medoids(i32 %0, i32 %1, double** %2, i32 %3, i32* %4, i32* %5, i32* %6) {
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = alloca double
%11 = alloca double
%12 = zext i32 %1 to i64
%13 = alloca i32, i64 %12
%14 = bitcast i32* %13 to i8*
%15 = zext i32 %0 to i64
%16 = alloca i32, i64 %15
%17 = bitcast i32* %16 to i8*
%18 = bitcast double* %10 to i8*
store double 0.000000e+00, double* %10
%19 = bitcast double* %11 to i8*
store double 0.000000e+00, double* %11
%20 = tail call i32 @srswor(i32 %3, i32 %1, i32* %5)
%21 = icmp sgt i32 %1, 0
br i1 %21, label %22, label %71
22: ; preds = %7
%23 = add nsw i64 %12, -1
%24 = and i64 %12, 3
%25 = icmp ult i64 %23, 3
br i1 %25, label %57, label %26
26: ; preds = %22
%27 = and i64 %12, 4294967292
br label %28
28: ; preds = %28, %26
%29 = phi i64 [ 0, %26 ], [ %54, %28 ]
%30 = phi i64 [ 0, %26 ], [ %55, %28 ]
%31 = getelementptr inbounds i32, i32* %5, i64 %29
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %4, i64 %33
%35 = load i32, i32* %34
store i32 %35, i32* %31
%36 = or i64 %29, 1
%37 = getelementptr inbounds i32, i32* %5, i64 %36
%38 = load i32, i32* %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %4, i64 %39
%41 = load i32, i32* %40
store i32 %41, i32* %37
%42 = or i64 %29, 2
%43 = getelementptr inbounds i32, i32* %5, i64 %42
%44 = load i32, i32* %43
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %4, i64 %45
%47 = load i32, i32* %46
store i32 %47, i32* %43
%48 = or i64 %29, 3
%49 = getelementptr inbounds i32, i32* %5, i64 %48
%50 = load i32, i32* %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %4, i64 %51
%53 = load i32, i32* %52
store i32 %53, i32* %49
%54 = add nuw nsw i64 %29, 4
%55 = add i64 %30, 4
%56 = icmp eq i64 %55, %27
br i1 %56, label %57, label %28
57: ; preds = %28, %22
%58 = phi i64 [ 0, %22 ], [ %54, %28 ]
%59 = icmp eq i64 %24, 0
br i1 %59, label %71, label %60
60: ; preds = %57, %60
%61 = phi i64 [ %68, %60 ], [ %58, %57 ]
%62 = phi i64 [ %69, %60 ], [ 0, %57 ]
%63 = getelementptr inbounds i32, i32* %5, i64 %61
%64 = load i32, i32* %63
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %4, i64 %65
%67 = load i32, i32* %66
store i32 %67, i32* %63
%68 = add nuw nsw i64 %61, 1
%69 = add i64 %62, 1
%70 = icmp eq i64 %69, %24
br i1 %70, label %71, label %60
71: ; preds = %57, %60, %7
%72 = call i32 @assign_class_id_compute_total_cost(i32 %0, i32 %1, double** %2, i32* %5, i32* %6, double* %10)
%73 = icmp sgt i32 %0, 0
%74 = shl nuw nsw i64 %12, 2
%75 = shl nuw nsw i64 %15, 2
br label %76
76: ; preds = %71, %87
%77 = phi i32 [ 0, %71 ], [ %88, %87 ]
%78 = call i32 @classify_unique_by_EDM(i32 %0, i32 %1, double** %2, i32 %3, i32* %4, i32* %5, i32* %6, i32* %13)
%79 = call i32 @assign_class_id_compute_total_cost(i32 %0, i32 %1, double** %2, i32* %13, i32* %16, double* %11)
%80 = load double, double* %11
%81 = load double, double* %10
%82 = fcmp olt double %80, %81
br i1 %82, label %83, label %90
83: ; preds = %76
store double %80, double* %10
br i1 %21, label %84, label %85
84: ; preds = %83
br label %85
85: ; preds = %84, %83
br i1 %73, label %86, label %87
86: ; preds = %85
br label %87
87: ; preds = %86, %85
%88 = add nuw nsw i32 %77, 1
%89 = icmp eq i32 %88, 1000
br i1 %89, label %90, label %76
90: ; preds = %76, %87
br i1 %73, label %91, label %109
91: ; preds = %90, %106
%92 = phi i64 [ %107, %106 ], [ 0, %90 ]
br i1 %21, label %93, label %106
93: ; preds = %91
%94 = getelementptr inbounds i32, i32* %6, i64 %92
%95 = load i32, i32* %94
br label %96
96: ; preds = %93, %103
%97 = phi i64 [ 0, %93 ], [ %104, %103 ]
%98 = getelementptr inbounds i32, i32* %5, i64 %97
%99 = load i32, i32* %98
%100 = icmp eq i32 %95, %99
br i1 %100, label %101, label %103
101: ; preds = %96
%102 = trunc i64 %97 to i32
store i32 %102, i32* %94
br label %106
103: ; preds = %96
%104 = add nuw nsw i64 %97, 1
%105 = icmp eq i64 %104, %12
br i1 %105, label %106, label %96
106: ; preds = %103, %91, %101
%107 = add nuw nsw i64 %92, 1
%108 = icmp eq i64 %107, %15
br i1 %108, label %109, label %91
109: ; preds = %106, %90
ret void
}