void norm0(double *x, double *y, int m) {
  y[0] = 1 / x[0];
  for (; m >= 1; m--)
    y[m] = x[m] * y[0];
  return;
}


x86 assembly (clang, -O0):
<norm0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xee5(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x1,-0x14(%rbp)
jl     1161 <norm0+0x61>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%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    1127 <norm0+0x27>
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm0>:
movsd  0xef8(%rip),%xmm0
divsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
test   %edx,%edx
jle    123a <norm0+0x13a>
mov    %edx,%eax
cmp    $0x4,%edx
jb     1217 <norm0+0x117>
lea    0x8(%rsi),%rcx
lea    (%rdi,%rax,8),%rdx
add    $0x8,%rdx
cmp    %rdx,%rcx
jae    1149 <norm0+0x49>
lea    (%rsi,%rax,8),%rcx
add    $0x8,%rcx
lea    0x8(%rdi),%rdx
cmp    %rcx,%rdx
jb     1217 <norm0+0x117>
mov    %eax,%r8d
and    $0xfffffffc,%r8d
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%r8),%rcx
mov    %rcx,%r9
shr    $0x2,%r9
add    $0x1,%r9
shufpd $0x1,%xmm1,%xmm1
test   %rcx,%rcx
je     123b <norm0+0x13b>
mov    %r9,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rsi,%rax,8),%r10
add    $0xfffffffffffffff8,%r10
lea    (%rdi,%rax,8),%r11
add    $0xfffffffffffffff8,%r11
xor    %ecx,%ecx
xchg   %ax,%ax
movupd -0x10(%r11,%rcx,8),%xmm2
movupd (%r11,%rcx,8),%xmm3
mulpd  %xmm1,%xmm3
movupd %xmm3,(%r10,%rcx,8)
mulpd  %xmm1,%xmm2
movupd %xmm2,-0x10(%r10,%rcx,8)
movupd -0x30(%r11,%rcx,8),%xmm2
movupd -0x20(%r11,%rcx,8),%xmm3
mulpd  %xmm1,%xmm3
movupd %xmm3,-0x20(%r10,%rcx,8)
mulpd  %xmm1,%xmm2
movupd %xmm2,-0x30(%r10,%rcx,8)
add    $0xfffffffffffffff8,%rcx
add    $0xfffffffffffffffe,%rdx
jne    1190 <norm0+0x90>
neg    %rcx
test   $0x1,%r9b
je     120f <norm0+0x10f>
mov    %rax,%rdx
sub    %rcx,%rdx
movupd -0x18(%rdi,%rdx,8),%xmm2
movupd -0x8(%rdi,%rdx,8),%xmm3
mulpd  %xmm1,%xmm3
movupd %xmm3,-0x8(%rsi,%rdx,8)
mulpd  %xmm1,%xmm2
movupd %xmm2,-0x18(%rsi,%rdx,8)
cmp    %rax,%r8
je     123a <norm0+0x13a>
and    $0x3,%eax
add    $0x1,%rax
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rdi,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rsi,%rax,8)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1220 <norm0+0x120>
ret
xor    %ecx,%ecx
test   $0x1,%r9b
jne    11e9 <norm0+0xe9>
jmp    120f <norm0+0x10f>

LLVM IR (-O0):
define void @norm0(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = fdiv double 1.000000e+00, %9
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 0
store double %10, double* %12
br label %13
13: ; preds = %30, %3
%14 = load i32, i32* %6
%15 = icmp sge i32 %14, 1
br i1 %15, label %16, label %33
16: ; preds = %13
%17 = load double*, double** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fmul double %21, %24
%26 = load double*, double** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
store double %25, double* %29
br label %30
30: ; preds = %16
%31 = load i32, i32* %6
%32 = add nsw i32 %31, -1
store i32 %32, i32* %6
br label %13
33: ; preds = %13
ret void
}

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