#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 fabs(double);
int sqrt(double);
void evals2(double H[2][2], double *eval1, double *eval2) {
  double M[2][2];
  double b, c;
  double root1, root2;
  double xmax;
  int i, j;
  M[0][0] = M[1][0] = M[0][1] = M[1][1] = 0.0;
  xmax = 0.0;
  for (i = 0; i < 2; i++) {
    for (j = i; j < 2; j++) {
      if (fabs(H[i][j]) > xmax) {
        xmax = fabs(H[i][j]);
      }
    }
  }
  if (xmax != 0) {
    for (i = 0; i < 2; i++) {
      for (j = 0; j < 2; j++) {
        M[i][j] = H[i][j] / xmax;
      }
    }
  }
  b = -M[0][0] - M[1][1];
  c = M[0][0] * M[1][1] - M[1][0] * M[1][0];
  root1 = -.5 * (b + ((b) < 0 ? -1 : 1) * sqrt(b * b - 4 * c));
  root2 = c / root1;
  root1 *= xmax;
  root2 *= xmax;
  *eval1 = ((root1) < (root2) ? (root1) : (root2));
  *eval2 = ((root1) > (root2) ? (root1) : (root2));
}


x86 assembly (clang, -O0):
<evals2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
cmpl   $0x2,-0x6c(%rbp)
jge    11ec <evals2+0xdc>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x70(%rbp)
cmpl   $0x2,-0x70(%rbp)
jge    11d9 <evals2+0xc9>
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe81(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    11c6 <evals2+0xb6>
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe53(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    11cb <evals2+0xbb>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1166 <evals2+0x56>
jmp    11de <evals2+0xce>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1156 <evals2+0x46>
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1209 <evals2+0xf9>
jp     1209 <evals2+0xf9>
jmp    1286 <evals2+0x176>
movl   $0x0,-0x6c(%rbp)
cmpl   $0x2,-0x6c(%rbp)
jge    1281 <evals2+0x171>
movl   $0x0,-0x70(%rbp)
cmpl   $0x2,-0x70(%rbp)
jge    126e <evals2+0x15e>
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x68(%rbp),%xmm0
movslq -0x6c(%rbp),%rcx
lea    -0x40(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x70(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1221 <evals2+0x111>
jmp    1273 <evals2+0x163>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1210 <evals2+0x100>
jmp    1286 <evals2+0x176>
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x74(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0xcec(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  -0x80(%rbp),%xmm1
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm1
movsd  0xc9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    13be <evals2+0x2ae>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    13cb <evals2+0x2bb>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x60(%rbp),%xmm0
jbe    13fd <evals2+0x2ed>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    140a <evals2+0x2fa>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evals2>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
movapd 0xedb(%rip),%xmm0
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm2
movsd  0x18(%rdi),%xmm3
andpd  %xmm0,%xmm1
xorpd  %xmm4,%xmm4
maxsd  %xmm4,%xmm1
andpd  %xmm0,%xmm2
maxsd  %xmm1,%xmm2
andpd  %xmm0,%xmm3
maxsd  %xmm2,%xmm3
ucomisd %xmm4,%xmm3
movapd %xmm3,0x20(%rsp)
jne    115d <evals2+0x4d>
jnp    1178 <evals2+0x68>
movsd  (%rdi),%xmm0
divsd  %xmm3,%xmm0
movupd 0x10(%rdi),%xmm1
movapd %xmm3,%xmm2
unpcklpd %xmm3,%xmm2
divpd  %xmm2,%xmm1
jmp    1180 <evals2+0x70>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
movapd 0xe88(%rip),%xmm3
xorpd  %xmm0,%xmm3
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
subsd  %xmm2,%xmm3
movapd %xmm3,(%rsp)
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  0xe69(%rip),%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
mov    %eax,%ecx
neg    %ecx
xorpd  %xmm0,%xmm0
movapd (%rsp),%xmm1
ucomisd %xmm1,%xmm0
cmovbe %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xe35(%rip),%xmm0
movapd 0x10(%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd 0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
minsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
maxsd  %xmm2,%xmm0
movsd  %xmm0,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @evals2([2 x double]* %0, double* %1, double* %2) {
%4 = alloca [2 x double]*
%5 = alloca double*
%6 = alloca double*
%7 = alloca [2 x [2 x double]]
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
store [2 x double]* %0, [2 x double]** %4
store double* %1, double** %5
store double* %2, double** %6
%15 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 1
%16 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 1
store double 0.000000e+00, double* %16
%17 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 0
%18 = getelementptr inbounds [2 x double], [2 x double]* %17, i64 0, i64 1
store double 0.000000e+00, double* %18
%19 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 1
%20 = getelementptr inbounds [2 x double], [2 x double]* %19, i64 0, i64 0
store double 0.000000e+00, double* %20
%21 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 0
%22 = getelementptr inbounds [2 x double], [2 x double]* %21, i64 0, i64 0
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %12
store i32 0, i32* %13
br label %23
23: ; preds = %58, %3
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 2
br i1 %25, label %26, label %61
26: ; preds = %23
%27 = load i32, i32* %13
store i32 %27, i32* %14
br label %28
28: ; preds = %54, %26
%29 = load i32, i32* %14
%30 = icmp slt i32 %29, 2
br i1 %30, label %31, label %57
31: ; preds = %28
%32 = load [2 x double]*, [2 x double]** %4
%33 = load i32, i32* %13
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [2 x double], [2 x double]* %32, i64 %34
%36 = load i32, i32* %14
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [2 x double], [2 x double]* %35, i64 0, i64 %37
%39 = load double, double* %38
%40 = call double @llvm.fabs.f64(double %39)
%41 = load double, double* %12
%42 = fcmp ogt double %40, %41
br i1 %42, label %43, label %53
43: ; preds = %31
%44 = load [2 x double]*, [2 x double]** %4
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [2 x double], [2 x double]* %44, i64 %46
%48 = load i32, i32* %14
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [2 x double], [2 x double]* %47, i64 0, i64 %49
%51 = load double, double* %50
%52 = call double @llvm.fabs.f64(double %51)
store double %52, double* %12
br label %53
53: ; preds = %43, %31
br label %54
54: ; preds = %53
%55 = load i32, i32* %14
%56 = add nsw i32 %55, 1
store i32 %56, i32* %14
br label %28
57: ; preds = %28
br label %58
58: ; preds = %57
%59 = load i32, i32* %13
%60 = add nsw i32 %59, 1
store i32 %60, i32* %13
br label %23
61: ; preds = %23
%62 = load double, double* %12
%63 = fcmp une double %62, 0.000000e+00
br i1 %63, label %64, label %97
64: ; preds = %61
store i32 0, i32* %13
br label %65
65: ; preds = %93, %64
%66 = load i32, i32* %13
%67 = icmp slt i32 %66, 2
br i1 %67, label %68, label %96
68: ; preds = %65
store i32 0, i32* %14
br label %69
69: ; preds = %89, %68
%70 = load i32, i32* %14
%71 = icmp slt i32 %70, 2
br i1 %71, label %72, label %92
72: ; preds = %69
%73 = load [2 x double]*, [2 x double]** %4
%74 = load i32, i32* %13
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [2 x double], [2 x double]* %73, i64 %75
%77 = load i32, i32* %14
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [2 x double], [2 x double]* %76, i64 0, i64 %78
%80 = load double, double* %79
%81 = load double, double* %12
%82 = fdiv double %80, %81
%83 = load i32, i32* %13
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 %84
%86 = load i32, i32* %14
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [2 x double], [2 x double]* %85, i64 0, i64 %87
store double %82, double* %88
br label %89
89: ; preds = %72
%90 = load i32, i32* %14
%91 = add nsw i32 %90, 1
store i32 %91, i32* %14
br label %69
92: ; preds = %69
br label %93
93: ; preds = %92
%94 = load i32, i32* %13
%95 = add nsw i32 %94, 1
store i32 %95, i32* %13
br label %65
96: ; preds = %65
br label %97
97: ; preds = %96, %61
%98 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 0
%99 = getelementptr inbounds [2 x double], [2 x double]* %98, i64 0, i64 0
%100 = load double, double* %99
%101 = fneg double %100
%102 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 1
%103 = getelementptr inbounds [2 x double], [2 x double]* %102, i64 0, i64 1
%104 = load double, double* %103
%105 = fsub double %101, %104
store double %105, double* %8
%106 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 0
%107 = getelementptr inbounds [2 x double], [2 x double]* %106, i64 0, i64 0
%108 = load double, double* %107
%109 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 1
%110 = getelementptr inbounds [2 x double], [2 x double]* %109, i64 0, i64 1
%111 = load double, double* %110
%112 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 1
%113 = getelementptr inbounds [2 x double], [2 x double]* %112, i64 0, i64 0
%114 = load double, double* %113
%115 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %7, i64 0, i64 1
%116 = getelementptr inbounds [2 x double], [2 x double]* %115, i64 0, i64 0
%117 = load double, double* %116
%118 = fmul double %114, %117
%119 = fneg double %118
%120 = call double @llvm.fmuladd.f64(double %108, double %111, double %119)
store double %120, double* %9
%121 = load double, double* %8
%122 = load double, double* %8
%123 = fcmp olt double %122, 0.000000e+00
%124 = zext i1 %123 to i64
%125 = select i1 %123, i32 -1, i32 1
%126 = load double, double* %8
%127 = load double, double* %8
%128 = load double, double* %9
%129 = fmul double 4.000000e+00, %128
%130 = fneg double %129
%131 = call double @llvm.fmuladd.f64(double %126, double %127, double %130)
%132 = call i32 @sqrt(double %131)
%133 = mul nsw i32 %125, %132
%134 = sitofp i32 %133 to double
%135 = fadd double %121, %134
%136 = fmul double -5.000000e-01, %135
store double %136, double* %10
%137 = load double, double* %9
%138 = load double, double* %10
%139 = fdiv double %137, %138
store double %139, double* %11
%140 = load double, double* %12
%141 = load double, double* %10
%142 = fmul double %141, %140
store double %142, double* %10
%143 = load double, double* %12
%144 = load double, double* %11
%145 = fmul double %144, %143
store double %145, double* %11
%146 = load double, double* %10
%147 = load double, double* %11
%148 = fcmp olt double %146, %147
br i1 %148, label %149, label %151
149: ; preds = %97
%150 = load double, double* %10
br label %153
151: ; preds = %97
%152 = load double, double* %11
br label %153
153: ; preds = %151, %149
%154 = phi double [ %150, %149 ], [ %152, %151 ]
%155 = load double*, double** %5
store double %154, double* %155
%156 = load double, double* %10
%157 = load double, double* %11
%158 = fcmp ogt double %156, %157
br i1 %158, label %159, label %161
159: ; preds = %153
%160 = load double, double* %10
br label %163
161: ; preds = %153
%162 = load double, double* %11
br label %163
163: ; preds = %161, %159
%164 = phi double [ %160, %159 ], [ %162, %161 ]
%165 = load double*, double** %6
store double %164, double* %165
ret void
}

LLVM IR (-O2):
define void @evals2([2 x double]* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0
%5 = load double, double* %4
%6 = tail call double @llvm.fabs.f64(double %5)
%7 = fcmp ogt double %6, 0.000000e+00
%8 = select i1 %7, double %6, double 0.000000e+00
%9 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 1
%10 = load double, double* %9
%11 = tail call double @llvm.fabs.f64(double %10)
%12 = fcmp ogt double %11, %8
%13 = select i1 %12, double %11, double %8
%14 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 1
%15 = load double, double* %14
%16 = tail call double @llvm.fabs.f64(double %15)
%17 = fcmp ogt double %16, %13
%18 = select i1 %17, double %16, double %13
%19 = fcmp une double %18, 0.000000e+00
br i1 %19, label %20, label %30
20: ; preds = %3
%21 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 0, i64 0
%22 = load double, double* %21
%23 = fdiv double %22, %18
%24 = getelementptr inbounds [2 x double], [2 x double]* %0, i64 1, i64 0
%25 = bitcast double* %24 to <2 x double>*
%26 = load <2 x double>, <2 x double>* %25
%27 = insertelement <2 x double> poison, double %18, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = fdiv <2 x double> %26, %28
br label %30
30: ; preds = %20, %3
%31 = phi double [ %23, %20 ], [ 0.000000e+00, %3 ]
%32 = phi <2 x double> [ %29, %20 ], [ zeroinitializer, %3 ]
%33 = fneg double %31
%34 = extractelement <2 x double> %32, i64 1
%35 = fsub double %33, %34
%36 = extractelement <2 x double> %32, i64 0
%37 = fneg double %36
%38 = fmul double %36, %37
%39 = tail call double @llvm.fmuladd.f64(double %31, double %34, double %38)
%40 = fcmp olt double %35, 0.000000e+00
%41 = fmul double %39, -4.000000e+00
%42 = tail call double @llvm.fmuladd.f64(double %35, double %35, double %41)
%43 = tail call i32 @sqrt(double %42)
%44 = sub nsw i32 0, %43
%45 = select i1 %40, i32 %44, i32 %43
%46 = sitofp i32 %45 to double
%47 = fadd double %35, %46
%48 = fmul double %47, -5.000000e-01
%49 = fdiv double %39, %48
%50 = fmul double %18, %48
%51 = fmul double %18, %49
%52 = fcmp olt double %50, %51
%53 = select i1 %52, double %50, double %51
store double %53, double* %1
%54 = fcmp ogt double %50, %51
%55 = select i1 %54, double %50, double %51
store double %55, double* %2
ret void
}