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

/* Variables and functions */
int /*<<< orphan*/ deleta(struct pilha **, int);
int /*<<< orphan*/ empilha(struct pilha **, int);
int /*<<< orphan*/ imprime(struct pilha **);
int main() {
  int i;
  struct pilha *topo = NULL;
  for (i = 0; i < 25; i++) {
    empilha(&topo, i);
  }
  imprime(&topo);
  deleta(&topo, 18);
  imprime(&topo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jge    1172 <main+0x42>
mov    -0x8(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1030 <empilha@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x1e>
lea    -0x10(%rbp),%rdi
call   1040 <imprime@plt>
lea    -0x10(%rbp),%rdi
mov    $0x12,%esi
call   1050 <deleta@plt>
lea    -0x10(%rbp),%rdi
call   1040 <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
xor    %esi,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x15,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
mov    $0x18,%esi
call   1030 <empilha@plt>
mov    %rbx,%rdi
call   1040 <imprime@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
call   1050 <deleta@plt>
mov    %rbx,%rdi
call   1040 <imprime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.pilha = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.pilha*
store i32 0, i32* %1
store %struct.pilha* null, %struct.pilha** %3
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 25
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @empilha(%struct.pilha** %3, i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = call i32 @imprime(%struct.pilha** %3)
%15 = call i32 @deleta(%struct.pilha** %3, i32 18)
%16 = call i32 @imprime(%struct.pilha** %3)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
%struct.pilha = type { i32 }
define i32 @main() {
%1 = alloca %struct.pilha*
%2 = bitcast %struct.pilha** %1 to i8*
store %struct.pilha* null, %struct.pilha** %1
%3 = call i32 @empilha(%struct.pilha** %1, i32 0)
%4 = call i32 @empilha(%struct.pilha** %1, i32 1)
%5 = call i32 @empilha(%struct.pilha** %1, i32 2)
%6 = call i32 @empilha(%struct.pilha** %1, i32 3)
%7 = call i32 @empilha(%struct.pilha** %1, i32 4)
%8 = call i32 @empilha(%struct.pilha** %1, i32 5)
%9 = call i32 @empilha(%struct.pilha** %1, i32 6)
%10 = call i32 @empilha(%struct.pilha** %1, i32 7)
%11 = call i32 @empilha(%struct.pilha** %1, i32 8)
%12 = call i32 @empilha(%struct.pilha** %1, i32 9)
%13 = call i32 @empilha(%struct.pilha** %1, i32 10)
%14 = call i32 @empilha(%struct.pilha** %1, i32 11)
%15 = call i32 @empilha(%struct.pilha** %1, i32 12)
%16 = call i32 @empilha(%struct.pilha** %1, i32 13)
%17 = call i32 @empilha(%struct.pilha** %1, i32 14)
%18 = call i32 @empilha(%struct.pilha** %1, i32 15)
%19 = call i32 @empilha(%struct.pilha** %1, i32 16)
%20 = call i32 @empilha(%struct.pilha** %1, i32 17)
%21 = call i32 @empilha(%struct.pilha** %1, i32 18)
%22 = call i32 @empilha(%struct.pilha** %1, i32 19)
%23 = call i32 @empilha(%struct.pilha** %1, i32 20)
%24 = call i32 @empilha(%struct.pilha** %1, i32 21)
%25 = call i32 @empilha(%struct.pilha** %1, i32 22)
%26 = call i32 @empilha(%struct.pilha** %1, i32 23)
%27 = call i32 @empilha(%struct.pilha** %1, i32 24)
%28 = call i32 @imprime(%struct.pilha** %1)
%29 = call i32 @deleta(%struct.pilha** %1, i32 18)
%30 = call i32 @imprime(%struct.pilha** %1)
ret i32 0
}