#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 */
int /*<<< orphan*/ memcpy(unsigned char *, float *, int);
void f2c(float f, unsigned char temp_1[]) {
  int i, j;
  float fv;
  unsigned char a1[sizeof fv];
  fv = f;
  memcpy(a1, &fv, sizeof fv);
  for (i = 0, j = 3; i < sizeof fv; i++, j--) {
    temp_1[j] = a1[i];
  }
}


x86 assembly (clang, -O0):
<f2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jae    1183 <f2c+0x73>
movslq -0x14(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    114b <f2c+0x3b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2c>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%al
mov    %al,0x3(%rbx)
mov    0x9(%rsp),%al
mov    %al,0x2(%rbx)
mov    0xa(%rsp),%al
mov    %al,0x1(%rbx)
mov    0xb(%rsp),%al
mov    %al,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @f2c(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca [4 x i8]
store float %0, float* %3
store i8* %1, i8** %4
%9 = load float, float* %3
store float %9, float* %7
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%11 = call i32 @memcpy(i8* %10, float* %7, i32 4)
store i32 0, i32* %5
store i32 3, i32* %6
br label %12
12: ; preds = %25, %2
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 4
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
br label %25
25: ; preds = %16
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
%28 = load i32, i32* %6
%29 = add nsw i32 %28, -1
store i32 %29, i32* %6
br label %12
30: ; preds = %12
ret void
}

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