#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*/ c_start();
int /*<<< orphan*/ c_stop();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ qfits_memory_status();
int /*<<< orphan*/ stress1();
int /*<<< orphan*/ stress2();
int main(void) {
  printf("Allocating/deallocating %d pointers\n", 100);
  c_start();
  stress1();
  c_stop();
  printf("Allocating/deallocating 1 pointer %d times\n", 100);
  c_start();
  stress2();
  c_stop();
  qfits_memory_status();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <c_start@plt>
mov    $0x0,%al
call   1080 <stress1@plt>
mov    $0x0,%al
call   1060 <c_stop@plt>
lea    0xe89(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <c_start@plt>
mov    $0x0,%al
call   1050 <stress2@plt>
mov    $0x0,%al
call   1060 <c_stop@plt>
mov    $0x0,%al
call   1040 <qfits_memory_status@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1070 <c_start@plt>
xor    %eax,%eax
call   1080 <stress1@plt>
xor    %eax,%eax
call   1060 <c_stop@plt>
lea    0xe97(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1070 <c_start@plt>
xor    %eax,%eax
call   1050 <stress2@plt>
xor    %eax,%eax
call   1060 <c_stop@plt>
xor    %eax,%eax
call   1040 <qfits_memory_status@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Allocating/deallocating %d pointers\0A\00"
@.str.1 = [44 x i8] c"Allocating/deallocating 1 pointer %d times\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 100)
%3 = call i32 (...) @c_start()
%4 = call i32 (...) @stress1()
%5 = call i32 (...) @c_stop()
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 100)
%7 = call i32 (...) @c_start()
%8 = call i32 (...) @stress2()
%9 = call i32 (...) @c_stop()
%10 = call i32 (...) @qfits_memory_status()
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Allocating/deallocating %d pointers\0A\00"
@.str.1 = [44 x i8] c"Allocating/deallocating 1 pointer %d times\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 100)
%2 = tail call i32 (...) @c_start()
%3 = tail call i32 (...) @stress1()
%4 = tail call i32 (...) @c_stop()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 100)
%6 = tail call i32 (...) @c_start()
%7 = tail call i32 (...) @stress2()
%8 = tail call i32 (...) @c_stop()
%9 = tail call i32 (...) @qfits_memory_status()
ret i32 0
}