#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 *, ...);
void main() {
  char *pc;
  float *px;
  float x;
  x = 6.5;
  px = &x;
  pc = (char *)px;
  printf("x = %f (%p)\n", x, &x);
  printf("px = %f (%p)\n", *px, px);
  printf("pc = %s (%p)\n", pc, &pc);
  printf("sizeof(char)=%d\n", sizeof(char));
  printf("sizeof(float)=%d\n", sizeof(float));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x40d00000,0x4(%rsp)
40
lea    0x4(%rsp),%rbx
mov    %rbx,0x8(%rsp)
lea    0xedb(%rip),%rdi
movsd  0xeca(%rip),%xmm0
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"x = %f (%p)\0A\00"
@.str.1 = [14 x i8] c"px = %f (%p)\0A\00"
@.str.2 = [14 x i8] c"pc = %s (%p)\0A\00"
@.str.3 = [17 x i8] c"sizeof(char)=%d\0A\00"
@.str.4 = [18 x i8] c"sizeof(float)=%d\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca float*
%3 = alloca float
store float 6.500000e+00, float* %3
store float* %3, float** %2
%4 = load float*, float** %2
%5 = bitcast float* %4 to i8*
store i8* %5, i8** %1
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %7, float* %3)
%9 = load float*, float** %2
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = load float*, float** %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %11, float* %12)
%14 = load i8*, i8** %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %14, i8** %1)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i64 1)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i64 4)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"x = %f (%p)\0A\00"
@.str.1 = [14 x i8] c"px = %f (%p)\0A\00"
@.str.2 = [14 x i8] c"pc = %s (%p)\0A\00"
@.str.3 = [17 x i8] c"sizeof(char)=%d\0A\00"
@.str.4 = [18 x i8] c"sizeof(float)=%d\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca float
%3 = bitcast i8** %1 to i8*
%4 = bitcast float* %2 to i8*
store float 6.500000e+00, float* %2
%5 = bitcast i8** %1 to float**
store float* %2, float** %5
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 6.500000e+00, float* %2)
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %8, float* %2)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float* %2, i8** %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i64 1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i64 4)
ret void
}