int main() {
  char *value_in = 0, *value_in_fractional_part;
  scanf("%ms", &value_in);
  double value_out = strtol(value_in, &value_in_fractional_part, 2);
  if (*value_in_fractional_part) {
    assert(*value_in_fractional_part == '.');
    ++value_in_fractional_part;
    long numerator = strtol(value_in_fractional_part, 0, 2);
    long denominator_log2 = strlen(value_in_fractional_part);
    value_out += (double)numerator / (1 << denominator_log2);
  }
  printf("%.12lf\n", value_out);
  free(value_in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xe82(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1070 <strtol@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     121f <main+0xbf>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1060 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1070 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x30(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xdd9(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
lea    0xe89(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x2,%edx
call   1070 <strtol@plt>
cvtsi2sd %rax,%xmm0
mov    0x10(%rsp),%rbx
mov    (%rbx),%al
test   %al,%al
je     1205 <main+0xa5>
xor    %edi,%edi
cmp    $0x2e,%al
sete   %dil
xor    %eax,%eax
movsd  %xmm0,(%rsp)
call   1060 <assert@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1070 <strtol@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
lea    0xdf8(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ms\00"
@.str.1 = [8 x i8] c"%.12lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i8* null, i8** %2
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2)
%8 = load i8*, i8** %2
%9 = call i64 @strtol(i8* %8, i8** %3, i32 2)
%10 = sitofp i64 %9 to double
store double %10, double* %4
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %36
14: ; preds = %0
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 46
%19 = zext i1 %18 to i32
%20 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %19)
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %3
%24 = call i64 @strtol(i8* %23, i8** null, i32 2)
store i64 %24, i64* %5
%25 = load i8*, i8** %3
%26 = call i64 @strlen(i8* %25)
store i64 %26, i64* %6
%27 = load i64, i64* %5
%28 = sitofp i64 %27 to double
%29 = load i64, i64* %6
%30 = trunc i64 %29 to i32
%31 = shl i32 1, %30
%32 = sitofp i32 %31 to double
%33 = fdiv double %28, %32
%34 = load double, double* %4
%35 = fadd double %34, %33
store double %35, double* %4
br label %36
36: ; preds = %14, %0
%37 = load double, double* %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %37)
%39 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ms\00"
@.str.1 = [8 x i8] c"%.12lf\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i8** %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1)
%6 = load i8*, i8** %1
%7 = call i64 @strtol(i8* %6, i8** %2, i32 2)
%8 = sitofp i64 %7 to double
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %0
%13 = icmp eq i8 %10, 46
%14 = zext i1 %13 to i32
%15 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %14)
%16 = getelementptr inbounds i8, i8* %9, i64 1
%17 = call i64 @strtol(i8* nocapture %16, i8** null, i32 2)
%18 = call i64 @strlen(i8* %16)
%19 = sitofp i64 %17 to double
%20 = trunc i64 %18 to i32
%21 = shl nuw i32 1, %20
%22 = sitofp i32 %21 to double
%23 = fdiv double %19, %22
%24 = fadd double %23, %8
br label %25
25: ; preds = %12, %0
%26 = phi double [ %24, %12 ], [ %8, %0 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = load i8*, i8** %1
ret i32 0
}