#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 ceil(int /*<<< orphan*/);
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ fmax(double, double);
int /*<<< orphan*/ fmin(double, double);
int printf(char *, int);
int scanf(char *, double *, double *);
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
int main() {
  double a, b;
  return scanf("%lf %lf", &a, &b),
         0 * printf("%.0lf\n",
                    1 - ceil(sqrt(fmin(a, b))) + floor(sqrt(fmax(a, b))));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <fmin@plt>
mov    %eax,%edi
call   1080 <sqrt@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1070 <fmax@plt>
mov    %eax,%edi
call   1080 <sqrt@plt>
mov    %eax,%edi
call   1090 <floor@plt>
mov    -0x1c(%rbp),%esi
add    %eax,%esi
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
imul   $0x0,%eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xe84(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1050 <fmin@plt>
mov    %eax,%edi
call   1080 <sqrt@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1070 <fmax@plt>
mov    %eax,%edi
call   1080 <sqrt@plt>
mov    %eax,%edi
call   1090 <floor@plt>
sub    %ebx,%eax
lea    0x1(%rax),%esi
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = call i32 @fmin(double %5, double %6)
%8 = call i32 @sqrt(i32 %7)
%9 = call i32 @ceil(i32 %8)
%10 = sub nsw i32 1, %9
%11 = load double, double* %2
%12 = load double, double* %3
%13 = call i32 @fmax(double %11, double %12)
%14 = call i32 @sqrt(i32 %13)
%15 = call i32 @floor(i32 %14)
%16 = add nsw i32 %10, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = mul nsw i32 0, %17
ret i32 %18
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = call i32 @fmin(double %6, double %7)
%9 = call i32 @sqrt(i32 %8)
%10 = call i32 @ceil(i32 %9)
%11 = sub i32 1, %10
%12 = load double, double* %1
%13 = load double, double* %2
%14 = call i32 @fmax(double %12, double %13)
%15 = call i32 @sqrt(i32 %14)
%16 = call i32 @floor(i32 %15)
%17 = add nsw i32 %11, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}