#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 *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int *T;
  int *tab;
  int i;
  T = malloc(10 * sizeof(int));
  for (i = 0; i < 10; i++) {
    T[i] = i;
  }
  for (i = 0; i < 10; i++) {
    printf("T[%d]=%d\n", i, T[i]);
  }
  printf("====================\n");
  for (i = 0; i < 10; i++) {
    printf("*(T+%d)=%d\n", i, *(T + i));
  }
  tab = T;
  for (i = 0; i < 10; i++) {
    printf("tab[%d]=%d\n", i, tab[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    1171 <main+0x51>
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114b <main+0x2b>
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    11ac <main+0x8c>
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1178 <main+0x58>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    11f5 <main+0xd5>
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c1 <main+0xa1>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    1238 <main+0x118>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1204 <main+0xe4>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movaps 0xeae(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xeb4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movabs $0x900000008,%rax
mov    %rax,0x20(%rbx)
lea    0xeab(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx),%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%edx
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%edx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%edx
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%edx
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%edx
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx),%edx
mov    %r14,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe16(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edx
lea    0xdf0(%rip),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%edx
mov    %edx,0x14(%rsp)
mov    %rbp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%edx
mov    %edx,0x10(%rsp)
mov    %rbp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx),%edx
mov    %edx,0xc(%rsp)
mov    %rbp,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%edx
mov    %edx,0x8(%rsp)
mov    %rbp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%edx
mov    %edx,0x4(%rsp)
mov    %rbp,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%r14d
mov    %rbp,%rdi
mov    $0x6,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%r15d
mov    %rbp,%rdi
mov    $0x7,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%r12d
mov    %rbp,%rdi
mov    $0x8,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx),%r13d
mov    %rbp,%rdi
mov    $0x9,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edx
lea    0xd21(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    0x14(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    0x10(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"T[%d]=%d\0A\00"
@.str.1 = [22 x i8] c"====================\0A\00"
@.str.2 = [12 x i8] c"*(T+%d)=%d\0A\00"
@.str.3 = [12 x i8] c"tab[%d]=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32* @malloc(i32 40)
store i32* %9, i32** %6
store i32 0, i32* %8
br label %10
10: ; preds = %19, %2
%11 = load i32, i32* %8
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %8
%15 = load i32*, i32** %6
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %13
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %10
22: ; preds = %10
store i32 0, i32* %8
br label %23
23: ; preds = %34, %22
%24 = load i32, i32* %8
%25 = icmp slt i32 %24, 10
br i1 %25, label %26, label %37
26: ; preds = %23
%27 = load i32, i32* %8
%28 = load i32*, i32** %6
%29 = load i32, i32* %8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %32)
br label %34
34: ; preds = %26
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %23
37: ; preds = %23
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %8
br label %39
39: ; preds = %50, %37
%40 = load i32, i32* %8
%41 = icmp slt i32 %40, 10
br i1 %41, label %42, label %53
42: ; preds = %39
%43 = load i32, i32* %8
%44 = load i32*, i32** %6
%45 = load i32, i32* %8
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %48)
br label %50
50: ; preds = %42
%51 = load i32, i32* %8
%52 = add nsw i32 %51, 1
store i32 %52, i32* %8
br label %39
53: ; preds = %39
%54 = load i32*, i32** %6
store i32* %54, i32** %7
store i32 0, i32* %8
br label %55
55: ; preds = %66, %53
%56 = load i32, i32* %8
%57 = icmp slt i32 %56, 10
br i1 %57, label %58, label %69
58: ; preds = %55
%59 = load i32, i32* %8
%60 = load i32*, i32** %7
%61 = load i32, i32* %8
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %59, i32 %64)
br label %66
66: ; preds = %58
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
store i32 %68, i32* %8
br label %55
69: ; preds = %55
%70 = load i32, i32* %3
ret i32 %70
}

LLVM IR (-O2):
@.str = [10 x i8] c"T[%d]=%d\0A\00"
@.str.2 = [12 x i8] c"*(T+%d)=%d\0A\00"
@.str.3 = [12 x i8] c"tab[%d]=%d\0A\00"
@str = [21 x i8] c"====================\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 40)
%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 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %3, i64 4
%9 = getelementptr inbounds i32, i32* %3, i64 5
%10 = getelementptr inbounds i32, i32* %3, i64 6
%11 = getelementptr inbounds i32, i32* %3, i64 7
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %12
%13 = getelementptr inbounds i32, i32* %3, i64 8
store i32 8, i32* %13
%14 = getelementptr inbounds i32, i32* %3, i64 9
store i32 9, i32* %14
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%16 = load i32, i32* %4
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 %16)
%18 = load i32, i32* %5
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2, i32 %18)
%20 = load i32, i32* %6
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3, i32 %20)
%22 = load i32, i32* %8
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4, i32 %22)
%24 = load i32, i32* %9
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i32 %24)
%26 = load i32, i32* %10
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6, i32 %26)
%28 = load i32, i32* %11
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7, i32 %28)
%30 = load i32, i32* %13
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8, i32 %30)
%32 = load i32, i32* %14
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 %32)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%35 = load i32, i32* %3
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %35)
%37 = load i32, i32* %4
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %37)
%39 = load i32, i32* %5
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %39)
%41 = load i32, i32* %6
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %41)
%43 = load i32, i32* %8
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %43)
%45 = load i32, i32* %9
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 %45)
%47 = load i32, i32* %10
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 %47)
%49 = load i32, i32* %11
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 %49)
%51 = load i32, i32* %13
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 8, i32 %51)
%53 = load i32, i32* %14
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 9, i32 %53)
%55 = load i32, i32* %3
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %55)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %37)
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %39)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %41)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 %43)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 5, i32 %45)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 %47)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 7, i32 %49)
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 8, i32 %51)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 9, i32 %53)
ret i32 0
}