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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, float *, int);
void GST_WRITE_FLOAT_LE(uint8_t *data, float num) {
  float f = num;
  uint32_t i = 0;
  memcpy(&i, &f, sizeof(float));
  do {
    ((uint8_t *)(data))[0] = (((uint32_t)(i)) >> 0) & 0xff;
    ((uint8_t *)(data))[1] = (((uint32_t)(i)) >> 8) & 0xff;
    ((uint8_t *)(data))[2] = (((uint32_t)(i)) >> 16) & 0xff;
    ((uint8_t *)(data))[3] = (((uint32_t)(i)) >> 24) & 0xff;
  } while (0);
}


x86 assembly (clang, -O0):
<GST_WRITE_FLOAT_LE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x14(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GST_WRITE_FLOAT_LE>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%eax
movzbl %al,%ecx
mov    %ecx,(%rbx)
movzbl %ah,%ecx
mov    %ecx,0x4(%rbx)
mov    %eax,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rbx)
shr    $0x18,%eax
mov    %eax,0xc(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @GST_WRITE_FLOAT_LE(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store i32* %0, i32** %3
store float %1, float* %4
%7 = load float, float* %4
store float %7, float* %5
store i32 0, i32* %6
%8 = call i32 @memcpy(i32* %6, float* %5, i32 4)
br label %9
9: ; preds = %2
%10 = load i32, i32* %6
%11 = ashr i32 %10, 0
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
%15 = load i32, i32* %6
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i32, i32* %6
%21 = ashr i32 %20, 16
%22 = and i32 %21, 255
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 2
store i32 %22, i32* %24
%25 = load i32, i32* %6
%26 = ashr i32 %25, 24
%27 = and i32 %26, 255
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 3
store i32 %27, i32* %29
br label %30
30: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @GST_WRITE_FLOAT_LE(i32* nocapture writeonly %0, float %1) {
%3 = alloca float
%4 = alloca i32
%5 = bitcast float* %3 to i8*
store float %1, float* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = call i32 @memcpy(i32* %4, float* %3, i32 4)
%8 = load i32, i32* %4
%9 = and i32 %8, 255
store i32 %9, i32* %0
%10 = lshr i32 %8, 8
%11 = and i32 %10, 255
%12 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %11, i32* %12
%13 = lshr i32 %8, 16
%14 = and i32 %13, 255
%15 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %14, i32* %15
%16 = lshr i32 %8, 24
%17 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %16, i32* %17
ret void
}