#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 imprimir_vetor(int p, int q, int r, int n, int *v) {
  printf("[ ");
  for (int i = 0; i < n; i++) {
    if (i == p || i == q || i == r)
      printf("| ");
    printf("%d ", v[i]);
  }
  printf("]\n");
}


x86 assembly (clang, -O0):
<imprimir_vetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a2 <imprimir_vetor+0x92>
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     116d <imprimir_vetor+0x5d>
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     116d <imprimir_vetor+0x5d>
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    117b <imprimir_vetor+0x6b>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <imprimir_vetor+0x2d>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_vetor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %edx,%r12d
mov    %esi,%r15d
mov    %edi,%r13d
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    119a <imprimir_vetor+0x7a>
mov    %r12d,%ebp
mov    %r15d,%r12d
mov    %r13d,%r13d
mov    %r14d,%r14d
xor    %r15d,%r15d
jmp    1189 <imprimir_vetor+0x69>
xchg   %ax,%ax
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r15,4),%esi
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r14
je     119a <imprimir_vetor+0x7a>
cmp    %r15,%rbp
je     1160 <imprimir_vetor+0x40>
cmp    %r15,%r13
je     1160 <imprimir_vetor+0x40>
cmp    %r15,%r12
jne    116e <imprimir_vetor+0x4e>
jmp    1160 <imprimir_vetor+0x40>
lea    0xe69(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"[ \00"
@.str.1 = [3 x i8] c"| \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [3 x i8] c"]\0A\00"
define void @imprimir_vetor(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
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %13
13: ; preds = %38, %5
%14 = load i32, i32* %11
%15 = load i32, i32* %9
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %41
17: ; preds = %13
%18 = load i32, i32* %11
%19 = load i32, i32* %6
%20 = icmp eq i32 %18, %19
br i1 %20, label %29, label %21
21: ; preds = %17
%22 = load i32, i32* %11
%23 = load i32, i32* %7
%24 = icmp eq i32 %22, %23
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i32, i32* %11
%27 = load i32, i32* %8
%28 = icmp eq i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %25, %21, %17
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
%32 = load i32*, i32** %10
%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 ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %31
%39 = load i32, i32* %11
%40 = add nsw i32 %39, 1
store i32 %40, i32* %11
br label %13
41: ; preds = %13
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

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