#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*/ f();
int /*<<< orphan*/ mem_close();
int /*<<< orphan*/ mem_init();
int /*<<< orphan*/ mem_pop_overlide();
int /*<<< orphan*/ mem_push_overlide();
int main(int argc, char **argv) {
  mem_init();
  f();
  mem_push_overlide();
  f();
  mem_push_overlide();
  f();
  mem_pop_overlide();
  f();
  mem_pop_overlide();
  f();
  mem_pop_overlide();
  f();
  mem_close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <mem_init@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1040 <mem_push_overlide@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1040 <mem_push_overlide@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1070 <mem_pop_overlide@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1070 <mem_pop_overlide@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1070 <mem_pop_overlide@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1030 <mem_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <mem_init@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1040 <mem_push_overlide@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1040 <mem_push_overlide@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1070 <mem_pop_overlide@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1070 <mem_pop_overlide@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1070 <mem_pop_overlide@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1030 <mem_close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @mem_init()
%6 = call i32 (...) @f()
%7 = call i32 (...) @mem_push_overlide()
%8 = call i32 (...) @f()
%9 = call i32 (...) @mem_push_overlide()
%10 = call i32 (...) @f()
%11 = call i32 (...) @mem_pop_overlide()
%12 = call i32 (...) @f()
%13 = call i32 (...) @mem_pop_overlide()
%14 = call i32 (...) @f()
%15 = call i32 (...) @mem_pop_overlide()
%16 = call i32 (...) @f()
%17 = call i32 (...) @mem_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mem_init()
%4 = tail call i32 (...) @f()
%5 = tail call i32 (...) @mem_push_overlide()
%6 = tail call i32 (...) @f()
%7 = tail call i32 (...) @mem_push_overlide()
%8 = tail call i32 (...) @f()
%9 = tail call i32 (...) @mem_pop_overlide()
%10 = tail call i32 (...) @f()
%11 = tail call i32 (...) @mem_pop_overlide()
%12 = tail call i32 (...) @f()
%13 = tail call i32 (...) @mem_pop_overlide()
%14 = tail call i32 (...) @f()
%15 = tail call i32 (...) @mem_close()
ret i32 0
}