#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ muntrace();
int main(int argc, char *argv[]) {
  int i;
  mtrace();
  for (i = 0; i < 10; i++) {
    malloc(100);
  }
  muntrace();
  malloc(4);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <mtrace@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1186 <main+0x46>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1030 <muntrace@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <mtrace@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    $0x64,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
call   1030 <muntrace@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @mtrace()
store i32 0, i32* %6
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32 @malloc(i32 100)
br label %13
13: ; preds = %11
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %8
16: ; preds = %8
%17 = call i32 (...) @muntrace()
%18 = call i32 @malloc(i32 4)
%19 = load i32, i32* @EXIT_SUCCESS
%20 = call i32 @exit(i32 %19)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mtrace()
%4 = tail call i32 @malloc(i32 100)
%5 = tail call i32 @malloc(i32 100)
%6 = tail call i32 @malloc(i32 100)
%7 = tail call i32 @malloc(i32 100)
%8 = tail call i32 @malloc(i32 100)
%9 = tail call i32 @malloc(i32 100)
%10 = tail call i32 @malloc(i32 100)
%11 = tail call i32 @malloc(i32 100)
%12 = tail call i32 @malloc(i32 100)
%13 = tail call i32 @malloc(i32 100)
%14 = tail call i32 (...) @muntrace()
%15 = tail call i32 @malloc(i32 4)
%16 = load i32, i32* @EXIT_SUCCESS
%17 = tail call i32 @exit(i32 %16)
unreachable
}