#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 *, ...);
void printCode(int *arr) {
  int temp[10];
  int min_index = 0;
  for (int i = 2; i < 10; i += 2) {
    if (arr[i] < arr[min_index]) {
      min_index = i;
    }
  }
  for (int i = 0; i < 10; i++) {
    temp[i] = arr[(i + min_index) % 10];
  }
  for (int i = 0; i < 10; i += 2) {
    printf("%d", temp[i]);
    printf("%d", temp[(i + 1) % 10]);
    printf("%d", temp[(i + 3) % 10]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1169 <printCode+0x59>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x34(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1156 <printCode+0x46>
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    115b <printCode+0x4b>
mov    -0x38(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x38(%rbp)
jmp    112a <printCode+0x1a>
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11b0 <printCode+0xa0>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x34(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x48(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x3c(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1170 <printCode+0x60>
movl   $0x0,-0x40(%rbp)
cmpl   $0xa,-0x40(%rbp)
jge    122b <printCode+0x11b>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%eax
add    $0x3,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x40(%rbp)
jmp    11b7 <printCode+0xa7>
lea    0xdd1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x8(%rdi),%eax
mov    0x10(%rdi),%ecx
xor    %edx,%edx
cmp    (%rdi),%eax
setl   %dl
add    %edx,%edx
cmp    (%rdi,%rdx,4),%ecx
mov    $0x4,%eax
cmovge %edx,%eax
mov    0x18(%rdi),%ecx
cmp    (%rdi,%rax,4),%ecx
mov    $0x6,%ecx
cmovge %eax,%ecx
mov    0x20(%rdi),%eax
cmp    (%rdi,%rcx,4),%eax
mov    $0x8,%eax
cmovge %ecx,%eax
mov    (%rdi,%rax,4),%esi
lea    0x1(%rax),%ecx
mov    $0xcccccccd,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%ecx
neg    %ecx
add    %eax,%ecx
add    $0x1,%ecx
mov    (%rdi,%rcx,4),%r15d
lea    0x2(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%ecx
mov    %ecx,0x14(%rsp)
lea    0x3(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%ebp
lea    0x4(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%ecx
mov    %ecx,0x10(%rsp)
lea    0x5(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%ebx
lea    0x6(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%ecx
mov    %ecx,0xc(%rsp)
lea    0x7(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%r14d
lea    0x8(%rax),%ecx
movzbl %cl,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xa,%edx
and    $0xfffffffe,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
mov    (%rdi,%rcx,4),%ecx
mov    %ecx,0x8(%rsp)
add    $0x9,%al
movzbl %al,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
movzbl %al,%eax
mov    (%rdi,%rax,4),%r13d
lea    0xd79(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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