#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 *calloc(int, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int *i;
  i = calloc(5, sizeof(int));
  printf("%p %p %p %p %p \n", i, i + 1, i + 2, i + 3);
  printf("%d %d %d %d %d \n", *i, *(i + 1), *(i + 2), *(i + 3));
  free(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x4,%rdx
mov    -0x18(%rbp),%rcx
add    $0x8,%rcx
mov    -0x18(%rbp),%r8
add    $0xc,%r8
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0x4(%rax),%rdx
lea    0x8(%rax),%rcx
lea    0xc(%rax),%r8
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%p %p %p %p %p \0A\00"
@.str.1 = [17 x i8] c"%d %d %d %d %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @calloc(i32 5, i32 4)
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %8, i32* %10, i32* %12, i32* %14)
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i64 3
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %20, i32 %23, i32 %26)
%28 = load i32*, i32** %6
%29 = call i32 @free(i32* %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%p %p %p %p %p \0A\00"
@.str.1 = [17 x i8] c"%d %d %d %d %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @calloc(i32 5, i32 4)
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = getelementptr inbounds i32, i32* %3, i64 2
%6 = getelementptr inbounds i32, i32* %3, i64 3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11)
%13 = tail call i32 @free(i32* %3)
ret i32 0
}