#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 pickHighest(int *);
int /*<<< orphan*/ printf(char *, int);
void processing(int a[], int length) {
  int b[3];
  int i = 0;
  int j = 0;
  for (; i < (length - 3 + 1); i++) {
    b[j++] = a[i + 0];
    b[j++] = a[i + 1];
    b[j++] = a[i + 2];
    j = 0;
    int temp = pickHighest(b);
    printf("%d\n", temp);
  }
}


x86 assembly (clang, -O0):
<processing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11e4 <processing+0xc4>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0x18(%rbp,%rax,4)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0x18(%rbp,%rax,4)
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0x18(%rbp,%rax,4)
movl   $0x0,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <pickHighest@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <processing+0x1d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processing>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
cmp    $0x3,%esi
jl     1189 <processing+0x69>
mov    %esi,%r14d
mov    %rdi,%r13
add    $0xfffffffe,%r14d
xor    %eax,%eax
lea    0x4(%rsp),%r15
lea    0xeb6(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rax,4),%ecx
mov    %ecx,0x4(%rsp)
lea    0x1(%rax),%rbx
mov    0x4(%r13,%rax,4),%ecx
mov    %ecx,0x8(%rsp)
mov    0x8(%r13,%rax,4),%eax
mov    %eax,0xc(%rsp)
mov    %r15,%rdi
call   1040 <pickHighest@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rax
cmp    %rbx,%r14
jne    1150 <processing+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @processing(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [3 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %50, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 3
%13 = add nsw i32 %12, 1
%14 = icmp slt i32 %10, %13
br i1 %14, label %15, label %53
15: ; preds = %9
%16 = load i32*, i32** %3
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 0
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %16, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
%24 = sext i32 %22 to i64
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %24
store i32 %21, i32* %25
%26 = load i32*, i32** %3
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
%34 = sext i32 %32 to i64
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %34
store i32 %31, i32* %35
%36 = load i32*, i32** %3
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %36, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 %44
store i32 %41, i32* %45
store i32 0, i32* %7
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%47 = call i32 @pickHighest(i32* %46)
store i32 %47, i32* %8
%48 = load i32, i32* %8
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %15
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %9
53: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @processing(i32* nocapture %0, i32 %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = icmp sgt i32 %1, 2
br i1 %5, label %6, label %25
6: ; preds = %2
%7 = add nsw i32 %1, -2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%11 = zext i32 %7 to i64
br label %12
12: ; preds = %6, %12
%13 = phi i64 [ 0, %6 ], [ %16, %12 ]
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = add nuw nsw i64 %13, 1
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %9
%19 = add nuw nsw i64 %13, 2
%20 = getelementptr inbounds i32, i32* %0, i64 %19
%21 = load i32, i32* %20
store i32 %21, i32* %10
%22 = call i32 @pickHighest(i32* %8)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = icmp eq i64 %16, %11
br i1 %24, label %25, label %12
25: ; preds = %12, %2
ret void
}