#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;

/* Variables and functions */
double mcnet_read_double(uint8_t *in) {
  double out;
  uint8_t *t = (uint8_t *)&out;
  t[0] = in[7];
  t[1] = in[6];
  t[2] = in[5];
  t[3] = in[4];
  t[4] = in[3];
  t[5] = in[2];
  t[6] = in[1];
  t[7] = in[0];
  return out;
}


x86 assembly (clang, -O0):
<mcnet_read_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x1c(%rax)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_read_double>:
mov    0x18(%rdi),%eax
mov    0x1c(%rdi),%ecx
shl    $0x20,%rax
or     %rcx,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
define double @mcnet_read_double(i32* %0) {
%2 = alloca i32*
%3 = alloca double
%4 = alloca i32*
store i32* %0, i32** %2
%5 = bitcast double* %3 to i32*
store i32* %5, i32** %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 7
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 6
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 5
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %18, i32* %20
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 4
%23 = load i32, i32* %22
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 3
store i32 %23, i32* %25
%26 = load i32*, i32** %2
%27 = getelementptr inbounds i32, i32* %26, i64 3
%28 = load i32, i32* %27
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 4
store i32 %28, i32* %30
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 2
%33 = load i32, i32* %32
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 5
store i32 %33, i32* %35
%36 = load i32*, i32** %2
%37 = getelementptr inbounds i32, i32* %36, i64 1
%38 = load i32, i32* %37
%39 = load i32*, i32** %4
%40 = getelementptr inbounds i32, i32* %39, i64 6
store i32 %38, i32* %40
%41 = load i32*, i32** %2
%42 = getelementptr inbounds i32, i32* %41, i64 0
%43 = load i32, i32* %42
%44 = load i32*, i32** %4
%45 = getelementptr inbounds i32, i32* %44, i64 7
store i32 %43, i32* %45
%46 = load double, double* %3
ret double %46
}

LLVM IR (-O2):
define double @mcnet_read_double(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 6
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = shl nuw i64 %7, 32
%9 = or i64 %8, %4
%10 = bitcast i64 %9 to double
ret double %10
}