#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 /*<<< orphan*/ scanf(char *, ...);
double solve(int, double, double, double);
int main(void) {
  int num_tests, test = 0, ret = -1;
  double round, farm_cost, farm_rate, cap;
  scanf("%d", &num_tests);
  if (num_tests < 1 || num_tests > 100) {
    printf("Illegal number of tests (1 <= T <= 100)\n");
    goto out;
  }
  while (test++ < num_tests) {
    scanf("%lf %lf %lf", &farm_cost, &farm_rate, &cap);
    round = solve(2, farm_cost, farm_rate, cap);
    printf("Case #%d: %.7f\n", test, round);
  }
  ret = 0;
out:
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1173 <main+0x43>
cmpl   $0x64,-0x8(%rbp)
jle    1186 <main+0x56>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f9 <main+0xc9>
jmp    118b <main+0x5b>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jge    11f2 <main+0xc2>
lea    0xe86(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1050 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mov    $0x2,%edi
call   1030 <solve@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
lea    0xe52(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    118b <main+0x5b>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xeab(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffff9b,%eax
cmp    $0xffffff9c,%eax
jae    1183 <main+0x43>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%r14d
jmp    11e8 <main+0xa8>
lea    0x20(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xe76(%rip),%rbp
xor    %r14d,%r14d
nopl   0x0(%rax)
add    $0x1,%ebx
lea    0xe59(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1060 <scanf@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    $0x2,%edi
call   1030 <solve@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1050 <printf@plt>
cmp    0xc(%rsp),%ebx
jl     11a0 <main+0x60>
mov    %r14d,%eax
add    $0x28,%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 = [41 x i8] c"Illegal number of tests (1 <= T <= 100)\0A\00"
@.str.2 = [12 x i8] c"%lf %lf %lf\00"
@.str.3 = [16 x i8] c"Case #%d: %.7f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
store i32 0, i32* %3
store i32 -1, i32* %4
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 100
br i1 %14, label %15, label %17
15: ; preds = %12, %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %33
17: ; preds = %12
br label %18
18: ; preds = %23, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = icmp slt i32 %19, %21
br i1 %22, label %23, label %32
23: ; preds = %18
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double* %6, double* %7, double* %8)
%25 = load double, double* %6
%26 = load double, double* %7
%27 = load double, double* %8
%28 = call double @solve(i32 2, double %25, double %26, double %27)
store double %28, double* %5
%29 = load i32, i32* %3
%30 = load double, double* %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %29, double %30)
br label %18
32: ; preds = %18
store i32 0, i32* %4
br label %33
33: ; preds = %32, %15
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"%lf %lf %lf\00"
@.str.3 = [16 x i8] c"Case #%d: %.7f\0A\00"
@str = [40 x i8] c"Illegal number of tests (1 <= T <= 100)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast i32* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = add i32 %10, -101
%12 = icmp ult i32 %11, -100
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %26
15: ; preds = %0, %15
%16 = phi i32 [ %23, %15 ], [ 1, %0 ]
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double* %2, double* %3, double* %4)
%18 = load double, double* %2
%19 = load double, double* %3
%20 = load double, double* %4
%21 = call double @solve(i32 2, double %18, double %19, double %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %16, double %21)
%23 = add nuw nsw i32 %16, 1
%24 = load i32, i32* %1
%25 = icmp slt i32 %16, %24
br i1 %25, label %15, label %26
26: ; preds = %15, %13
%27 = phi i32 [ -1, %13 ], [ 0, %15 ]
ret i32 %27
}