void corner_dlauum_nt_1x1_lib4(double *A, double *B, int alg, double *C,
                               double *D) {
  double a_0, b_0, d_00;
  a_0 = A[0];
  b_0 = B[0];
  d_00 = a_0 * b_0;
  if (alg != 0) {
    if (alg == 1) {
      d_00 = C[0] + d_00;
    } else {
      d_00 = C[0] - d_00;
    }
  }
  D[0] = d_00;
}


x86 assembly (clang, -O0):
<corner_dlauum_nt_1x1_lib4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1182 <corner_dlauum_nt_1x1_lib4+0x82>
cmpl   $0x1,-0x14(%rbp)
jne    116b <corner_dlauum_nt_1x1_lib4+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    117d <corner_dlauum_nt_1x1_lib4+0x7d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1182 <corner_dlauum_nt_1x1_lib4+0x82>
movsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_dlauum_nt_1x1_lib4>:
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
test   %edx,%edx
je     1127 <corner_dlauum_nt_1x1_lib4+0x27>
cmp    $0x1,%edx
jne    111b <corner_dlauum_nt_1x1_lib4+0x1b>
addsd  (%rcx),%xmm0
movsd  %xmm0,(%r8)
ret
movsd  (%rcx),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
movsd  %xmm0,(%r8)
ret

LLVM IR (-O0):
define void @corner_dlauum_nt_1x1_lib4(double* %0, double* %1, i32 %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store double* %4, double** %10
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
store double %16, double* %11
%17 = load double*, double** %7
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
store double %19, double* %12
%20 = load double, double* %11
%21 = load double, double* %12
%22 = fmul double %20, %21
store double %22, double* %13
%23 = load i32, i32* %8
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %41
25: ; preds = %5
%26 = load i32, i32* %8
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %34
28: ; preds = %25
%29 = load double*, double** %9
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = load double, double* %13
%33 = fadd double %31, %32
store double %33, double* %13
br label %40
34: ; preds = %25
%35 = load double*, double** %9
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = load double, double* %13
%39 = fsub double %37, %38
store double %39, double* %13
br label %40
40: ; preds = %34, %28
br label %41
41: ; preds = %40, %5
%42 = load double, double* %13
%43 = load double*, double** %10
%44 = getelementptr inbounds double, double* %43, i64 0
store double %42, double* %44
ret void
}

LLVM IR (-O2):
define void @corner_dlauum_nt_1x1_lib4(double* nocapture %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = load double, double* %0
%7 = load double, double* %1
%8 = fmul double %6, %7
switch i32 %2, label %12 [
i32 0, label %15
i32 1, label %9
]
9: ; preds = %5
%10 = load double, double* %3
%11 = fadd double %8, %10
br label %15
12: ; preds = %5
%13 = load double, double* %3
%14 = fsub double %13, %8
br label %15
15: ; preds = %5, %9, %12
%16 = phi double [ %11, %9 ], [ %14, %12 ], [ %8, %5 ]
store double %16, double* %4
ret void
}