void set_squid_record(struct module *mod, double st_array[],
                      unsigned long long pre_array[],
                      unsigned long long cur_array[], int inter) {
  int i;
  if (cur_array[0] >= pre_array[0])
    st_array[0] = (cur_array[0] - pre_array[0]) / inter;
  else
    st_array[0] = 0;
  st_array[1] = cur_array[1] / 100.0;
  for (i = 2; i <= 5; i++)
    st_array[i] = cur_array[i] / 10.0;
  for (i = 6; i <= 10; i++)
    st_array[i] = cur_array[i];
  st_array[11] = (cur_array[11] << 10) / 100.0;
  st_array[12] = cur_array[12];
  st_array[13] = cur_array[13];
}


x86 assembly (clang, -O0):
<set_squid_record>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jb     117a <set_squid_record+0x7a>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
movslq -0x24(%rbp),%rcx
xor    %edx,%edx
div    %rcx
movq   %rax,%xmm0
movaps 0xeae(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xeb2(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1185 <set_squid_record+0x85>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movq   0x8(%rax),%xmm0
movaps 0xe6b(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xe6f(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x2,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jg     122c <set_squid_record+0x12c>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movq   (%rax,%rcx,8),%xmm0
movaps 0xe16(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xe1a(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe1b(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11cc <set_squid_record+0xcc>
movl   $0x6,-0x28(%rbp)
cmpl   $0xa,-0x28(%rbp)
jg     1287 <set_squid_record+0x187>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movq   (%rax,%rcx,8),%xmm0
movaps 0xdaf(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xdb3(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1233 <set_squid_record+0x133>
mov    -0x20(%rbp),%rax
mov    0x58(%rax),%rax
shl    $0xa,%rax
movq   %rax,%xmm0
movaps 0xd61(%rip),%xmm2
punpckldq %xmm2,%xmm0
movapd 0xd65(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm3
unpckhpd %xmm0,%xmm0
addsd  %xmm3,%xmm0
movsd  0xd5e(%rip),%xmm3
divsd  %xmm3,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x58(%rax)
mov    -0x20(%rbp),%rax
movq   0x60(%rax),%xmm0
punpckldq %xmm2,%xmm0
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm3
unpckhpd %xmm0,%xmm0
addsd  %xmm3,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x60(%rax)
mov    -0x20(%rbp),%rax
movq   0x68(%rax),%xmm0
punpckldq %xmm2,%xmm0
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x68(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_squid_record>:
mov    (%rcx),%rax
xorpd  %xmm0,%xmm0
sub    (%rdx),%rax
jb     1148 <set_squid_record+0x48>
movslq %r8d,%rdi
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
je     1122 <set_squid_record+0x22>
xor    %edx,%edx
div    %rdi
jmp    1127 <set_squid_record+0x27>
xor    %edx,%edx
div    %r8d
movq   %rax,%xmm1
punpckldq 0xecc(%rip),%xmm1
subpd  0xed4(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsi)
movdqu 0x8(%rcx),%xmm4
movdqa 0xec7(%rip),%xmm0
movdqa %xmm4,%xmm5
pand   %xmm0,%xmm5
movdqa 0xec7(%rip),%xmm1
por    %xmm1,%xmm5
psrlq  $0x20,%xmm4
movdqa 0xec6(%rip),%xmm2
por    %xmm2,%xmm4
movapd 0xeca(%rip),%xmm3
subpd  %xmm3,%xmm4
addpd  %xmm5,%xmm4
divpd  0xeca(%rip),%xmm4
movupd %xmm4,0x8(%rsi)
movdqu 0x18(%rcx),%xmm4
movdqa %xmm4,%xmm5
pand   %xmm0,%xmm5
por    %xmm1,%xmm5
psrlq  $0x20,%xmm4
por    %xmm2,%xmm4
subpd  %xmm3,%xmm4
addpd  %xmm5,%xmm4
divpd  0xeab(%rip),%xmm4
movupd %xmm4,0x18(%rsi)
movsd  0x28(%rcx),%xmm6
movapd 0xe29(%rip),%xmm4
unpcklps %xmm4,%xmm6
movapd 0xe2e(%rip),%xmm5
subpd  %xmm5,%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
addsd  %xmm6,%xmm7
divsd  0xe86(%rip),%xmm7
movsd  %xmm7,0x28(%rsi)
movdqu 0x30(%rcx),%xmm6
movdqa %xmm6,%xmm7
pand   %xmm0,%xmm7
por    %xmm1,%xmm7
psrlq  $0x20,%xmm6
por    %xmm2,%xmm6
subpd  %xmm3,%xmm6
addpd  %xmm7,%xmm6
movupd %xmm6,0x30(%rsi)
movdqu 0x40(%rcx),%xmm6
movdqa %xmm6,%xmm7
pand   %xmm0,%xmm7
por    %xmm1,%xmm7
psrlq  $0x20,%xmm6
por    %xmm2,%xmm6
subpd  %xmm3,%xmm6
addpd  %xmm7,%xmm6
movupd %xmm6,0x40(%rsi)
movsd  0x50(%rcx),%xmm6
unpcklps %xmm4,%xmm6
subpd  %xmm5,%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
addsd  %xmm6,%xmm7
movsd  %xmm7,0x50(%rsi)
mov    0x58(%rcx),%rax
shl    $0xa,%rax
movq   %rax,%xmm6
punpckldq %xmm4,%xmm6
subpd  %xmm5,%xmm6
movapd %xmm6,%xmm4
unpckhpd %xmm6,%xmm4
addsd  %xmm6,%xmm4
divsd  0xdf5(%rip),%xmm4
movsd  %xmm4,0x58(%rsi)
movdqu 0x60(%rcx),%xmm4
pand   %xmm4,%xmm0
por    %xmm1,%xmm0
psrlq  $0x20,%xmm4
por    %xmm2,%xmm4
subpd  %xmm3,%xmm4
addpd  %xmm0,%xmm4
movupd %xmm4,0x60(%rsi)
ret

LLVM IR (-O0):
%struct.module = type opaque
define void @set_squid_record(%struct.module* %0, double* %1, i64* %2, i64* %3, i32 %4) {
%6 = alloca %struct.module*
%7 = alloca double*
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i32
%11 = alloca i32
store %struct.module* %0, %struct.module** %6
store double* %1, double** %7
store i64* %2, i64** %8
store i64* %3, i64** %9
store i32 %4, i32* %10
%12 = load i64*, i64** %9
%13 = getelementptr inbounds i64, i64* %12, i64 0
%14 = load i64, i64* %13
%15 = load i64*, i64** %8
%16 = getelementptr inbounds i64, i64* %15, i64 0
%17 = load i64, i64* %16
%18 = icmp uge i64 %14, %17
br i1 %18, label %19, label %33
19: ; preds = %5
%20 = load i64*, i64** %9
%21 = getelementptr inbounds i64, i64* %20, i64 0
%22 = load i64, i64* %21
%23 = load i64*, i64** %8
%24 = getelementptr inbounds i64, i64* %23, i64 0
%25 = load i64, i64* %24
%26 = sub i64 %22, %25
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = udiv i64 %26, %28
%30 = uitofp i64 %29 to double
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 0
store double %30, double* %32
br label %36
33: ; preds = %5
%34 = load double*, double** %7
%35 = getelementptr inbounds double, double* %34, i64 0
store double 0.000000e+00, double* %35
br label %36
36: ; preds = %33, %19
%37 = load i64*, i64** %9
%38 = getelementptr inbounds i64, i64* %37, i64 1
%39 = load i64, i64* %38
%40 = uitofp i64 %39 to double
%41 = fdiv double %40, 1.000000e+02
%42 = load double*, double** %7
%43 = getelementptr inbounds double, double* %42, i64 1
store double %41, double* %43
store i32 2, i32* %11
br label %44
44: ; preds = %59, %36
%45 = load i32, i32* %11
%46 = icmp sle i32 %45, 5
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = load i64*, i64** %9
%49 = load i32, i32* %11
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i64, i64* %48, i64 %50
%52 = load i64, i64* %51
%53 = uitofp i64 %52 to double
%54 = fdiv double %53, 1.000000e+01
%55 = load double*, double** %7
%56 = load i32, i32* %11
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
store double %54, double* %58
br label %59
59: ; preds = %47
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %11
br label %44
62: ; preds = %44
store i32 6, i32* %11
br label %63
63: ; preds = %77, %62
%64 = load i32, i32* %11
%65 = icmp sle i32 %64, 10
br i1 %65, label %66, label %80
66: ; preds = %63
%67 = load i64*, i64** %9
%68 = load i32, i32* %11
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i64, i64* %67, i64 %69
%71 = load i64, i64* %70
%72 = uitofp i64 %71 to double
%73 = load double*, double** %7
%74 = load i32, i32* %11
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
store double %72, double* %76
br label %77
77: ; preds = %66
%78 = load i32, i32* %11
%79 = add nsw i32 %78, 1
store i32 %79, i32* %11
br label %63
80: ; preds = %63
%81 = load i64*, i64** %9
%82 = getelementptr inbounds i64, i64* %81, i64 11
%83 = load i64, i64* %82
%84 = shl i64 %83, 10
%85 = uitofp i64 %84 to double
%86 = fdiv double %85, 1.000000e+02
%87 = load double*, double** %7
%88 = getelementptr inbounds double, double* %87, i64 11
store double %86, double* %88
%89 = load i64*, i64** %9
%90 = getelementptr inbounds i64, i64* %89, i64 12
%91 = load i64, i64* %90
%92 = uitofp i64 %91 to double
%93 = load double*, double** %7
%94 = getelementptr inbounds double, double* %93, i64 12
store double %92, double* %94
%95 = load i64*, i64** %9
%96 = getelementptr inbounds i64, i64* %95, i64 13
%97 = load i64, i64* %96
%98 = uitofp i64 %97 to double
%99 = load double*, double** %7
%100 = getelementptr inbounds double, double* %99, i64 13
store double %98, double* %100
ret void
}

LLVM IR (-O2):
%struct.module = type opaque
define void @set_squid_record(%struct.module* nocapture readnone %0, double* nocapture writeonly %1, i64* nocapture %2, i64* nocapture %3, i32 %4) {
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = sub i64 %6, %7
%11 = sext i32 %4 to i64
%12 = udiv i64 %10, %11
%13 = uitofp i64 %12 to double
br label %14
14: ; preds = %5, %9
%15 = phi double [ %13, %9 ], [ 0.000000e+00, %5 ]
store double %15, double* %1
%16 = getelementptr inbounds i64, i64* %3, i64 1
%17 = getelementptr inbounds double, double* %1, i64 1
%18 = bitcast i64* %16 to <2 x i64>*
%19 = load <2 x i64>, <2 x i64>* %18
%20 = uitofp <2 x i64> %19 to <2 x double>
%21 = fdiv <2 x double> %20, <double 1.000000e+02, double 1.000000e+01>
%22 = bitcast double* %17 to <2 x double>*
store <2 x double> %21, <2 x double>* %22
%23 = getelementptr inbounds i64, i64* %3, i64 3
%24 = getelementptr inbounds double, double* %1, i64 3
%25 = bitcast i64* %23 to <2 x i64>*
%26 = load <2 x i64>, <2 x i64>* %25
%27 = uitofp <2 x i64> %26 to <2 x double>
%28 = fdiv <2 x double> %27, <double 1.000000e+01, double 1.000000e+01>
%29 = bitcast double* %24 to <2 x double>*
store <2 x double> %28, <2 x double>* %29
%30 = getelementptr inbounds i64, i64* %3, i64 5
%31 = load i64, i64* %30
%32 = uitofp i64 %31 to double
%33 = fdiv double %32, 1.000000e+01
%34 = getelementptr inbounds double, double* %1, i64 5
store double %33, double* %34
%35 = getelementptr inbounds i64, i64* %3, i64 6
%36 = getelementptr inbounds double, double* %1, i64 6
%37 = bitcast i64* %35 to <2 x i64>*
%38 = load <2 x i64>, <2 x i64>* %37
%39 = uitofp <2 x i64> %38 to <2 x double>
%40 = bitcast double* %36 to <2 x double>*
store <2 x double> %39, <2 x double>* %40
%41 = getelementptr inbounds i64, i64* %3, i64 8
%42 = getelementptr inbounds double, double* %1, i64 8
%43 = bitcast i64* %41 to <2 x i64>*
%44 = load <2 x i64>, <2 x i64>* %43
%45 = uitofp <2 x i64> %44 to <2 x double>
%46 = bitcast double* %42 to <2 x double>*
store <2 x double> %45, <2 x double>* %46
%47 = getelementptr inbounds i64, i64* %3, i64 10
%48 = load i64, i64* %47
%49 = uitofp i64 %48 to double
%50 = getelementptr inbounds double, double* %1, i64 10
store double %49, double* %50
%51 = getelementptr inbounds i64, i64* %3, i64 11
%52 = load i64, i64* %51
%53 = shl i64 %52, 10
%54 = uitofp i64 %53 to double
%55 = fdiv double %54, 1.000000e+02
%56 = getelementptr inbounds double, double* %1, i64 11
store double %55, double* %56
%57 = getelementptr inbounds i64, i64* %3, i64 12
%58 = getelementptr inbounds double, double* %1, i64 12
%59 = bitcast i64* %57 to <2 x i64>*
%60 = load <2 x i64>, <2 x i64>* %59
%61 = uitofp <2 x i64> %60 to <2 x double>
%62 = bitcast double* %58 to <2 x double>*
store <2 x double> %61, <2 x double>* %62
ret void
}