#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 *, ...);
mostrad(int *seq, int destaque, int tam) {
  for (int x = 0; x < tam; x++) {
    if (x == destaque)
      printf("\x1b[31m"
             "%d "
             "\x1b[0m",
             seq[x]);
    else
      printf("%d ", seq[x]);
  }
  printf("\n");
  if (0) {
    printf("Mostrou com: dest: %d, tam: %d\n", destaque, tam);
  }
}


x86 assembly (clang, -O0):
<mostrad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    118b <mostrad+0x7b>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    115f <mostrad+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1178 <mostrad+0x68>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117d <mostrad+0x6d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1129 <mostrad+0x19>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostrad>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    116e <mostrad+0x4e>
mov    %rdi,%r14
mov    %esi,%r15d
mov    %edx,%ebx
lea    0xec2(%rip),%r12
lea    0xec8(%rip),%r13
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
cmp    %rbp,%r15
mov    %r13,%rdi
cmove  %r12,%rdi
mov    (%r14,%rbp,4),%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1150 <mostrad+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"\1B[31m%d \1B[0m\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @mostrad(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = zext i32 %2 to i64
br label %10
8: ; preds = %10, %3
%9 = tail call i32 @putchar(i32 10)
ret i32 undef
10: ; preds = %5, %10
%11 = phi i64 [ 0, %5 ], [ %17, %10 ]
%12 = icmp eq i64 %11, %6
%13 = getelementptr inbounds i32, i32* %0, i64 %11
%14 = select i1 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%15 = load i32, i32* %13
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14, i32 %15)
%17 = add nuw nsw i64 %11, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %8, label %10
}