#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 */
int /*<<< orphan*/ vr_init(void *, double, int, double);
char const *vr_create(void *channel, void *shared, double max_io_ratio,
                      void *q_spec, void *r_spec, double scale) {
  double x = max_io_ratio;
  int n;
  for (n = 0; x > 1; x *= .5, ++n)
    ;
  vr_init(channel, max_io_ratio, n, scale);
  return 0;
  (void)shared, (void)q_spec, (void)r_spec;
}


x86 assembly (clang, -O0):
<vr_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117f <vr_create+0x6f>
jmp    115f <vr_create+0x4f>
movsd  0xea1(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1143 <vr_create+0x33>
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x3c(%rbp),%esi
movsd  -0x30(%rbp),%xmm1
call   1030 <vr_init@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vr_create>:
push   %rax
xor    %esi,%esi
ucomisd 0xee5(%rip),%xmm0
jbe    114d <vr_create+0x3d>
xor    %esi,%esi
movsd  0xee1(%rip),%xmm2
movsd  0xed1(%rip),%xmm3
movapd %xmm0,%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mulsd  %xmm2,%xmm4
add    $0x1,%esi
ucomisd %xmm3,%xmm4
ja     1140 <vr_create+0x30>
call   1030 <vr_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @vr_create(i8* %0, i8* %1, double %2, i8* %3, i8* %4, double %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca double
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca double
%13 = alloca double
%14 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store double %2, double* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store double %5, double* %12
%15 = load double, double* %9
store double %15, double* %13
store i32 0, i32* %14
br label %16
16: ; preds = %20, %6
%17 = load double, double* %13
%18 = fcmp ogt double %17, 1.000000e+00
br i1 %18, label %19, label %25
19: ; preds = %16
br label %20
20: ; preds = %19
%21 = load double, double* %13
%22 = fmul double %21, 5.000000e-01
store double %22, double* %13
%23 = load i32, i32* %14
%24 = add nsw i32 %23, 1
store i32 %24, i32* %14
br label %16
25: ; preds = %16
%26 = load i8*, i8** %7
%27 = load double, double* %9
%28 = load i32, i32* %14
%29 = load double, double* %12
%30 = call i32 @vr_init(i8* %26, double %27, i32 %28, double %29)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @vr_create(i8* %0, i8* nocapture readnone %1, double %2, i8* nocapture readnone %3, i8* nocapture readnone %4, double %5) {
%7 = fcmp ogt double %2, 1.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %6, %8
%9 = phi i32 [ %12, %8 ], [ 0, %6 ]
%10 = phi double [ %11, %8 ], [ %2, %6 ]
%11 = fmul double %10, 5.000000e-01
%12 = add nuw nsw i32 %9, 1
%13 = fcmp ogt double %11, 1.000000e+00
br i1 %13, label %8, label %14
14: ; preds = %8, %6
%15 = phi i32 [ 0, %6 ], [ %12, %8 ]
%16 = tail call i32 @vr_init(i8* %0, double %2, i32 %15, double %5)
ret i8* null
}