#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, double);
void wcsulex_add(double *factor, double types[], double *expon, double *scale,
                 double units[]) {
  int i;
  *scale *= pow(*factor, *expon);
  for (i = 0; i < 17; i++) {
    units[i] += *expon * types[i];
    types[i] = 0.0;
  }
  *expon = 1.0;
  *factor = 1.0;
  return;
}


x86 assembly (clang, -O0):
<wcsulex_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
call   1030 <pow@plt>
mov    -0x20(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x11,-0x2c(%rbp)
jge    11ab <wcsulex_add+0x9b>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1154 <wcsulex_add+0x44>
mov    -0x18(%rbp),%rax
movsd  0xe49(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe39(%rip),%xmm0
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsulex_add>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r12
mov    %rcx,%r13
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movsd  (%rdi),%xmm0
movsd  (%rdx),%xmm1
call   1030 <pow@plt>
mulsd  0x0(%r13),%xmm0
movsd  %xmm0,0x0(%r13)
lea    0x88(%r12),%rax
lea    0x88(%rbx),%rdi
lea    0x8(%r14),%rdx
cmp    %r12,%rdi
seta   %sil
cmp    %rbx,%rax
seta   %cl
and    %sil,%cl
cmp    %r12,%rdx
seta   %sil
cmp    %r14,%rax
seta   %al
and    %sil,%al
or     %cl,%al
cmp    %rbx,%rdx
seta   %cl
cmp    %r14,%rdi
seta   %dl
and    %cl,%dl
or     %al,%dl
je     118f <wcsulex_add+0x7f>
xor    %ecx,%ecx
jmp    12dc <wcsulex_add+0x1cc>
movsd  (%r14),%xmm0
unpcklpd %xmm0,%xmm0
movupd (%rbx),%xmm1
mulpd  %xmm0,%xmm1
movupd (%r12),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm0,(%r12)
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x10(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x10(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x10(%r12)
movupd %xmm0,0x10(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x20(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x20(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x20(%r12)
movupd %xmm0,0x20(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x30(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x30(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x30(%r12)
movupd %xmm0,0x30(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x40(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x40(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x40(%r12)
movupd %xmm0,0x40(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x50(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x50(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x50(%r12)
movupd %xmm0,0x50(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x60(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x60(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x60(%r12)
movupd %xmm0,0x60(%rbx)
movsd  (%r14),%xmm1
unpcklpd %xmm1,%xmm1
movupd 0x70(%rbx),%xmm2
mulpd  %xmm1,%xmm2
movupd 0x70(%r12),%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,0x70(%r12)
movupd %xmm0,0x70(%rbx)
mov    $0x10,%ecx
movsd  (%r14),%xmm0
mulsd  (%rbx,%rcx,8),%xmm0
addsd  (%r12,%rcx,8),%xmm0
movsd  %xmm0,(%r12,%rcx,8)
movq   $0x0,(%rbx,%rcx,8)
test   %dl,%dl
je     134e <wcsulex_add+0x23e>
xchg   %ax,%ax
movsd  (%r14),%xmm0
mulsd  0x8(%rbx,%rcx,8),%xmm0
addsd  0x8(%r12,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r12,%rcx,8)
movq   $0x0,0x8(%rbx,%rcx,8)
movsd  (%r14),%xmm0
mulsd  0x10(%rbx,%rcx,8),%xmm0
addsd  0x10(%r12,%rcx,8),%xmm0
movsd  %xmm0,0x10(%r12,%rcx,8)
movq   $0x0,0x10(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    $0x10,%rcx
jne    1300 <wcsulex_add+0x1f0>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
mov    %rax,(%r15)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @wcsulex_add(double* %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %8
%15 = load double, double* %14
%16 = call double @pow(double %13, double %15)
%17 = load double*, double** %9
%18 = load double, double* %17
%19 = fmul double %18, %16
store double %19, double* %17
store i32 0, i32* %11
br label %20
20: ; preds = %41, %5
%21 = load i32, i32* %11
%22 = icmp slt i32 %21, 17
br i1 %22, label %23, label %44
23: ; preds = %20
%24 = load double*, double** %8
%25 = load double, double* %24
%26 = load double*, double** %7
%27 = load i32, i32* %11
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
%31 = load double*, double** %10
%32 = load i32, i32* %11
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = call double @llvm.fmuladd.f64(double %25, double %30, double %35)
store double %36, double* %34
%37 = load double*, double** %7
%38 = load i32, i32* %11
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %37, i64 %39
store double 0.000000e+00, double* %40
br label %41
41: ; preds = %23
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
store i32 %43, i32* %11
br label %20
44: ; preds = %20
%45 = load double*, double** %8
store double 1.000000e+00, double* %45
%46 = load double*, double** %6
store double 1.000000e+00, double* %46
ret void
}

LLVM IR (-O2):
define void @wcsulex_add(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
%6 = load double, double* %0
%7 = load double, double* %2
%8 = tail call double @pow(double %6, double %7)
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %3
%11 = getelementptr double, double* %4, i64 17
%12 = getelementptr double, double* %1, i64 17
%13 = getelementptr double, double* %2, i64 1
%14 = icmp ugt double* %12, %4
%15 = icmp ugt double* %11, %1
%16 = and i1 %14, %15
%17 = icmp ugt double* %13, %4
%18 = icmp ugt double* %11, %2
%19 = and i1 %17, %18
%20 = or i1 %16, %19
%21 = icmp ugt double* %13, %1
%22 = icmp ugt double* %12, %2
%23 = and i1 %21, %22
%24 = or i1 %20, %23
br i1 %24, label %120, label %25
25: ; preds = %5
%26 = load double, double* %2
%27 = insertelement <2 x double> poison, double %26, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = bitcast double* %1 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = bitcast double* %4 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %28, <2 x double> %30, <2 x double> %32)
%34 = bitcast double* %4 to <2 x double>*
store <2 x double> %33, <2 x double>* %34
%35 = bitcast double* %1 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %35
%36 = load double, double* %2
%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 = getelementptr inbounds double, double* %1, i64 2
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = getelementptr inbounds double, double* %4, i64 2
%43 = bitcast double* %42 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %41, <2 x double> %44)
%46 = bitcast double* %42 to <2 x double>*
store <2 x double> %45, <2 x double>* %46
%47 = bitcast double* %39 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %47
%48 = load double, double* %2
%49 = insertelement <2 x double> poison, double %48, i64 0
%50 = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> zeroinitializer
%51 = getelementptr inbounds double, double* %1, i64 4
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = getelementptr inbounds double, double* %4, i64 4
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %50, <2 x double> %53, <2 x double> %56)
%58 = bitcast double* %54 to <2 x double>*
store <2 x double> %57, <2 x double>* %58
%59 = bitcast double* %51 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %59
%60 = load double, double* %2
%61 = insertelement <2 x double> poison, double %60, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
%63 = getelementptr inbounds double, double* %1, i64 6
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = getelementptr inbounds double, double* %4, i64 6
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %62, <2 x double> %65, <2 x double> %68)
%70 = bitcast double* %66 to <2 x double>*
store <2 x double> %69, <2 x double>* %70
%71 = bitcast double* %63 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %71
%72 = load double, double* %2
%73 = insertelement <2 x double> poison, double %72, i64 0
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> zeroinitializer
%75 = getelementptr inbounds double, double* %1, i64 8
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = getelementptr inbounds double, double* %4, i64 8
%79 = bitcast double* %78 to <2 x double>*
%80 = load <2 x double>, <2 x double>* %79
%81 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %77, <2 x double> %80)
%82 = bitcast double* %78 to <2 x double>*
store <2 x double> %81, <2 x double>* %82
%83 = bitcast double* %75 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %83
%84 = load double, double* %2
%85 = insertelement <2 x double> poison, double %84, i64 0
%86 = shufflevector <2 x double> %85, <2 x double> poison, <2 x i32> zeroinitializer
%87 = getelementptr inbounds double, double* %1, i64 10
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = getelementptr inbounds double, double* %4, i64 10
%91 = bitcast double* %90 to <2 x double>*
%92 = load <2 x double>, <2 x double>* %91
%93 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %86, <2 x double> %89, <2 x double> %92)
%94 = bitcast double* %90 to <2 x double>*
store <2 x double> %93, <2 x double>* %94
%95 = bitcast double* %87 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %95
%96 = load double, double* %2
%97 = insertelement <2 x double> poison, double %96, i64 0
%98 = shufflevector <2 x double> %97, <2 x double> poison, <2 x i32> zeroinitializer
%99 = getelementptr inbounds double, double* %1, i64 12
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %4, i64 12
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %101, <2 x double> %104)
%106 = bitcast double* %102 to <2 x double>*
store <2 x double> %105, <2 x double>* %106
%107 = bitcast double* %99 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %107
%108 = load double, double* %2
%109 = insertelement <2 x double> poison, double %108, i64 0
%110 = shufflevector <2 x double> %109, <2 x double> poison, <2 x i32> zeroinitializer
%111 = getelementptr inbounds double, double* %1, i64 14
%112 = bitcast double* %111 to <2 x double>*
%113 = load <2 x double>, <2 x double>* %112
%114 = getelementptr inbounds double, double* %4, i64 14
%115 = bitcast double* %114 to <2 x double>*
%116 = load <2 x double>, <2 x double>* %115
%117 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %110, <2 x double> %113, <2 x double> %116)
%118 = bitcast double* %114 to <2 x double>*
store <2 x double> %117, <2 x double>* %118
%119 = bitcast double* %111 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %119
br label %120
120: ; preds = %25, %5
%121 = phi i64 [ 0, %5 ], [ 16, %25 ]
%122 = load double, double* %2
%123 = getelementptr inbounds double, double* %1, i64 %121
%124 = load double, double* %123
%125 = getelementptr inbounds double, double* %4, i64 %121
%126 = load double, double* %125
%127 = tail call double @llvm.fmuladd.f64(double %122, double %124, double %126)
store double %127, double* %125
store double 0.000000e+00, double* %123
%128 = or i64 %121, 1
br i1 %24, label %129, label %146
129: ; preds = %120, %129
%130 = phi i64 [ %144, %129 ], [ %128, %120 ]
%131 = load double, double* %2
%132 = getelementptr inbounds double, double* %1, i64 %130
%133 = load double, double* %132
%134 = getelementptr inbounds double, double* %4, i64 %130
%135 = load double, double* %134
%136 = tail call double @llvm.fmuladd.f64(double %131, double %133, double %135)
store double %136, double* %134
store double 0.000000e+00, double* %132
%137 = add nuw nsw i64 %130, 1
%138 = load double, double* %2
%139 = getelementptr inbounds double, double* %1, i64 %137
%140 = load double, double* %139
%141 = getelementptr inbounds double, double* %4, i64 %137
%142 = load double, double* %141
%143 = tail call double @llvm.fmuladd.f64(double %138, double %140, double %142)
store double %143, double* %141
store double 0.000000e+00, double* %139
%144 = add nuw nsw i64 %130, 2
%145 = icmp eq i64 %144, 17
br i1 %145, label %146, label %129
146: ; preds = %129, %120
store double 1.000000e+00, double* %2
store double 1.000000e+00, double* %0
ret void
}