#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int arr1[] = {7, 2, 5, 3, 1, 6, -8, 16, 4};
  char arr2[] = {'m', 'q', 'k', 'z', '%', '>'};
  double arr3[] = {3.14, -2.718, 6.626, 0.529};
  int *iptr = &arr1[3];
  printf("%d\n", *iptr);
  long int addr13 = (long int)iptr;
  iptr--;
  printf("%d\n", *iptr);
  long int addr12 = (long int)iptr;
  printf("addr13 - addr12 = %ld\n", addr13 - addr12);
  printf("=====================================\n");
  char *cptr = &arr2[1];
  printf("%c\n", *cptr);
  long int addr21 = (long int)cptr;
  cptr++;
  printf("%c\n", *cptr);
  long int addr22 = (long int)cptr;
  printf("addr22 - addr21 = %ld\n", addr22 - addr21);
  printf("=====================================\n");
  double *dptr = &arr3[2];
  printf("%f\n", *dptr);
  long int addr32 = (long int)dptr;
  dptr--;
  printf("%f\n", *dptr);
  long int addr31 = (long int)dptr;
  printf("addr32 - addr31 = %ld\n", addr32 - addr31);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
mov    0xed0(%rip),%eax
mov    %eax,-0x46(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x42(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    -0x40(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    (%rax),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x80(%rbp),%rsi
sub    -0x88(%rbp),%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x46(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
movsbl (%rax),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
movsbl (%rax),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rsi
sub    -0x98(%rbp),%rsi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xded(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xa8(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0xa8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xdb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xa8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xb0(%rbp),%rsi
sub    -0xb8(%rbp),%rsi
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2caf(%rip),%rax
mov    (%rax),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefe(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x71,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rbx
movsd  0xe46(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe3c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.arr1 = [9 x i32] [i32 7, i32 2, i32 5, i32 3, i32 1, i32 6, i32 -8, i32 16, i32 4]
@__const.main.arr2 = [6 x i8] c"mqkz%>"
@__const.main.arr3 = [4 x double] [double 3.140000e+00, double -2.718000e+00, double 6.626000e+00, double 5.290000e-01]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [23 x i8] c"addr13 - addr12 = %ld\0A\00"
@.str.2 = [39 x i8] c"=====================================\0A\00"
@.str.3 = [4 x i8] c"%c\0A\00"
@.str.4 = [23 x i8] c"addr22 - addr21 = %ld\0A\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [23 x i8] c"addr32 - addr31 = %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i32]
%7 = alloca [6 x i8]
%8 = alloca [4 x double]
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i64
%15 = alloca double*
%16 = alloca i64
%17 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = bitcast [9 x i32]* %6 to i8*
%19 = bitcast [6 x i8]* %7 to i8*
%20 = bitcast [4 x double]* %8 to i8*
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 3
store i32* %21, i32** %9
%22 = load i32*, i32** %9
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32*, i32** %9
%26 = ptrtoint i32* %25 to i64
store i64 %26, i64* %10
%27 = load i32*, i32** %9
%28 = getelementptr inbounds i32, i32* %27, i32 -1
store i32* %28, i32** %9
%29 = load i32*, i32** %9
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i32*, i32** %9
%33 = ptrtoint i32* %32 to i64
store i64 %33, i64* %11
%34 = load i64, i64* %10
%35 = load i64, i64* %11
%36 = sub nsw i64 %34, %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%39 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 1
store i8* %39, i8** %12
%40 = load i8*, i8** %12
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%44 = load i8*, i8** %12
%45 = ptrtoint i8* %44 to i64
store i64 %45, i64* %13
%46 = load i8*, i8** %12
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %12
%48 = load i8*, i8** %12
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%52 = load i8*, i8** %12
%53 = ptrtoint i8* %52 to i64
store i64 %53, i64* %14
%54 = load i64, i64* %14
%55 = load i64, i64* %13
%56 = sub nsw i64 %54, %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%59 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 2
store double* %59, double** %15
%60 = load double*, double** %15
%61 = load double, double* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %61)
%63 = load double*, double** %15
%64 = ptrtoint double* %63 to i64
store i64 %64, i64* %16
%65 = load double*, double** %15
%66 = getelementptr inbounds double, double* %65, i32 -1
store double* %66, double** %15
%67 = load double*, double** %15
%68 = load double, double* %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %68)
%70 = load double*, double** %15
%71 = ptrtoint double* %70 to i64
store i64 %71, i64* %17
%72 = load i64, i64* %16
%73 = load i64, i64* %17
%74 = sub nsw i64 %72, %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i64 %74)
%76 = load i32, i32* @EXIT_SUCCESS
ret i32 %76
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [23 x i8] c"addr13 - addr12 = %ld\0A\00"
@.str.3 = [4 x i8] c"%c\0A\00"
@.str.4 = [23 x i8] c"addr22 - addr21 = %ld\0A\00"
@.str.5 = [4 x i8] c"%f\0A\00"
@.str.6 = [23 x i8] c"addr32 - addr31 = %ld\0A\00"
@EXIT_SUCCESS = global i32 0
@str.7 = [38 x i8] c"=====================================\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 113)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 107)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.7, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double 6.626000e+00)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double -2.718000e+00)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i64 8)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}