#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 */
typedef int /*<<< orphan*/ vec;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int vec[10] = {98, 16, 24, 10, 87, 28, 93, 11, 54, 92};
  int *ptr = &vec[10 - 1];
  printf("            Array: ");
  for (int i = 0; i < sizeof(vec) / sizeof(vec[0]); i++)
    printf("%d, ", vec[i]);
  printf("\nAddress of vector: %d %p \n", *ptr, (void *)ptr);
  ptr--;
  printf("ptr - %d (%2d byte): %d %p\n", 1, 4, *ptr, (void *)ptr);
  ptr -= 1;
  printf("ptr - %d (%2d byte): %d %p\n", 1, 4, *ptr, (void *)ptr);
  printf("ptr - %d (%2d byte): %d %p\n", 4, 16, *(ptr - 4), (void *)(ptr - 4));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
add    $0x24,%rax
mov    %rax,-0x38(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
movslq -0x3c(%rbp),%rax
cmp    $0xa,%rax
jae    1197 <main+0x77>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1165 <main+0x45>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rdx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
mov    -0x38(%rbp),%r8
lea    0xe91(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
mov    -0x38(%rbp),%r8
lea    0xe63(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    -0x10(%rax),%ecx
mov    -0x38(%rbp),%r8
add    $0xfffffffffffffff0,%r8
lea    0xe3c(%rip),%rdi
mov    $0x4,%esi
mov    $0x10,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    0xefc(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x62,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x18,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x57,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1c,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1c(%rsp),%r12
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x36,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x24(%rsp),%r13
mov    %rbx,%rdi
mov    $0x5c,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe3b(%rip),%rdi
mov    $0x5c,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%ecx
lea    0xe3d(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r14,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x1c(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r12,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x10,%edx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.vec = [10 x i32] [i32 98, i32 16, i32 24, i32 10, i32 87, i32 28, i32 93, i32 11, i32 54, i32 92]
@.str = [20 x i8] c" Array: \00"
@.str.1 = [5 x i8] c"%d, \00"
@.str.2 = [28 x i8] c"\0AAddress of vector: %d %p \0A\00"
@.str.3 = [28 x i8] c"ptr - %d (%2d byte): %d %p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32* %6, i32** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %8
8: ; preds = %18, %0
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %8
21: ; preds = %8
%22 = load i32*, i32** %3
%23 = load i32, i32* %22
%24 = load i32*, i32** %3
%25 = bitcast i32* %24 to i8*
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %23, i8* %25)
%27 = load i32*, i32** %3
%28 = getelementptr inbounds i32, i32* %27, i32 -1
store i32* %28, i32** %3
%29 = load i32*, i32** %3
%30 = load i32, i32* %29
%31 = load i32*, i32** %3
%32 = bitcast i32* %31 to i8*
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 4, i32 %30, i8* %32)
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 -1
store i32* %35, i32** %3
%36 = load i32*, i32** %3
%37 = load i32, i32* %36
%38 = load i32*, i32** %3
%39 = bitcast i32* %38 to i8*
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 4, i32 %37, i8* %39)
%41 = load i32*, i32** %3
%42 = getelementptr inbounds i32, i32* %41, i64 -4
%43 = load i32, i32* %42
%44 = load i32*, i32** %3
%45 = getelementptr inbounds i32, i32* %44, i64 -4
%46 = bitcast i32* %45 to i8*
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 16, i32 %43, i8* %46)
%48 = load i32, i32* @EXIT_SUCCESS
ret i32 %48
}

LLVM IR (-O2):
@__const.main.vec = [10 x i32] [i32 98, i32 16, i32 24, i32 10, i32 87, i32 28, i32 93, i32 11, i32 54, i32 92]
@.str = [20 x i8] c" Array: \00"
@.str.1 = [5 x i8] c"%d, \00"
@.str.2 = [28 x i8] c"\0AAddress of vector: %d %p \0A\00"
@.str.3 = [28 x i8] c"ptr - %d (%2d byte): %d %p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 98)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 16)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 24)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 10)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 87)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 28)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 93)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 11)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 54)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 92)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 92, i32* %16)
%19 = load i32, i32* %14
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 4, i32 %19, i32* %14)
%21 = load i32, i32* %12
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 4, i32 %21, i32* %12)
%23 = load i32, i32* %7
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 16, i32 %23, i32* %7)
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}