#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*/ printf(char *, unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char);
void dump(double d) {
  union {
    double d;
    unsigned char byte[8];
  } u;
  u.d = d;
  printf("%02X %02X %02X %02X %02X %02X %02X %02X\n", u.byte[0], u.byte[1],
         u.byte[2], u.byte[3], u.byte[4], u.byte[5], u.byte[6], u.byte[7]);
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%sil
mov    -0xf(%rbp),%dl
mov    -0xe(%rbp),%cl
mov    -0xd(%rbp),%r8b
mov    -0xc(%rbp),%r9b
mov    -0xb(%rbp),%r10b
mov    -0xa(%rbp),%al
lea    0xeb9(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %r10b,%r10d
mov    %r10d,(%rsp)
movzbl %al,%eax
mov    %eax,0x8(%rsp)
movzbl -0x9(%rbp),%eax
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %rbx
movq   %xmm0,%rcx
mov    %rcx,%rdi
shr    $0x20,%rdi
mov    %rcx,%rdx
shr    $0x28,%rdx
mov    %rcx,%rsi
shr    $0x30,%rsi
mov    %rcx,%rax
shr    $0x38,%rax
sub    $0x8,%rsp
movzbl %sil,%r10d
movzbl %dl,%r11d
mov    %ecx,%ebx
shr    $0x18,%ebx
movzbl %cl,%esi
movzbl %ch,%edx
shr    $0x10,%ecx
movzbl %cl,%ecx
movzbl %dil,%r9d
lea    0xea6(%rip),%rdi
mov    %ebx,%r8d
push   %rax
push   %r10
push   %r11
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { double }
@.str = [41 x i8] c"%02X %02X %02X %02X %02X %02X %02X %02X\0A\00"
define void @dump(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to [8 x i8]*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%8 = load i8, i8* %7
%9 = bitcast %union.anon* %3 to [8 x i8]*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 1
%11 = load i8, i8* %10
%12 = bitcast %union.anon* %3 to [8 x i8]*
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %12, i64 0, i64 2
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %3 to [8 x i8]*
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %15, i64 0, i64 3
%17 = load i8, i8* %16
%18 = bitcast %union.anon* %3 to [8 x i8]*
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 4
%20 = load i8, i8* %19
%21 = bitcast %union.anon* %3 to [8 x i8]*
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %21, i64 0, i64 5
%23 = load i8, i8* %22
%24 = bitcast %union.anon* %3 to [8 x i8]*
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 6
%26 = load i8, i8* %25
%27 = bitcast %union.anon* %3 to [8 x i8]*
%28 = getelementptr inbounds [8 x i8], [8 x i8]* %27, i64 0, i64 7
%29 = load i8, i8* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i8 zeroext %11, i8 zeroext %14, i8 zeroext %17, i8 zeroext %20, i8 zeroext %23, i8 zeroext %26, i8 zeroext %29)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"%02X %02X %02X %02X %02X %02X %02X %02X\0A\00"
define void @dump(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i8
%4 = lshr i64 %2, 8
%5 = trunc i64 %4 to i8
%6 = lshr i64 %2, 16
%7 = trunc i64 %6 to i8
%8 = lshr i64 %2, 24
%9 = trunc i64 %8 to i8
%10 = lshr i64 %2, 32
%11 = trunc i64 %10 to i8
%12 = lshr i64 %2, 40
%13 = trunc i64 %12 to i8
%14 = lshr i64 %2, 48
%15 = trunc i64 %14 to i8
%16 = lshr i64 %2, 56
%17 = trunc i64 %16 to i8
%18 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %5, i8 zeroext %7, i8 zeroext %9, i8 zeroext %11, i8 zeroext %13, i8 zeroext %15, i8 zeroext %17)
ret void
}