#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*/ free(void *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Step 1\n");
  printf("*************************\n");
  int i1 = 1;
  int i2 = 2;
  double d1 = 3.0;
  double d2 = 4.0;
  printf("The chosen initial value for i1 is: %d\n", i1);
  printf("The chosen initial value for i2 is: %d\n", i2);
  printf("The chosen initial value for d1 is: %f\n", d1);
  printf("The chosen initial value for d2 is: %f\n\n", d2);
  printf("The address of i1 is: %p\n", &i1);
  printf("The address of i2 is: %p\n", &i2);
  printf("The address of d1 is: %p\n", &d1);
  printf("The address of d2 is: %p\n", &d2);
  printf("\n");
  printf("Step 2\n");
  printf("*************************\n");
  int *intptr1;
  int *intptr2;
  double *dubptr1;
  double *dubptr2;
  printf("The address of intptr1 is: %p\n", &intptr1);
  printf("The address of intptr2 is: %p\n", &intptr2);
  printf("The address of dubptr1 is: %p\n", &dubptr1);
  printf("The address of dubptr2 is: %p\n", &dubptr2);
  printf("\n");
  printf("Step 3\n");
  printf("*************************\n");
  intptr1 = &i1;
  intptr2 = &i2;
  dubptr1 = &d1;
  dubptr2 = &d2;
  printf("The value of intptr1 is: %p\n", intptr1);
  printf("The value of intptr2 is: %p\n", intptr2);
  printf("The value of dubptr1 is: %p\n", dubptr1);
  printf("The value of dubptr2 is: %p\n", dubptr2);
  printf("\n");
  printf("Step 4\n");
  printf("*************************\n");
  intptr1 = intptr2;
  printf("The value of intptr1 after (intptr1 = intptr2) is: %p\n", intptr1);
  printf("The assigment of dubptr1 = intptr1 without cast causes an "
         "incompatiable type warning.\n");
  dubptr1 = (double *)intptr1;
  printf("The value of dubptr1 = (double*)intptr1 after typcasting is: %p\n",
         dubptr1);
  printf("\n");
  printf("Step 5\n");
  printf("*************************\n");
  intptr1 = NULL;
  printf("The value of intptr1 after the assignent of intptr1 = NULL is: %p\n",
         intptr1);
  printf("The assignment of intptr1 = NULL causes a segmaentation fault in "
         "step 6.\n");
  printf("\n");
  printf("Step 6\n");
  printf("*************************\n");
  printf("The value of *intptr2 is: %d\n", *intptr2);
  printf("The value of *intptr1 after the assignment to NULL causes a "
         "segmentation fault here.\n");
  printf("\n");
  printf("Step 7\n");
  printf("*************************\n");
  *intptr2 = 100;
  printf("The value of i1 after *intptr2 = 100 is: %d\n", i1);
  printf("The value of i2 after *intptr2 = 100 is: %d\n", i2);
  printf("\n");
  printf("Step8\n");
  printf("*************************\n");
  printf("The value of intptr2++ is: %p\n", (intptr2 + 1));
  printf("The value of dubptr2++ is: %p\n", (dubptr2 + 1));
  printf("The value of intptr2-- is: %p\n", (intptr2 - 1));
  printf("The value of dubptr2-- is: %p\n", (dubptr2 - 1));
  printf("The value of *intptr2++ is: %d\n", *(intptr2 + 1));
  printf("The value of *dubptr2++ is: %f\n", *(dubptr2 + 1));
  printf("The value of *intptr2-- is: %d\n", *(intptr2 - 1));
  printf("The value of *dubptr2-- is: %f\n", *(dubptr2 - 1));
  printf("\n");
  printf("Step 9\n");
  printf("*************************\n");
  intptr1 = &i1;
  printf("Does intptr1 == intptr2 after intptr1 = &i1?: %d, it is false.\n",
         (intptr1 == intptr2));
  printf("Does *intptr1 == *intptr2 after intptr1 = &i1?: %d, it is false.\n",
         (*intptr1 == *intptr2));
  intptr1 = &i2;
  printf(
      "Does intptr1 == intptr2 after i2 = (int)(intptr1)?: %d, it is true.\n",
      (intptr1 == intptr2));
  printf(
      "Does *intptr1 == *intptr2 after i2 = (int)(intptr1)?: %d, it is true.\n",
      (*intptr1 == *intptr2));
  printf("\n");
  printf("Step 10\n");
  printf("*************************\n");
  double *ptr;
  ptr = (double *)malloc(sizeof(100.0));
  *ptr = 3.1416;
  printf("The value of ptr is: %p\n", ptr);
  printf("The value of *ptr is: %f\n", *ptr);
  printf("\n");
  printf("Step 11\n");
  printf("*************************\n");
  free((void *)ptr);
  ptr = (double *)malloc(sizeof(100.0));
  printf("Is the value of ptr the same as it was in qustion 10?: %p , Yes it "
         "is.\n",
         ptr);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xeda(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xeef(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf12(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf1a(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf2f(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xf5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xf63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfc6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
lea    0xfac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xff6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x8(%rbp),%esi
lea    0xfd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xff1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1002(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
add    $0x4,%rsi
lea    0xfe5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
add    $0x8,%rsi
lea    0xfee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xff7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
add    $0xfffffffffffffff8,%rsi
lea    0x1000(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%esi
lea    0x100a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
movsd  0x8(%rax),%xmm0
lea    0x1013(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    -0x4(%rax),%esi
lea    0x101e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
movsd  -0x8(%rax),%xmm0
lea    0x1027(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x102b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xaac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xfff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0x101d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0x1039(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x30(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0x105c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xac8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1087(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x9f2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsd  0x9b1(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rsi
lea    0x1052(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
lea    0x1055(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xa58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1053(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x982(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0x1025(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xa05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0x145d(%rip),%rdi
call   1050 <puts@plt>
lea    0x1593(%rip),%r12
mov    %r12,%rdi
call   1050 <puts@plt>
movl   $0x1,0x24(%rsp)
movl   $0x2,0x20(%rsp)
movabs $0x4008000000000000,%rax
mov    %rax,0x38(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x30(%rsp)
lea    0xe63(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe8d(%rip),%rdi
movsd  0xe25(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xe9f(%rip),%rdi
movsd  0xe17(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0x24(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x20(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeba(%rip),%rdi
lea    0x38(%rsp),%r13
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1367(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xebc(%rip),%rdi
lea    0x28(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1304(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %r15,0x10(%rsp)
mov    %r14,0x8(%rsp)
mov    %r13,0x28(%rsp)
mov    %rbx,0x18(%rsp)
lea    0xea2(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x28(%rsp),%rsi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rsi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x128f(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    0x8(%rsp),%rsi
mov    %rsi,0x10(%rsp)
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x126a(%rip),%rdi
call   1050 <puts@plt>
mov    0x10(%rsp),%rsi
mov    %rsi,0x28(%rsp)
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1292(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
movq   $0x0,0x10(%rsp)
lea    0xec3(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x126c(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x129f(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x127d(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x12bc(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    0x8(%rsp),%rax
movl   $0x64,(%rax)
mov    0x24(%rsp),%esi
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x1276(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    0x8(%rsp),%rsi
add    $0x4,%rsi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rsi
add    $0x8,%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rsi
add    $0xfffffffffffffff8,%rsi
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rax
mov    0x4(%rax),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rax
movsd  0x8(%rax),%xmm0
lea    0xed8(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x8(%rsp),%rax
mov    -0x4(%rax),%esi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rax
movsd  -0x8(%rax),%xmm0
lea    0xeea(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x11a6(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %r15,0x10(%rsp)
xor    %esi,%esi
cmp    0x8(%rsp),%r15
sete   %sil
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%eax
mov    0x8(%rsp),%rcx
xor    %esi,%esi
cmp    (%rcx),%eax
sete   %sil
lea    0xeec(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,0x10(%rsp)
xor    %esi,%esi
cmp    0x8(%rsp),%r14
sete   %sil
lea    0xf10(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%eax
mov    0x8(%rsp),%rcx
xor    %esi,%esi
cmp    (%rcx),%eax
sete   %sil
lea    0xf33(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x110f(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
movabs $0x400921ff2e48e8a7,%rax
21 09 40
mov    %rax,(%rbx)
lea    0xf34(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movsd  (%rbx),%xmm0
lea    0xf38(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x10bc(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x8,%edi
call   1070 <malloc@plt>
lea    0xf14(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Step 1\0A\00"
@.str.1 = [27 x i8] c"*************************\0A\00"
@.str.2 = [40 x i8] c"The chosen initial value for i1 is: %d\0A\00"
@.str.3 = [40 x i8] c"The chosen initial value for i2 is: %d\0A\00"
@.str.4 = [40 x i8] c"The chosen initial value for d1 is: %f\0A\00"
@.str.5 = [41 x i8] c"The chosen initial value for d2 is: %f\0A\0A\00"
@.str.6 = [26 x i8] c"The address of i1 is: %p\0A\00"
@.str.7 = [26 x i8] c"The address of i2 is: %p\0A\00"
@.str.8 = [26 x i8] c"The address of d1 is: %p\0A\00"
@.str.9 = [26 x i8] c"The address of d2 is: %p\0A\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [8 x i8] c"Step 2\0A\00"
@.str.12 = [31 x i8] c"The address of intptr1 is: %p\0A\00"
@.str.13 = [31 x i8] c"The address of intptr2 is: %p\0A\00"
@.str.14 = [31 x i8] c"The address of dubptr1 is: %p\0A\00"
@.str.15 = [31 x i8] c"The address of dubptr2 is: %p\0A\00"
@.str.16 = [8 x i8] c"Step 3\0A\00"
@.str.17 = [29 x i8] c"The value of intptr1 is: %p\0A\00"
@.str.18 = [29 x i8] c"The value of intptr2 is: %p\0A\00"
@.str.19 = [29 x i8] c"The value of dubptr1 is: %p\0A\00"
@.str.20 = [29 x i8] c"The value of dubptr2 is: %p\0A\00"
@.str.21 = [8 x i8] c"Step 4\0A\00"
@.str.22 = [55 x i8] c"The value of intptr1 after (intptr1 = intptr2) is: %p\0A\00"
@.str.23 = [87 x i8] c"The assigment of dubptr1 = intptr1 without cast causes an incompatiable type warning.\0A\00"
@.str.24 = [65 x i8] c"The value of dubptr1 = (double*)intptr1 after typcasting is: %p\0A\00"
@.str.25 = [8 x i8] c"Step 5\0A\00"
@.str.26 = [67 x i8] c"The value of intptr1 after the assignent of intptr1 = NULL is: %p\0A\00"
@.str.27 = [74 x i8] c"The assignment of intptr1 = NULL causes a segmaentation fault in step 6.\0A\00"
@.str.28 = [8 x i8] c"Step 6\0A\00"
@.str.29 = [30 x i8] c"The value of *intptr2 is: %d\0A\00"
@.str.30 = [86 x i8] c"The value of *intptr1 after the assignment to NULL causes a segmentation fault here.\0A\00"
@.str.31 = [8 x i8] c"Step 7\0A\00"
@.str.32 = [45 x i8] c"The value of i1 after *intptr2 = 100 is: %d\0A\00"
@.str.33 = [45 x i8] c"The value of i2 after *intptr2 = 100 is: %d\0A\00"
@.str.34 = [7 x i8] c"Step8\0A\00"
@.str.35 = [31 x i8] c"The value of intptr2++ is: %p\0A\00"
@.str.36 = [31 x i8] c"The value of dubptr2++ is: %p\0A\00"
@.str.37 = [31 x i8] c"The value of intptr2-- is: %p\0A\00"
@.str.38 = [31 x i8] c"The value of dubptr2-- is: %p\0A\00"
@.str.39 = [32 x i8] c"The value of *intptr2++ is: %d\0A\00"
@.str.40 = [32 x i8] c"The value of *dubptr2++ is: %f\0A\00"
@.str.41 = [32 x i8] c"The value of *intptr2-- is: %d\0A\00"
@.str.42 = [32 x i8] c"The value of *dubptr2-- is: %f\0A\00"
@.str.43 = [8 x i8] c"Step 9\0A\00"
@.str.44 = [64 x i8] c"Does intptr1 == intptr2 after intptr1 = &i1?: %d, it is false.\0A\00"
@.str.45 = [66 x i8] c"Does *intptr1 == *intptr2 after intptr1 = &i1?: %d, it is false.\0A\00"
@.str.46 = [69 x i8] c"Does intptr1 == intptr2 after i2 = (int)(intptr1)?: %d, it is true.\0A\00"
@.str.47 = [71 x i8] c"Does *intptr1 == *intptr2 after i2 = (int)(intptr1)?: %d, it is true.\0A\00"
@.str.48 = [9 x i8] c"Step 10\0A\00"
@.str.49 = [25 x i8] c"The value of ptr is: %p\0A\00"
@.str.50 = [26 x i8] c"The value of *ptr is: %f\0A\00"
@.str.51 = [9 x i8] c"Step 11\0A\00"
@.str.52 = [72 x i8] c"Is the value of ptr the same as it was in qustion 10?: %p , Yes it is.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
store i32 2, i32* %3
store double 3.000000e+00, double* %4
store double 4.000000e+00, double* %5
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = load double, double* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double %17)
%19 = load double, double* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), double* %4)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), double* %5)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i32** %6)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i32** %7)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), double** %8)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.15, i64 0, i64 0), double** %9)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %6
store i32* %3, i32** %7
store double* %4, double** %8
store double* %5, double** %9
%35 = load i32*, i32** %6
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.17, i64 0, i64 0), i32* %35)
%37 = load i32*, i32** %7
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i32* %37)
%39 = load double*, double** %8
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0), double* %39)
%41 = load double*, double** %9
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.20, i64 0, i64 0), double* %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%46 = load i32*, i32** %7
store i32* %46, i32** %6
%47 = load i32*, i32** %6
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.22, i64 0, i64 0), i32* %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.23, i64 0, i64 0))
%50 = load i32*, i32** %6
%51 = bitcast i32* %50 to double*
store double* %51, double** %8
%52 = load double*, double** %8
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.24, i64 0, i64 0), double* %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0))
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32* null, i32** %6
%57 = load i32*, i32** %6
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.26, i64 0, i64 0), i32* %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.27, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0))
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%63 = load i32*, i32** %7
%64 = load i32, i32* %63
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.29, i64 0, i64 0), i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.30, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.31, i64 0, i64 0))
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%70 = load i32*, i32** %7
store i32 100, i32* %70
%71 = load i32, i32* %2
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.32, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %3
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.33, i64 0, i64 0), i32 %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.34, i64 0, i64 0))
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%78 = load i32*, i32** %7
%79 = getelementptr inbounds i32, i32* %78, i64 1
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.35, i64 0, i64 0), i32* %79)
%81 = load double*, double** %9
%82 = getelementptr inbounds double, double* %81, i64 1
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.36, i64 0, i64 0), double* %82)
%84 = load i32*, i32** %7
%85 = getelementptr inbounds i32, i32* %84, i64 -1
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.37, i64 0, i64 0), i32* %85)
%87 = load double*, double** %9
%88 = getelementptr inbounds double, double* %87, i64 -1
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.38, i64 0, i64 0), double* %88)
%90 = load i32*, i32** %7
%91 = getelementptr inbounds i32, i32* %90, i64 1
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.39, i64 0, i64 0), i32 %92)
%94 = load double*, double** %9
%95 = getelementptr inbounds double, double* %94, i64 1
%96 = load double, double* %95
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.40, i64 0, i64 0), double %96)
%98 = load i32*, i32** %7
%99 = getelementptr inbounds i32, i32* %98, i64 -1
%100 = load i32, i32* %99
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.41, i64 0, i64 0), i32 %100)
%102 = load double*, double** %9
%103 = getelementptr inbounds double, double* %102, i64 -1
%104 = load double, double* %103
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.42, i64 0, i64 0), double %104)
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.43, i64 0, i64 0))
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %6
%109 = load i32*, i32** %6
%110 = load i32*, i32** %7
%111 = icmp eq i32* %109, %110
%112 = zext i1 %111 to i32
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.44, i64 0, i64 0), i32 %112)
%114 = load i32*, i32** %6
%115 = load i32, i32* %114
%116 = load i32*, i32** %7
%117 = load i32, i32* %116
%118 = icmp eq i32 %115, %117
%119 = zext i1 %118 to i32
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.45, i64 0, i64 0), i32 %119)
store i32* %3, i32** %6
%121 = load i32*, i32** %6
%122 = load i32*, i32** %7
%123 = icmp eq i32* %121, %122
%124 = zext i1 %123 to i32
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.46, i64 0, i64 0), i32 %124)
%126 = load i32*, i32** %6
%127 = load i32, i32* %126
%128 = load i32*, i32** %7
%129 = load i32, i32* %128
%130 = icmp eq i32 %127, %129
%131 = zext i1 %130 to i32
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.47, i64 0, i64 0), i32 %131)
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.48, i64 0, i64 0))
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%136 = call i64 @malloc(i32 8)
%137 = inttoptr i64 %136 to double*
store double* %137, double** %10
%138 = load double*, double** %10
store double 3.141600e+00, double* %138
%139 = load double*, double** %10
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.49, i64 0, i64 0), double* %139)
%141 = load double*, double** %10
%142 = load double, double* %141
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.50, i64 0, i64 0), double %142)
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.51, i64 0, i64 0))
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%147 = load double*, double** %10
%148 = bitcast double* %147 to i8*
%149 = call i32 @free(i8* %148)
%150 = call i64 @malloc(i32 8)
%151 = inttoptr i64 %150 to double*
store double* %151, double** %10
%152 = load double*, double** %10
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.52, i64 0, i64 0), double* %152)
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [40 x i8] c"The chosen initial value for i1 is: %d\0A\00"
@.str.3 = [40 x i8] c"The chosen initial value for i2 is: %d\0A\00"
@.str.4 = [40 x i8] c"The chosen initial value for d1 is: %f\0A\00"
@.str.5 = [41 x i8] c"The chosen initial value for d2 is: %f\0A\0A\00"
@.str.6 = [26 x i8] c"The address of i1 is: %p\0A\00"
@.str.7 = [26 x i8] c"The address of i2 is: %p\0A\00"
@.str.8 = [26 x i8] c"The address of d1 is: %p\0A\00"
@.str.9 = [26 x i8] c"The address of d2 is: %p\0A\00"
@.str.12 = [31 x i8] c"The address of intptr1 is: %p\0A\00"
@.str.13 = [31 x i8] c"The address of intptr2 is: %p\0A\00"
@.str.14 = [31 x i8] c"The address of dubptr1 is: %p\0A\00"
@.str.15 = [31 x i8] c"The address of dubptr2 is: %p\0A\00"
@.str.17 = [29 x i8] c"The value of intptr1 is: %p\0A\00"
@.str.18 = [29 x i8] c"The value of intptr2 is: %p\0A\00"
@.str.19 = [29 x i8] c"The value of dubptr1 is: %p\0A\00"
@.str.20 = [29 x i8] c"The value of dubptr2 is: %p\0A\00"
@.str.22 = [55 x i8] c"The value of intptr1 after (intptr1 = intptr2) is: %p\0A\00"
@.str.24 = [65 x i8] c"The value of dubptr1 = (double*)intptr1 after typcasting is: %p\0A\00"
@.str.26 = [67 x i8] c"The value of intptr1 after the assignent of intptr1 = NULL is: %p\0A\00"
@.str.29 = [30 x i8] c"The value of *intptr2 is: %d\0A\00"
@.str.32 = [45 x i8] c"The value of i1 after *intptr2 = 100 is: %d\0A\00"
@.str.33 = [45 x i8] c"The value of i2 after *intptr2 = 100 is: %d\0A\00"
@.str.35 = [31 x i8] c"The value of intptr2++ is: %p\0A\00"
@.str.36 = [31 x i8] c"The value of dubptr2++ is: %p\0A\00"
@.str.37 = [31 x i8] c"The value of intptr2-- is: %p\0A\00"
@.str.38 = [31 x i8] c"The value of dubptr2-- is: %p\0A\00"
@.str.39 = [32 x i8] c"The value of *intptr2++ is: %d\0A\00"
@.str.40 = [32 x i8] c"The value of *dubptr2++ is: %f\0A\00"
@.str.41 = [32 x i8] c"The value of *intptr2-- is: %d\0A\00"
@.str.42 = [32 x i8] c"The value of *dubptr2-- is: %f\0A\00"
@.str.44 = [64 x i8] c"Does intptr1 == intptr2 after intptr1 = &i1?: %d, it is false.\0A\00"
@.str.45 = [66 x i8] c"Does *intptr1 == *intptr2 after intptr1 = &i1?: %d, it is false.\0A\00"
@.str.46 = [69 x i8] c"Does intptr1 == intptr2 after i2 = (int)(intptr1)?: %d, it is true.\0A\00"
@.str.47 = [71 x i8] c"Does *intptr1 == *intptr2 after i2 = (int)(intptr1)?: %d, it is true.\0A\00"
@.str.49 = [25 x i8] c"The value of ptr is: %p\0A\00"
@.str.50 = [26 x i8] c"The value of *ptr is: %f\0A\00"
@.str.52 = [72 x i8] c"Is the value of ptr the same as it was in qustion 10?: %p , Yes it is.\0A\00"
@str = [7 x i8] c"Step 1\00"
@str.54 = [7 x i8] c"Step 2\00"
@str.56 = [7 x i8] c"Step 3\00"
@str.58 = [7 x i8] c"Step 4\00"
@str.60 = [86 x i8] c"The assigment of dubptr1 = intptr1 without cast causes an incompatiable type warning.\00"
@str.61 = [7 x i8] c"Step 5\00"
@str.63 = [73 x i8] c"The assignment of intptr1 = NULL causes a segmaentation fault in step 6.\00"
@str.64 = [7 x i8] c"Step 6\00"
@str.66 = [85 x i8] c"The value of *intptr1 after the assignment to NULL causes a segmentation fault here.\00"
@str.67 = [7 x i8] c"Step 7\00"
@str.69 = [6 x i8] c"Step8\00"
@str.71 = [7 x i8] c"Step 9\00"
@str.73 = [8 x i8] c"Step 10\00"
@str.75 = [8 x i8] c"Step 11\00"
@str.76 = [26 x i8] c"*************************\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca double*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%11 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%12 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%13 = bitcast double* %3 to i8*
store double 3.000000e+00, double* %3
%14 = bitcast double* %4 to i8*
store double 4.000000e+00, double* %4
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 1)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 2)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), double 3.000000e+00)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), double 4.000000e+00)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), double* %3)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), double* %4)
%23 = call i32 @putchar(i32 10)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.54, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%26 = bitcast i32** %5 to i8*
%27 = bitcast i32** %6 to i8*
%28 = bitcast double** %7 to i8*
%29 = bitcast double** %8 to i8*
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i32** %5)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i32** %6)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), double** %7)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.15, i64 0, i64 0), double** %8)
%34 = call i32 @putchar(i32 10)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.56, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
store i32* %1, i32** %5
store i32* %2, i32** %6
store double* %3, double** %7
store double* %4, double** %8
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.17, i64 0, i64 0), i32* %1)
%38 = load i32*, i32** %6
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0), i32* %38)
%40 = load double*, double** %7
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.19, i64 0, i64 0), double* %40)
%42 = load double*, double** %8
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.20, i64 0, i64 0), double* %42)
%44 = call i32 @putchar(i32 10)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.58, i64 0, i64 0))
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%47 = load i32*, i32** %6
store i32* %47, i32** %5
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.22, i64 0, i64 0), i32* %47)
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str.60, i64 0, i64 0))
%50 = bitcast i32** %5 to double**
%51 = load double*, double** %50
store double* %51, double** %7
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.24, i64 0, i64 0), double* %51)
%53 = call i32 @putchar(i32 10)
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.61, i64 0, i64 0))
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
store i32* null, i32** %5
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.26, i64 0, i64 0), i32* null)
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.63, i64 0, i64 0))
%58 = call i32 @putchar(i32 10)
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.64, i64 0, i64 0))
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%61 = load i32*, i32** %6
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.29, i64 0, i64 0), i32 %62)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.66, i64 0, i64 0))
%65 = call i32 @putchar(i32 10)
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.67, i64 0, i64 0))
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%68 = load i32*, i32** %6
store i32 100, i32* %68
%69 = load i32, i32* %1
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.32, i64 0, i64 0), i32 %69)
%71 = load i32, i32* %2
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.33, i64 0, i64 0), i32 %71)
%73 = call i32 @putchar(i32 10)
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.69, i64 0, i64 0))
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%76 = load i32*, i32** %6
%77 = getelementptr inbounds i32, i32* %76, i64 1
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.35, i64 0, i64 0), i32* %77)
%79 = load double*, double** %8
%80 = getelementptr inbounds double, double* %79, i64 1
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.36, i64 0, i64 0), double* %80)
%82 = load i32*, i32** %6
%83 = getelementptr inbounds i32, i32* %82, i64 -1
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.37, i64 0, i64 0), i32* %83)
%85 = load double*, double** %8
%86 = getelementptr inbounds double, double* %85, i64 -1
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.38, i64 0, i64 0), double* %86)
%88 = load i32*, i32** %6
%89 = getelementptr inbounds i32, i32* %88, i64 1
%90 = load i32, i32* %89
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.39, i64 0, i64 0), i32 %90)
%92 = load double*, double** %8
%93 = getelementptr inbounds double, double* %92, i64 1
%94 = load double, double* %93
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.40, i64 0, i64 0), double %94)
%96 = load i32*, i32** %6
%97 = getelementptr inbounds i32, i32* %96, i64 -1
%98 = load i32, i32* %97
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.41, i64 0, i64 0), i32 %98)
%100 = load double*, double** %8
%101 = getelementptr inbounds double, double* %100, i64 -1
%102 = load double, double* %101
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.42, i64 0, i64 0), double %102)
%104 = call i32 @putchar(i32 10)
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.71, i64 0, i64 0))
%106 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
store i32* %1, i32** %5
%107 = load i32*, i32** %6
%108 = icmp eq i32* %1, %107
%109 = zext i1 %108 to i32
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.44, i64 0, i64 0), i32 %109)
%111 = load i32*, i32** %5
%112 = load i32, i32* %111
%113 = load i32*, i32** %6
%114 = load i32, i32* %113
%115 = icmp eq i32 %112, %114
%116 = zext i1 %115 to i32
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.45, i64 0, i64 0), i32 %116)
store i32* %2, i32** %5
%118 = load i32*, i32** %6
%119 = icmp eq i32* %2, %118
%120 = zext i1 %119 to i32
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.46, i64 0, i64 0), i32 %120)
%122 = load i32*, i32** %5
%123 = load i32, i32* %122
%124 = load i32*, i32** %6
%125 = load i32, i32* %124
%126 = icmp eq i32 %123, %125
%127 = zext i1 %126 to i32
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.47, i64 0, i64 0), i32 %127)
%129 = call i32 @putchar(i32 10)
%130 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.73, i64 0, i64 0))
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%132 = call i64 @malloc(i32 8)
%133 = inttoptr i64 %132 to double*
store double 3.141600e+00, double* %133
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.49, i64 0, i64 0), double* %133)
%135 = load double, double* %133
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.50, i64 0, i64 0), double %135)
%137 = call i32 @putchar(i32 10)
%138 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.75, i64 0, i64 0))
%139 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.76, i64 0, i64 0))
%140 = inttoptr i64 %132 to i8*
%141 = call i32 @free(i8* %140)
%142 = call i64 @malloc(i32 8)
%143 = inttoptr i64 %142 to double*
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.52, i64 0, i64 0), double* %143)
%145 = call i32 @putchar(i32 10)
ret i32 0
}