int main() {
  char ch = 'a';
  int i = 123;
  float f = 12.34;
  double d = 123.456789;
  char *cptr = &ch;
  int *iptr = &i;
  float *fptr = &f;
  double *dptr = &d;
  void *vptr = &i;
  printf("char\taddress: %u\tvalue: %c\n", cptr, *cptr);
  printf("int\taddress: %u\tvalue: %d\n", iptr, *iptr);
  printf("float\taddress: %u\tvalue: %f\n", fptr, *fptr);
  printf("double\taddress: %u\tvalue: %lf\n", dptr, *dptr);
  printf("void\taddress: %u\tvalue: %d\n", vptr, *((int *)vptr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movl   $0x7b,-0xc(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rax
movsbl (%rax),%edx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movb   $0x61,0xf(%rsp)
movl   $0x7b,0x10(%rsp)
movl   $0x414570a4,0x14(%rsp)
41
movabs $0x405edd3c07ee0b0b,%rax
dd 5e 40
mov    %rax,0x18(%rsp)
lea    0xed0(%rip),%rdi
lea    0xf(%rsp),%rsi
mov    $0x61,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x7b,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x14(%rsp),%rsi
movsd  0xe80(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x18(%rsp),%rsi
movsd  0xe6d(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"char\09address: %u\09value: %c\0A\00"
@.str.1 = [27 x i8] c"int\09address: %u\09value: %d\0A\00"
@.str.2 = [29 x i8] c"float\09address: %u\09value: %f\0A\00"
@.str.3 = [31 x i8] c"double\09address: %u\09value: %lf\0A\00"
@.str.4 = [28 x i8] c"void\09address: %u\09value: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca float
%5 = alloca double
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca float*
%9 = alloca double*
%10 = alloca i8*
store i32 0, i32* %1
store i8 97, i8* %2
store i32 123, i32* %3
store float 0x4028AE1480000000, float* %4
store double 0x405EDD3C07EE0B0B, double* %5
store i8* %2, i8** %6
store i32* %3, i32** %7
store float* %4, float** %8
store double* %5, double** %9
%11 = bitcast i32* %3 to i8*
store i8* %11, i8** %10
%12 = load i8*, i8** %6
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %15)
%17 = load i32*, i32** %7
%18 = load i32*, i32** %7
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* %17, i32 %19)
%21 = load float*, float** %8
%22 = load float*, float** %8
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), float* %21, double %24)
%26 = load double*, double** %9
%27 = load double*, double** %9
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), double* %26, double %28)
%30 = load i8*, i8** %10
%31 = load i8*, i8** %10
%32 = bitcast i8* %31 to i32*
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %30, i32 %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"char\09address: %u\09value: %c\0A\00"
@.str.1 = [27 x i8] c"int\09address: %u\09value: %d\0A\00"
@.str.2 = [29 x i8] c"float\09address: %u\09value: %f\0A\00"
@.str.3 = [31 x i8] c"double\09address: %u\09value: %lf\0A\00"
@.str.4 = [28 x i8] c"void\09address: %u\09value: %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = alloca double
store i8 97, i8* %1
%5 = bitcast i32* %2 to i8*
store i32 123, i32* %2
%6 = bitcast float* %3 to i8*
store float 0x4028AE1480000000, float* %3
%7 = bitcast double* %4 to i8*
store double 0x405EDD3C07EE0B0B, double* %4
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %1, i32 97)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32 123)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), float* %3, double 0x4028AE1480000000)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), double* %4, double 0x405EDD3C07EE0B0B)
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32* %2, i32 %12)
ret i32 0
}