#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 pow(double, double);
double from_1750flt(short *input) {
  long int_mant;
  double flt_mant, flt_exp;
  signed char int_exp;
  int_exp = (signed char)(input[1] & 0xFF);
  int_mant = ((long)input[0] << 8) | (((long)input[1] & 0xFF00L) >> 8);
  flt_mant = (double)int_mant / 8388608.0;
  flt_exp = pow(2.0, (double)int_exp);
  return flt_mant * flt_exp;
}


x86 assembly (clang, -O0):
<from_1750flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x8(%rbp),%rcx
movswq (%rcx),%rax
shl    $0x8,%rax
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsbl -0x21(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xe9c(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_1750flt>:
push   %rax
movzwl 0x2(%rdi),%eax
movzwl %ax,%ecx
movswl (%rdi),%edx
shl    $0x8,%edx
shr    $0x8,%rcx
or     %edx,%ecx
cvtsi2sd %ecx,%xmm0
mulsd  0xed0(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsbl %al,%edi
movsd  0xec8(%rip),%xmm0
call   1030 <ldexp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @from_1750flt(i16* %0) {
%2 = alloca i16*
%3 = alloca i64
%4 = alloca double
%5 = alloca double
%6 = alloca i8
store i16* %0, i16** %2
%7 = load i16*, i16** %2
%8 = getelementptr inbounds i16, i16* %7, i64 1
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
%13 = load i16*, i16** %2
%14 = getelementptr inbounds i16, i16* %13, i64 0
%15 = load i16, i16* %14
%16 = sext i16 %15 to i64
%17 = shl i64 %16, 8
%18 = load i16*, i16** %2
%19 = getelementptr inbounds i16, i16* %18, i64 1
%20 = load i16, i16* %19
%21 = sext i16 %20 to i64
%22 = and i64 %21, 65280
%23 = ashr i64 %22, 8
%24 = or i64 %17, %23
store i64 %24, i64* %3
%25 = load i64, i64* %3
%26 = sitofp i64 %25 to double
%27 = fdiv double %26, 0x4160000000000000
store double %27, double* %4
%28 = load i8, i8* %6
%29 = sitofp i8 %28 to double
%30 = call double @pow(double 2.000000e+00, double %29)
store double %30, double* %5
%31 = load double, double* %4
%32 = load double, double* %5
%33 = fmul double %31, %32
ret double %33
}

LLVM IR (-O2):
define double @from_1750flt(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 1
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = load i16, i16* %0
%6 = sext i16 %5 to i64
%7 = shl nsw i64 %6, 8
%8 = lshr i16 %3, 8
%9 = zext i16 %8 to i64
%10 = or i64 %7, %9
%11 = sitofp i64 %10 to double
%12 = fmul double %11, 0x3E80000000000000
%13 = shl i32 %4, 24
%14 = ashr exact i32 %13, 24
%15 = tail call double @ldexp(double 1.000000e+00, i32 %14)
%16 = fmul double %15, %12
ret double %16
}