#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  uint32_t value;
  value = strtoul(argv[1], NULL, 16);
  value &= 0x3ff;
  if ((value >> 9) & 0x1)
    printf("%f\n", -(((value - 1) ^ 0x3ff) / 256.0f));
  else
    printf("%f\n", value / 256.0f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x3ff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x9,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11a9 <main+0x89>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
xor    $0x3ff,%eax
cvtsi2ss %eax,%xmm0
movss  0xe7d(%rip),%xmm1
divss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvttss2si %xmm0,%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
jmp    11ca <main+0xaa>
cvtsi2ssl -0x14(%rbp),%xmm0
movss  0xe4a(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,%ecx
and    $0x3ff,%ecx
lea    -0x1(%rcx),%edx
xor    $0x3ff,%edx
xor    %esi,%esi
test   $0x200,%eax
sete   %sil
cmove  %ecx,%edx
cvtsi2ss %edx,%xmm0
lea    0xea5(%rip),%rax
mulss  (%rax,%rsi,4),%xmm0
cvttss2si %xmm0,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strtoul(i8* %9, i32* null, i32 16)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = and i32 %11, 1023
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = ashr i32 %13, 9
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %2
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 1
%20 = xor i32 %19, 1023
%21 = sitofp i32 %20 to float
%22 = fdiv float %21, 2.560000e+02
%23 = fneg float %22
%24 = fptosi float %23 to i32
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %32
26: ; preds = %2
%27 = load i32, i32* %6
%28 = sitofp i32 %27 to float
%29 = fdiv float %28, 2.560000e+02
%30 = fptosi float %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %26, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtoul(i8* nocapture %4, i32* null, i32 16)
%6 = and i32 %5, 1023
%7 = and i32 %5, 512
%8 = icmp eq i32 %7, 0
%9 = add nsw i32 %6, -1
%10 = xor i32 %9, 1023
%11 = select i1 %8, i32 %6, i32 %10
%12 = select i1 %8, float 3.906250e-03, float -3.906250e-03
%13 = sitofp i32 %11 to float
%14 = fmul float %12, %13
%15 = fptosi float %14 to i32
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}