#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 *, double, unsigned int, unsigned int,
                          unsigned int, unsigned int, unsigned int,
                          unsigned int, unsigned int, unsigned int);
int main(int argc, char *argv[]) {
  volatile union {
    double d;
    unsigned char x[8];
  } u;
  u.d = 0.0;
  do {
    printf("%lf -> %02x %02x %02x %02x %02x %02x %02x %02x\n", u.d,
           (unsigned int)u.x[0], (unsigned int)u.x[1], (unsigned int)u.x[2],
           (unsigned int)u.x[3], (unsigned int)u.x[4], (unsigned int)u.x[5],
           (unsigned int)u.x[6], (unsigned int)u.x[7]);
  } while (0);
  u.d = -u.d;
  do {
    printf("%lf -> %02x %02x %02x %02x %02x %02x %02x %02x\n", u.d,
           (unsigned int)u.x[0], (unsigned int)u.x[1], (unsigned int)u.x[2],
           (unsigned int)u.x[3], (unsigned int)u.x[4], (unsigned int)u.x[5],
           (unsigned int)u.x[6], (unsigned int)u.x[7]);
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x18(%rbp),%al
movzbl %al,%esi
mov    -0x17(%rbp),%al
movzbl %al,%edx
mov    -0x16(%rbp),%al
movzbl %al,%ecx
mov    -0x15(%rbp),%al
movzbl %al,%r8d
mov    -0x14(%rbp),%al
movzbl %al,%r9d
mov    -0x13(%rbp),%al
movzbl %al,%r11d
mov    -0x12(%rbp),%al
movzbl %al,%r10d
mov    -0x11(%rbp),%al
movzbl %al,%eax
lea    0xe99(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x18(%rbp),%al
movzbl %al,%esi
mov    -0x17(%rbp),%al
movzbl %al,%edx
mov    -0x16(%rbp),%al
movzbl %al,%ecx
mov    -0x15(%rbp),%al
movzbl %al,%r8d
mov    -0x14(%rbp),%al
movzbl %al,%r9d
mov    -0x13(%rbp),%al
movzbl %al,%r11d
mov    -0x12(%rbp),%al
movzbl %al,%r10d
mov    -0x11(%rbp),%al
movzbl %al,%eax
lea    0xe26(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x0,(%rsp)
movsd  (%rsp),%xmm0
movzbl (%rsp),%esi
movzbl 0x1(%rsp),%edx
movzbl 0x2(%rsp),%ecx
movzbl 0x3(%rsp),%r8d
movzbl 0x4(%rsp),%r9d
movzbl 0x5(%rsp),%r10d
movzbl 0x6(%rsp),%ebx
movzbl 0x7(%rsp),%eax
sub    $0x8,%rsp
lea    0xeba(%rip),%r14
mov    %r14,%rdi
push   %rax
push   %rbx
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
movsd  (%rsp),%xmm0
xorps  0xe8e(%rip),%xmm0
movlps %xmm0,(%rsp)
movsd  (%rsp),%xmm0
movzbl (%rsp),%esi
movzbl 0x1(%rsp),%edx
movzbl 0x2(%rsp),%ecx
movzbl 0x3(%rsp),%r8d
movzbl 0x4(%rsp),%r9d
movzbl 0x5(%rsp),%r10d
movzbl 0x6(%rsp),%ebx
movzbl 0x7(%rsp),%eax
sub    $0x8,%rsp
mov    %r14,%rdi
push   %rax
push   %rbx
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.anon = type { double }
@.str = [48 x i8] c"%lf -> %02x %02x %02x %02x %02x %02x %02x %02x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %union.anon
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast %union.anon* %5 to double*
store volatile double 0.000000e+00, double* %6
br label %7
7: ; preds = %2
%8 = bitcast %union.anon* %5 to double*
%9 = load volatile double, double* %8
%10 = bitcast %union.anon* %5 to [8 x i8]*
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 0
%12 = load volatile i8, i8* %11
%13 = zext i8 %12 to i32
%14 = bitcast %union.anon* %5 to [8 x i8]*
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %14, i64 0, i64 1
%16 = load volatile i8, i8* %15
%17 = zext i8 %16 to i32
%18 = bitcast %union.anon* %5 to [8 x i8]*
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %18, i64 0, i64 2
%20 = load volatile i8, i8* %19
%21 = zext i8 %20 to i32
%22 = bitcast %union.anon* %5 to [8 x i8]*
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %22, i64 0, i64 3
%24 = load volatile i8, i8* %23
%25 = zext i8 %24 to i32
%26 = bitcast %union.anon* %5 to [8 x i8]*
%27 = getelementptr inbounds [8 x i8], [8 x i8]* %26, i64 0, i64 4
%28 = load volatile i8, i8* %27
%29 = zext i8 %28 to i32
%30 = bitcast %union.anon* %5 to [8 x i8]*
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %30, i64 0, i64 5
%32 = load volatile i8, i8* %31
%33 = zext i8 %32 to i32
%34 = bitcast %union.anon* %5 to [8 x i8]*
%35 = getelementptr inbounds [8 x i8], [8 x i8]* %34, i64 0, i64 6
%36 = load volatile i8, i8* %35
%37 = zext i8 %36 to i32
%38 = bitcast %union.anon* %5 to [8 x i8]*
%39 = getelementptr inbounds [8 x i8], [8 x i8]* %38, i64 0, i64 7
%40 = load volatile i8, i8* %39
%41 = zext i8 %40 to i32
%42 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %9, i32 %13, i32 %17, i32 %21, i32 %25, i32 %29, i32 %33, i32 %37, i32 %41)
br label %43
43: ; preds = %7
%44 = bitcast %union.anon* %5 to double*
%45 = load volatile double, double* %44
%46 = fneg double %45
%47 = bitcast %union.anon* %5 to double*
store volatile double %46, double* %47
br label %48
48: ; preds = %43
%49 = bitcast %union.anon* %5 to double*
%50 = load volatile double, double* %49
%51 = bitcast %union.anon* %5 to [8 x i8]*
%52 = getelementptr inbounds [8 x i8], [8 x i8]* %51, i64 0, i64 0
%53 = load volatile i8, i8* %52
%54 = zext i8 %53 to i32
%55 = bitcast %union.anon* %5 to [8 x i8]*
%56 = getelementptr inbounds [8 x i8], [8 x i8]* %55, i64 0, i64 1
%57 = load volatile i8, i8* %56
%58 = zext i8 %57 to i32
%59 = bitcast %union.anon* %5 to [8 x i8]*
%60 = getelementptr inbounds [8 x i8], [8 x i8]* %59, i64 0, i64 2
%61 = load volatile i8, i8* %60
%62 = zext i8 %61 to i32
%63 = bitcast %union.anon* %5 to [8 x i8]*
%64 = getelementptr inbounds [8 x i8], [8 x i8]* %63, i64 0, i64 3
%65 = load volatile i8, i8* %64
%66 = zext i8 %65 to i32
%67 = bitcast %union.anon* %5 to [8 x i8]*
%68 = getelementptr inbounds [8 x i8], [8 x i8]* %67, i64 0, i64 4
%69 = load volatile i8, i8* %68
%70 = zext i8 %69 to i32
%71 = bitcast %union.anon* %5 to [8 x i8]*
%72 = getelementptr inbounds [8 x i8], [8 x i8]* %71, i64 0, i64 5
%73 = load volatile i8, i8* %72
%74 = zext i8 %73 to i32
%75 = bitcast %union.anon* %5 to [8 x i8]*
%76 = getelementptr inbounds [8 x i8], [8 x i8]* %75, i64 0, i64 6
%77 = load volatile i8, i8* %76
%78 = zext i8 %77 to i32
%79 = bitcast %union.anon* %5 to [8 x i8]*
%80 = getelementptr inbounds [8 x i8], [8 x i8]* %79, i64 0, i64 7
%81 = load volatile i8, i8* %80
%82 = zext i8 %81 to i32
%83 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %50, i32 %54, i32 %58, i32 %62, i32 %66, i32 %70, i32 %74, i32 %78, i32 %82)
br label %84
84: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"%lf -> %02x %02x %02x %02x %02x %02x %02x %02x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store volatile double 0.000000e+00, double* %3
%5 = load volatile double, double* %3
%6 = load volatile i8, i8* %4
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load volatile i8, i8* %8
%10 = zext i8 %9 to i32
%11 = getelementptr inbounds i8, i8* %4, i64 2
%12 = load volatile i8, i8* %11
%13 = zext i8 %12 to i32
%14 = getelementptr inbounds i8, i8* %4, i64 3
%15 = load volatile i8, i8* %14
%16 = zext i8 %15 to i32
%17 = getelementptr inbounds i8, i8* %4, i64 4
%18 = load volatile i8, i8* %17
%19 = zext i8 %18 to i32
%20 = getelementptr inbounds i8, i8* %4, i64 5
%21 = load volatile i8, i8* %20
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds i8, i8* %4, i64 6
%24 = load volatile i8, i8* %23
%25 = zext i8 %24 to i32
%26 = getelementptr inbounds i8, i8* %4, i64 7
%27 = load volatile i8, i8* %26
%28 = zext i8 %27 to i32
%29 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %5, i32 %7, i32 %10, i32 %13, i32 %16, i32 %19, i32 %22, i32 %25, i32 %28)
%30 = load volatile double, double* %3
%31 = fneg double %30
store volatile double %31, double* %3
%32 = load volatile double, double* %3
%33 = load volatile i8, i8* %4
%34 = zext i8 %33 to i32
%35 = load volatile i8, i8* %8
%36 = zext i8 %35 to i32
%37 = load volatile i8, i8* %11
%38 = zext i8 %37 to i32
%39 = load volatile i8, i8* %14
%40 = zext i8 %39 to i32
%41 = load volatile i8, i8* %17
%42 = zext i8 %41 to i32
%43 = load volatile i8, i8* %20
%44 = zext i8 %43 to i32
%45 = load volatile i8, i8* %23
%46 = zext i8 %45 to i32
%47 = load volatile i8, i8* %26
%48 = zext i8 %47 to i32
%49 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %32, i32 %34, i32 %36, i32 %38, i32 %40, i32 %42, i32 %44, i32 %46, i32 %48)
ret i32 0
}