#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, ...);
int main(void) {
  double d = 3.14;
  printf("The double %.2f(%a) is: ", d, d);
  for (size_t n = 0; n < sizeof d; ++n)
    printf("0x%02x ", ((unsigned char *)&d)[n]);
  struct S {
    int x;
  } s;
  (void)s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x40091eb851eb851f,%rax
1e 09 40
mov    %rax,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
movsd  -0x10(%rbp),%xmm0
lea    0xec2(%rip),%rdi
movzbl %al,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    1183 <main+0x73>
mov    -0x18(%rbp),%rax
lea    0xeb3(%rip),%rdi
movzbl -0x10(%rbp,%rax,1),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <main+0x40>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1f,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x85,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xeb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xb8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.S = type { i32 }
@.str = [25 x i8] c"The double %.2f(%a) is: \00"
@.str.1 = [8 x i8] c"0x%02x \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i64
%4 = alloca %struct.S
store i32 0, i32* %1
store double 3.140000e+00, double* %2
%5 = load double, double* %2
%6 = fptoui double %5 to i8
%7 = load double, double* %2
%8 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %6, double %7)
store i64 0, i64* %3
br label %9
9: ; preds = %18, %0
%10 = load i64, i64* %3
%11 = icmp ult i64 %10, 8
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = bitcast double* %2 to i8*
%14 = load i64, i64* %3
%15 = getelementptr inbounds i8, i8* %13, i64 %14
%16 = load i8, i8* %15
%17 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %16)
br label %18
18: ; preds = %12
%19 = load i64, i64* %3
%20 = add i64 %19, 1
store i64 %20, i64* %3
br label %9
21: ; preds = %9
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [25 x i8] c"The double %.2f(%a) is: \00"
@.str.1 = [8 x i8] c"0x%02x \00"
define i32 @main() {
%1 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext 3, double 3.140000e+00)
%2 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 31)
%3 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -123)
%4 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -21)
%5 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 81)
%6 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -72)
%7 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 30)
%8 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 9)
%9 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 zeroext 64)
ret i32 0
}