#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 */
int /*<<< orphan*/ printf(char *, int, double, double);
int scanf(char *, ...);
double sqrt(double);
int main() {
  double a, b, c;
  int i, t = 0;
  while (scanf("%d", &i) == 1) {
    if (i == 0)
      break;
    t++;
    scanf("%lf %lf %lf", &a, &b, &c);
    if (i == 1) {
      printf("Case %d: %.3lf %.3lf\n", t, ((a + b) / 2) * c, (b - a) / c);
    } else if (i == 2) {
      printf("Case %d: %.3lf %.3lf\n", t, (b * b - a * a) / (2 * c),
             (b - a) / c);
    } else if (i == 3) {
      printf("Case %d: %.3lf %.3lf\n", t, sqrt(a * a + 2 * b * c),
             (sqrt(a * a + 2 * b * c) - a) / b);
    } else {
      printf("Case %d: %.3lf %.3lf\n", t, sqrt(a * a - 2 * b * c),
             (a - sqrt(a * a - 2 * b * c)) / b);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    13a2 <main+0x272>
cmpl   $0x0,-0x24(%rbp)
jne    1170 <main+0x40>
jmp    13a2 <main+0x272>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    0xe8b(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    11db <main+0xab>
mov    -0x28(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
jmp    139d <main+0x26d>
cmpl   $0x2,-0x24(%rbp)
jne    124c <main+0x11c>
mov    -0x28(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xddd(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
jmp    1398 <main+0x268>
cmpl   $0x3,-0x24(%rbp)
jne    12d9 <main+0x1a9>
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xd92(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xd64(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
mov    -0x34(%rbp),%esi
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
lea    0xd48(%rip),%rdi
call   1030 <printf@plt>
jmp    1393 <main+0x263>
mov    -0x28(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xd0f(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xcc0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x50(%rbp),%xmm1
mov    -0x44(%rbp),%esi
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
subsd  %xmm2,%xmm1
divsd  -0x18(%rbp),%xmm1
lea    0xc89(%rip),%rdi
call   1030 <printf@plt>
jmp    1398 <main+0x268>
jmp    139d <main+0x26d>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xed3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1396 <main+0x266>
cmpl   $0x0,0xc(%rsp)
je     1396 <main+0x266>
mov    $0x1,%ebx
lea    0x10(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0xeac(%rip),%rbp
lea    0xe96(%rip),%r14
lea    0xc(%rsp),%r15
nopw   0x0(%rax,%rax,1)
lea    0xe84(%rip),%rdi
lea    0x18(%rsp),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
je     11f0 <main+0xc0>
cmp    $0x2,%eax
je     1230 <main+0x100>
cmp    $0x1,%eax
jne    1270 <main+0x140>
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xe24(%rip),%xmm0
movsd  0x20(%rsp),%xmm3
mulsd  %xmm3,%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
jmp    1262 <main+0x132>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
mulsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xdfa(%rip),%xmm0
jb     12a5 <main+0x175>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    12ae <main+0x17e>
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
subsd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm2,%xmm2
divsd  %xmm2,%xmm0
mov    %rbp,%rdi
mov    %ebx,%esi
jmp    1371 <main+0x241>
nopl   0x0(%rax)
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0xd84(%rip),%xmm1
mulsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd76(%rip),%xmm0
jb     12e5 <main+0x1b5>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    12ee <main+0x1be>
call   1050 <sqrt@plt>
movapd %xmm0,%xmm2
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
mulsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xd3c(%rip),%xmm0
jb     1324 <main+0x1f4>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
subsd  0x18(%rsp),%xmm1
jmp    1362 <main+0x232>
call   1050 <sqrt@plt>
movapd %xmm0,%xmm2
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm3
mulsd  0xd06(%rip),%xmm3
mulsd  0x20(%rsp),%xmm3
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
ucomisd 0xcf4(%rip),%xmm0
jb     1341 <main+0x211>
sqrtsd %xmm0,%xmm0
jmp    135e <main+0x22e>
movsd  %xmm2,0x28(%rsp)
call   1050 <sqrt@plt>
movsd  0x28(%rsp),%xmm2
movapd %xmm0,%xmm1
subsd  0x18(%rsp),%xmm1
jmp    1362 <main+0x232>
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x30(%rsp)
call   1050 <sqrt@plt>
movsd  0x30(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
subsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
mov    %rbp,%rdi
mov    %ebx,%esi
movapd %xmm2,%xmm0
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1396 <main+0x266>
add    $0x1,%ebx
cmpl   $0x0,0xc(%rsp)
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [22 x i8] c"Case %d: %.3lf %.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %7
7: ; preds = %108, %0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %109
10: ; preds = %7
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %109
14: ; preds = %10
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %34
20: ; preds = %14
%21 = load i32, i32* %6
%22 = load double, double* %2
%23 = load double, double* %3
%24 = fadd double %22, %23
%25 = fdiv double %24, 2.000000e+00
%26 = load double, double* %4
%27 = fmul double %25, %26
%28 = load double, double* %3
%29 = load double, double* %2
%30 = fsub double %28, %29
%31 = load double, double* %4
%32 = fdiv double %30, %31
%33 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %21, double %27, double %32)
br label %108
34: ; preds = %14
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 2
br i1 %36, label %37, label %55
37: ; preds = %34
%38 = load i32, i32* %6
%39 = load double, double* %3
%40 = load double, double* %3
%41 = load double, double* %2
%42 = load double, double* %2
%43 = fmul double %41, %42
%44 = fneg double %43
%45 = call double @llvm.fmuladd.f64(double %39, double %40, double %44)
%46 = load double, double* %4
%47 = fmul double 2.000000e+00, %46
%48 = fdiv double %45, %47
%49 = load double, double* %3
%50 = load double, double* %2
%51 = fsub double %49, %50
%52 = load double, double* %4
%53 = fdiv double %51, %52
%54 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %38, double %48, double %53)
br label %107
55: ; preds = %34
%56 = load i32, i32* %5
%57 = icmp eq i32 %56, 3
br i1 %57, label %58, label %81
58: ; preds = %55
%59 = load i32, i32* %6
%60 = load double, double* %2
%61 = load double, double* %2
%62 = load double, double* %3
%63 = fmul double 2.000000e+00, %62
%64 = load double, double* %4
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %60, double %61, double %65)
%67 = call double @sqrt(double %66)
%68 = load double, double* %2
%69 = load double, double* %2
%70 = load double, double* %3
%71 = fmul double 2.000000e+00, %70
%72 = load double, double* %4
%73 = fmul double %71, %72
%74 = call double @llvm.fmuladd.f64(double %68, double %69, double %73)
%75 = call double @sqrt(double %74)
%76 = load double, double* %2
%77 = fsub double %75, %76
%78 = load double, double* %3
%79 = fdiv double %77, %78
%80 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %59, double %67, double %79)
br label %106
81: ; preds = %55
%82 = load i32, i32* %6
%83 = load double, double* %2
%84 = load double, double* %2
%85 = load double, double* %3
%86 = fmul double 2.000000e+00, %85
%87 = load double, double* %4
%88 = fmul double %86, %87
%89 = fneg double %88
%90 = call double @llvm.fmuladd.f64(double %83, double %84, double %89)
%91 = call double @sqrt(double %90)
%92 = load double, double* %2
%93 = load double, double* %2
%94 = load double, double* %2
%95 = load double, double* %3
%96 = fmul double 2.000000e+00, %95
%97 = load double, double* %4
%98 = fmul double %96, %97
%99 = fneg double %98
%100 = call double @llvm.fmuladd.f64(double %93, double %94, double %99)
%101 = call double @sqrt(double %100)
%102 = fsub double %92, %101
%103 = load double, double* %3
%104 = fdiv double %102, %103
%105 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %82, double %91, double %104)
br label %106
106: ; preds = %81, %58
br label %107
107: ; preds = %106, %37
br label %108
108: ; preds = %107, %20
br label %7
109: ; preds = %13, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [22 x i8] c"Case %d: %.3lf %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%10 = icmp ne i32 %9, 1
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %86, label %14
14: ; preds = %0, %80
%15 = phi i32 [ %16, %80 ], [ 0, %0 ]
%16 = add nuw nsw i32 %15, 1
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%18 = load i32, i32* %4
switch i32 %18, label %61 [
i32 1, label %19
i32 2, label %29
i32 3, label %41
]
19: ; preds = %14
%20 = load double, double* %1
%21 = load double, double* %2
%22 = fadd double %20, %21
%23 = fmul double %22, 5.000000e-01
%24 = load double, double* %3
%25 = fmul double %24, %23
%26 = fsub double %21, %20
%27 = fdiv double %26, %24
%28 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %16, double %25, double %27)
br label %80
29: ; preds = %14
%30 = load double, double* %2
%31 = load double, double* %1
%32 = fneg double %31
%33 = fmul double %31, %32
%34 = call double @llvm.fmuladd.f64(double %30, double %30, double %33)
%35 = load double, double* %3
%36 = fmul double %35, 2.000000e+00
%37 = fdiv double %34, %36
%38 = fsub double %30, %31
%39 = fdiv double %38, %35
%40 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %16, double %37, double %39)
br label %80
41: ; preds = %14
%42 = load double, double* %1
%43 = load double, double* %2
%44 = fmul double %43, 2.000000e+00
%45 = load double, double* %3
%46 = fmul double %44, %45
%47 = call double @llvm.fmuladd.f64(double %42, double %42, double %46)
%48 = call double @sqrt(double %47)
%49 = load double, double* %1
%50 = load double, double* %2
%51 = fmul double %50, 2.000000e+00
%52 = load double, double* %3
%53 = fmul double %51, %52
%54 = call double @llvm.fmuladd.f64(double %49, double %49, double %53)
%55 = call double @sqrt(double %54)
%56 = load double, double* %1
%57 = fsub double %55, %56
%58 = load double, double* %2
%59 = fdiv double %57, %58
%60 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %16, double %48, double %59)
br label %80
61: ; preds = %14
%62 = load double, double* %1
%63 = load double, double* %2
%64 = load double, double* %3
%65 = fmul double %63, -2.000000e+00
%66 = fmul double %65, %64
%67 = call double @llvm.fmuladd.f64(double %62, double %62, double %66)
%68 = call double @sqrt(double %67)
%69 = load double, double* %1
%70 = load double, double* %2
%71 = load double, double* %3
%72 = fmul double %70, -2.000000e+00
%73 = fmul double %72, %71
%74 = call double @llvm.fmuladd.f64(double %69, double %69, double %73)
%75 = call double @sqrt(double %74)
%76 = fsub double %69, %75
%77 = load double, double* %2
%78 = fdiv double %76, %77
%79 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %16, double %68, double %78)
br label %80
80: ; preds = %29, %61, %41, %19
%81 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%82 = icmp ne i32 %81, 1
%83 = load i32, i32* %4
%84 = icmp eq i32 %83, 0
%85 = select i1 %82, i1 true, i1 %84
br i1 %85, label %86, label %14
86: ; preds = %80, %0
ret i32 0
}