#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 EXIT_SUCCESS;
int /*<<< orphan*/ array_rol(int *, int);
int /*<<< orphan*/ array_ror(int *, int);
int /*<<< orphan*/ init_array(int *, int);
int /*<<< orphan*/ parray(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int nums[10];
  int i;
  init_array(nums, 10);
  printf("Left roll:\n");
  for (i = 0; i <= 10; ++i) {
    printf("rolls: %2d, array: ", i);
    parray(nums, 10);
    array_rol(nums, 10);
  }
  init_array(nums, 10);
  printf("\n\nRight roll:\n");
  for (i = 0; i <= 10; ++i) {
    printf("rolls: %2d, array: ", i);
    parray(nums, 10);
    array_ror(nums, 10);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <init_array@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jg     11c7 <main+0x77>
mov    -0x34(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1070 <parray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <array_rol@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1182 <main+0x32>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <init_array@plt>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jg     122f <main+0xdf>
mov    -0x34(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1070 <parray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ea <main+0x9a>
mov    0x2daa(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <init_array@plt>
lea    0xe96(%rip),%rdi
call   1040 <puts@plt>
lea    0xe76(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %r14,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <array_rol@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <init_array@plt>
lea    0xcc1(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    %r14,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <parray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <array_ror@plt>
mov    0x2ab6(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Left roll:\0A\00"
@.str.1 = [20 x i8] c"rolls: %2d, array: \00"
@.str.2 = [15 x i8] c"\0A\0ARight roll:\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @init_array(i32* %4, i32 10)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%14 = call i32 @parray(i32* %13, i32 10)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%16 = call i32 @array_rol(i32* %15, i32 10)
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %7
20: ; preds = %7
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%22 = call i32 @init_array(i32* %21, i32 10)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %24
24: ; preds = %34, %20
%25 = load i32, i32* %3
%26 = icmp sle i32 %25, 10
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = load i32, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%31 = call i32 @parray(i32* %30, i32 10)
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%33 = call i32 @array_ror(i32* %32, i32 10)
br label %34
34: ; preds = %27
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %24
37: ; preds = %24
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"rolls: %2d, array: \00"
@EXIT_SUCCESS = global i32 0
@str = [11 x i8] c"Left roll:\00"
@str.3 = [14 x i8] c"\0A\0ARight roll:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @init_array(i32* %3, i32 10)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
%7 = call i32 @parray(i32* %3, i32 10)
%8 = call i32 @array_rol(i32* %3, i32 10)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = call i32 @parray(i32* %3, i32 10)
%11 = call i32 @array_rol(i32* %3, i32 10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2)
%13 = call i32 @parray(i32* %3, i32 10)
%14 = call i32 @array_rol(i32* %3, i32 10)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 3)
%16 = call i32 @parray(i32* %3, i32 10)
%17 = call i32 @array_rol(i32* %3, i32 10)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 4)
%19 = call i32 @parray(i32* %3, i32 10)
%20 = call i32 @array_rol(i32* %3, i32 10)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 5)
%22 = call i32 @parray(i32* %3, i32 10)
%23 = call i32 @array_rol(i32* %3, i32 10)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 6)
%25 = call i32 @parray(i32* %3, i32 10)
%26 = call i32 @array_rol(i32* %3, i32 10)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 7)
%28 = call i32 @parray(i32* %3, i32 10)
%29 = call i32 @array_rol(i32* %3, i32 10)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 8)
%31 = call i32 @parray(i32* %3, i32 10)
%32 = call i32 @array_rol(i32* %3, i32 10)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 9)
%34 = call i32 @parray(i32* %3, i32 10)
%35 = call i32 @array_rol(i32* %3, i32 10)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 10)
%37 = call i32 @parray(i32* %3, i32 10)
%38 = call i32 @array_rol(i32* %3, i32 10)
%39 = call i32 @init_array(i32* %3, i32 10)
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
%42 = call i32 @parray(i32* %3, i32 10)
%43 = call i32 @array_ror(i32* %3, i32 10)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1)
%45 = call i32 @parray(i32* %3, i32 10)
%46 = call i32 @array_ror(i32* %3, i32 10)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2)
%48 = call i32 @parray(i32* %3, i32 10)
%49 = call i32 @array_ror(i32* %3, i32 10)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 3)
%51 = call i32 @parray(i32* %3, i32 10)
%52 = call i32 @array_ror(i32* %3, i32 10)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 4)
%54 = call i32 @parray(i32* %3, i32 10)
%55 = call i32 @array_ror(i32* %3, i32 10)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 5)
%57 = call i32 @parray(i32* %3, i32 10)
%58 = call i32 @array_ror(i32* %3, i32 10)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 6)
%60 = call i32 @parray(i32* %3, i32 10)
%61 = call i32 @array_ror(i32* %3, i32 10)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 7)
%63 = call i32 @parray(i32* %3, i32 10)
%64 = call i32 @array_ror(i32* %3, i32 10)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 8)
%66 = call i32 @parray(i32* %3, i32 10)
%67 = call i32 @array_ror(i32* %3, i32 10)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 9)
%69 = call i32 @parray(i32* %3, i32 10)
%70 = call i32 @array_ror(i32* %3, i32 10)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 10)
%72 = call i32 @parray(i32* %3, i32 10)
%73 = call i32 @array_ror(i32* %3, i32 10)
%74 = load i32, i32* @EXIT_SUCCESS
ret i32 %74
}