#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*/ free(char *);
char *malloc(int);
int main(void) {
  char *big;
  char *a0 = malloc(10);
  char *a1 = malloc(10);
  char *a2 = malloc(10);
  char *a3 = malloc(10);
  char *a4 = malloc(10);
  char *a5 = malloc(10);
  char *a6 = malloc(10);
  char *a7 = malloc(10);
  char *a8 = malloc(10);
  char *a9 = malloc(10);
  free(a0);
  free(a1);
  free(a2);
  free(a3);
  free(a4);
  free(a5);
  free(a6);
  free(a7);
  free(a8);
  free(a9);
  big = malloc(1000);
  free(big);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    $0x3e8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%r12
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%r13
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0x3e8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 0, i32* %1
%13 = call i8* @malloc(i32 10)
store i8* %13, i8** %3
%14 = call i8* @malloc(i32 10)
store i8* %14, i8** %4
%15 = call i8* @malloc(i32 10)
store i8* %15, i8** %5
%16 = call i8* @malloc(i32 10)
store i8* %16, i8** %6
%17 = call i8* @malloc(i32 10)
store i8* %17, i8** %7
%18 = call i8* @malloc(i32 10)
store i8* %18, i8** %8
%19 = call i8* @malloc(i32 10)
store i8* %19, i8** %9
%20 = call i8* @malloc(i32 10)
store i8* %20, i8** %10
%21 = call i8* @malloc(i32 10)
store i8* %21, i8** %11
%22 = call i8* @malloc(i32 10)
store i8* %22, i8** %12
%23 = load i8*, i8** %3
%24 = call i32 @free(i8* %23)
%25 = load i8*, i8** %4
%26 = call i32 @free(i8* %25)
%27 = load i8*, i8** %5
%28 = call i32 @free(i8* %27)
%29 = load i8*, i8** %6
%30 = call i32 @free(i8* %29)
%31 = load i8*, i8** %7
%32 = call i32 @free(i8* %31)
%33 = load i8*, i8** %8
%34 = call i32 @free(i8* %33)
%35 = load i8*, i8** %9
%36 = call i32 @free(i8* %35)
%37 = load i8*, i8** %10
%38 = call i32 @free(i8* %37)
%39 = load i8*, i8** %11
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %12
%42 = call i32 @free(i8* %41)
%43 = call i8* @malloc(i32 1000)
store i8* %43, i8** %2
%44 = load i8*, i8** %2
%45 = call i32 @free(i8* %44)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%4 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%5 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%6 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%7 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%8 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%9 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%10 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%11 = tail call i32 @free(i8* %1)
%12 = tail call i32 @free(i8* %2)
%13 = tail call i32 @free(i8* %3)
%14 = tail call i32 @free(i8* %4)
%15 = tail call i32 @free(i8* %5)
%16 = tail call i32 @free(i8* %6)
%17 = tail call i32 @free(i8* %7)
%18 = tail call i32 @free(i8* %8)
%19 = tail call i32 @free(i8* %9)
%20 = tail call i32 @free(i8* %10)
%21 = tail call dereferenceable_or_null(1000) i8* @malloc(i32 1000)
%22 = tail call i32 @free(i8* %21)
ret i32 0
}