#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 header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ criaHeader(struct header **);
int /*<<< orphan*/ imprime(struct header **);
int /*<<< orphan*/ insereEsquerda(struct header **, int);
int main() {
  int i;
  struct header *header = NULL;
  criaHeader(&header);
  for (i = 0; i < 10; i++) {
    insereEsquerda(&header, i);
  }
  imprime(&header);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <criaHeader@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    117b <main+0x4b>
mov    -0x8(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1040 <insereEsquerda@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <main+0x27>
lea    -0x10(%rbp),%rdi
call   1050 <imprime@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <criaHeader@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <insereEsquerda@plt>
mov    %rbx,%rdi
call   1050 <imprime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.header = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.header*
store i32 0, i32* %1
store %struct.header* null, %struct.header** %3
%4 = call i32 @criaHeader(%struct.header** %3)
store i32 0, i32* %2
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 @insereEsquerda(%struct.header** %3, 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 = call i32 @imprime(%struct.header** %3)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
%struct.header = type { i32 }
define i32 @main() {
%1 = alloca %struct.header*
%2 = bitcast %struct.header** %1 to i8*
store %struct.header* null, %struct.header** %1
%3 = call i32 @criaHeader(%struct.header** %1)
%4 = call i32 @insereEsquerda(%struct.header** %1, i32 0)
%5 = call i32 @insereEsquerda(%struct.header** %1, i32 1)
%6 = call i32 @insereEsquerda(%struct.header** %1, i32 2)
%7 = call i32 @insereEsquerda(%struct.header** %1, i32 3)
%8 = call i32 @insereEsquerda(%struct.header** %1, i32 4)
%9 = call i32 @insereEsquerda(%struct.header** %1, i32 5)
%10 = call i32 @insereEsquerda(%struct.header** %1, i32 6)
%11 = call i32 @insereEsquerda(%struct.header** %1, i32 7)
%12 = call i32 @insereEsquerda(%struct.header** %1, i32 8)
%13 = call i32 @insereEsquerda(%struct.header** %1, i32 9)
%14 = call i32 @imprime(%struct.header** %1)
ret i32 0
}