#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*/ fprintf(int /*<<< orphan*/, char *, char *);
char *malloc(int);
int /*<<< orphan*/ stderr;
void recur(int depth) {
  char *arr;
  if (depth == 20)
    return;
  arr = malloc(2 * 1024 * 1024);
  arr[0] = '<';
  arr[1] = 0;
  fprintf(stderr, "%s", arr);
  recur(depth + 1);
  arr[0] = '>';
  arr[1] = 0;
  fprintf(stderr, "%s", arr);
}


x86 assembly (clang, -O0):
<recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jne    114a <recur+0x1a>
jmp    11b3 <recur+0x83>
mov    $0x200000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x3c,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <recur@plt>
mov    -0x10(%rbp),%rax
movb   $0x3e,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe52(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recur>:
cmp    $0x14,%edi
jne    1136 <recur+0x6>
ret
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x200000,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
movw   $0x3c,(%rax)
mov    0x2e87(%rip),%r12
mov    (%r12),%edi
lea    0xe9c(%rip),%r15
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <fprintf@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <recur@plt>
movw   $0x3e,(%r14)
mov    (%r12),%edi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @recur(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 20
br i1 %5, label %6, label %7
6: ; preds = %1
br label %25
7: ; preds = %1
%8 = call i8* @malloc(i32 2097152)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 60, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 0, i8* %12
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 0
store i8 62, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 0, i8* %21
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %3
%24 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @recur(i32 %0) {
%2 = icmp eq i32 %0, 20
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = tail call dereferenceable_or_null(2097152) i8* @malloc(i32 2097152)
store i8 60, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %6
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = add nsw i32 %0, 1
tail call void @recur(i32 %9)
store i8 62, i8* %5
store i8 0, i8* %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %3
}