void set_mem_record(struct module *mod, double st_array[],
                    unsigned long long pre_array[],
                    unsigned long long cur_array[], int inter) {
  st_array[0] = cur_array[0] << 10;
  st_array[1] = (cur_array[4] - cur_array[0] - cur_array[2] - cur_array[3])
                << 10;
  st_array[2] = cur_array[2] << 10;
  st_array[3] = cur_array[3] << 10;
  st_array[4] = cur_array[4] << 10;
  st_array[5] = st_array[1] * 100.0 / (cur_array[4] << 10);
}


x86 assembly (clang, -O0):
<set_mem_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
shl    $0xa,%rax
movq   %rax,%xmm0
movaps 0xed1(%rip),%xmm3
punpckldq %xmm3,%xmm0
movapd 0xed5(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rcx
mov    0x20(%rcx),%rax
mov    (%rcx),%rsi
mov    0x10(%rcx),%rdx
sub    %rsi,%rax
sub    %rdx,%rax
mov    0x18(%rcx),%rcx
sub    %rcx,%rax
shl    $0xa,%rax
movq   %rax,%xmm0
punpckldq %xmm3,%xmm0
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0xa,%rax
movq   %rax,%xmm0
punpckldq %xmm3,%xmm0
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0xa,%rax
movq   %rax,%xmm0
punpckldq %xmm3,%xmm0
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rax
shl    $0xa,%rax
movq   %rax,%xmm0
punpckldq %xmm3,%xmm0
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xdf5(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rax
shl    $0xa,%rax
movq   %rax,%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mem_record>:
mov    (%rcx),%rdx
mov    0x20(%rcx),%rax
movdqu 0x10(%rcx),%xmm1
movq   %xmm1,%rcx
add    %rdx,%rcx
pshufd $0xee,%xmm1,%xmm0
movq   %xmm0,%rdi
add    %rcx,%rdi
mov    %rax,%rcx
sub    %rdi,%rcx
movq   %rcx,%xmm2
movq   %rdx,%xmm0
punpcklqdq %xmm2,%xmm0
psllq  $0xa,%xmm0
movdqa 0xebe(%rip),%xmm2
movdqa %xmm0,%xmm3
pand   %xmm2,%xmm3
movdqa 0xebe(%rip),%xmm4
por    %xmm4,%xmm3
psrlq  $0x20,%xmm0
movdqa 0xebd(%rip),%xmm5
por    %xmm5,%xmm0
movapd 0xec1(%rip),%xmm6
subpd  %xmm6,%xmm0
addpd  %xmm3,%xmm0
movupd %xmm0,(%rsi)
psllq  $0xa,%xmm1
pand   %xmm1,%xmm2
por    %xmm4,%xmm2
psrlq  $0x20,%xmm1
por    %xmm5,%xmm1
subpd  %xmm6,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x10(%rsi)
shl    $0xa,%rax
movq   %rax,%xmm1
punpckldq 0xe91(%rip),%xmm1
subpd  0xe99(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsi)
unpckhpd %xmm0,%xmm0
mulsd  0xe8c(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x28(%rsi)
ret

LLVM IR (-O0):
%struct.module = type opaque
define void @set_mem_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
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
%11 = load i64*, i64** %9
%12 = getelementptr inbounds i64, i64* %11, i64 0
%13 = load i64, i64* %12
%14 = shl i64 %13, 10
%15 = uitofp i64 %14 to double
%16 = load double*, double** %7
%17 = getelementptr inbounds double, double* %16, i64 0
store double %15, double* %17
%18 = load i64*, i64** %9
%19 = getelementptr inbounds i64, i64* %18, i64 4
%20 = load i64, i64* %19
%21 = load i64*, i64** %9
%22 = getelementptr inbounds i64, i64* %21, i64 0
%23 = load i64, i64* %22
%24 = sub i64 %20, %23
%25 = load i64*, i64** %9
%26 = getelementptr inbounds i64, i64* %25, i64 2
%27 = load i64, i64* %26
%28 = sub i64 %24, %27
%29 = load i64*, i64** %9
%30 = getelementptr inbounds i64, i64* %29, i64 3
%31 = load i64, i64* %30
%32 = sub i64 %28, %31
%33 = shl i64 %32, 10
%34 = uitofp i64 %33 to double
%35 = load double*, double** %7
%36 = getelementptr inbounds double, double* %35, i64 1
store double %34, double* %36
%37 = load i64*, i64** %9
%38 = getelementptr inbounds i64, i64* %37, i64 2
%39 = load i64, i64* %38
%40 = shl i64 %39, 10
%41 = uitofp i64 %40 to double
%42 = load double*, double** %7
%43 = getelementptr inbounds double, double* %42, i64 2
store double %41, double* %43
%44 = load i64*, i64** %9
%45 = getelementptr inbounds i64, i64* %44, i64 3
%46 = load i64, i64* %45
%47 = shl i64 %46, 10
%48 = uitofp i64 %47 to double
%49 = load double*, double** %7
%50 = getelementptr inbounds double, double* %49, i64 3
store double %48, double* %50
%51 = load i64*, i64** %9
%52 = getelementptr inbounds i64, i64* %51, i64 4
%53 = load i64, i64* %52
%54 = shl i64 %53, 10
%55 = uitofp i64 %54 to double
%56 = load double*, double** %7
%57 = getelementptr inbounds double, double* %56, i64 4
store double %55, double* %57
%58 = load double*, double** %7
%59 = getelementptr inbounds double, double* %58, i64 1
%60 = load double, double* %59
%61 = fmul double %60, 1.000000e+02
%62 = load i64*, i64** %9
%63 = getelementptr inbounds i64, i64* %62, i64 4
%64 = load i64, i64* %63
%65 = shl i64 %64, 10
%66 = uitofp i64 %65 to double
%67 = fdiv double %61, %66
%68 = load double*, double** %7
%69 = getelementptr inbounds double, double* %68, i64 5
store double %67, double* %69
ret void
}

LLVM IR (-O2):
%struct.module = type opaque
define void @set_mem_record(%struct.module* nocapture readnone %0, double* nocapture %1, i64* nocapture readnone %2, i64* nocapture %3, i32 %4) {
%6 = load i64, i64* %3
%7 = getelementptr inbounds i64, i64* %3, i64 4
%8 = load i64, i64* %7
%9 = getelementptr inbounds i64, i64* %3, i64 2
%10 = bitcast i64* %9 to <2 x i64>*
%11 = load <2 x i64>, <2 x i64>* %10
%12 = extractelement <2 x i64> %11, i64 0
%13 = add i64 %6, %12
%14 = extractelement <2 x i64> %11, i64 1
%15 = add i64 %13, %14
%16 = sub i64 %8, %15
%17 = insertelement <2 x i64> poison, i64 %6, i64 0
%18 = insertelement <2 x i64> %17, i64 %16, i64 1
%19 = shl <2 x i64> %18, <i64 10, i64 10>
%20 = uitofp <2 x i64> %19 to <2 x double>
%21 = bitcast double* %1 to <2 x double>*
store <2 x double> %20, <2 x double>* %21
%22 = getelementptr inbounds double, double* %1, i64 2
%23 = shl <2 x i64> %11, <i64 10, i64 10>
%24 = uitofp <2 x i64> %23 to <2 x double>
%25 = bitcast double* %22 to <2 x double>*
store <2 x double> %24, <2 x double>* %25
%26 = shl i64 %8, 10
%27 = uitofp i64 %26 to double
%28 = getelementptr inbounds double, double* %1, i64 4
store double %27, double* %28
%29 = extractelement <2 x double> %20, i64 1
%30 = fmul double %29, 1.000000e+02
%31 = fdiv double %30, %27
%32 = getelementptr inbounds double, double* %1, i64 5
store double %31, double* %32
ret void
}