#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 exibe(int *v) {
  int soma;
  soma = 0;
  for (int i = 0; i < 20; i++) {
    soma = soma + v[i];
  }
  printf("\n\nsoma = %d\n\n", soma);
  if (soma % 2) {
    for (int i = 19; i >= 0; i--) {
      printf("\n%d", v[i]);
    }
  } else {
    for (int i = 0; i < 20; i++)
      printf("\n%d", v[i]);
  }
}


x86 assembly (clang, -O0):
<exibe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1153 <exibe+0x43>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <exibe+0x1a>
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b1 <exibe+0xa1>
movl   $0x13,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     11ac <exibe+0x9c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    117d <exibe+0x6d>
jmp    11ec <exibe+0xdc>
movl   $0x0,-0x18(%rbp)
cmpl   $0x14,-0x18(%rbp)
jge    11e7 <exibe+0xd7>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b8 <exibe+0xa8>
jmp    11ec <exibe+0xdc>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exibe>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%r13
lea    0x10(%rdi),%r10
mov    %r10,0x8(%rsp)
lea    0x30(%rdi),%r9
movdqu 0x40(%rdi),%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
movdqu 0x20(%rdi),%xmm3
paddd  %xmm0,%xmm3
movdqu 0x30(%rdi),%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm3,%xmm0
pshufd $0xee,%xmm0,%xmm2
paddd  %xmm0,%xmm2
pshufd $0x55,%xmm2,%xmm0
paddd  %xmm2,%xmm0
movd   %xmm0,%ecx
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%r11d
add    %ecx,%r11d
mov    %r11d,%ecx
and    $0x1,%ecx
lea    0x1c(%rdi),%rsi
mov    %rsi,0x20(%rsp)
lea    0x18(%rdi),%rax
mov    %rax,0x18(%rsp)
lea    0x34(%rdi),%rbx
add    $0x14,%rdi
mov    %rdi,0x10(%rsp)
lea    0x38(%r13),%r8
test   %ecx,%ecx
mov    %rcx,%r14
mov    %rcx,0x40(%rsp)
mov    %rsi,%rcx
cmove  %r9,%rcx
mov    %rcx,0x50(%rsp)
cmove  %rbx,%rax
mov    %rax,0x58(%rsp)
mov    %rdi,%rax
cmove  %r8,%rax
mov    %rax,0x60(%rsp)
lea    0x3c(%r13),%rsi
mov    %r10,%rax
cmove  %rsi,%rax
mov    %rax,0x68(%rsp)
lea    0x40(%r13),%rax
lea    0xc(%r13),%r10
mov    %r10,%rcx
cmove  %rax,%rcx
mov    %rcx,0x70(%rsp)
lea    0x8(%r13),%rcx
lea    0x44(%r13),%r15
mov    %rcx,%rdx
cmove  %r15,%rdx
mov    %rdx,0x78(%rsp)
lea    0x4(%r13),%rdi
lea    0x48(%r13),%r12
mov    %rdi,%rdx
cmove  %r12,%rdx
mov    %rdx,0x80(%rsp)
lea    0x4c(%r13),%rbp
mov    %r13,%rdx
cmove  %rbp,%rdx
mov    %rdx,0x48(%rsp)
xor    %edx,%edx
test   %r14d,%r14d
cmove  %rdi,%r12
cmove  %rcx,%r15
cmove  %r10,%rax
mov    %rax,0x28(%rsp)
cmove  0x8(%rsp),%rsi
mov    %rsi,0x30(%rsp)
cmove  0x10(%rsp),%r8
mov    %r8,0x38(%rsp)
cmove  0x18(%rsp),%rbx
cmove  0x20(%rsp),%r9
mov    %r9,0x8(%rsp)
lea    0x20(%r13),%rcx
lea    0x2c(%r13),%rax
mov    %rax,%rsi
cmove  %rcx,%rsi
mov    %rsi,0x10(%rsp)
cmove  %rax,%rcx
mov    %rcx,0x20(%rsp)
sete   %dl
mov    %rdx,0x18(%rsp)
cmove  %r13,%rbp
lea    0xd5b(%rip),%rdi
mov    %r11d,%esi
call   1030 <printf@plt>
mov    0x0(%rbp),%esi
lea    0xd57(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r12),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r15),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x38(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x40(%rsp),%rax
mov    0x24(%r13,%rax,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rax
mov    0x24(%r13,%rax,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x50(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x58(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x60(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x68(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x70(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x78(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x80(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x48(%rsp),%rax
mov    (%rax),%esi
mov    %r14,%rdi
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

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

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