#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(int vet[10], int *ini, int *num) {
  int i;
  if (*num == 0) {
    printf("\n\a\tA fila esta vazia!\n");
    return;
  }
  printf("\n\tFila:");
  for (i = 0; i < *num; ++i)
    printf("  %d", vet[(*ini + i < 10) ? *ini + i : *ini + i - 10]);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<imprimir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1144 <imprimir+0x34>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d9 <imprimir+0xc9>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    11cb <imprimir+0xbb>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x1c(%rbp),%eax
cmp    $0xa,%eax
jge    1193 <imprimir+0x83>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11a2 <imprimir+0x92>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    -0x1c(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1159 <imprimir+0x49>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmpl   $0x0,(%rdx)
je     11ac <imprimir+0x7c>
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x0(%r13)
jle    1199 <imprimir+0x69>
lea    0xea5(%rip),%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14),%eax
lea    (%rbx,%rax,1),%ecx
cmp    $0xa,%ecx
lea    -0xa(%rbx,%rax,1),%eax
cmovl  %ecx,%eax
cltq
mov    (%r15,%rax,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    0x0(%r13),%ebx
jl     1170 <imprimir+0x40>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>
lea    0xe5a(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

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

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