#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*/ f2;
typedef int /*<<< orphan*/ f1;
typedef int /*<<< orphan*/ d2;
typedef int /*<<< orphan*/ d1;

/* Variables and functions */
int /*<<< orphan*/ disp_hex(char *, ...);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Examine integer and floating point variables.\n");
  double d1 = 123.456;
  disp_hex("d1", &d1, sizeof(d1));
  double d2 = -14.57;
  disp_hex("d2", &d2, sizeof(d2));
  float f1 = 123.456;
  disp_hex("f1", &f1, sizeof(f1));
  float f2 = -14.57;
  disp_hex("f2", &f2, sizeof(f2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xef1(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <disp_hex@plt>
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xed0(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <disp_hex@plt>
movss  0xe72(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xeaf(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <disp_hex@plt>
movss  0xe4a(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
lea    0xe8e(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <disp_hex@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee1(%rip),%rdi
call   1040 <puts@plt>
movabs $0x405edd2f1a9fbe77,%rax
dd 5e 40
mov    %rax,0x10(%rsp)
lea    0xeba(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <disp_hex@plt>
movabs $0xc02d23d70a3d70a4,%rax
23 2d c0
mov    %rax,0x8(%rsp)
lea    0xe96(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <disp_hex@plt>
movl   $0x42f6e979,0x4(%rsp)
42
lea    0xe79(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <disp_hex@plt>
movl   $0xc1691eb8,(%rsp)
lea    0xe5d(%rip),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <disp_hex@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Examine integer and floating point variables.\0A\00"
@.str.1 = [3 x i8] c"d1\00"
@.str.2 = [3 x i8] c"d2\00"
@.str.3 = [3 x i8] c"f1\00"
@.str.4 = [3 x i8] c"f2\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca float
%9 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store double 1.234560e+02, double* %6
%11 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %6, i64 8)
store double -1.457000e+01, double* %7
%12 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double* %7, i64 8)
store float 0x405EDD2F20000000, float* %8
%13 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %8, i64 4)
store float 0xC02D23D700000000, float* %9
%14 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %9, i64 4)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"d1\00"
@.str.2 = [3 x i8] c"d2\00"
@.str.3 = [3 x i8] c"f1\00"
@.str.4 = [3 x i8] c"f2\00"
@str = [46 x i8] c"Examine integer and floating point variables.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca float
%6 = alloca float
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%8 = bitcast double* %3 to i8*
store double 1.234560e+02, double* %3
%9 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double* %3, i64 8)
%10 = bitcast double* %4 to i8*
store double -1.457000e+01, double* %4
%11 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double* %4, i64 8)
%12 = bitcast float* %5 to i8*
store float 0x405EDD2F20000000, float* %5
%13 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5, i64 4)
%14 = bitcast float* %6 to i8*
store float 0xC02D23D700000000, float* %6
%15 = call i32 (i8*, ...) @disp_hex(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %6, i64 4)
ret i32 0
}