int main() {
  int a[10];
  int *p, i;
  printf("please enter 10 intger numbers:\n");
  for (i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
  }
  for (p = a; p < (a + 10); p++) {
    printf("%5d", *p);
    printf("%15d\n", p);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    1179 <main+0x59>
movslq -0x3c(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1144 <main+0x24>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
lea    -0x30(%rbp),%rcx
add    $0x28,%rcx
cmp    %rcx,%rax
jae    11cd <main+0xad>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
jmp    1181 <main+0x61>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
lea    0xe9f(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x28(%rsp),%r12
lea    0xe02(%rip),%r14
lea    0xdff(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x4,%rbx
cmp    %r12,%rbx
jb     1210 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [33 x i8] c"please enter 10 intger numbers:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%5d\00"
@.str.3 = [6 x i8] c"%15d\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %11
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32* %18, i32** %3
br label %19
19: ; preds = %30, %17
%20 = load i32*, i32** %3
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%22 = getelementptr inbounds i32, i32* %21, i64 10
%23 = icmp ult i32* %20, %22
br i1 %23, label %24, label %33
24: ; preds = %19
%25 = load i32*, i32** %3
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %28)
br label %30
30: ; preds = %24
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i32 1
store i32* %32, i32** %3
br label %19
33: ; preds = %19
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%5d\00"
@.str.3 = [6 x i8] c"%15d\0A\00"
@str = [32 x i8] c"please enter 10 intger numbers:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
br label %25
25: ; preds = %0, %25
%26 = phi i32* [ %4, %0 ], [ %30, %25 ]
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %26)
%30 = getelementptr inbounds i32, i32* %26, i64 1
%31 = icmp ult i32* %30, %24
br i1 %31, label %25, label %32
32: ; preds = %25
%33 = call i32 @putchar(i32 10)
ret i32 0
}