#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 */
char **generateParenthesis(int, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int size = 0;
  char **ret = generateParenthesis(5, &size);
  int dbg;
  for (dbg = 1; dbg < 11; dbg++) {
    ret = generateParenthesis(dbg, &size);
    printf("dbg = %d, size = %d\n", dbg, size);
  }
  int i;
  for (i = 0; i < size; i++) {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x5,%edi
lea    -0x14(%rbp),%rsi
call   1040 <generateParenthesis@plt>
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0xb,-0x24(%rbp)
jge    1190 <main+0x70>
mov    -0x24(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1040 <generateParenthesis@plt>
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <main+0x36>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b6 <main+0x96>
jmp    11a8 <main+0x88>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1197 <main+0x77>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
lea    0xeaa(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    $0x9,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <generateParenthesis@plt>
mov    0x4(%rsp),%edx
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"dbg = %d, size = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = call i8** @generateParenthesis(i32 5, i32* %6)
store i8** %10, i8*** %7
store i32 1, i32* %8
br label %11
11: ; preds = %20, %2
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 11
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %8
%16 = call i8** @generateParenthesis(i32 %15, i32* %6)
store i8** %16, i8*** %7
%17 = load i32, i32* %8
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %14
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %11
23: ; preds = %11
store i32 0, i32* %9
br label %24
24: ; preds = %29, %23
%25 = load i32, i32* %9
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %24
br label %29
29: ; preds = %28
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %24
32: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"dbg = %d, size = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i8** @generateParenthesis(i32 5, i32* %3)
%6 = call i8** @generateParenthesis(i32 1, i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 %7)
%9 = call i8** @generateParenthesis(i32 2, i32* %3)
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2, i32 %10)
%12 = call i8** @generateParenthesis(i32 3, i32* %3)
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 3, i32 %13)
%15 = call i8** @generateParenthesis(i32 4, i32* %3)
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 4, i32 %16)
%18 = call i8** @generateParenthesis(i32 5, i32* %3)
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 5, i32 %19)
%21 = call i8** @generateParenthesis(i32 6, i32* %3)
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 6, i32 %22)
%24 = call i8** @generateParenthesis(i32 7, i32* %3)
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 7, i32 %25)
%27 = call i8** @generateParenthesis(i32 8, i32* %3)
%28 = load i32, i32* %3
%29 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 8, i32 %28)
%30 = call i8** @generateParenthesis(i32 9, i32* %3)
%31 = load i32, i32* %3
%32 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 9, i32 %31)
%33 = call i8** @generateParenthesis(i32 10, i32* %3)
%34 = load i32, i32* %3
%35 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 10, i32 %34)
ret i32 0
}