#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 */
struct fila {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ desenfileirar(struct fila **, struct fila **);
int /*<<< orphan*/ enfileirar(struct fila **, struct fila **, int);
int /*<<< orphan*/ imprime(struct fila **);
int /*<<< orphan*/ printf(char *, struct fila *);
int main() {
  int i;
  struct fila *inicio = NULL;
  struct fila *fim = NULL;
  for (i = 0; i < 2; i++) {
    enfileirar(&inicio, &fim, i);
  }
  printf("%p\n", inicio);
  printf("%p\n", fim);
  imprime(&inicio);
  desenfileirar(&inicio, &fim);
  printf("%p\n", inicio);
  printf("%p\n", fim);
  imprime(&inicio);
  desenfileirar(&inicio, &fim);
  printf("%p\n", inicio);
  printf("%p\n", fim);
  imprime(&inicio);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    118e <main+0x4e>
mov    -0x8(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <enfileirar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x26>
mov    -0x10(%rbp),%rsi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <imprime@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <desenfileirar@plt>
mov    -0x10(%rbp),%rsi
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe21(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <imprime@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <desenfileirar@plt>
mov    -0x10(%rbp),%rsi
lea    0xdfb(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xdeb(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <imprime@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x8(%rsp),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <enfileirar@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <enfileirar@plt>
mov    0x8(%rsp),%rsi
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1050 <imprime@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <desenfileirar@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1050 <imprime@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <desenfileirar@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1050 <imprime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.fila = type { i32 }
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.fila*
%4 = alloca %struct.fila*
store i32 0, i32* %1
store %struct.fila* null, %struct.fila** %3
store %struct.fila* null, %struct.fila** %4
store i32 0, i32* %2
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @enfileirar(%struct.fila** %3, %struct.fila** %4, i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = load %struct.fila*, %struct.fila** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %15)
%17 = load %struct.fila*, %struct.fila** %4
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %17)
%19 = call i32 @imprime(%struct.fila** %3)
%20 = call i32 @desenfileirar(%struct.fila** %3, %struct.fila** %4)
%21 = load %struct.fila*, %struct.fila** %3
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %21)
%23 = load %struct.fila*, %struct.fila** %4
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %23)
%25 = call i32 @imprime(%struct.fila** %3)
%26 = call i32 @desenfileirar(%struct.fila** %3, %struct.fila** %4)
%27 = load %struct.fila*, %struct.fila** %3
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %27)
%29 = load %struct.fila*, %struct.fila** %4
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %29)
%31 = call i32 @imprime(%struct.fila** %3)
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
%struct.fila = type { i32 }
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca %struct.fila*
%2 = alloca %struct.fila*
%3 = bitcast %struct.fila** %1 to i8*
store %struct.fila* null, %struct.fila** %1
%4 = bitcast %struct.fila** %2 to i8*
store %struct.fila* null, %struct.fila** %2
%5 = call i32 @enfileirar(%struct.fila** %1, %struct.fila** %2, i32 0)
%6 = call i32 @enfileirar(%struct.fila** %1, %struct.fila** %2, i32 1)
%7 = load %struct.fila*, %struct.fila** %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %7)
%9 = load %struct.fila*, %struct.fila** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %9)
%11 = call i32 @imprime(%struct.fila** %1)
%12 = call i32 @desenfileirar(%struct.fila** %1, %struct.fila** %2)
%13 = load %struct.fila*, %struct.fila** %1
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %13)
%15 = load %struct.fila*, %struct.fila** %2
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %15)
%17 = call i32 @imprime(%struct.fila** %1)
%18 = call i32 @desenfileirar(%struct.fila** %1, %struct.fila** %2)
%19 = load %struct.fila*, %struct.fila** %1
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %19)
%21 = load %struct.fila*, %struct.fila** %2
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.fila* %21)
%23 = call i32 @imprime(%struct.fila** %1)
ret i32 0
}