#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 INFINITY;
double double_min_size() {
  double d, d_p, step;
  int i;
  d = -1;
  while (d != (-INFINITY)) {
    d_p = d;
    d = d * 10;
    i++;
  };
  d = d_p;
  step = d;
  while (step < -1) {
    step = step / 10;
    i = 0;
    while ((d > (-INFINITY)) && (d + step != d)) {
      d_p = d;
      d = d + step;
      i++;
    };
    d = d_p;
  };
  return d;
}


x86 assembly (clang, -O0):
<double_min_size>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jne    114d <double_min_size+0x4d>
jp     114d <double_min_size+0x4d>
jmp    1177 <double_min_size+0x77>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xea9(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1111 <double_min_size+0x11>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe6d(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1251 <double_min_size+0x151>
movsd  -0x18(%rbp),%xmm0
movsd  0xe5d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e21(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x1d(%rbp)
jbe    120b <double_min_size+0x10b>
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    121b <double_min_size+0x11b>
jmp    1242 <double_min_size+0x142>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bb <double_min_size+0xbb>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <double_min_size+0x8b>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_min_size>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
ucomisd 0xefd(%rip),%xmm1
jne    111b <double_min_size+0x1b>
jnp    11b0 <double_min_size+0xb0>
xorpd  0xedd(%rip),%xmm1
movsd  0xeed(%rip),%xmm0
movsd  0xeed(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jne    1140 <double_min_size+0x40>
jp     1140 <double_min_size+0x40>
movsd  0xec0(%rip),%xmm4
ucomisd %xmm3,%xmm4
jbe    11b1 <double_min_size+0xb1>
movapd %xmm3,%xmm0
jmp    1176 <double_min_size+0x76>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
ucomisd %xmm3,%xmm4
jbe    11b0 <double_min_size+0xb0>
divsd  %xmm2,%xmm3
movapd %xmm0,%xmm6
movapd %xmm0,%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm5,%xmm0
ucomisd %xmm1,%xmm6
jbe    1170 <double_min_size+0x70>
movapd %xmm6,%xmm5
movapd %xmm3,%xmm6
addsd  %xmm5,%xmm6
ucomisd %xmm5,%xmm6
jne    1190 <double_min_size+0x90>
jp     1190 <double_min_size+0x90>
jmp    1170 <double_min_size+0x70>
ret
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
@INFINITY = global double 0.000000e+00
define double @double_min_size() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double -1.000000e+00, double* %1
br label %5
5: ; preds = %10, %0
%6 = load double, double* %1
%7 = load double, double* @INFINITY
%8 = fneg double %7
%9 = fcmp une double %6, %8
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load double, double* %1
store double %11, double* %2
%12 = load double, double* %1
%13 = fmul double %12, 1.000000e+01
store double %13, double* %1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load double, double* %2
store double %17, double* %1
%18 = load double, double* %1
store double %18, double* %3
br label %19
19: ; preds = %45, %16
%20 = load double, double* %3
%21 = fcmp olt double %20, -1.000000e+00
br i1 %21, label %22, label %47
22: ; preds = %19
%23 = load double, double* %3
%24 = fdiv double %23, 1.000000e+01
store double %24, double* %3
store i32 0, i32* %4
br label %25
25: ; preds = %38, %22
%26 = load double, double* %1
%27 = load double, double* @INFINITY
%28 = fneg double %27
%29 = fcmp ogt double %26, %28
br i1 %29, label %30, label %36
30: ; preds = %25
%31 = load double, double* %1
%32 = load double, double* %3
%33 = fadd double %31, %32
%34 = load double, double* %1
%35 = fcmp une double %33, %34
br label %36
36: ; preds = %30, %25
%37 = phi i1 [ false, %25 ], [ %35, %30 ]
br i1 %37, label %38, label %45
38: ; preds = %36
%39 = load double, double* %1
store double %39, double* %2
%40 = load double, double* %1
%41 = load double, double* %3
%42 = fadd double %40, %41
store double %42, double* %1
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %25
45: ; preds = %36
%46 = load double, double* %2
store double %46, double* %1
br label %19
47: ; preds = %19
%48 = load double, double* %1
ret double %48
}

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define double @double_min_size() {
%1 = load double, double* @INFINITY
%2 = fneg double %1
%3 = fcmp une double %1, 1.000000e+00
br i1 %3, label %6, label %23
4: ; preds = %6
%5 = fcmp olt double %7, -1.000000e+00
br i1 %5, label %12, label %23
6: ; preds = %0, %6
%7 = phi double [ %8, %6 ], [ -1.000000e+00, %0 ]
%8 = fmul double %7, 1.000000e+01
%9 = fcmp une double %8, %2
br i1 %9, label %6, label %4
10: ; preds = %16
%11 = fcmp olt double %15, -1.000000e+00
br i1 %11, label %12, label %23
12: ; preds = %4, %10
%13 = phi double [ %15, %10 ], [ %7, %4 ]
%14 = phi double [ %18, %10 ], [ %7, %4 ]
%15 = fdiv double %13, 1.000000e+01
br label %16
16: ; preds = %16, %12
%17 = phi double [ %14, %12 ], [ %20, %16 ]
%18 = phi double [ %14, %12 ], [ %17, %16 ]
%19 = fcmp ogt double %17, %2
%20 = fadd double %15, %17
%21 = fcmp une double %20, %17
%22 = select i1 %19, i1 %21, i1 false
br i1 %22, label %16, label %10
23: ; preds = %10, %0, %4
%24 = phi double [ %7, %4 ], [ undef, %0 ], [ %18, %10 ]
ret double %24
}