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

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int *, int);
float GST_READ_FLOAT_BE(const uint8_t *data) {
  uint32_t i = 0;
  float f = 0;
  i = ((((uint32_t)(((const uint8_t *)(data))[0])) << 24) |
       (((uint32_t)(((const uint8_t *)(data))[1])) << 16) |
       (((uint32_t)(((const uint8_t *)(data))[2])) << 8) |
       (((uint32_t)(((const uint8_t *)(data))[3])) << 0));
  memcpy(&f, &i, sizeof(uint32_t));
  return f;
}


x86 assembly (clang, -O0):
<GST_READ_FLOAT_BE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GST_READ_FLOAT_BE>:
push   %rax
movl   $0x0,(%rsp)
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @GST_READ_FLOAT_BE(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca float
store i32* %0, i32** %2
store i32 0, i32* %3
store float 0.000000e+00, float* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 24
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 8
%18 = or i32 %13, %17
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = shl i32 %21, 0
%23 = or i32 %18, %22
store i32 %23, i32* %3
%24 = call i32 @memcpy(float* %4, i32* %3, i32 4)
%25 = load float, float* %4
ret float %25
}

LLVM IR (-O2):
define float @GST_READ_FLOAT_BE(i32* nocapture %0) {
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %2 to i8*
%5 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%6 = load i32, i32* %0
%7 = shl i32 %6, 24
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %10, %7
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = getelementptr inbounds i32, i32* %0, i64 3
%17 = load i32, i32* %16
%18 = or i32 %15, %17
store i32 %18, i32* %2
%19 = call i32 @memcpy(float* %3, i32* %2, i32 4)
%20 = load float, float* %3
ret float %20
}