#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 pow(double, long);
void update_test_point_dense_Katyusha(double *x, double *w, double *wold,
                                      double *gold, double sigmoid,
                                      double sigmoidold, long d,
                                      double stepSize, double lambda,
                                      double *ww, double *ym, double *zm,
                                      double *zm_prev, double tau, double tau2,
                                      long iter) {
  for (long j = 0; j < d; j++) {
    zm_prev[j] = zm[j];
    zm[j] -= stepSize * (gold[j] + x[j] * (sigmoid - sigmoidold) +
                         lambda * (w[j] - wold[j]));
    ym[j] = w[j] + (zm[j] - zm_prev[j]) * tau;
    ww[j] += ym[j] * pow(tau2, iter);
  }
}


x86 assembly (clang, -O0):
<update_test_point_dense_Katyusha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movsd  %xmm3,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
movsd  %xmm4,-0x58(%rbp)
movsd  %xmm5,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    12ab <update_test_point_dense_Katyusha+0x19b>
mov    0x18(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x28(%rbp),%xmm3
subsd  -0x30(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x48(%rbp),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%rax
mov    -0x68(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    0x18(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x18(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
mov    -0x68(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    0x28(%rbp),%rdi
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
jmp    1166 <update_test_point_dense_Katyusha+0x56>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_test_point_dense_Katyusha>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movaps %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
test   %r8,%r8
jle    124a <update_test_point_dense_Katyusha+0x13a>
mov    %r9,%rbx
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
movsd  0x8(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xea4(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xor    %r14d,%r14d
movsd  %xmm5,0x38(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x28(%rsp)
mov    %rdi,0x20(%rsp)
nopl   0x0(%rax)
mov    0x88(%rsp),%rbp
movsd  0x0(%rbp,%r14,8),%xmm0
mov    0x90(%rsp),%rax
movsd  %xmm0,(%rax,%r14,8)
movsd  (%rdi,%r14,8),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  (%r15,%r14,8),%xmm0
movsd  0x0(%r13,%r14,8),%xmm1
subsd  (%r12,%r14,8),%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  0x0(%rbp,%r14,8),%xmm1
movsd  %xmm1,0x0(%rbp,%r14,8)
subsd  (%rax,%r14,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  0x0(%r13,%r14,8),%xmm1
movsd  %xmm1,0x40(%rsp)
mov    0x80(%rsp),%rax
movsd  %xmm1,(%rax,%r14,8)
movapd %xmm5,%xmm0
mov    0x98(%rsp),%rdi
mov    %r8,%rbp
call   1030 <pow@plt>
mov    0x20(%rsp),%rdi
mov    %rbp,%r8
movsd  0x28(%rsp),%xmm3
movsd  0x30(%rsp),%xmm4
movsd  0x38(%rsp),%xmm5
mulsd  0x40(%rsp),%xmm0
addsd  (%rbx,%r14,8),%xmm0
movsd  %xmm0,(%rbx,%r14,8)
add    $0x1,%r14
cmp    %r14,%rbp
jne    1180 <update_test_point_dense_Katyusha+0x70>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @update_test_point_dense_Katyusha(double* %0, double* %1, double* %2, double* %3, double %4, double %5, i64 %6, double %7, double %8, double* %9, double* %10, double* %11, double* %12, double %13, double %14, i64 %15) {
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double
%22 = alloca double
%23 = alloca i64
%24 = alloca double
%25 = alloca double
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double
%31 = alloca double
%32 = alloca i64
%33 = alloca i64
store double* %0, double** %17
store double* %1, double** %18
store double* %2, double** %19
store double* %3, double** %20
store double %4, double* %21
store double %5, double* %22
store i64 %6, i64* %23
store double %7, double* %24
store double %8, double* %25
store double* %9, double** %26
store double* %10, double** %27
store double* %11, double** %28
store double* %12, double** %29
store double %13, double* %30
store double %14, double* %31
store i64 %15, i64* %32
store i64 0, i64* %33
br label %34
34: ; preds = %106, %16
%35 = load i64, i64* %33
%36 = load i64, i64* %23
%37 = icmp slt i64 %35, %36
br i1 %37, label %38, label %109
38: ; preds = %34
%39 = load double*, double** %28
%40 = load i64, i64* %33
%41 = getelementptr inbounds double, double* %39, i64 %40
%42 = load double, double* %41
%43 = load double*, double** %29
%44 = load i64, i64* %33
%45 = getelementptr inbounds double, double* %43, i64 %44
store double %42, double* %45
%46 = load double, double* %24
%47 = load double*, double** %20
%48 = load i64, i64* %33
%49 = getelementptr inbounds double, double* %47, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %17
%52 = load i64, i64* %33
%53 = getelementptr inbounds double, double* %51, i64 %52
%54 = load double, double* %53
%55 = load double, double* %21
%56 = load double, double* %22
%57 = fsub double %55, %56
%58 = call double @llvm.fmuladd.f64(double %54, double %57, double %50)
%59 = load double, double* %25
%60 = load double*, double** %18
%61 = load i64, i64* %33
%62 = getelementptr inbounds double, double* %60, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %19
%65 = load i64, i64* %33
%66 = getelementptr inbounds double, double* %64, i64 %65
%67 = load double, double* %66
%68 = fsub double %63, %67
%69 = call double @llvm.fmuladd.f64(double %59, double %68, double %58)
%70 = load double*, double** %28
%71 = load i64, i64* %33
%72 = getelementptr inbounds double, double* %70, i64 %71
%73 = load double, double* %72
%74 = fneg double %46
%75 = call double @llvm.fmuladd.f64(double %74, double %69, double %73)
store double %75, double* %72
%76 = load double*, double** %18
%77 = load i64, i64* %33
%78 = getelementptr inbounds double, double* %76, i64 %77
%79 = load double, double* %78
%80 = load double*, double** %28
%81 = load i64, i64* %33
%82 = getelementptr inbounds double, double* %80, i64 %81
%83 = load double, double* %82
%84 = load double*, double** %29
%85 = load i64, i64* %33
%86 = getelementptr inbounds double, double* %84, i64 %85
%87 = load double, double* %86
%88 = fsub double %83, %87
%89 = load double, double* %30
%90 = call double @llvm.fmuladd.f64(double %88, double %89, double %79)
%91 = load double*, double** %27
%92 = load i64, i64* %33
%93 = getelementptr inbounds double, double* %91, i64 %92
store double %90, double* %93
%94 = load double*, double** %27
%95 = load i64, i64* %33
%96 = getelementptr inbounds double, double* %94, i64 %95
%97 = load double, double* %96
%98 = load double, double* %31
%99 = load i64, i64* %32
%100 = call double @pow(double %98, i64 %99)
%101 = load double*, double** %26
%102 = load i64, i64* %33
%103 = getelementptr inbounds double, double* %101, i64 %102
%104 = load double, double* %103
%105 = call double @llvm.fmuladd.f64(double %97, double %100, double %104)
store double %105, double* %103
br label %106
106: ; preds = %38
%107 = load i64, i64* %33
%108 = add nsw i64 %107, 1
store i64 %108, i64* %33
br label %34
109: ; preds = %34
ret void
}

LLVM IR (-O2):
define void @update_test_point_dense_Katyusha(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double %4, double %5, i64 %6, double %7, double %8, double* nocapture %9, double* nocapture writeonly %10, double* nocapture %11, double* nocapture %12, double %13, double %14, i64 %15) {
%17 = icmp sgt i64 %6, 0
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = fsub double %4, %5
%20 = fneg double %7
br label %22
21: ; preds = %22, %16
ret void
22: ; preds = %18, %22
%23 = phi i64 [ 0, %18 ], [ %49, %22 ]
%24 = getelementptr inbounds double, double* %11, i64 %23
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %12, i64 %23
store double %25, double* %26
%27 = getelementptr inbounds double, double* %3, i64 %23
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %0, i64 %23
%30 = load double, double* %29
%31 = tail call double @llvm.fmuladd.f64(double %30, double %19, double %28)
%32 = getelementptr inbounds double, double* %1, i64 %23
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %2, i64 %23
%35 = load double, double* %34
%36 = fsub double %33, %35
%37 = tail call double @llvm.fmuladd.f64(double %8, double %36, double %31)
%38 = load double, double* %24
%39 = tail call double @llvm.fmuladd.f64(double %20, double %37, double %38)
store double %39, double* %24
%40 = load double, double* %32
%41 = load double, double* %26
%42 = fsub double %39, %41
%43 = tail call double @llvm.fmuladd.f64(double %42, double %13, double %40)
%44 = getelementptr inbounds double, double* %10, i64 %23
store double %43, double* %44
%45 = tail call double @pow(double %14, i64 %15)
%46 = getelementptr inbounds double, double* %9, i64 %23
%47 = load double, double* %46
%48 = tail call double @llvm.fmuladd.f64(double %43, double %45, double %47)
store double %48, double* %46
%49 = add nuw nsw i64 %23, 1
%50 = icmp eq i64 %49, %6
br i1 %50, label %21, label %22
}