#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);
void printPartition(int *arr, int length) {
  int ind;
  for (ind = 0; ind < length; ind++) {
    if ((arr[ind] % 2) == 0) {
      return;
    }
  }
  for (ind = 0; ind < length - 1; ind++) {
    printf("%d + ", arr[ind]);
  }
  printf("%d\n", arr[length - 1]);
}


x86 assembly (clang, -O0):
<printPartition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <printPartition+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <printPartition+0x43>
jmp    11bf <printPartition+0xaf>
jmp    1158 <printPartition+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printPartition+0x16>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11a3 <printPartition+0x93>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116d <printPartition+0x5d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPartition>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    1176 <printPartition+0x66>
mov    %esi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testb  $0x1,(%rbx,%rcx,4)
je     1196 <printPartition+0x86>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1130 <printPartition+0x20>
lea    -0x1(%rsi),%r15d
cmp    $0x2,%esi
jl     117c <printPartition+0x6c>
mov    %r15d,%r12d
xor    %ebp,%ebp
lea    0xeac(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx,%rbp,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1160 <printPartition+0x50>
jmp    117c <printPartition+0x6c>
add    $0xffffffff,%esi
mov    %esi,%r15d
movslq %r15d,%rax
mov    (%rbx,%rax,4),%esi
lea    0xe7d(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d + \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @printPartition(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = add i32 %1, -1
br label %29
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %15
8: ; preds = %15
%9 = icmp eq i64 %21, %7
br i1 %9, label %10, label %15
10: ; preds = %8
%11 = add i32 %1, -1
%12 = icmp sgt i32 %1, 1
br i1 %12, label %13, label %29
13: ; preds = %10
%14 = zext i32 %11 to i64
br label %22
15: ; preds = %6, %8
%16 = phi i64 [ 0, %6 ], [ %21, %8 ]
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = and i32 %18, 1
%20 = icmp eq i32 %19, 0
%21 = add nuw nsw i64 %16, 1
br i1 %20, label %35, label %8
22: ; preds = %13, %22
%23 = phi i64 [ 0, %13 ], [ %27, %22 ]
%24 = getelementptr inbounds i32, i32* %0, i64 %23
%25 = load i32, i32* %24
%26 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = add nuw nsw i64 %23, 1
%28 = icmp eq i64 %27, %14
br i1 %28, label %29, label %22
29: ; preds = %22, %4, %10
%30 = phi i32 [ %5, %4 ], [ %11, %10 ], [ %11, %22 ]
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %0, i64 %31
%33 = load i32, i32* %32
%34 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %15, %29
ret void
}