#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 cfrac_log(double, unsigned int);
double log(double);
double my_abs(double);
int /*<<< orphan*/ printf(char *, double, ...);
void cf_iter(double min, double max, double eps) {
  unsigned int hodnota_min;
  unsigned int hodnota_max;
  unsigned int max_interval = 1;
  unsigned int min_interval;
  unsigned int stred;
  int pravda = 1;
  while (pravda) {
    if (my_abs(log(min) - cfrac_log(min, max_interval)) <= eps)
      pravda = 0;
    else
      max_interval *= 10;
  }
  if (max_interval == 1)
    min_interval = 1;
  else
    min_interval = max_interval / 10;
  stred = (min_interval + max_interval) / 2;
  max_interval = max_interval + min_interval;
  pravda = 1;
  int pom_pravda = 1;
  if (stred - 1 == 0) {
    pravda = 0;
    hodnota_min = 0;
  }
  while (pravda) {
    if (my_abs(log(min) - cfrac_log(min, stred)) <= eps)
      pom_pravda = 1;
    else
      pom_pravda = 0;
    if (pom_pravda && (my_abs(log(min) - cfrac_log(min, stred - 1)) > eps)) {
      pravda = 0;
      hodnota_min = stred;
      break;
    }
    if (pom_pravda) {
      max_interval = stred;
      stred = stred / 2;
    } else {
      stred = (max_interval + stred) / 2;
    }
    if (stred == 0) {
      pravda = 0;
      hodnota_min = stred;
    }
  }
  pravda = 1;
  max_interval = 1;
  while (pravda) {
    if (my_abs(log(max) - cfrac_log(max, max_interval)) <= eps)
      pravda = 0;
    else
      max_interval *= 10;
  }
  if (max_interval == 1)
    min_interval = 1;
  else
    min_interval = max_interval / 10;
  pravda = 1;
  stred = (min_interval + max_interval) / 2;
  max_interval = max_interval + min_interval;
  if ((stred - 1) == 0) {
    pravda = 0;
    hodnota_max = 0;
  }
  while (pravda) {
    if (my_abs(log(max) - cfrac_log(max, stred)) <= eps)
      pom_pravda = 1;
    else
      pom_pravda = 0;
    if (pom_pravda && (my_abs(log(max) - cfrac_log(max, stred - 1)) > eps)) {
      pravda = 0;
      hodnota_max = stred;
      break;
    }
    if (pom_pravda) {
      max_interval = stred;
      stred = stred / 2;
    } else {
      stred = (max_interval + stred) / 2;
    }
    if (stred == 0) {
      pravda = 0;
      hodnota_max = stred;
    }
  }
  if (hodnota_min < hodnota_max)
    stred = hodnota_max;
  else
    stred = hodnota_min;
  printf("continued fraction iterations = %d\n", stred);
  printf("cf_log(%g) = %.12g\n", min, cfrac_log(min, stred));
  printf("cf_log(%g) = %.12g\n", max, cfrac_log(max, stred));
  return;
}


x86 assembly (clang, -O0):
<cf_iter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     11c9 <cf_iter+0x89>
movsd  -0x8(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <my_abs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11bd <cf_iter+0x7d>
movl   $0x0,-0x30(%rbp)
jmp    11c4 <cf_iter+0x84>
imul   $0xa,-0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1168 <cf_iter+0x28>
cmpl   $0x1,-0x24(%rbp)
jne    11df <cf_iter+0x9f>
movl   $0x1,-0x28(%rbp)
jmp    11ee <cf_iter+0xae>
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    -0x24(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jne    122e <cf_iter+0xee>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    1233 <cf_iter+0xf3>
cmpl   $0x0,-0x30(%rbp)
je     132c <cf_iter+0x1ec>
movsd  -0x8(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <my_abs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1288 <cf_iter+0x148>
movl   $0x1,-0x34(%rbp)
jmp    128f <cf_iter+0x14f>
movl   $0x0,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     12e6 <cf_iter+0x1a6>
movsd  -0x8(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
sub    $0x1,%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <my_abs@plt>
ucomisd -0x18(%rbp),%xmm0
jbe    12e6 <cf_iter+0x1a6>
movl   $0x0,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    132c <cf_iter+0x1ec>
cmpl   $0x0,-0x34(%rbp)
je     1304 <cf_iter+0x1c4>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1310 <cf_iter+0x1d0>
mov    -0x24(%rbp),%eax
add    -0x2c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1327 <cf_iter+0x1e7>
movl   $0x0,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1233 <cf_iter+0xf3>
movl   $0x1,-0x30(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     139b <cf_iter+0x25b>
movsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <my_abs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     138f <cf_iter+0x24f>
movl   $0x0,-0x30(%rbp)
jmp    1396 <cf_iter+0x256>
imul   $0xa,-0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    133a <cf_iter+0x1fa>
cmpl   $0x1,-0x24(%rbp)
jne    13b1 <cf_iter+0x271>
movl   $0x1,-0x28(%rbp)
jmp    13c0 <cf_iter+0x280>
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x28(%rbp),%eax
add    -0x24(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
jne    13f9 <cf_iter+0x2b9>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
jmp    13fe <cf_iter+0x2be>
cmpl   $0x0,-0x30(%rbp)
je     14f7 <cf_iter+0x3b7>
movsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <my_abs@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1453 <cf_iter+0x313>
movl   $0x1,-0x34(%rbp)
jmp    145a <cf_iter+0x31a>
movl   $0x0,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     14b1 <cf_iter+0x371>
movsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
sub    $0x1,%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <my_abs@plt>
ucomisd -0x18(%rbp),%xmm0
jbe    14b1 <cf_iter+0x371>
movl   $0x0,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    14f7 <cf_iter+0x3b7>
cmpl   $0x0,-0x34(%rbp)
je     14cf <cf_iter+0x38f>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    14db <cf_iter+0x39b>
mov    -0x24(%rbp),%eax
add    -0x2c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    14f2 <cf_iter+0x3b2>
movl   $0x0,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    13fe <cf_iter+0x2be>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    150e <cf_iter+0x3ce>
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1514 <cf_iter+0x3d4>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cvtsi2sd %rax,%xmm0
lea    0xadd(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
lea    0xad4(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x2c(%rbp),%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
lea    0xaa7(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_iter>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x1,%r15d
movsd  0x10(%rsp),%xmm0
mov    $0x1,%edi
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x1,%ebx
jae    11f0 <cf_iter+0xb0>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
movsd  0x10(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     11b0 <cf_iter+0x70>
cmp    $0x1,%ebx
je     1205 <cf_iter+0xc5>
mov    %ebx,%eax
mov    $0xcccccccd,%r15d
imul   %rax,%r15
shr    $0x23,%r15
add    %ebx,%r15d
mov    %r15d,%r14d
shr    %r14d
cmp    $0x1,%r14d
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
jne    1387 <cf_iter+0x247>
xor    %r14d,%r14d
movaps %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x1,%r15d
movsd  0x8(%rsp),%xmm0
mov    $0x1,%edi
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x1,%ebx
jae    12c0 <cf_iter+0x180>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
movsd  0x8(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1280 <cf_iter+0x140>
cmp    $0x1,%ebx
je     12d5 <cf_iter+0x195>
mov    %ebx,%eax
mov    $0xcccccccd,%r15d
imul   %rax,%r15
shr    $0x23,%r15
add    %ebx,%r15d
mov    %r15d,%ebx
shr    %ebx
cmp    $0x1,%ebx
movsd  0x8(%rsp),%xmm0
jne    142e <cf_iter+0x2ee>
xor    %ebx,%ebx
cmp    %ebx,%r14d
cmovb  %ebx,%r14d
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
lea    0xcfc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %r14d,%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
lea    0xd01(%rip),%rbx
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %r14d,%edi
call   1050 <cfrac_log@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x2,%al
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>
nopl   (%rax)
mov    %r14d,%eax
add    %r15d,%eax
mov    %r15d,%r14d
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
mov    %r14d,%r15d
mov    %eax,%r14d
shr    %r14d
cmp    $0x1,%eax
jbe    1224 <cf_iter+0xe4>
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    %r14d,%edi
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1360 <cf_iter+0x220>
movsd  0x10(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
lea    -0x1(%r14),%edi
movsd  0x10(%rsp),%xmm0
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
ucomisd 0x18(%rsp),%xmm0
mov    %r14d,%eax
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
jbe    1375 <cf_iter+0x235>
jmp    1227 <cf_iter+0xe7>
xchg   %ax,%ax
mov    %ebx,%eax
add    %r15d,%eax
mov    %r15d,%ebx
movsd  0x8(%rsp),%xmm0
mov    %ebx,%r15d
mov    %eax,%ebx
shr    %ebx
cmp    $0x1,%eax
jbe    12ec <cf_iter+0x1ac>
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1410 <cf_iter+0x2d0>
movsd  0x8(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,(%rsp)
lea    -0x1(%rbx),%edi
movsd  0x8(%rsp),%xmm0
call   1050 <cfrac_log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <my_abs@plt>
ucomisd 0x18(%rsp),%xmm0
mov    %ebx,%eax
movsd  0x8(%rsp),%xmm0
jbe    141e <cf_iter+0x2de>
jmp    12ee <cf_iter+0x1ae>

LLVM IR (-O0):
@.str = [36 x i8] c"continued fraction iterations = %d\0A\00"
@.str.1 = [20 x i8] c"cf_log(%g) = %.12g\0A\00"
define void @cf_iter(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store i32 1, i32* %9
store i32 1, i32* %12
br label %14
14: ; preds = %31, %3
%15 = load i32, i32* %12
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %14
%18 = load double, double* %4
%19 = call double @log(double %18)
%20 = load double, double* %4
%21 = load i32, i32* %9
%22 = call double @cfrac_log(double %20, i32 %21)
%23 = fsub double %19, %22
%24 = call double @my_abs(double %23)
%25 = load double, double* %6
%26 = fcmp ole double %24, %25
br i1 %26, label %27, label %28
27: ; preds = %17
store i32 0, i32* %12
br label %31
28: ; preds = %17
%29 = load i32, i32* %9
%30 = mul i32 %29, 10
store i32 %30, i32* %9
br label %31
31: ; preds = %28, %27
br label %14
32: ; preds = %14
%33 = load i32, i32* %9
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 1, i32* %10
br label %39
36: ; preds = %32
%37 = load i32, i32* %9
%38 = udiv i32 %37, 10
store i32 %38, i32* %10
br label %39
39: ; preds = %36, %35
%40 = load i32, i32* %10
%41 = load i32, i32* %9
%42 = add i32 %40, %41
%43 = udiv i32 %42, 2
store i32 %43, i32* %11
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = add i32 %44, %45
store i32 %46, i32* %9
store i32 1, i32* %12
store i32 1, i32* %13
%47 = load i32, i32* %11
%48 = sub i32 %47, 1
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %39
store i32 0, i32* %12
store i32 0, i32* %7
br label %51
51: ; preds = %50, %39
br label %52
52: ; preds = %100, %51
%53 = load i32, i32* %12
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %101
55: ; preds = %52
%56 = load double, double* %4
%57 = call double @log(double %56)
%58 = load double, double* %4
%59 = load i32, i32* %11
%60 = call double @cfrac_log(double %58, i32 %59)
%61 = fsub double %57, %60
%62 = call double @my_abs(double %61)
%63 = load double, double* %6
%64 = fcmp ole double %62, %63
br i1 %64, label %65, label %66
65: ; preds = %55
store i32 1, i32* %13
br label %67
66: ; preds = %55
store i32 0, i32* %13
br label %67
67: ; preds = %66, %65
%68 = load i32, i32* %13
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %83
70: ; preds = %67
%71 = load double, double* %4
%72 = call double @log(double %71)
%73 = load double, double* %4
%74 = load i32, i32* %11
%75 = sub i32 %74, 1
%76 = call double @cfrac_log(double %73, i32 %75)
%77 = fsub double %72, %76
%78 = call double @my_abs(double %77)
%79 = load double, double* %6
%80 = fcmp ogt double %78, %79
br i1 %80, label %81, label %83
81: ; preds = %70
store i32 0, i32* %12
%82 = load i32, i32* %11
store i32 %82, i32* %7
br label %101
83: ; preds = %70, %67
%84 = load i32, i32* %13
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %90
86: ; preds = %83
%87 = load i32, i32* %11
store i32 %87, i32* %9
%88 = load i32, i32* %11
%89 = udiv i32 %88, 2
store i32 %89, i32* %11
br label %95
90: ; preds = %83
%91 = load i32, i32* %9
%92 = load i32, i32* %11
%93 = add i32 %91, %92
%94 = udiv i32 %93, 2
store i32 %94, i32* %11
br label %95
95: ; preds = %90, %86
%96 = load i32, i32* %11
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %95
store i32 0, i32* %12
%99 = load i32, i32* %11
store i32 %99, i32* %7
br label %100
100: ; preds = %98, %95
br label %52
101: ; preds = %81, %52
store i32 1, i32* %12
store i32 1, i32* %9
br label %102
102: ; preds = %119, %101
%103 = load i32, i32* %12
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %120
105: ; preds = %102
%106 = load double, double* %5
%107 = call double @log(double %106)
%108 = load double, double* %5
%109 = load i32, i32* %9
%110 = call double @cfrac_log(double %108, i32 %109)
%111 = fsub double %107, %110
%112 = call double @my_abs(double %111)
%113 = load double, double* %6
%114 = fcmp ole double %112, %113
br i1 %114, label %115, label %116
115: ; preds = %105
store i32 0, i32* %12
br label %119
116: ; preds = %105
%117 = load i32, i32* %9
%118 = mul i32 %117, 10
store i32 %118, i32* %9
br label %119
119: ; preds = %116, %115
br label %102
120: ; preds = %102
%121 = load i32, i32* %9
%122 = icmp eq i32 %121, 1
br i1 %122, label %123, label %124
123: ; preds = %120
store i32 1, i32* %10
br label %127
124: ; preds = %120
%125 = load i32, i32* %9
%126 = udiv i32 %125, 10
store i32 %126, i32* %10
br label %127
127: ; preds = %124, %123
store i32 1, i32* %12
%128 = load i32, i32* %10
%129 = load i32, i32* %9
%130 = add i32 %128, %129
%131 = udiv i32 %130, 2
store i32 %131, i32* %11
%132 = load i32, i32* %9
%133 = load i32, i32* %10
%134 = add i32 %132, %133
store i32 %134, i32* %9
%135 = load i32, i32* %11
%136 = sub i32 %135, 1
%137 = icmp eq i32 %136, 0
br i1 %137, label %138, label %139
138: ; preds = %127
store i32 0, i32* %12
store i32 0, i32* %8
br label %139
139: ; preds = %138, %127
br label %140
140: ; preds = %188, %139
%141 = load i32, i32* %12
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %189
143: ; preds = %140
%144 = load double, double* %5
%145 = call double @log(double %144)
%146 = load double, double* %5
%147 = load i32, i32* %11
%148 = call double @cfrac_log(double %146, i32 %147)
%149 = fsub double %145, %148
%150 = call double @my_abs(double %149)
%151 = load double, double* %6
%152 = fcmp ole double %150, %151
br i1 %152, label %153, label %154
153: ; preds = %143
store i32 1, i32* %13
br label %155
154: ; preds = %143
store i32 0, i32* %13
br label %155
155: ; preds = %154, %153
%156 = load i32, i32* %13
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %171
158: ; preds = %155
%159 = load double, double* %5
%160 = call double @log(double %159)
%161 = load double, double* %5
%162 = load i32, i32* %11
%163 = sub i32 %162, 1
%164 = call double @cfrac_log(double %161, i32 %163)
%165 = fsub double %160, %164
%166 = call double @my_abs(double %165)
%167 = load double, double* %6
%168 = fcmp ogt double %166, %167
br i1 %168, label %169, label %171
169: ; preds = %158
store i32 0, i32* %12
%170 = load i32, i32* %11
store i32 %170, i32* %8
br label %189
171: ; preds = %158, %155
%172 = load i32, i32* %13
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %178
174: ; preds = %171
%175 = load i32, i32* %11
store i32 %175, i32* %9
%176 = load i32, i32* %11
%177 = udiv i32 %176, 2
store i32 %177, i32* %11
br label %183
178: ; preds = %171
%179 = load i32, i32* %9
%180 = load i32, i32* %11
%181 = add i32 %179, %180
%182 = udiv i32 %181, 2
store i32 %182, i32* %11
br label %183
183: ; preds = %178, %174
%184 = load i32, i32* %11
%185 = icmp eq i32 %184, 0
br i1 %185, label %186, label %188
186: ; preds = %183
store i32 0, i32* %12
%187 = load i32, i32* %11
store i32 %187, i32* %8
br label %188
188: ; preds = %186, %183
br label %140
189: ; preds = %169, %140
%190 = load i32, i32* %7
%191 = load i32, i32* %8
%192 = icmp ult i32 %190, %191
br i1 %192, label %193, label %195
193: ; preds = %189
%194 = load i32, i32* %8
store i32 %194, i32* %11
br label %197
195: ; preds = %189
%196 = load i32, i32* %7
store i32 %196, i32* %11
br label %197
197: ; preds = %195, %193
%198 = load i32, i32* %11
%199 = uitofp i32 %198 to double
%200 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %199)
%201 = load double, double* %4
%202 = load double, double* %4
%203 = load i32, i32* %11
%204 = call double @cfrac_log(double %202, i32 %203)
%205 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %201, double %204)
%206 = load double, double* %5
%207 = load double, double* %5
%208 = load i32, i32* %11
%209 = call double @cfrac_log(double %207, i32 %208)
%210 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %206, double %209)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"continued fraction iterations = %d\0A\00"
@.str.1 = [20 x i8] c"cf_log(%g) = %.12g\0A\00"
define void @cf_iter(double %0, double %1, double %2) {
%4 = tail call double @log(double %0)
%5 = tail call double @cfrac_log(double %0, i32 1)
%6 = fsub double %4, %5
%7 = tail call double @my_abs(double %6)
%8 = fcmp ugt double %7, %2
br i1 %8, label %9, label %17
9: ; preds = %3, %9
%10 = phi i32 [ %11, %9 ], [ 1, %3 ]
%11 = mul i32 %10, 10
%12 = tail call double @log(double %0)
%13 = tail call double @cfrac_log(double %0, i32 %11)
%14 = fsub double %12, %13
%15 = tail call double @my_abs(double %14)
%16 = fcmp ugt double %15, %2
br i1 %16, label %9, label %17
17: ; preds = %9, %3
%18 = phi i32 [ 1, %3 ], [ %11, %9 ]
%19 = icmp eq i32 %18, 1
%20 = udiv i32 %18, 10
%21 = select i1 %19, i32 1, i32 %20
%22 = add i32 %21, %18
%23 = lshr i32 %22, 1
%24 = icmp eq i32 %23, 1
br i1 %24, label %47, label %25
25: ; preds = %17, %42
%26 = phi i32 [ %45, %42 ], [ %23, %17 ]
%27 = phi i32 [ %43, %42 ], [ %22, %17 ]
%28 = tail call double @log(double %0)
%29 = tail call double @cfrac_log(double %0, i32 %26)
%30 = fsub double %28, %29
%31 = tail call double @my_abs(double %30)
%32 = fcmp ugt double %31, %2
br i1 %32, label %40, label %33
33: ; preds = %25
%34 = tail call double @log(double %0)
%35 = add nsw i32 %26, -1
%36 = tail call double @cfrac_log(double %0, i32 %35)
%37 = fsub double %34, %36
%38 = tail call double @my_abs(double %37)
%39 = fcmp ogt double %38, %2
br i1 %39, label %47, label %42
40: ; preds = %25
%41 = add i32 %26, %27
br label %42
42: ; preds = %33, %40
%43 = phi i32 [ %27, %40 ], [ %26, %33 ]
%44 = phi i32 [ %41, %40 ], [ %26, %33 ]
%45 = lshr i32 %44, 1
%46 = icmp ugt i32 %44, 1
br i1 %46, label %25, label %47
47: ; preds = %42, %33, %17
%48 = phi i32 [ 0, %17 ], [ %26, %33 ], [ 0, %42 ]
%49 = tail call double @log(double %1)
%50 = tail call double @cfrac_log(double %1, i32 1)
%51 = fsub double %49, %50
%52 = tail call double @my_abs(double %51)
%53 = fcmp ugt double %52, %2
br i1 %53, label %54, label %62
54: ; preds = %47, %54
%55 = phi i32 [ %56, %54 ], [ 1, %47 ]
%56 = mul i32 %55, 10
%57 = tail call double @log(double %1)
%58 = tail call double @cfrac_log(double %1, i32 %56)
%59 = fsub double %57, %58
%60 = tail call double @my_abs(double %59)
%61 = fcmp ugt double %60, %2
br i1 %61, label %54, label %62
62: ; preds = %54, %47
%63 = phi i32 [ 1, %47 ], [ %56, %54 ]
%64 = icmp eq i32 %63, 1
%65 = udiv i32 %63, 10
%66 = select i1 %64, i32 1, i32 %65
%67 = add i32 %66, %63
%68 = lshr i32 %67, 1
%69 = icmp eq i32 %68, 1
br i1 %69, label %92, label %70
70: ; preds = %62, %87
%71 = phi i32 [ %90, %87 ], [ %68, %62 ]
%72 = phi i32 [ %88, %87 ], [ %67, %62 ]
%73 = tail call double @log(double %1)
%74 = tail call double @cfrac_log(double %1, i32 %71)
%75 = fsub double %73, %74
%76 = tail call double @my_abs(double %75)
%77 = fcmp ugt double %76, %2
br i1 %77, label %85, label %78
78: ; preds = %70
%79 = tail call double @log(double %1)
%80 = add nsw i32 %71, -1
%81 = tail call double @cfrac_log(double %1, i32 %80)
%82 = fsub double %79, %81
%83 = tail call double @my_abs(double %82)
%84 = fcmp ogt double %83, %2
br i1 %84, label %92, label %87
85: ; preds = %70
%86 = add i32 %71, %72
br label %87
87: ; preds = %78, %85
%88 = phi i32 [ %72, %85 ], [ %71, %78 ]
%89 = phi i32 [ %86, %85 ], [ %71, %78 ]
%90 = lshr i32 %89, 1
%91 = icmp ugt i32 %89, 1
br i1 %91, label %70, label %92
92: ; preds = %87, %78, %62
%93 = phi i32 [ 0, %62 ], [ %71, %78 ], [ 0, %87 ]
%94 = icmp ult i32 %48, %93
%95 = select i1 %94, i32 %93, i32 %48
%96 = uitofp i32 %95 to double
%97 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %96)
%98 = tail call double @cfrac_log(double %0, i32 %95)
%99 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %0, double %98)
%100 = tail call double @cfrac_log(double %1, i32 %95)
%101 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %1, double %100)
ret void
}