#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 calka(double, double, double, double, double, double, double);
double f(double);
double poleO(double, double, double, double, double);
int /*<<< orphan*/ printf(char *, double, double);
double calkaD(double a, double b, double delta) {
  printf("%f,%f S\n", a, b);
  double fa = f(a);
  double fb = f(b);
  double fc = f((a + b) / 2.0);
  double S = poleO(a, b, fa, fb, fc);
  return calka(a, b, delta, S, fa, fb, fc);
}


x86 assembly (clang, -O0):
<calkaD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xea0(%rip),%rdi
call   1050 <printf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1030 <poleO@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
call   1060 <calka@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calkaD>:
sub    $0x38,%rsp
movsd  %xmm2,0x30(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
mulsd  0xe68(%rip),%xmm0
call   1040 <f@plt>
movapd %xmm0,%xmm4
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
call   1030 <poleO@plt>
movaps %xmm0,%xmm3
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  0x20(%rsp),%xmm4
movsd  0x18(%rsp),%xmm5
movsd  0x28(%rsp),%xmm6
add    $0x38,%rsp
jmp    1060 <calka@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%f,%f S\0A\00"
define double @calkaD(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %11, double %12)
%14 = load double, double* %4
%15 = call double @f(double %14)
store double %15, double* %7
%16 = load double, double* %5
%17 = call double @f(double %16)
store double %17, double* %8
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fadd double %18, %19
%21 = fdiv double %20, 2.000000e+00
%22 = call double @f(double %21)
store double %22, double* %9
%23 = load double, double* %4
%24 = load double, double* %5
%25 = load double, double* %7
%26 = load double, double* %8
%27 = load double, double* %9
%28 = call double @poleO(double %23, double %24, double %25, double %26, double %27)
store double %28, double* %10
%29 = load double, double* %4
%30 = load double, double* %5
%31 = load double, double* %6
%32 = load double, double* %10
%33 = load double, double* %7
%34 = load double, double* %8
%35 = load double, double* %9
%36 = call double @calka(double %29, double %30, double %31, double %32, double %33, double %34, double %35)
ret double %36
}

LLVM IR (-O2):
@.str = [9 x i8] c"%f,%f S\0A\00"
define double @calkaD(double %0, double %1, double %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %0, double %1)
%5 = tail call double @f(double %0)
%6 = tail call double @f(double %1)
%7 = fadd double %0, %1
%8 = fmul double %7, 5.000000e-01
%9 = tail call double @f(double %8)
%10 = tail call double @poleO(double %0, double %1, double %5, double %6, double %9)
%11 = tail call double @calka(double %0, double %1, double %2, double %10, double %5, double %6, double %9)
ret double %11
}