#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*/ scanf(char *, double *, int *);
int /*<<< orphan*/ test_case(int, double);
int main() {
  while (1) {
    double d;
    int n;
    scanf("%lf %d", &d, &n);
    if (d == 0.0 && n == 0)
      break;
    test_case(n, d * d);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    116a <main+0x4a>
jp     116a <main+0x4a>
cmpl   $0x0,-0x14(%rbp)
jne    116a <main+0x4a>
jmp    1181 <main+0x61>
mov    -0x14(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <test_case@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed8(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    0x4(%rsp),%edi
jne    1159 <main+0x39>
jp     1159 <main+0x39>
test   %edi,%edi
je     11a1 <main+0x81>
lea    0xea8(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm0
call   1030 <test_case@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe6b(%rip),%xmm0
mov    0x4(%rsp),%edi
jne    1170 <main+0x50>
jp     1170 <main+0x50>
test   %edi,%edi
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%lf %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %12
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %2, i32* %3)
%6 = load double, double* %2
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %18
12: ; preds = %8, %4
%13 = load i32, i32* %3
%14 = load double, double* %2
%15 = load double, double* %2
%16 = fmul double %14, %15
%17 = call i32 @test_case(i32 %13, double %16)
br label %4
18: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%lf %d\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i32
%3 = bitcast double* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %1, i32* %2)
%6 = load double, double* %1
%7 = fcmp oeq double %6, 0.000000e+00
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %22, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %19, %11 ], [ %8, %0 ]
%13 = phi double [ %17, %11 ], [ %6, %0 ]
%14 = fmul double %13, %13
%15 = call i32 @test_case(i32 %12, double %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %1, i32* %2)
%17 = load double, double* %1
%18 = fcmp oeq double %17, 0.000000e+00
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %22, label %11
22: ; preds = %11, %0
ret i32 0
}