#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 mostroca(int v[5000], int tam, int i, int j, int s) {
  for (int x = 0; x < tam; x++) {
    if (x == i)
      printf("\x1b[32m"
             "%d "
             "\x1b[0m",
             v[x]);
    else if (x == j)
      printf("\x1b[36m"
             "%d "
             "\x1b[0m",
             v[x]);
    else if (x == s)
      printf("\x1b[33m"
             "%d "
             "\x1b[0m",
             v[x]);
    else
      printf("%d ", v[x]);
  }
  printf(" \n");
}


x86 assembly (clang, -O0):
<mostroca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f0 <mostroca+0xe0>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1166 <mostroca+0x56>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <mostroca+0xcd>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1190 <mostroca+0x80>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <mostroca+0xc8>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11ba <mostroca+0xaa>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <mostroca+0xc3>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <mostroca+0xc8>
jmp    11dd <mostroca+0xcd>
jmp    11e2 <mostroca+0xd2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1130 <mostroca+0x20>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostroca>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,0x8(%rsp)
test   %esi,%esi
jle    11e2 <mostroca+0xc2>
mov    %r8d,%edi
mov    %ecx,%r12d
mov    %edx,%ebx
mov    %esi,%r13d
mov    0x8(%rsp),%rax
lea    (%rax,%rdi,4),%rcx
mov    %rcx,0x10(%rsp)
lea    (%rax,%r12,4),%rcx
mov    %rcx,0x20(%rsp)
lea    (%rax,%rbx,4),%rbp
shl    $0x2,%rbx
shl    $0x2,%r12
shl    $0x2,%rdi
mov    %rdi,0x18(%rsp)
shl    $0x2,%r13
lea    0xe83(%rip),%r15
xor    %r14d,%r14d
jmp    11a2 <mostroca+0x82>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rax),%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%r14
cmp    %r14,%r13
je     11e2 <mostroca+0xc2>
mov    %rbp,%rax
mov    %r15,%rdi
cmp    %r14,%rbx
je     1190 <mostroca+0x70>
mov    0x20(%rsp),%rax
lea    0xe54(%rip),%rdi
cmp    %r14,%r12
je     1190 <mostroca+0x70>
mov    0x10(%rsp),%rax
lea    0xe50(%rip),%rdi
cmp    %r14,0x18(%rsp)
je     1190 <mostroca+0x70>
mov    0x8(%rsp),%rax
add    %r14,%rax
lea    0xe47(%rip),%rdi
jmp    1190 <mostroca+0x70>
lea    0xe40(%rip),%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

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

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