#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() {
  int a = 50;
  printf("A degiskeninin bellekteki adresi: %p\n", &a);
  char c = 'c';
  char *g = &c;
  printf("C degiskeninin bellekteki adresi: %p\n", g);
  printf("Pointer'in adresi: %p\n", &g);
  int b = 14;
  int *p = &b;
  printf("B'nin degeri: %d\n", b);
  *p = 99;
  printf("B'nin degeri: %d\n", b);
  double d = 14.4;
  double *g01 = &d;
  double *g02 = &d;
  printf("Pointer1: %lf\n", *g01);
  printf("Pointer2: %lf\n", *g02);
  *g01 = 52.20;
  printf("Pointer1 degistirildikten sonra Pointer2: %lf\n", *g02);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
lea    0xee3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x63,-0x9(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xe,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
movl   $0x63,(%rax)
mov    -0x1c(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe5d(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xecf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
movsd  0xe08(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe89(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x32,0x4(%rsp)
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x63,0x3(%rsp)
lea    0x3(%rsp),%rsi
mov    %rsi,0x8(%rsp)
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0c(%rip),%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
movsd  0xe6c(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
movsd  0xe56(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
movsd  0xe48(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"A degiskeninin bellekteki adresi: %p\0A\00"
@.str.1 = [38 x i8] c"C degiskeninin bellekteki adresi: %p\0A\00"
@.str.2 = [23 x i8] c"Pointer'in adresi: %p\0A\00"
@.str.3 = [18 x i8] c"B'nin degeri: %d\0A\00"
@.str.4 = [15 x i8] c"Pointer1: %lf\0A\00"
@.str.5 = [15 x i8] c"Pointer2: %lf\0A\00"
@.str.6 = [47 x i8] c"Pointer1 degistirildikten sonra Pointer2: %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
store i32 0, i32* %1
store i32 50, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32* %2)
store i8 99, i8* %3
store i8* %3, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8** %4)
store i32 14, i32* %5
store i32* %5, i32** %6
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %6
store i32 99, i32* %16
%17 = load i32, i32* %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %17)
store double 1.440000e+01, double* %7
store double* %7, double** %8
store double* %7, double** %9
%19 = load double*, double** %8
%20 = load double, double* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = load double*, double** %9
%23 = load double, double* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %23)
%25 = load double*, double** %8
store double 5.220000e+01, double* %25
%26 = load double*, double** %9
%27 = load double, double* %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"A degiskeninin bellekteki adresi: %p\0A\00"
@.str.1 = [38 x i8] c"C degiskeninin bellekteki adresi: %p\0A\00"
@.str.2 = [23 x i8] c"Pointer'in adresi: %p\0A\00"
@.str.3 = [18 x i8] c"B'nin degeri: %d\0A\00"
@.str.4 = [15 x i8] c"Pointer1: %lf\0A\00"
@.str.5 = [15 x i8] c"Pointer2: %lf\0A\00"
@.str.6 = [47 x i8] c"Pointer1 degistirildikten sonra Pointer2: %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = bitcast i32* %1 to i8*
store i32 50, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32* %1)
store i8 99, i8* %2
%6 = bitcast i8** %3 to i8*
store i8* %2, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8** %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 14)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 99)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double 1.440000e+01)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double 1.440000e+01)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), double 5.220000e+01)
ret i32 0
}