#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 atan(double);
double sqrt(double);
double square(double);
double indefinite_integral_f1_dx(double r, double x) {
  return (
      -0.5 * atan((x * sqrt(square(r) - square(x))) / (square(x) - square(r))) *
          square(r) -
      (x * r) / 2.0 + 0.5 * x * sqrt(square(r) - square(x)));
}


x86 assembly (clang, -O0):
<indefinite_integral_f1_dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe4b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe16(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdde(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indefinite_integral_f1_dx>:
sub    $0x28,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <square@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <square@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1177 <indefinite_integral_f1_dx+0x47>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1180 <indefinite_integral_f1_dx+0x50>
call   1050 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <square@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <square@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <atan@plt>
mulsd  0xe39(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <square@plt>
movsd  0x10(%rsp),%xmm3
movapd %xmm3,%xmm1
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  0xe0c(%rip),%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xdfc(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x20(%rsp)
movapd %xmm3,%xmm0
call   1030 <square@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <square@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ucomisd 0xdca(%rip),%xmm1
jb     124e <indefinite_integral_f1_dx+0x11e>
sqrtsd %xmm0,%xmm0
jmp    1253 <indefinite_integral_f1_dx+0x123>
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @indefinite_integral_f1_dx(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @square(double %6)
%8 = load double, double* %4
%9 = call double @square(double %8)
%10 = fsub double %7, %9
%11 = call double @sqrt(double %10)
%12 = fmul double %5, %11
%13 = load double, double* %4
%14 = call double @square(double %13)
%15 = load double, double* %3
%16 = call double @square(double %15)
%17 = fsub double %14, %16
%18 = fdiv double %12, %17
%19 = call double @atan(double %18)
%20 = fmul double -5.000000e-01, %19
%21 = load double, double* %3
%22 = call double @square(double %21)
%23 = load double, double* %4
%24 = load double, double* %3
%25 = fmul double %23, %24
%26 = fdiv double %25, 2.000000e+00
%27 = fneg double %26
%28 = call double @llvm.fmuladd.f64(double %20, double %22, double %27)
%29 = load double, double* %4
%30 = fmul double 5.000000e-01, %29
%31 = load double, double* %3
%32 = call double @square(double %31)
%33 = load double, double* %4
%34 = call double @square(double %33)
%35 = fsub double %32, %34
%36 = call double @sqrt(double %35)
%37 = call double @llvm.fmuladd.f64(double %30, double %36, double %28)
ret double %37
}

LLVM IR (-O2):
define double @indefinite_integral_f1_dx(double %0, double %1) {
%3 = tail call double @square(double %0)
%4 = tail call double @square(double %1)
%5 = fsub double %3, %4
%6 = tail call double @sqrt(double %5)
%7 = fmul double %6, %1
%8 = tail call double @square(double %1)
%9 = tail call double @square(double %0)
%10 = fsub double %8, %9
%11 = fdiv double %7, %10
%12 = tail call double @atan(double %11)
%13 = fmul double %12, -5.000000e-01
%14 = tail call double @square(double %0)
%15 = fmul double %0, %1
%16 = fmul double %15, -5.000000e-01
%17 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %16)
%18 = fmul double %1, 5.000000e-01
%19 = tail call double @square(double %0)
%20 = tail call double @square(double %1)
%21 = fsub double %19, %20
%22 = tail call double @sqrt(double %21)
%23 = tail call double @llvm.fmuladd.f64(double %18, double %22, double %17)
ret double %23
}