#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 pow(double, int const);
int setRootBrackets(const int k, const int i, const double Tmin,
                    const double Tmax, const double T, double *Ta, double *Tb) {
  double dT = 1.0;
  dT *= pow(2.0, i);
  *Ta = T - dT;
  *Tb = T + dT;
  *Ta = ((Tmin) > (T - dT) ? (Tmin) : (T - dT));
  *Tb = ((Tmax) < (T + dT) ? (Tmax) : (T + dT));
}


x86 assembly (clang, -O0):
<setRootBrackets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xc(%rbp),%edi
movsd  0xeb3(%rip),%xmm0
call   1030 <pow@plt>
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a8 <setRootBrackets+0x98>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11b7 <setRootBrackets+0xa7>
movsd  -0x28(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ec <setRootBrackets+0xdc>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11fb <setRootBrackets+0xeb>
movsd  -0x28(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setRootBrackets>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    %esi,%edi
movsd  0xec8(%rip),%xmm0
call   1030 <pow@plt>
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm2
maxsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx)
movsd  0x10(%rsp),%xmm1
minsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @setRootBrackets(i32 %0, i32 %1, double %2, double %3, double %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca double
store i32 %0, i32* %9
store i32 %1, i32* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double* %5, double** %14
store double* %6, double** %15
store double 1.000000e+00, double* %16
%17 = load i32, i32* %10
%18 = call double @pow(double 2.000000e+00, i32 %17)
%19 = load double, double* %16
%20 = fmul double %19, %18
store double %20, double* %16
%21 = load double, double* %13
%22 = load double, double* %16
%23 = fsub double %21, %22
%24 = load double*, double** %14
store double %23, double* %24
%25 = load double, double* %13
%26 = load double, double* %16
%27 = fadd double %25, %26
%28 = load double*, double** %15
store double %27, double* %28
%29 = load double, double* %11
%30 = load double, double* %13
%31 = load double, double* %16
%32 = fsub double %30, %31
%33 = fcmp ogt double %29, %32
br i1 %33, label %34, label %36
34: ; preds = %7
%35 = load double, double* %11
br label %40
36: ; preds = %7
%37 = load double, double* %13
%38 = load double, double* %16
%39 = fsub double %37, %38
br label %40
40: ; preds = %36, %34
%41 = phi double [ %35, %34 ], [ %39, %36 ]
%42 = load double*, double** %14
store double %41, double* %42
%43 = load double, double* %12
%44 = load double, double* %13
%45 = load double, double* %16
%46 = fadd double %44, %45
%47 = fcmp olt double %43, %46
br i1 %47, label %48, label %50
48: ; preds = %40
%49 = load double, double* %12
br label %54
50: ; preds = %40
%51 = load double, double* %13
%52 = load double, double* %16
%53 = fadd double %51, %52
br label %54
54: ; preds = %50, %48
%55 = phi double [ %49, %48 ], [ %53, %50 ]
%56 = load double*, double** %15
store double %55, double* %56
%57 = load i32, i32* %8
ret i32 %57
}

LLVM IR (-O2):
define i32 @setRootBrackets(i32 %0, i32 %1, double %2, double %3, double %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = tail call double @pow(double 2.000000e+00, i32 %1)
%9 = fsub double %4, %8
%10 = fadd double %8, %4
%11 = fcmp olt double %9, %2
%12 = select i1 %11, double %2, double %9
store double %12, double* %5
%13 = fcmp ogt double %10, %3
%14 = select i1 %13, double %3, double %10
store double %14, double* %6
ret i32 undef
}