#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*/ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int numbers[10] = {1, 7, 8, 2};
  int *ptr = numbers;
  int i;
  *(ptr + 4) = 10;
  *ptr--;
  *(ptr + 3) = *(ptr + 9);
  ptr++;
  *ptr = 0;
  *(numbers + 1) = 1;
  for (i = 0; i < 10; i++) {
    printf("%d, ", *(ptr + i));
  }
  int my_array[] = {1, 3, 4, 5, -1};
  int *p;
  p = my_array;
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x7,-0x2c(%rbp)
movl   $0x8,-0x28(%rbp)
movl   $0x2,-0x24(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0xa,0x10(%rax)
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x2c(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11eb <main+0xbb>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11bc <main+0x8c>
mov    0xe1e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe1b(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe19(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%11 = tail call i32 (...) @getchar()
ret i32 0
}