#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 rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void main() {
  srand((unsigned)time(NULL));
  int array[10], second[10], i, s;
  for (i = 0; i < 10; i++)
    array[i] = rand() % 10 + 1;
  printf("the original array: ");
  for (i = 0; i < 10; i++)
    printf("%2d ", array[i]);
  printf("\nshift how many elements? ");
  scanf("%d", &s);
  if (s < 0 || s > 10)
    return;
  for (i = 10 - s; i < 10; i++)
    second[i - (10 - s)] = array[i];
  for (i = 0; i < 10 - s; i++)
    second[i + s] = array[i];
  printf("the shifted array: ");
  for (i = 0; i < 10; i++)
    printf("%2d ", second[i]);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11a1 <main+0x51>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
movslq -0x64(%rbp),%rax
mov    %edx,-0x30(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    116f <main+0x1f>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11e4 <main+0x94>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11b6 <main+0x66>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
lea    -0x68(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x68(%rbp)
jl     1216 <main+0xc6>
cmpl   $0xa,-0x68(%rbp)
jle    121b <main+0xcb>
jmp    12dd <main+0x18d>
mov    $0xa,%eax
sub    -0x68(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    1259 <main+0x109>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x64(%rbp),%eax
mov    $0xa,%edx
sub    -0x68(%rbp),%edx
sub    %edx,%eax
cltq
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1226 <main+0xd6>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    $0xa,%ecx
sub    -0x68(%rbp),%ecx
cmp    %ecx,%eax
jge    1295 <main+0x145>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0x64(%rbp),%eax
add    -0x68(%rbp),%eax
cltq
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1260 <main+0x110>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    12d8 <main+0x188>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12aa <main+0x15a>
jmp    12dd <main+0x18d>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x18(%rsp)
mov    %eax,0x50(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x14(%rsp)
mov    %eax,0x54(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x10(%rsp)
mov    %eax,0x58(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
mov    %eax,0x5c(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,0x8(%rsp)
mov    %eax,0x60(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
mov    %ebp,0x64(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r14d
add    $0x1,%r14d
mov    %r14d,0x68(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
mov    %r15d,0x6c(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r12d
add    $0x1,%r12d
mov    %r12d,0x70(%rsp)
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0x1,%r13d
mov    %r13d,0x74(%rsp)
lea    0xc78(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc7f(%rip),%rbx
mov    %rbx,%rdi
mov    0x18(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xbf7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc04(%rip),%rdi
lea    0x1c(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x1c(%rsp),%r9d
cmp    $0xa,%r9
ja     15ef <main+0x48f>
mov    $0xa,%r8d
sub    %r9,%r8
test   %r9d,%r9d
je     1528 <main+0x3c8>
cmp    $0xa,%r8d
mov    $0x9,%r10d
cmovge %r8d,%r10d
lea    (%r9,%r10,1),%ecx
add    $0x3,%ecx
lea    (%r9,%r10,1),%eax
add    $0xfffffff6,%eax
test   $0x3,%cl
je     14ac <main+0x34c>
lea    (%rsp,%r8,4),%rsi
add    $0x50,%rsi
and    $0x3,%ecx
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
mov    (%rsi,%rdi,4),%ebp
mov    %ebp,0x20(%rsp,%rdi,4)
add    $0x1,%rdi
cmp    %edi,%ecx
jne    1490 <main+0x330>
mov    %r8,%rcx
add    %rdi,%rcx
cmp    $0x3,%eax
jae    14b4 <main+0x354>
jmp    1522 <main+0x3c2>
mov    %r8,%rcx
cmp    $0x3,%eax
jb     1522 <main+0x3c2>
sub    %ecx,%r10d
add    $0x1,%r10d
lea    (%r9,%rcx,1),%r11d
add    $0xfffffff9,%r11d
lea    0x5c(%rsp,%rcx,4),%rdi
lea    (%r9,%rcx,1),%ebp
add    $0xfffffff8,%ebp
lea    (%r9,%rcx,1),%ebx
add    $0xfffffff6,%ebx
add    %r9d,%ecx
add    $0xfffffff7,%ecx
xor    %eax,%eax
xchg   %ax,%ax
mov    -0xc(%rdi,%rax,4),%edx
lea    (%rbx,%rax,1),%esi
movslq %esi,%rsi
mov    %edx,0x20(%rsp,%rsi,4)
mov    -0x8(%rdi,%rax,4),%edx
lea    (%rcx,%rax,1),%esi
movslq %esi,%rsi
mov    %edx,0x20(%rsp,%rsi,4)
mov    -0x4(%rdi,%rax,4),%edx
lea    0x0(%rbp,%rax,1),%esi
movslq %esi,%rsi
mov    %edx,0x20(%rsp,%rsi,4)
mov    (%rdi,%rax,4),%edx
lea    (%r11,%rax,1),%esi
movslq %esi,%rsi
mov    %edx,0x20(%rsp,%rsi,4)
add    $0x4,%rax
cmp    %eax,%r10d
jne    14e0 <main+0x380>
cmp    $0x9,%r9d
jg     154e <main+0x3ee>
movslq %r9d,%rax
lea    (%rsp,%rax,4),%rdi
add    $0x20,%rdi
cmp    $0x2,%r8d
mov    $0x1,%edx
cmovge %r8d,%edx
shl    $0x2,%rdx
lea    0x50(%rsp),%rsi
call   1050 <memcpy@plt>
lea    0xae3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xaae(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x40(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x44(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"the original array: \00"
@.str.1 = [5 x i8] c"%2d \00"
@.str.2 = [27 x i8] c"\0Ashift how many elements? \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [20 x i8] c"the shifted array: \00"
define void @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = tail call i64 @time(i32* null)
%6 = trunc i64 %5 to i32
%7 = tail call i32 @srand(i32 %6)
%8 = bitcast [10 x i32]* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 10
%12 = add nsw i32 %11, 1
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32 %12, i32* %13
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 10
%16 = add nsw i32 %15, 1
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
store i32 %16, i32* %17
%18 = tail call i32 (...) @rand()
%19 = srem i32 %18, 10
%20 = add nsw i32 %19, 1
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
store i32 %20, i32* %21
%22 = tail call i32 (...) @rand()
%23 = srem i32 %22, 10
%24 = add nsw i32 %23, 1
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
store i32 %24, i32* %25
%26 = tail call i32 (...) @rand()
%27 = srem i32 %26, 10
%28 = add nsw i32 %27, 1
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
store i32 %28, i32* %29
%30 = tail call i32 (...) @rand()
%31 = srem i32 %30, 10
%32 = add nsw i32 %31, 1
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32 %32, i32* %33
%34 = tail call i32 (...) @rand()
%35 = srem i32 %34, 10
%36 = add nsw i32 %35, 1
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
store i32 %36, i32* %37
%38 = tail call i32 (...) @rand()
%39 = srem i32 %38, 10
%40 = add nsw i32 %39, 1
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
store i32 %40, i32* %41
%42 = tail call i32 (...) @rand()
%43 = srem i32 %42, 10
%44 = add nsw i32 %43, 1
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 %44, i32* %45
%46 = tail call i32 (...) @rand()
%47 = srem i32 %46, 10
%48 = add nsw i32 %47, 1
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 %48, i32* %49
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%62 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%63 = load i32, i32* %4
%64 = icmp ugt i32 %63, 10
br i1 %64, label %166, label %65
65: ; preds = %0
%66 = sub nuw nsw i32 10, %63
%67 = icmp eq i32 %63, 0
br i1 %67, label %95, label %68
68: ; preds = %65
%69 = add nsw i32 %63, -10
%70 = zext i32 %66 to i64
%71 = call i32 @llvm.smax.i32(i32 %66, i32 9)
%72 = add nuw nsw i32 %71, 1
%73 = add i32 %63, %71
%74 = add i32 %73, 3
%75 = add i32 %73, -10
%76 = and i32 %74, 3
%77 = icmp eq i32 %76, 0
br i1 %77, label %90, label %78
78: ; preds = %68, %78
%79 = phi i64 [ %87, %78 ], [ %70, %68 ]
%80 = phi i32 [ %88, %78 ], [ 0, %68 ]
%81 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %79
%82 = load i32, i32* %81
%83 = trunc i64 %79 to i32
%84 = add i32 %69, %83
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %85
store i32 %82, i32* %86
%87 = add nuw nsw i64 %79, 1
%88 = add i32 %80, 1
%89 = icmp eq i32 %88, %76
br i1 %89, label %90, label %78
90: ; preds = %78, %68
%91 = phi i64 [ %70, %68 ], [ %87, %78 ]
%92 = icmp ult i32 %75, 3
br i1 %92, label %93, label %102
93: ; preds = %102, %90
%94 = icmp slt i32 %63, 10
br i1 %94, label %95, label %134
95: ; preds = %65, %93
%96 = sext i32 %63 to i64
%97 = getelementptr [10 x i32], [10 x i32]* %3, i64 0, i64 %96
%98 = bitcast i32* %97 to i8*
%99 = call i32 @llvm.smax.i32(i32 %66, i32 1)
%100 = zext i32 %99 to i64
%101 = shl nuw nsw i64 %100, 2
br label %134
102: ; preds = %90, %102
%103 = phi i64 [ %131, %102 ], [ %91, %90 ]
%104 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %103
%105 = load i32, i32* %104
%106 = trunc i64 %103 to i32
%107 = add i32 %69, %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %108
store i32 %105, i32* %109
%110 = add nuw nsw i64 %103, 1
%111 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %110
%112 = load i32, i32* %111
%113 = trunc i64 %110 to i32
%114 = add i32 %69, %113
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %115
store i32 %112, i32* %116
%117 = add nuw nsw i64 %103, 2
%118 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %117
%119 = load i32, i32* %118
%120 = trunc i64 %117 to i32
%121 = add i32 %69, %120
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %122
store i32 %119, i32* %123
%124 = add nuw nsw i64 %103, 3
%125 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = trunc i64 %124 to i32
%128 = add i32 %69, %127
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %129
store i32 %126, i32* %130
%131 = add nuw nsw i64 %103, 4
%132 = trunc i64 %131 to i32
%133 = icmp eq i32 %72, %132
br i1 %133, label %93, label %102
134: ; preds = %95, %93
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%136 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%137 = load i32, i32* %136
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %137)
%139 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%140 = load i32, i32* %139
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %140)
%142 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%143 = load i32, i32* %142
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %143)
%145 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%146 = load i32, i32* %145
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %146)
%148 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%149 = load i32, i32* %148
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %149)
%151 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%152 = load i32, i32* %151
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %152)
%154 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%155 = load i32, i32* %154
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %155)
%157 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%158 = load i32, i32* %157
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %158)
%160 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%161 = load i32, i32* %160
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %161)
%163 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
%164 = load i32, i32* %163
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %164)
br label %166
166: ; preds = %134, %0
ret void
}