#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*/ dump_mock_file(char *, float *, int);
int /*<<< orphan*/ exit(int);
float fabs(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
float *load_ngl_file(char *, int *);
int *load_skeleton(char *, int *);
float *malloc(int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int n_points;
  int n_pairs;
  int pair_a, pair_b;
  float *ngl_data;
  float *len_x, *len_y, *len_z;
  int *pairs;
  int i;
  if (argc != 6) {
    fprintf(stderr, "USAGE: %s\n",
            "./skel_shape.x ngl_file skel_clean_pair_file pair_lenght_x_file "
            "pair_lenght_y_file pair_lenght_z_file");
    exit(1);
  }
  ngl_data = load_ngl_file(argv[1], &n_points);
  pairs = load_skeleton(argv[2], &n_pairs);
  if (!(len_x = malloc(n_pairs * sizeof(float)))) {
    fprintf(stderr, "problem with len_x allocation\n");
    exit(1);
  }
  if (!(len_y = malloc(n_pairs * sizeof(float)))) {
    fprintf(stderr, "problem with len_y allocation\n");
    exit(1);
  }
  if (!(len_z = malloc(n_pairs * sizeof(float)))) {
    fprintf(stderr, "problem with len_z allocation\n");
    exit(1);
  }
  for (i = 0; i < n_pairs; i++) {
    len_x[i] = -1;
    len_y[i] = -1;
    len_z[i] = -1;
  }
  for (i = 0; i < n_pairs; i++) {
    pair_a = pairs[i * 2];
    pair_b = pairs[i * 2 + 1];
    len_x[i] = fabs(ngl_data[3 * pair_b + 0] - ngl_data[3 * pair_a + 0]);
    len_y[i] = fabs(ngl_data[3 * pair_b + 1] - ngl_data[3 * pair_a + 1]);
    len_z[i] = fabs(ngl_data[3 * pair_b + 2] - ngl_data[3 * pair_a + 2]);
  }
  dump_mock_file(argv[3], len_x, n_pairs);
  dump_mock_file(argv[4], len_y, n_pairs);
  dump_mock_file(argv[5], len_z, n_pairs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     11b8 <main+0x48>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
lea    0xe64(%rip),%rsi
lea    0xe68(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <load_ngl_file@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1090 <load_skeleton@plt>
mov    %rax,-0x48(%rbp)
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1220 <main+0xb0>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    125e <main+0xee>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    129c <main+0x12c>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    12fc <main+0x18c>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  0xd41(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  0xd2c(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  0xd17(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12a3 <main+0x133>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13ee <main+0x27e>
mov    -0x48(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x4c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
imul   $0x3,-0x20(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
subss  (%rax,%rcx,4),%xmm0
call   1040 <fabs@plt>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
imul   $0x3,-0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subss  (%rax,%rcx,4),%xmm0
call   1040 <fabs@plt>
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
imul   $0x3,-0x20(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
subss  (%rax,%rcx,4),%xmm0
call   1040 <fabs@plt>
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1303 <main+0x193>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1060 <dump_mock_file@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1060 <dump_mock_file@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1060 <dump_mock_file@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cmp    $0x6,%edi
jne    1393 <main+0x233>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0x14(%rsp),%rsi
call   1030 <load_ngl_file@plt>
mov    %rax,%rbx
mov    %rbp,0x8(%rsp)
mov    0x10(%rbp),%rdi
lea    0x4(%rsp),%rsi
call   1080 <load_skeleton@plt>
mov    %rax,%r12
mov    0x4(%rsp),%r15d
lea    0x0(,%r15,4),%r14d
mov    %r14d,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     13bb <main+0x25b>
mov    %rax,%r13
mov    %r14d,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     13cd <main+0x26d>
mov    %rax,%rbp
mov    %r14d,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     13df <main+0x27f>
mov    %rax,%r14
test   %r15d,%r15d
jle    133e <main+0x1de>
cmp    $0x8,%r15d
jae    1200 <main+0xa0>
xor    %eax,%eax
jmp    12b0 <main+0x150>
mov    %r15d,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     1383 <main+0x223>
mov    %rcx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %edx,%edx
movaps 0xdd2(%rip),%xmm0
xchg   %ax,%ax
movups %xmm0,0x0(%r13,%rdx,4)
movups %xmm0,0x10(%r13,%rdx,4)
movups %xmm0,0x0(%rbp,%rdx,4)
movups %xmm0,0x10(%rbp,%rdx,4)
movups %xmm0,(%r14,%rdx,4)
movups %xmm0,0x10(%r14,%rdx,4)
movups %xmm0,0x20(%r13,%rdx,4)
movups %xmm0,0x30(%r13,%rdx,4)
movups %xmm0,0x20(%rbp,%rdx,4)
movups %xmm0,0x30(%rbp,%rdx,4)
movups %xmm0,0x20(%r14,%rdx,4)
movups %xmm0,0x30(%r14,%rdx,4)
add    $0x10,%rdx
add    $0xfffffffffffffffe,%rsi
jne    1230 <main+0xd0>
test   $0x1,%cl
je     12aa <main+0x14a>
movaps 0xd77(%rip),%xmm0
movups %xmm0,0x0(%r13,%rdx,4)
movups %xmm0,0x10(%r13,%rdx,4)
movups %xmm0,0x0(%rbp,%rdx,4)
movups %xmm0,0x10(%rbp,%rdx,4)
movups %xmm0,(%r14,%rdx,4)
movups %xmm0,0x10(%r14,%rdx,4)
cmp    %r15,%rax
je     12d2 <main+0x172>
nop
movl   $0xbf800000,0x0(%r13,%rax,4)
80 bf
movl   $0xbf800000,0x0(%rbp,%rax,4)
bf
movl   $0xbf800000,(%r14,%rax,4)
bf
add    $0x1,%rax
cmp    %rax,%r15
jne    12b0 <main+0x150>
test   %r15d,%r15d
jle    133e <main+0x1de>
xor    %eax,%eax
movaps 0xd30(%rip),%xmm0
movslq (%r12,%rax,8),%rcx
movslq 0x4(%r12,%rax,8),%rdx
lea    (%rdx,%rdx,2),%rdx
movss  (%rbx,%rdx,4),%xmm1
lea    (%rcx,%rcx,2),%rcx
subss  (%rbx,%rcx,4),%xmm1
andps  %xmm0,%xmm1
movss  %xmm1,0x0(%r13,%rax,4)
movslq %edx,%rdx
movss  0x4(%rbx,%rdx,4),%xmm1
movslq %ecx,%rcx
subss  0x4(%rbx,%rcx,4),%xmm1
andps  %xmm0,%xmm1
movss  %xmm1,0x0(%rbp,%rax,4)
movss  0x8(%rbx,%rdx,4),%xmm1
subss  0x8(%rbx,%rcx,4),%xmm1
andps  %xmm0,%xmm1
movss  %xmm1,(%r14,%rax,4)
add    $0x1,%rax
cmp    %rax,%r15
jne    12e0 <main+0x180>
mov    0x8(%rsp),%rbx
mov    0x18(%rbx),%rdi
mov    %r13,%rsi
mov    %r15d,%edx
call   1050 <dump_mock_file@plt>
mov    0x20(%rbx),%rdi
mov    0x4(%rsp),%edx
mov    %rbp,%rsi
call   1050 <dump_mock_file@plt>
mov    0x28(%rbx),%rdi
mov    0x4(%rsp),%edx
mov    %r14,%rsi
call   1050 <dump_mock_file@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%cl
jne    1282 <main+0x122>
jmp    12aa <main+0x14a>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
lea    0xc7d(%rip),%rsi
lea    0xc81(%rip),%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
lea    0xcc6(%rip),%rsi
jmp    13ef <main+0x28f>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
lea    0xcd3(%rip),%rsi
jmp    13ef <main+0x28f>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    0xce0(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"USAGE: %s\0A\00"
@.str.1 = [102 x i8] c"./skel_shape.x ngl_file skel_clean_pair_file pair_lenght_x_file pair_lenght_y_file pair_lenght_z_file\00"
@.str.2 = [31 x i8] c"problem with len_x allocation\0A\00"
@.str.3 = [31 x i8] c"problem with len_y allocation\0A\00"
@.str.4 = [31 x i8] c"problem with len_z allocation\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 float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca i32*
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 6
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call float* @load_ngl_file(i8* %25, i32* %6)
store float* %26, float** %10
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i32* @load_skeleton(i8* %29, i32* %7)
store i32* %30, i32** %14
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 4
%34 = trunc i64 %33 to i32
%35 = call float* @malloc(i32 %34)
store float* %35, float** %11
%36 = icmp ne float* %35, null
br i1 %36, label %41, label %37
37: ; preds = %22
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %22
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 4
%45 = trunc i64 %44 to i32
%46 = call float* @malloc(i32 %45)
store float* %46, float** %12
%47 = icmp ne float* %46, null
br i1 %47, label %52, label %48
48: ; preds = %41
%49 = load i32, i32* @stderr
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %41
%53 = load i32, i32* %7
%54 = sext i32 %53 to i64
%55 = mul i64 %54, 4
%56 = trunc i64 %55 to i32
%57 = call float* @malloc(i32 %56)
store float* %57, float** %13
%58 = icmp ne float* %57, null
br i1 %58, label %63, label %59
59: ; preds = %52
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %52
store i32 0, i32* %15
br label %64
64: ; preds = %81, %63
%65 = load i32, i32* %15
%66 = load i32, i32* %7
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %84
68: ; preds = %64
%69 = load float*, float** %11
%70 = load i32, i32* %15
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %69, i64 %71
store float -1.000000e+00, float* %72
%73 = load float*, float** %12
%74 = load i32, i32* %15
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds float, float* %73, i64 %75
store float -1.000000e+00, float* %76
%77 = load float*, float** %13
%78 = load i32, i32* %15
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds float, float* %77, i64 %79
store float -1.000000e+00, float* %80
br label %81
81: ; preds = %68
%82 = load i32, i32* %15
%83 = add nsw i32 %82, 1
store i32 %83, i32* %15
br label %64
84: ; preds = %64
store i32 0, i32* %15
br label %85
85: ; preds = %163, %84
%86 = load i32, i32* %15
%87 = load i32, i32* %7
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %166
89: ; preds = %85
%90 = load i32*, i32** %14
%91 = load i32, i32* %15
%92 = mul nsw i32 %91, 2
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %90, i64 %93
%95 = load i32, i32* %94
store i32 %95, i32* %8
%96 = load i32*, i32** %14
%97 = load i32, i32* %15
%98 = mul nsw i32 %97, 2
%99 = add nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i32, i32* %96, i64 %100
%102 = load i32, i32* %101
store i32 %102, i32* %9
%103 = load float*, float** %10
%104 = load i32, i32* %9
%105 = mul nsw i32 3, %104
%106 = add nsw i32 %105, 0
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds float, float* %103, i64 %107
%109 = load float, float* %108
%110 = load float*, float** %10
%111 = load i32, i32* %8
%112 = mul nsw i32 3, %111
%113 = add nsw i32 %112, 0
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds float, float* %110, i64 %114
%116 = load float, float* %115
%117 = fsub float %109, %116
%118 = call float @fabs(float %117)
%119 = load float*, float** %11
%120 = load i32, i32* %15
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds float, float* %119, i64 %121
store float %118, float* %122
%123 = load float*, float** %10
%124 = load i32, i32* %9
%125 = mul nsw i32 3, %124
%126 = add nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds float, float* %123, i64 %127
%129 = load float, float* %128
%130 = load float*, float** %10
%131 = load i32, i32* %8
%132 = mul nsw i32 3, %131
%133 = add nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds float, float* %130, i64 %134
%136 = load float, float* %135
%137 = fsub float %129, %136
%138 = call float @fabs(float %137)
%139 = load float*, float** %12
%140 = load i32, i32* %15
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds float, float* %139, i64 %141
store float %138, float* %142
%143 = load float*, float** %10
%144 = load i32, i32* %9
%145 = mul nsw i32 3, %144
%146 = add nsw i32 %145, 2
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds float, float* %143, i64 %147
%149 = load float, float* %148
%150 = load float*, float** %10
%151 = load i32, i32* %8
%152 = mul nsw i32 3, %151
%153 = add nsw i32 %152, 2
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds float, float* %150, i64 %154
%156 = load float, float* %155
%157 = fsub float %149, %156
%158 = call float @fabs(float %157)
%159 = load float*, float** %13
%160 = load i32, i32* %15
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds float, float* %159, i64 %161
store float %158, float* %162
br label %163
163: ; preds = %89
%164 = load i32, i32* %15
%165 = add nsw i32 %164, 1
store i32 %165, i32* %15
br label %85
166: ; preds = %85
%167 = load i8**, i8*** %5
%168 = getelementptr inbounds i8*, i8** %167, i64 3
%169 = load i8*, i8** %168
%170 = load float*, float** %11
%171 = load i32, i32* %7
%172 = call i32 @dump_mock_file(i8* %169, float* %170, i32 %171)
%173 = load i8**, i8*** %5
%174 = getelementptr inbounds i8*, i8** %173, i64 4
%175 = load i8*, i8** %174
%176 = load float*, float** %12
%177 = load i32, i32* %7
%178 = call i32 @dump_mock_file(i8* %175, float* %176, i32 %177)
%179 = load i8**, i8*** %5
%180 = getelementptr inbounds i8*, i8** %179, i64 5
%181 = load i8*, i8** %180
%182 = load float*, float** %13
%183 = load i32, i32* %7
%184 = call i32 @dump_mock_file(i8* %181, float* %182, i32 %183)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"USAGE: %s\0A\00"
@.str.1 = [102 x i8] c"./skel_shape.x ngl_file skel_clean_pair_file pair_lenght_x_file pair_lenght_y_file pair_lenght_z_file\00"
@.str.2 = [31 x i8] c"problem with len_x allocation\0A\00"
@.str.3 = [31 x i8] c"problem with len_y allocation\0A\00"
@.str.4 = [31 x i8] c"problem with len_z allocation\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp eq i32 %0, 6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call float* @load_ngl_file(i8* %14, i32* %3)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = call i32* @load_skeleton(i8* %17, i32* %4)
%19 = load i32, i32* %4
%20 = shl i32 %19, 2
%21 = call float* @malloc(i32 %20)
%22 = icmp eq float* %21, null
br i1 %22, label %23, label %27
23: ; preds = %12
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @exit(i32 1)
unreachable
27: ; preds = %12
%28 = call float* @malloc(i32 %20)
%29 = icmp eq float* %28, null
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %27
%35 = call float* @malloc(i32 %20)
%36 = icmp eq float* %35, null
br i1 %36, label %102, label %37
37: ; preds = %34
%38 = icmp sgt i32 %19, 0
br i1 %38, label %39, label %159
39: ; preds = %37
%40 = zext i32 %19 to i64
%41 = icmp ult i32 %19, 8
br i1 %41, label %100, label %42
42: ; preds = %39
%43 = and i64 %40, 4294967288
%44 = add nsw i64 %43, -8
%45 = lshr exact i64 %44, 3
%46 = add nuw nsw i64 %45, 1
%47 = and i64 %46, 1
%48 = icmp eq i64 %44, 0
br i1 %48, label %82, label %49
49: ; preds = %42
%50 = and i64 %46, 4611686018427387902
br label %51
51: ; preds = %51, %49
%52 = phi i64 [ 0, %49 ], [ %79, %51 ]
%53 = phi i64 [ 0, %49 ], [ %80, %51 ]
%54 = getelementptr inbounds float, float* %21, i64 %52
%55 = bitcast float* %54 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %55
%56 = getelementptr inbounds float, float* %54, i64 4
%57 = bitcast float* %56 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %57
%58 = getelementptr inbounds float, float* %28, i64 %52
%59 = bitcast float* %58 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %59
%60 = getelementptr inbounds float, float* %58, i64 4
%61 = bitcast float* %60 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %61
%62 = getelementptr inbounds float, float* %35, i64 %52
%63 = bitcast float* %62 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %63
%64 = getelementptr inbounds float, float* %62, i64 4
%65 = bitcast float* %64 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %65
%66 = or i64 %52, 8
%67 = getelementptr inbounds float, float* %21, i64 %66
%68 = bitcast float* %67 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %68
%69 = getelementptr inbounds float, float* %67, i64 4
%70 = bitcast float* %69 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %70
%71 = getelementptr inbounds float, float* %28, i64 %66
%72 = bitcast float* %71 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %72
%73 = getelementptr inbounds float, float* %71, i64 4
%74 = bitcast float* %73 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %74
%75 = getelementptr inbounds float, float* %35, i64 %66
%76 = bitcast float* %75 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %76
%77 = getelementptr inbounds float, float* %75, i64 4
%78 = bitcast float* %77 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %78
%79 = add nuw i64 %52, 16
%80 = add i64 %53, 2
%81 = icmp eq i64 %80, %50
br i1 %81, label %82, label %51
82: ; preds = %51, %42
%83 = phi i64 [ 0, %42 ], [ %79, %51 ]
%84 = icmp eq i64 %47, 0
br i1 %84, label %98, label %85
85: ; preds = %82
%86 = getelementptr inbounds float, float* %21, i64 %83
%87 = bitcast float* %86 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %87
%88 = getelementptr inbounds float, float* %86, i64 4
%89 = bitcast float* %88 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %89
%90 = getelementptr inbounds float, float* %28, i64 %83
%91 = bitcast float* %90 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %91
%92 = getelementptr inbounds float, float* %90, i64 4
%93 = bitcast float* %92 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %93
%94 = getelementptr inbounds float, float* %35, i64 %83
%95 = bitcast float* %94 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %95
%96 = getelementptr inbounds float, float* %94, i64 4
%97 = bitcast float* %96 to <4 x float>*
store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00>, <4 x float>* %97
br label %98
98: ; preds = %82, %85
%99 = icmp eq i64 %43, %40
br i1 %99, label %106, label %100
100: ; preds = %39, %98
%101 = phi i64 [ 0, %39 ], [ %43, %98 ]
br label %109
102: ; preds = %34
%103 = load i32, i32* @stderr
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%105 = call i32 @exit(i32 1)
unreachable
106: ; preds = %109, %98
br i1 %38, label %107, label %159
107: ; preds = %106
%108 = zext i32 %19 to i64
br label %116
109: ; preds = %100, %109
%110 = phi i64 [ %114, %109 ], [ %101, %100 ]
%111 = getelementptr inbounds float, float* %21, i64 %110
store float -1.000000e+00, float* %111
%112 = getelementptr inbounds float, float* %28, i64 %110
store float -1.000000e+00, float* %112
%113 = getelementptr inbounds float, float* %35, i64 %110
store float -1.000000e+00, float* %113
%114 = add nuw nsw i64 %110, 1
%115 = icmp eq i64 %114, %40
br i1 %115, label %106, label %109
116: ; preds = %107, %116
%117 = phi i64 [ 0, %107 ], [ %157, %116 ]
%118 = shl nuw nsw i64 %117, 1
%119 = getelementptr inbounds i32, i32* %18, i64 %118
%120 = load i32, i32* %119
%121 = or i64 %118, 1
%122 = getelementptr inbounds i32, i32* %18, i64 %121
%123 = load i32, i32* %122
%124 = mul nsw i32 %123, 3
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds float, float* %15, i64 %125
%127 = load float, float* %126
%128 = mul nsw i32 %120, 3
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds float, float* %15, i64 %129
%131 = load float, float* %130
%132 = fsub float %127, %131
%133 = call float @llvm.fabs.f32(float %132)
%134 = getelementptr inbounds float, float* %21, i64 %117
store float %133, float* %134
%135 = add nsw i32 %124, 1
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds float, float* %15, i64 %136
%138 = load float, float* %137
%139 = add nsw i32 %128, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds float, float* %15, i64 %140
%142 = load float, float* %141
%143 = fsub float %138, %142
%144 = call float @llvm.fabs.f32(float %143)
%145 = getelementptr inbounds float, float* %28, i64 %117
store float %144, float* %145
%146 = add nsw i32 %124, 2
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds float, float* %15, i64 %147
%149 = load float, float* %148
%150 = add nsw i32 %128, 2
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds float, float* %15, i64 %151
%153 = load float, float* %152
%154 = fsub float %149, %153
%155 = call float @llvm.fabs.f32(float %154)
%156 = getelementptr inbounds float, float* %35, i64 %117
store float %155, float* %156
%157 = add nuw nsw i64 %117, 1
%158 = icmp eq i64 %157, %108
br i1 %158, label %159, label %116
159: ; preds = %116, %37, %106
%160 = getelementptr inbounds i8*, i8** %1, i64 3
%161 = load i8*, i8** %160
%162 = call i32 @dump_mock_file(i8* %161, float* %21, i32 %19)
%163 = getelementptr inbounds i8*, i8** %1, i64 4
%164 = load i8*, i8** %163
%165 = load i32, i32* %4
%166 = call i32 @dump_mock_file(i8* %164, float* %28, i32 %165)
%167 = getelementptr inbounds i8*, i8** %1, i64 5
%168 = load i8*, i8** %167
%169 = load i32, i32* %4
%170 = call i32 @dump_mock_file(i8* %168, float* %35, i32 %169)
ret i32 0
}