#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*/ ConvertToFloat(unsigned char *, float *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int i;
  float val;
  unsigned char buf[4] = {0xff, 0xff, 0xe0, 0x3f};
  ConvertToFloat(buf, &val);
  fprintf(stdout, "buf=");
  for (i = 0; i < 8; i++)
    fprintf(stdout, "%.2x", buf[i]);
  fprintf(stdout, "\n");
  fprintf(stdout, "val=%g\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <ConvertToFloat@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11a2 <main+0x82>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
movslq -0x14(%rbp),%rax
movzbl -0x1c(%rbp,%rax,1),%edx
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116a <main+0x4a>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xe62(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3c(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x3fe0ffff,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <ConvertToFloat@plt>
mov    0x2ea1(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb8(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl (%rsp),%edx
lea    0xea9(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x1(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x2(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x3(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x4(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x5(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x6(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movzbl 0x7(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe2a(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe0a(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.buf = [4 x i8] c"\FF\FF\E0?"
@stdout = global i32 0
@.str = [5 x i8] c"buf=\00"
@.str.1 = [5 x i8] c"%.2x\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [8 x i8] c"val=%g\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [4 x i8]* %8 to i8*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%11 = call i32 @ConvertToFloat(i8* %10, float* %7)
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %14
14: ; preds = %25, %2
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 8
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load i32, i32* @stdout
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %14
28: ; preds = %14
%29 = load i32, i32* @stdout
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @stdout
%32 = load float, float* %7
%33 = fpext float %32 to double
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %33)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"buf=\00"
@.str.1 = [5 x i8] c"%.2x\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [8 x i8] c"val=%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca i32
%5 = bitcast i32* %4 to [4 x i8]*
%6 = bitcast float* %3 to i8*
%7 = bitcast i32* %4 to i8*
store i32 1071710207, i32* %4
%8 = call i32 @ConvertToFloat(i8* %7, float* %3)
%9 = load i32, i32* @stdout
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = bitcast i32* %4 to i8*
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @stdout
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stdout
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load i32, i32* @stdout
%27 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* @stdout
%32 = getelementptr inbounds i32, i32* %4, i64 1
%33 = bitcast i32* %32 to i8*
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = load i32, i32* @stdout
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 5
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = load i32, i32* @stdout
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 6
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = load i32, i32* @stdout
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 7
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%52 = load i32, i32* @stdout
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%54 = load i32, i32* @stdout
%55 = load float, float* %3
%56 = fpext float %55 to double
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %56)
ret i32 0
}