#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 */
double INFINITY;
void iniCloserFurther(double *lastValues, double *closestValues,
                      int valueArrayCnt) {
  int i;
  for (i = 0; i < valueArrayCnt; i++) {
    lastValues[i] = INFINITY;
    closestValues[i] = INFINITY;
  }
}


x86 assembly (clang, -O0):
<iniCloserFurther>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <iniCloserFurther+0x60>
mov    0x2ebf(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2ea7(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <iniCloserFurther+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iniCloserFurther>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1271 <iniCloserFurther+0x171>
mov    %edx,%r10d
cmp    $0x4,%edx
jae    1184 <iniCloserFurther+0x84>
xor    %ecx,%ecx
mov    %rcx,%rax
not    %rax
test   $0x1,%r10b
je     113f <iniCloserFurther+0x3f>
mov    0x2ebf(%rip),%rdx
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
or     $0x1,%rcx
add    %r10,%rax
je     1271 <iniCloserFurther+0x171>
mov    0x2e99(%rip),%rax
nop
movsd  (%rax),%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rdi,%rcx,8)
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsi,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%r10
jne    1150 <iniCloserFurther+0x50>
jmp    1271 <iniCloserFurther+0x171>
lea    (%rsi,%r10,8),%rcx
cmp    %rdi,%rcx
seta   %r14b
lea    (%rdi,%r10,8),%rdx
cmp    %rsi,%rdx
seta   %bl
mov    0x2e48(%rip),%r8
lea    0x8(%r8),%rbp
cmp    %rbp,%rdi
setb   %al
cmp    %r8,%rdx
seta   %r9b
cmp    %rbp,%rsi
setb   %dl
cmp    %r8,%rcx
seta   %r11b
xor    %ecx,%ecx
test   %bl,%r14b
jne    1116 <iniCloserFurther+0x16>
and    %r9b,%al
jne    1116 <iniCloserFurther+0x16>
and    %r11b,%dl
jne    1116 <iniCloserFurther+0x16>
mov    %r10d,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rax
mov    %rax,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rax,%rax
je     1276 <iniCloserFurther+0x176>
mov    %r9,%rax
and    $0xfffffffffffffffe,%rax
movsd  (%r8),%xmm0
movlhps %xmm0,%xmm0
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movups %xmm0,(%rdi,%rdx,8)
movups %xmm0,0x10(%rdi,%rdx,8)
movups %xmm0,(%rsi,%rdx,8)
movups %xmm0,0x10(%rsi,%rdx,8)
movups %xmm0,0x20(%rdi,%rdx,8)
movups %xmm0,0x30(%rdi,%rdx,8)
movups %xmm0,0x20(%rsi,%rdx,8)
movups %xmm0,0x30(%rsi,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rax
jne    1210 <iniCloserFurther+0x110>
test   $0x1,%r9b
je     1268 <iniCloserFurther+0x168>
movsd  (%r8),%xmm0
movlhps %xmm0,%xmm0
movups %xmm0,(%rdi,%rdx,8)
movups %xmm0,0x10(%rdi,%rdx,8)
movsd  (%r8),%xmm0
movlhps %xmm0,%xmm0
movups %xmm0,(%rsi,%rdx,8)
movups %xmm0,0x10(%rsi,%rdx,8)
cmp    %r10,%rcx
jne    1116 <iniCloserFurther+0x16>
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%r9b
jne    1246 <iniCloserFurther+0x146>
jmp    1268 <iniCloserFurther+0x168>

LLVM IR (-O0):
@INFINITY = global double 0.000000e+00
define void @iniCloserFurther(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load double, double* @INFINITY
%14 = load double*, double** %4
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double %13, double* %17
%18 = load double, double* @INFINITY
%19 = load double*, double** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
store double %18, double* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %8
26: ; preds = %8
ret void
}

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define void @iniCloserFurther(double* nocapture writeonly %0, double* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %126
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = icmp ult i32 %2, 4
br i1 %7, label %98, label %8
8: ; preds = %5
%9 = getelementptr double, double* %0, i64 %6
%10 = getelementptr double, double* %1, i64 %6
%11 = icmp ugt double* %10, %0
%12 = icmp ugt double* %9, %1
%13 = and i1 %11, %12
%14 = icmp ult double* %0, getelementptr inbounds (double, double* @INFINITY, i64 1)
%15 = icmp ugt double* %9, @INFINITY
%16 = and i1 %14, %15
%17 = or i1 %13, %16
%18 = icmp ult double* %1, getelementptr inbounds (double, double* @INFINITY, i64 1)
%19 = icmp ugt double* %10, @INFINITY
%20 = and i1 %18, %19
%21 = or i1 %17, %20
br i1 %21, label %98, label %22
22: ; preds = %8
%23 = and i64 %6, 4294967292
%24 = add nsw i64 %23, -4
%25 = lshr exact i64 %24, 2
%26 = add nuw nsw i64 %25, 1
%27 = and i64 %26, 1
%28 = icmp eq i64 %24, 0
br i1 %28, label %74, label %29
29: ; preds = %22
%30 = and i64 %26, 9223372036854775806
%31 = load double, double* @INFINITY
%32 = insertelement <2 x double> poison, double %31, i64 0
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
%34 = insertelement <2 x double> poison, double %31, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = load double, double* @INFINITY
%37 = insertelement <2 x double> poison, double %36, i64 0
%38 = shufflevector <2 x double> %37, <2 x double> poison, <2 x i32> zeroinitializer
%39 = insertelement <2 x double> poison, double %36, i64 0
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
%41 = load double, double* @INFINITY
%42 = insertelement <2 x double> poison, double %41, i64 0
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
%44 = insertelement <2 x double> poison, double %41, i64 0
%45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
%46 = load double, double* @INFINITY
%47 = insertelement <2 x double> poison, double %46, i64 0
%48 = shufflevector <2 x double> %47, <2 x double> poison, <2 x i32> zeroinitializer
%49 = insertelement <2 x double> poison, double %46, i64 0
%50 = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> zeroinitializer
br label %51
51: ; preds = %51, %29
%52 = phi i64 [ 0, %29 ], [ %71, %51 ]
%53 = phi i64 [ 0, %29 ], [ %72, %51 ]
%54 = getelementptr inbounds double, double* %0, i64 %52
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> %33, <2 x double>* %55
%56 = getelementptr inbounds double, double* %54, i64 2
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %35, <2 x double>* %57
%58 = getelementptr inbounds double, double* %1, i64 %52
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %38, <2 x double>* %59
%60 = getelementptr inbounds double, double* %58, i64 2
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> %40, <2 x double>* %61
%62 = or i64 %52, 4
%63 = getelementptr inbounds double, double* %0, i64 %62
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %43, <2 x double>* %64
%65 = getelementptr inbounds double, double* %63, i64 2
%66 = bitcast double* %65 to <2 x double>*
store <2 x double> %45, <2 x double>* %66
%67 = getelementptr inbounds double, double* %1, i64 %62
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> %48, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %50, <2 x double>* %70
%71 = add nuw i64 %52, 8
%72 = add i64 %53, 2
%73 = icmp eq i64 %72, %30
br i1 %73, label %74, label %51
74: ; preds = %51, %22
%75 = phi i64 [ 0, %22 ], [ %71, %51 ]
%76 = icmp eq i64 %27, 0
br i1 %76, label %96, label %77
77: ; preds = %74
%78 = load double, double* @INFINITY
%79 = insertelement <2 x double> poison, double %78, i64 0
%80 = shufflevector <2 x double> %79, <2 x double> poison, <2 x i32> zeroinitializer
%81 = insertelement <2 x double> poison, double %78, i64 0
%82 = shufflevector <2 x double> %81, <2 x double> poison, <2 x i32> zeroinitializer
%83 = getelementptr inbounds double, double* %0, i64 %75
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> %80, <2 x double>* %84
%85 = getelementptr inbounds double, double* %83, i64 2
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> %82, <2 x double>* %86
%87 = load double, double* @INFINITY
%88 = insertelement <2 x double> poison, double %87, i64 0
%89 = shufflevector <2 x double> %88, <2 x double> poison, <2 x i32> zeroinitializer
%90 = insertelement <2 x double> poison, double %87, i64 0
%91 = shufflevector <2 x double> %90, <2 x double> poison, <2 x i32> zeroinitializer
%92 = getelementptr inbounds double, double* %1, i64 %75
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> %89, <2 x double>* %93
%94 = getelementptr inbounds double, double* %92, i64 2
%95 = bitcast double* %94 to <2 x double>*
store <2 x double> %91, <2 x double>* %95
br label %96
96: ; preds = %74, %77
%97 = icmp eq i64 %23, %6
br i1 %97, label %126, label %98
98: ; preds = %8, %5, %96
%99 = phi i64 [ 0, %8 ], [ 0, %5 ], [ %23, %96 ]
%100 = xor i64 %99, -1
%101 = and i64 %6, 1
%102 = icmp eq i64 %101, 0
br i1 %102, label %109, label %103
103: ; preds = %98
%104 = load double, double* @INFINITY
%105 = getelementptr inbounds double, double* %0, i64 %99
store double %104, double* %105
%106 = load double, double* @INFINITY
%107 = getelementptr inbounds double, double* %1, i64 %99
store double %106, double* %107
%108 = or i64 %99, 1
br label %109
109: ; preds = %103, %98
%110 = phi i64 [ %99, %98 ], [ %108, %103 ]
%111 = sub nsw i64 0, %6
%112 = icmp eq i64 %100, %111
br i1 %112, label %126, label %113
113: ; preds = %109, %113
%114 = phi i64 [ %124, %113 ], [ %110, %109 ]
%115 = load double, double* @INFINITY
%116 = getelementptr inbounds double, double* %0, i64 %114
store double %115, double* %116
%117 = load double, double* @INFINITY
%118 = getelementptr inbounds double, double* %1, i64 %114
store double %117, double* %118
%119 = add nuw nsw i64 %114, 1
%120 = load double, double* @INFINITY
%121 = getelementptr inbounds double, double* %0, i64 %119
store double %120, double* %121
%122 = load double, double* @INFINITY
%123 = getelementptr inbounds double, double* %1, i64 %119
store double %122, double* %123
%124 = add nuw nsw i64 %114, 2
%125 = icmp eq i64 %124, %6
br i1 %125, label %126, label %113
126: ; preds = %109, %113, %96, %3
ret void
}