#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 sqrt(double);
int circle_in_circle(double x1, double y1, double r1, double x2, double y2,
                     double r2) {
  double xdist = x2 - x1;
  double ydist = y2 - y1;
  return sqrt(xdist * xdist + ydist * ydist) + r1 < r2;
}


x86 assembly (clang, -O0):
<circle_in_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_in_circle>:
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm4
mulsd  %xmm4,%xmm4
mulsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jb     1137 <circle_in_circle+0x27>
xorps  %xmm0,%xmm0
sqrtsd %xmm3,%xmm0
jmp    1160 <circle_in_circle+0x50>
sub    $0x18,%rsp
movapd %xmm3,%xmm0
movsd  %xmm5,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm5
add    $0x18,%rsp
addsd  %xmm2,%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm5
seta   %al
ret

LLVM IR (-O0):
define i32 @circle_in_circle(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%15 = load double, double* %10
%16 = load double, double* %7
%17 = fsub double %15, %16
store double %17, double* %13
%18 = load double, double* %11
%19 = load double, double* %8
%20 = fsub double %18, %19
store double %20, double* %14
%21 = load double, double* %13
%22 = load double, double* %13
%23 = load double, double* %14
%24 = load double, double* %14
%25 = fmul double %23, %24
%26 = call double @llvm.fmuladd.f64(double %21, double %22, double %25)
%27 = call double @sqrt(double %26)
%28 = load double, double* %9
%29 = fadd double %27, %28
%30 = load double, double* %12
%31 = fcmp olt double %29, %30
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @circle_in_circle(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %3, %0
%8 = fsub double %4, %1
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %9)
%11 = tail call double @sqrt(double %10)
%12 = fadd double %11, %2
%13 = fcmp olt double %12, %5
%14 = zext i1 %13 to i32
ret i32 %14
}