float vax2flt_(le_flt)
unsigned short *le_flt;
{
  union {
    float ff;
    unsigned short fs[2];
    struct {
      unsigned int sign : 1;
      unsigned int exponent : 8;
      unsigned int mantissa : 23;
    } v;
  } vaxbuf;
  union {
    float ff;
    unsigned short fs[2];
    struct {
      unsigned int sign : 1;
      unsigned int exponent : 8;
      unsigned int mantissa : 23;
    } v;
  } ieeebuf;
  int i;
  for (i = 0; i < 2; i++)
    vaxbuf.fs[i] = *(le_flt++);
  ieeebuf.fs[0] = shortswap_(vaxbuf.fs[0]);
  ieeebuf.fs[1] = shortswap_(vaxbuf.fs[1]);
  if (ieeebuf.v.exponent < 3)
    ieeebuf.ff = 0.0;
  else
    ieeebuf.ff = ieeebuf.ff / 4.0;
  return (ieeebuf.ff);
}


x86 assembly (clang, -O0):
<vax2flt_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    1156 <vax2flt_+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cx
movslq -0x1c(%rbp),%rax
mov    %cx,-0x10(%rbp,%rax,2)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1123 <vax2flt_+0x13>
movzwl -0x10(%rbp),%edi
mov    $0x0,%al
call   1030 <shortswap_@plt>
mov    %ax,-0x18(%rbp)
movzwl -0xe(%rbp),%edi
mov    $0x0,%al
call   1030 <shortswap_@plt>
mov    %ax,-0x16(%rbp)
mov    -0x18(%rbp),%eax
shr    $0x1,%eax
and    $0xff,%eax
cmp    $0x3,%eax
jge    1195 <vax2flt_+0x85>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11b3 <vax2flt_+0xa3>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5a(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vax2flt_>:
push   %rbp
push   %rbx
push   %rax
movzwl (%rdi),%eax
movzwl 0x2(%rdi),%ebp
mov    %eax,%edi
xor    %eax,%eax
call   1030 <shortswap_@plt>
mov    %eax,%ebx
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <shortswap_@plt>
mov    %ebx,%ecx
and    $0x1fe,%ecx
xorps  %xmm0,%xmm0
cmp    $0x6,%ecx
jb     1152 <vax2flt_+0x42>
movzwl %bx,%ecx
shl    $0x10,%eax
or     %ecx,%eax
movd   %eax,%xmm0
mulss  0xeae(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { float }
%union.anon.0 = type { float }
%struct.anon.1 = type { i32 }
define float @vax2flt_(i16* %0) {
%2 = alloca i16*
%3 = alloca %union.anon
%4 = alloca %union.anon.0
%5 = alloca i32
store i16* %0, i16** %2
store i32 0, i32* %5
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i16*, i16** %2
%11 = getelementptr inbounds i16, i16* %10, i32 1
store i16* %11, i16** %2
%12 = load i16, i16* %10
%13 = bitcast %union.anon* %3 to [2 x i16]*
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i16], [2 x i16]* %13, i64 0, i64 %15
store i16 %12, i16* %16
br label %17
17: ; preds = %9
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = bitcast %union.anon* %3 to [2 x i16]*
%22 = getelementptr inbounds [2 x i16], [2 x i16]* %21, i64 0, i64 0
%23 = load i16, i16* %22
%24 = zext i16 %23 to i32
%25 = call i32 (i32, ...) bitcast (i32 (...)* @shortswap_ to i32 (i32, ...)*)(i32 %24)
%26 = trunc i32 %25 to i16
%27 = bitcast %union.anon.0* %4 to [2 x i16]*
%28 = getelementptr inbounds [2 x i16], [2 x i16]* %27, i64 0, i64 0
store i16 %26, i16* %28
%29 = bitcast %union.anon* %3 to [2 x i16]*
%30 = getelementptr inbounds [2 x i16], [2 x i16]* %29, i64 0, i64 1
%31 = load i16, i16* %30
%32 = zext i16 %31 to i32
%33 = call i32 (i32, ...) bitcast (i32 (...)* @shortswap_ to i32 (i32, ...)*)(i32 %32)
%34 = trunc i32 %33 to i16
%35 = bitcast %union.anon.0* %4 to [2 x i16]*
%36 = getelementptr inbounds [2 x i16], [2 x i16]* %35, i64 0, i64 1
store i16 %34, i16* %36
%37 = bitcast %union.anon.0* %4 to %struct.anon.1*
%38 = bitcast %struct.anon.1* %37 to i32*
%39 = load i32, i32* %38
%40 = lshr i32 %39, 1
%41 = and i32 %40, 255
%42 = icmp slt i32 %41, 3
br i1 %42, label %43, label %45
43: ; preds = %20
%44 = bitcast %union.anon.0* %4 to float*
store float 0.000000e+00, float* %44
br label %52
45: ; preds = %20
%46 = bitcast %union.anon.0* %4 to float*
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = fdiv double %48, 4.000000e+00
%50 = fptrunc double %49 to float
%51 = bitcast %union.anon.0* %4 to float*
store float %50, float* %51
br label %52
52: ; preds = %45, %43
%53 = bitcast %union.anon.0* %4 to float*
%54 = load float, float* %53
ret float %54
}

LLVM IR (-O2):
define float @vax2flt_(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = zext i16 %2 to i32
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @shortswap_ to i32 (i32, ...)*)(i32 %5)
%7 = zext i16 %4 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @shortswap_ to i32 (i32, ...)*)(i32 %7)
%9 = and i32 %6, 510
%10 = icmp ult i32 %9, 6
br i1 %10, label %17, label %11
11: ; preds = %1
%12 = and i32 %6, 65535
%13 = shl i32 %8, 16
%14 = or i32 %13, %12
%15 = bitcast i32 %14 to float
%16 = fmul float %15, 2.500000e-01
br label %17
17: ; preds = %1, %11
%18 = phi float [ %16, %11 ], [ 0.000000e+00, %1 ]
ret float %18
}