void dmat_init_1x2(double **a11, double **a12, double alpha, int n) {
  int i;
  int j;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      a11[i][j] = 0.;
      a12[i][j] = 0.;
    }
    a11[i][i] = alpha;
  }
}


x86 assembly (clang, -O0):
<dmat_init_1x2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11a0 <dmat_init_1x2+0xa0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1178 <dmat_init_1x2+0x78>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <dmat_init_1x2+0x2e>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111b <dmat_init_1x2+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmat_init_1x2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    12de <dmat_init_1x2+0x1de>
mov    %edx,%r13d
mov    %r13d,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%r9
mov    %r9,-0x8(%rsp)
shr    $0x2,%r9
add    $0x1,%r9
mov    %r9d,%r10d
and    $0x3,%r10d
and    $0xfffffffffffffffc,%r9
mov    %r13d,%r8d
and    $0x3,%r8d
mov    %r10,%r15
shl    $0x5,%r15
xor    %r12d,%r12d
xorps  %xmm1,%xmm1
jmp    1163 <dmat_init_1x2+0x63>
xchg   %ax,%ax
movsd  %xmm0,(%rbx,%r12,8)
add    $0x1,%r12
cmp    %r13,%r12
je     12de <dmat_init_1x2+0x1de>
mov    (%rdi,%r12,8),%rbx
mov    (%rsi,%r12,8),%rcx
cmp    $0x4,%edx
jb     118a <dmat_init_1x2+0x8a>
lea    (%rcx,%r13,8),%rax
cmp    %rax,%rbx
jae    1220 <dmat_init_1x2+0x120>
lea    (%rbx,%r13,8),%rax
cmp    %rax,%rcx
jae    1220 <dmat_init_1x2+0x120>
xor    %eax,%eax
mov    %rax,%rbp
not    %rbp
add    %r13,%rbp
test   %r8,%r8
je     11ba <dmat_init_1x2+0xba>
mov    %r8,%r14
nopl   (%rax)
movq   $0x0,(%rbx,%rax,8)
movq   $0x0,(%rcx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%r14
jne    11a0 <dmat_init_1x2+0xa0>
cmp    $0x3,%rbp
jb     1150 <dmat_init_1x2+0x50>
movq   $0x0,(%rbx,%rax,8)
movq   $0x0,(%rcx,%rax,8)
movq   $0x0,0x8(%rbx,%rax,8)
movq   $0x0,0x8(%rcx,%rax,8)
movq   $0x0,0x10(%rbx,%rax,8)
movq   $0x0,0x10(%rcx,%rax,8)
movq   $0x0,0x18(%rbx,%rax,8)
movq   $0x0,0x18(%rcx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r13
jne    11c0 <dmat_init_1x2+0xc0>
jmp    1150 <dmat_init_1x2+0x50>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpq   $0xc,-0x8(%rsp)
jae    122c <dmat_init_1x2+0x12c>
xor    %eax,%eax
jmp    1298 <dmat_init_1x2+0x198>
mov    %r9,%rbp
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups %xmm1,(%rbx,%rax,8)
movups %xmm1,0x10(%rbx,%rax,8)
movups %xmm1,(%rcx,%rax,8)
movups %xmm1,0x10(%rcx,%rax,8)
movups %xmm1,0x20(%rbx,%rax,8)
movups %xmm1,0x30(%rbx,%rax,8)
movups %xmm1,0x20(%rcx,%rax,8)
movups %xmm1,0x30(%rcx,%rax,8)
movups %xmm1,0x40(%rbx,%rax,8)
movups %xmm1,0x50(%rbx,%rax,8)
movups %xmm1,0x40(%rcx,%rax,8)
movups %xmm1,0x50(%rcx,%rax,8)
movups %xmm1,0x60(%rbx,%rax,8)
movups %xmm1,0x70(%rbx,%rax,8)
movups %xmm1,0x60(%rcx,%rax,8)
movups %xmm1,0x70(%rcx,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rbp
jne    1240 <dmat_init_1x2+0x140>
test   %r10,%r10
je     12cd <dmat_init_1x2+0x1cd>
lea    (%rcx,%rax,8),%r14
add    $0x10,%r14
lea    (%rbx,%rax,8),%rax
add    $0x10,%rax
xor    %ebp,%ebp
nop
movups %xmm1,-0x10(%rax,%rbp,1)
movups %xmm1,(%rax,%rbp,1)
movups %xmm1,-0x10(%r14,%rbp,1)
movups %xmm1,(%r14,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%r15
jne    12b0 <dmat_init_1x2+0x1b0>
mov    %r11,%rax
cmp    %r13,%r11
je     1150 <dmat_init_1x2+0x50>
jmp    118c <dmat_init_1x2+0x8c>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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