#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*/ uint64_t;

/* Variables and functions */
double swap(uint64_t a) {
  double d;
  unsigned char *src = (unsigned char *)&a;
  unsigned char *dst = (unsigned char *)&d;
  dst[0] = src[7];
  dst[1] = src[6];
  dst[2] = src[5];
  dst[3] = src[4];
  dst[4] = src[3];
  dst[5] = src[2];
  dst[6] = src[1];
  dst[7] = src[0];
  return d;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x6(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x7(%rax)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
ret

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

LLVM IR (-O2):
define double @swap(i32 %0) {
ret double poison
}