#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_1750eflt(short *input) {
  long int_mant_hi, int_mant_lo;
  double flt_mant, flt_exp;
  signed char int_exp;
  int_exp = (signed char)(input[1] & 0xFF);
  int_mant_hi = (((long)input[0] << 16) | ((long)input[1] & 0xFF00L)) >> 8;
  int_mant_lo = ((long)input[2] & 0xFFFFL);
  flt_mant =
      (double)int_mant_hi / 8388608.0 + (double)int_mant_lo / 549755813888.0;
  flt_exp = pow(2.0, (double)int_exp);
  return flt_mant * flt_exp;
}


x86 assembly (clang, -O0):
<from_1750eflt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x29(%rbp)
mov    -0x8(%rbp),%rcx
movswq (%rcx),%rax
shl    $0x10,%rax
movzwl 0x2(%rcx),%ecx
or     %rcx,%rax
sar    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x4(%rax),%eax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0xea3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsbl -0x29(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xe76(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_1750eflt>:
push   %rax
movzwl 0x2(%rdi),%eax
movswq (%rdi),%rcx
shl    $0x10,%rcx
movzwl %ax,%edx
or     %rcx,%rdx
shr    $0x8,%rdx
movzwl 0x4(%rdi),%ecx
cvtsi2sd %edx,%xmm0
mulsd  0xec9(%rip),%xmm0
cvtsi2sd %ecx,%xmm1
mulsd  0xec5(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsbl %al,%edi
movsd  0xeb9(%rip),%xmm0
call   1030 <ldexp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @from_1750eflt(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, 16
%8 = zext i16 %3 to i64
%9 = or i64 %7, %8
%10 = ashr i64 %9, 8
%11 = getelementptr inbounds i16, i16* %0, i64 2
%12 = load i16, i16* %11
%13 = sitofp i64 %10 to double
%14 = fmul double %13, 0x3E80000000000000
%15 = uitofp i16 %12 to double
%16 = fmul double %15, 0x3D80000000000000
%17 = fadd double %16, %14
%18 = shl i32 %4, 24
%19 = ashr exact i32 %18, 24
%20 = tail call double @ldexp(double 1.000000e+00, i32 %19)
%21 = fmul double %20, %17
ret double %21
}