#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*/ printf(char *, double);
int main(void) {
  double A, B;
  A = 1.0;
  while ((A + 1.0) - A == 1.0)
    A *= 2.0;
  B = 1.0;
  while ((A + B) - A != B)
    B += 1.0;
  printf("Radix B = %g\n", B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    116d <main+0x5d>
jp     116d <main+0x5d>
movsd  0xeaa(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    112c <main+0x1c>
movsd  0xe8b(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    119f <main+0x8f>
jp     119f <main+0x8f>
jmp    11b6 <main+0xa6>
movsd  0xe59(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    117a <main+0x6a>
movsd  -0x18(%rbp),%xmm0
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movapd %xmm0,%xmm1
nopl   (%rax)
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
movapd %xmm1,%xmm2
addsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
ucomisd %xmm0,%xmm2
jne    1156 <main+0x46>
jp     1156 <main+0x46>
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm1
jmp    1120 <main+0x10>
movsd  0xea2(%rip),%xmm2
movapd %xmm2,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm2,%xmm0
movapd %xmm1,%xmm3
addsd  %xmm0,%xmm3
subsd  %xmm1,%xmm3
ucomisd %xmm0,%xmm3
jne    1170 <main+0x60>
jp     1170 <main+0x60>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Radix B = %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e+00, double* %2
br label %4
4: ; preds = %10, %0
%5 = load double, double* %2
%6 = fadd double %5, 1.000000e+00
%7 = load double, double* %2
%8 = fsub double %6, %7
%9 = fcmp oeq double %8, 1.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load double, double* %2
%12 = fmul double %11, 2.000000e+00
store double %12, double* %2
br label %4
13: ; preds = %4
store double 1.000000e+00, double* %3
br label %14
14: ; preds = %22, %13
%15 = load double, double* %2
%16 = load double, double* %3
%17 = fadd double %15, %16
%18 = load double, double* %2
%19 = fsub double %17, %18
%20 = load double, double* %3
%21 = fcmp une double %19, %20
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = load double, double* %3
%24 = fadd double %23, 1.000000e+00
store double %24, double* %3
br label %14
25: ; preds = %14
%26 = load double, double* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Radix B = %g\0A\00"
define i32 @main() {
br label %1
1: ; preds = %11, %0
%2 = phi double [ 1.000000e+00, %0 ], [ %14, %11 ]
%3 = fmul double %2, 2.000000e+00
%4 = fmul double %3, 2.000000e+00
%5 = fmul double %4, 2.000000e+00
%6 = fmul double %5, 2.000000e+00
%7 = fmul double %6, 2.000000e+00
%8 = fadd double %7, 1.000000e+00
%9 = fsub double %8, %7
%10 = fcmp oeq double %9, 1.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = fmul double %7, 2.000000e+00
%13 = fmul double %12, 2.000000e+00
%14 = fmul double %13, 2.000000e+00
br label %1
15: ; preds = %1, %15
%16 = phi double [ %17, %15 ], [ 1.000000e+00, %1 ]
%17 = fadd double %16, 1.000000e+00
%18 = fadd double %7, %17
%19 = fsub double %18, %7
%20 = fcmp une double %19, %17
br i1 %20, label %15, label %21
21: ; preds = %15
%22 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %17)
ret i32 0
}