#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int temp;
  int i, j, n;
  scanf("%d", &n);
  for (i = 0; i < 10; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
  for (j = 0; j < n; j++) {
    temp = array[10 - 1];
    for (i = 10 - 1; i > 0; i--) {
      array[i] = array[i - 1];
    }
    array[0] = temp;
  }
  for (i = 0; i < 10; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xecd(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1199 <main+0x69>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    116b <main+0x3b>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1207 <main+0xd7>
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x9,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jle    11f3 <main+0xc3>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    11c7 <main+0x97>
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ae <main+0x7e>
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    123c <main+0x10c>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    120e <main+0xde>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    0xedb(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec0(%rip),%rdi
lea    0x44(%rsp),%rsi
call   1050 <scanf@plt>
mov    (%rsp),%esi
lea    0xeaf(%rip),%rbp
mov    %rbp,%rdi
mov    %esi,0x40(%rsp)
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbp,%rdi
mov    %esi,0x3c(%rsp)
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbp,%rdi
mov    %esi,0x38(%rsp)
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbp,%rdi
mov    %esi,0x34(%rsp)
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbp,%rdi
mov    %esi,0x30(%rsp)
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%r14d
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%r15d
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%r12d
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%r13d
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%ebx
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x44(%rsp),%esi
test   %esi,%esi
jle    136f <main+0x23f>
lea    0x4(%rsp),%rax
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    0x20(%rsp),%ecx
mov    %ecx,0x20(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    %ebx,(%rsp)
cmp    $0x1,%esi
je     1333 <main+0x203>
lea    -0x1(%rsi),%edx
add    $0xfffffffe,%esi
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x3,%esi
jb     12fd <main+0x1cd>
and    $0xfffffffc,%edx
nop
mov    0x24(%rsp),%esi
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    0x20(%rsp),%edi
mov    %edi,0x20(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    %esi,(%rsp)
mov    0x24(%rsp),%esi
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    0x20(%rsp),%edi
mov    %edi,0x20(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    %esi,(%rsp)
mov    0x24(%rsp),%esi
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    0x20(%rsp),%edi
mov    %edi,0x20(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    %esi,(%rsp)
mov    0x24(%rsp),%ebx
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    0x20(%rsp),%esi
mov    %esi,0x20(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    %ebx,(%rsp)
add    $0xfffffffc,%edx
jne    1280 <main+0x150>
test   %ecx,%ecx
je     1333 <main+0x203>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x24(%rsp),%ebx
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
mov    0x20(%rsp),%edx
mov    %edx,0x20(%rax)
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
mov    %ebx,(%rsp)
add    $0xffffffff,%ecx
jne    1310 <main+0x1e0>
mov    %ebx,%esi
mov    0x4(%rsp),%eax
mov    %eax,0x3c(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x38(%rsp)
mov    0xc(%rsp),%eax
mov    %eax,0x34(%rsp)
mov    0x10(%rsp),%eax
mov    %eax,0x30(%rsp)
mov    0x14(%rsp),%r14d
mov    0x18(%rsp),%r15d
mov    0x1c(%rsp),%r12d
mov    0x20(%rsp),%r13d
mov    0x24(%rsp),%ebx
jmp    1373 <main+0x243>
mov    0x40(%rsp),%esi
lea    0xcb1(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x3c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x38(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x34(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    0x30(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [10 x i32]* %2 to i8*
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %4
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %21
12: ; preds = %9
%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 ([4 x i8], [4 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 %9
21: ; preds = %9
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %23
23: ; preds = %48, %21
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %51
27: ; preds = %23
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%29 = load i32, i32* %28
store i32 %29, i32* %3
store i32 9, i32* %4
br label %30
30: ; preds = %42, %27
%31 = load i32, i32* %4
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %45
33: ; preds = %30
%34 = load i32, i32* %4
%35 = sub nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %40
store i32 %38, i32* %41
br label %42
42: ; preds = %33
%43 = load i32, i32* %4
%44 = add nsw i32 %43, -1
store i32 %44, i32* %4
br label %30
45: ; preds = %30
%46 = load i32, i32* %3
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %46, i32* %47
br label %48
48: ; preds = %45
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %23
51: ; preds = %23
store i32 0, i32* %4
br label %52
52: ; preds = %61, %51
%53 = load i32, i32* %4
%54 = icmp slt i32 %53, 10
br i1 %54, label %55, label %64
55: ; preds = %52
%56 = load i32, i32* %4
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %55
%62 = load i32, i32* %4
%63 = add nsw i32 %62, 1
store i32 %63, i32* %4
br label %52
64: ; preds = %52
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = call i32 @putchar(i32 10)
%37 = load i32, i32* %2
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %68
39: ; preds = %0
%40 = bitcast i32* %9 to i8*
store i32 %34, i32* %6
%41 = icmp eq i32 %37, 1
br i1 %41, label %57, label %42
42: ; preds = %39
%43 = add i32 %37, -1
%44 = add i32 %37, -2
%45 = and i32 %43, 3
%46 = icmp ult i32 %44, 3
br i1 %46, label %49, label %47
47: ; preds = %42
%48 = and i32 %43, -4
br label %90
49: ; preds = %90, %42
%50 = phi i32 [ undef, %42 ], [ %95, %90 ]
%51 = icmp eq i32 %45, 0
br i1 %51, label %57, label %52
52: ; preds = %49, %52
%53 = phi i32 [ %55, %52 ], [ 0, %49 ]
%54 = load i32, i32* %33
store i32 %54, i32* %6
%55 = add i32 %53, 1
%56 = icmp eq i32 %55, %45
br i1 %56, label %57, label %52
57: ; preds = %49, %52, %39
%58 = phi i32 [ %34, %39 ], [ %50, %49 ], [ %54, %52 ]
%59 = load i32, i32* %9
%60 = load i32, i32* %12
%61 = load i32, i32* %15
%62 = load i32, i32* %18
%63 = load i32, i32* %21
%64 = load i32, i32* %24
%65 = load i32, i32* %27
%66 = load i32, i32* %30
%67 = load i32, i32* %33
br label %68
68: ; preds = %0, %57
%69 = phi i32 [ %67, %57 ], [ %34, %0 ]
%70 = phi i32 [ %66, %57 ], [ %31, %0 ]
%71 = phi i32 [ %65, %57 ], [ %28, %0 ]
%72 = phi i32 [ %64, %57 ], [ %25, %0 ]
%73 = phi i32 [ %63, %57 ], [ %22, %0 ]
%74 = phi i32 [ %62, %57 ], [ %19, %0 ]
%75 = phi i32 [ %61, %57 ], [ %16, %0 ]
%76 = phi i32 [ %60, %57 ], [ %13, %0 ]
%77 = phi i32 [ %59, %57 ], [ %10, %0 ]
%78 = phi i32 [ %58, %57 ], [ %7, %0 ]
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %78)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %77)
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %76)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %75)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %74)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %73)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %72)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71)
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %70)
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%89 = call i32 @putchar(i32 10)
ret i32 0
90: ; preds = %90, %47
%91 = phi i32 [ 0, %47 ], [ %96, %90 ]
%92 = load i32, i32* %33
store i32 %92, i32* %6
%93 = load i32, i32* %33
store i32 %93, i32* %6
%94 = load i32, i32* %33
store i32 %94, i32* %6
%95 = load i32, i32* %33
store i32 %95, i32* %6
%96 = add i32 %91, 4
%97 = icmp eq i32 %96, %48
br i1 %97, label %49, label %90
}