#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(void) {
  int i_num = 15, *p_int;
  float *p_dbl, f_num = 45.88;
  p_int = &i_num;
  p_dbl = &f_num;
  printf("The address of variable i_num is %p\n", p_int);
  printf("The address of variable f_num is %p\n", p_dbl);
  *p_int = 28;
  printf("p_int points to value %d, i_num has value: %d\n", *p_int, i_num);
  *p_dbl = 12.5 + *p_int;
  printf("p_dbl points to %.2lf\n", *p_dbl);
  f_num = 5.8;
  printf("p_dbl points to %.2lf\n", *p_dbl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x1c,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xe70(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xe36(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xf,0xc(%rsp)
movl   $0x4237851f,0x8(%rsp)
42
lea    0xee4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x1c,0xc(%rsp)
lea    0xf00(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1c,%edx
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
addsd  0xe87(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xefb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x40b9999a,0x8(%rsp)
40
movsd  0xe60(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"The address of variable i_num is %p\0A\00"
@.str.1 = [37 x i8] c"The address of variable f_num is %p\0A\00"
@.str.2 = [47 x i8] c"p_int points to value %d, i_num has value: %d\0A\00"
@.str.3 = [23 x i8] c"p_dbl points to %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca float*
%5 = alloca float
store i32 0, i32* %1
store i32 15, i32* %2
store float 0x4046F0A3E0000000, float* %5
store i32* %2, i32** %3
store float* %5, float** %4
%6 = load i32*, i32** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load float*, float** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), float* %8)
%10 = load i32*, i32** %3
store i32 28, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to double
%18 = fadd double 1.250000e+01, %17
%19 = fptrunc double %18 to float
%20 = load float*, float** %4
store float %19, float* %20
%21 = load float*, float** %4
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %23)
store float 0x4017333340000000, float* %5
%25 = load float*, float** %4
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"The address of variable i_num is %p\0A\00"
@.str.1 = [37 x i8] c"The address of variable f_num is %p\0A\00"
@.str.2 = [47 x i8] c"p_int points to value %d, i_num has value: %d\0A\00"
@.str.3 = [23 x i8] c"p_dbl points to %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
store i32 15, i32* %1
%4 = bitcast float* %2 to i8*
store float 0x4046F0A3E0000000, float* %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), float* %2)
store i32 28, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 28, i32 28)
%8 = load i32, i32* %1
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.250000e+01
%11 = fptrunc double %10 to float
store float %11, float* %2
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %12)
store float 0x4017333340000000, float* %2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double 0x4017333340000000)
ret i32 0
}