#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
float stl_get_little_float(FILE *fp) {
  union {
    int int_value;
    float float_value;
  } value;
  value.int_value = fgetc(fp) & 0xFF;
  value.int_value |= (fgetc(fp) & 0xFF) << 0x08;
  value.int_value |= (fgetc(fp) & 0xFF) << 0x10;
  value.int_value |= (fgetc(fp) & 0xFF) << 0x18;
  return (value.float_value);
}


x86 assembly (clang, -O0):
<stl_get_little_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
and    $0xff,%eax
shl    $0x8,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
and    $0xff,%eax
shl    $0x10,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
and    $0xff,%eax
shl    $0x18,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stl_get_little_float>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
movzbl %al,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
movzwl %ax,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
movzbl %al,%ebx
shl    $0x10,%ebx
or     %ebp,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
movd   %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @stl_get_little_float(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = and i32 %5, 255
%7 = bitcast %union.anon* %3 to i32*
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = call i32 @fgetc(i32* %8)
%10 = and i32 %9, 255
%11 = shl i32 %10, 8
%12 = bitcast %union.anon* %3 to i32*
%13 = load i32, i32* %12
%14 = or i32 %13, %11
store i32 %14, i32* %12
%15 = load i32*, i32** %2
%16 = call i32 @fgetc(i32* %15)
%17 = and i32 %16, 255
%18 = shl i32 %17, 16
%19 = bitcast %union.anon* %3 to i32*
%20 = load i32, i32* %19
%21 = or i32 %20, %18
store i32 %21, i32* %19
%22 = load i32*, i32** %2
%23 = call i32 @fgetc(i32* %22)
%24 = and i32 %23, 255
%25 = shl i32 %24, 24
%26 = bitcast %union.anon* %3 to i32*
%27 = load i32, i32* %26
%28 = or i32 %27, %25
store i32 %28, i32* %26
%29 = bitcast %union.anon* %3 to float*
%30 = load float, float* %29
ret float %30
}

LLVM IR (-O2):
define float @stl_get_little_float(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = and i32 %2, 255
%4 = tail call i32 @fgetc(i32* %0)
%5 = shl i32 %4, 8
%6 = and i32 %5, 65280
%7 = or i32 %6, %3
%8 = tail call i32 @fgetc(i32* %0)
%9 = shl i32 %8, 16
%10 = and i32 %9, 16711680
%11 = or i32 %7, %10
%12 = tail call i32 @fgetc(i32* %0)
%13 = shl i32 %12, 24
%14 = or i32 %11, %13
%15 = bitcast i32 %14 to float
ret float %15
}