#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 *, ...);
int main() {
  float in1 = 5.223, in2 = 100.7;
  float *ptr1, *ptr2;
  ptr1 = &in1;
  ptr2 = &in2;
  printf("Addresses of variables:\n");
  printf("in1: %p\nin2: %p\nptr1: %p\nptr2: %p\n", &in1, &in2, &ptr1, &ptr2);
  printf("Contents of:\nptr1: %p\nptr2: %p\n", ptr1, ptr2);
  printf("Contents of address at:\nptr1: %f\nptr2: %f\n", *ptr1, *ptr2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xeba(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x40a722d1,0x14(%rsp)
40
movl   $0x42c96666,0x10(%rsp)
42
lea    0x14(%rsp),%r14
mov    %r14,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,(%rsp)
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rsi
mov    (%rsp),%rdx
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    (%rsp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe9a(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Addresses of variables:\0A\00"
@.str.1 = [35 x i8] c"in1: %p\0Ain2: %p\0Aptr1: %p\0Aptr2: %p\0A\00"
@.str.2 = [32 x i8] c"Contents of:\0Aptr1: %p\0Aptr2: %p\0A\00"
@.str.3 = [43 x i8] c"Contents of address at:\0Aptr1: %f\0Aptr2: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float*
%5 = alloca float*
store i32 0, i32* %1
store float 0x4014E45A20000000, float* %2
store float 0x40592CCCC0000000, float* %3
store float* %2, float** %4
store float* %3, float** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float** %4, float** %5)
%8 = load float*, float** %4
%9 = load float*, float** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), float* %8, float* %9)
%11 = load float*, float** %4
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = load float*, float** %5
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), double %13, double %16)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"in1: %p\0Ain2: %p\0Aptr1: %p\0Aptr2: %p\0A\00"
@.str.2 = [32 x i8] c"Contents of:\0Aptr1: %p\0Aptr2: %p\0A\00"
@.str.3 = [43 x i8] c"Contents of address at:\0Aptr1: %f\0Aptr2: %f\0A\00"
@str = [24 x i8] c"Addresses of variables:\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float*
%4 = alloca float*
%5 = bitcast float* %1 to i8*
store float 0x4014E45A20000000, float* %1
%6 = bitcast float* %2 to i8*
store float 0x40592CCCC0000000, float* %2
%7 = bitcast float** %3 to i8*
%8 = bitcast float** %4 to i8*
store float* %1, float** %3
store float* %2, float** %4
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float** %3, float** %4)
%11 = load float*, float** %3
%12 = load float*, float** %4
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), float* %11, float* %12)
%14 = load float*, float** %3
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = load float*, float** %4
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), double %16, double %19)
ret i32 0
}