#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 */
void mcnet_write_double(uint8_t *out, double in) {
  uint8_t *t = (uint8_t *)&in;
  out[0] = t[7];
  out[1] = t[6];
  out[2] = t[5];
  out[3] = t[4];
  out[4] = t[3];
  out[5] = t[2];
  out[6] = t[1];
  out[7] = t[0];
}


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

x86 assembly (clang, -O2):
<mcnet_write_double>:
movq   %xmm0,%rax
ror    $0x20,%rax
mov    %rax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @mcnet_write_double(i32* nocapture writeonly %0, double %1) {
%3 = bitcast double %1 to i64
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %5, i32* %6
%7 = trunc i64 %3 to i32
%8 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %7, i32* %8
ret void
}