#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 log(double);
int /*<<< orphan*/ movem(double *, double *, int, int);
double pow(double, double const);
void ignorm(double *c1, double *c2, int m, const double g) {
  double k;
  k = pow(c1[0], g);
  if (g != 0.0) {
    for (; m >= 1; m--)
      c2[m] = k * c1[m];
    c2[0] = (k - 1.0) / g;
  } else {
    movem(&c1[1], &c2[1], sizeof(*c1), m);
    c2[0] = log(c1[0]);
  }
  return;
}


x86 assembly (clang, -O0):
<ignorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117c <ignorm+0x4c>
jp     117c <ignorm+0x4c>
jmp    11db <ignorm+0xab>
jmp    1181 <ignorm+0x51>
cmpl   $0x1,-0x14(%rbp)
jl     11b8 <ignorm+0x88>
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <ignorm+0x51>
movsd  -0x28(%rbp),%xmm0
movsd  0xe3b(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    120d <ignorm+0xdd>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x14(%rbp),%ecx
mov    $0x8,%edx
call   1030 <movem@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <log@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignorm>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm4
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm4
jne    1169 <ignorm+0x39>
jnp    12a9 <ignorm+0x179>
test   %ebp,%ebp
jle    129b <ignorm+0x16b>
mov    %ebp,%eax
cmp    $0x4,%ebp
jb     1271 <ignorm+0x141>
lea    0x8(%r14),%rcx
lea    (%rbx,%rax,8),%rdx
add    $0x8,%rdx
cmp    %rdx,%rcx
jae    11a2 <ignorm+0x72>
lea    (%r14,%rax,8),%rcx
add    $0x8,%rcx
lea    0x8(%rbx),%rdx
cmp    %rcx,%rdx
jb     1271 <ignorm+0x141>
mov    %eax,%r8d
and    $0xfffffffc,%r8d
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%r8),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
shufpd $0x1,%xmm1,%xmm1
test   %rcx,%rcx
je     12d4 <ignorm+0x1a4>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
lea    (%r14,%rax,8),%rbp
add    $0xfffffffffffffff8,%rbp
lea    (%rbx,%rax,8),%rcx
add    $0xfffffffffffffff8,%rcx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movupd -0x10(%rcx,%rsi,8),%xmm2
movupd (%rcx,%rsi,8),%xmm3
mulpd  %xmm1,%xmm3
movupd %xmm3,0x0(%rbp,%rsi,8)
mulpd  %xmm1,%xmm2
movupd %xmm2,-0x10(%rbp,%rsi,8)
movupd -0x30(%rcx,%rsi,8),%xmm2
movupd -0x20(%rcx,%rsi,8),%xmm3
mulpd  %xmm1,%xmm3
movupd %xmm3,-0x20(%rbp,%rsi,8)
mulpd  %xmm1,%xmm2
movupd %xmm2,-0x30(%rbp,%rsi,8)
add    $0xfffffffffffffff8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    11f0 <ignorm+0xc0>
neg    %rsi
test   $0x1,%dl
je     1269 <ignorm+0x139>
mov    %rax,%rcx
sub    %rsi,%rcx
movupd -0x18(%rbx,%rcx,8),%xmm2
movupd -0x8(%rbx,%rcx,8),%xmm3
mulpd  %xmm1,%xmm3
movupd %xmm3,-0x8(%r14,%rcx,8)
mulpd  %xmm1,%xmm2
movupd %xmm2,-0x18(%r14,%rcx,8)
cmp    %rax,%r8
je     129b <ignorm+0x16b>
and    $0x3,%eax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x8(%rbx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%r14,%rax,8)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1280 <ignorm+0x150>
addsd  0xd5d(%rip),%xmm0
divsd  %xmm4,%xmm0
jmp    12c6 <ignorm+0x196>
lea    0x8(%rbx),%rdi
lea    0x8(%r14),%rsi
mov    $0x8,%edx
mov    %ebp,%ecx
call   1030 <movem@plt>
movsd  (%rbx),%xmm0
call   1040 <log@plt>
movsd  %xmm0,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%dl
jne    1241 <ignorm+0x111>
jmp    1269 <ignorm+0x139>

LLVM IR (-O0):
define void @ignorm(double* %0, double* %1, i32 %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double %3, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double, double* %8
%14 = call double @pow(double %12, double %13)
store double %14, double* %9
%15 = load double, double* %8
%16 = fcmp une double %15, 0.000000e+00
br i1 %16, label %17, label %43
17: ; preds = %4
br label %18
18: ; preds = %33, %17
%19 = load i32, i32* %7
%20 = icmp sge i32 %19, 1
br i1 %20, label %21, label %36
21: ; preds = %18
%22 = load double, double* %9
%23 = load double*, double** %5
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
%27 = load double, double* %26
%28 = fmul double %22, %27
%29 = load double*, double** %6
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
store double %28, double* %32
br label %33
33: ; preds = %21
%34 = load i32, i32* %7
%35 = add nsw i32 %34, -1
store i32 %35, i32* %7
br label %18
36: ; preds = %18
%37 = load double, double* %9
%38 = fsub double %37, 1.000000e+00
%39 = load double, double* %8
%40 = fdiv double %38, %39
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 0
store double %40, double* %42
br label %56
43: ; preds = %4
%44 = load double*, double** %5
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double*, double** %6
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load i32, i32* %7
%49 = call i32 @movem(double* %45, double* %47, i32 8, i32 %48)
%50 = load double*, double** %5
%51 = getelementptr inbounds double, double* %50, i64 0
%52 = load double, double* %51
%53 = call double @log(double %52)
%54 = load double*, double** %6
%55 = getelementptr inbounds double, double* %54, i64 0
store double %53, double* %55
br label %56
56: ; preds = %43, %36
ret void
}

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