#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(int *);
int *malloc(int);
int matrix_chain_multiplication(int *, int, int *, int *);
int /*<<< orphan*/ print_optimal_parens(int *, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int p[] = {30, 35, 15, 5, 10, 20, 25};
  int p_length = 7;
  int number_of_matrix = p_length - 1;
  int *multiplies = malloc(sizeof(int) * number_of_matrix * number_of_matrix);
  int *splits = malloc(sizeof(int) * number_of_matrix * number_of_matrix);
  int result = matrix_chain_multiplication(p, p_length, multiplies, splits);
  for (int i = 0; i < number_of_matrix; i++) {
    for (int j = i + 1; j < number_of_matrix; j++) {
      printf("M[%i, %i] = %i\n", i + 1, j + 1,
             multiplies[i * number_of_matrix + j]);
    }
  }
  for (int i = 0; i < number_of_matrix; i++) {
    for (int j = i + 1; j < number_of_matrix; j++) {
      printf("S[%i, %i] = %i\n", i + 1, j + 1,
             splits[i * number_of_matrix + j] + 1);
    }
  }
  print_optimal_parens(splits, number_of_matrix, 0, 5);
  free(multiplies);
  free(splits);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xe92(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
movslq -0x28(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
movslq -0x28(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
call   1040 <matrix_chain_multiplication@plt>
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    125b <main+0x10b>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1248 <main+0xf8>
mov    -0x40(%rbp),%esi
add    $0x1,%esi
mov    -0x44(%rbp),%edx
add    $0x1,%edx
mov    -0x30(%rbp),%rax
mov    -0x40(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xde7(%rip),%rdi
call   1050 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1202 <main+0xb2>
jmp    124d <main+0xfd>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11ed <main+0x9d>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12d3 <main+0x183>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12c0 <main+0x170>
mov    -0x48(%rbp),%esi
add    $0x1,%esi
mov    -0x4c(%rbp),%edx
add    $0x1,%edx
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
imul   -0x28(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
add    $0x1,%ecx
lea    0xd7f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1277 <main+0x127>
jmp    12c5 <main+0x175>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1262 <main+0x112>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%esi
xor    %edx,%edx
mov    $0x5,%ecx
call   1070 <print_optimal_parens@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movups 0xeac(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x90,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0x90,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x7,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1040 <matrix_chain_multiplication@plt>
mov    0x4(%r14),%ecx
lea    0xe74(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <printf@plt>
mov    0x8(%r14),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1050 <printf@plt>
mov    0xc(%r14),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <printf@plt>
mov    0x10(%r14),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x14(%r14),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x20(%r14),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <printf@plt>
mov    0x24(%r14),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1050 <printf@plt>
mov    0x28(%r14),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x2c(%r14),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x3c(%r14),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1050 <printf@plt>
mov    0x40(%r14),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x44(%r14),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x58(%r14),%ecx
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x5c(%r14),%ecx
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x74(%r14),%ecx
mov    %r15,%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x4(%rbx),%ecx
add    $0x1,%ecx
lea    0xd31(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <printf@plt>
mov    0x8(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1050 <printf@plt>
mov    0xc(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <printf@plt>
mov    0x10(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x14(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x20(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1050 <printf@plt>
mov    0x24(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1050 <printf@plt>
mov    0x28(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x2c(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x3c(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1050 <printf@plt>
mov    0x40(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x44(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x58(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
call   1050 <printf@plt>
mov    0x5c(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x4,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    0x74(%rbx),%ecx
add    $0x1,%ecx
mov    %r15,%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x5,%ecx
call   1070 <print_optimal_parens@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.p = [7 x i32] [i32 30, i32 35, i32 15, i32 5, i32 10, i32 20, i32 25]
@.str = [16 x i8] c"M[%i, %i] = %i\0A\00"
@.str.1 = [16 x i8] c"S[%i, %i] = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = mul i64 4, %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = mul i64 %17, %19
%21 = trunc i64 %20 to i32
%22 = call i32* @malloc(i32 %21)
store i32* %22, i32** %5
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = mul i64 4, %24
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = mul i64 %25, %27
%29 = trunc i64 %28 to i32
%30 = call i32* @malloc(i32 %29)
store i32* %30, i32** %6
%31 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%32 = load i32, i32* %3
%33 = load i32*, i32** %5
%34 = load i32*, i32** %6
%35 = call i32 @matrix_chain_multiplication(i32* %31, i32 %32, i32* %33, i32* %34)
store i32 %35, i32* %7
store i32 0, i32* %8
br label %36
36: ; preds = %66, %0
%37 = load i32, i32* %8
%38 = load i32, i32* %4
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %69
40: ; preds = %36
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
br label %43
43: ; preds = %62, %40
%44 = load i32, i32* %9
%45 = load i32, i32* %4
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %65
47: ; preds = %43
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
%50 = load i32, i32* %9
%51 = add nsw i32 %50, 1
%52 = load i32*, i32** %5
%53 = load i32, i32* %8
%54 = load i32, i32* %4
%55 = mul nsw i32 %53, %54
%56 = load i32, i32* %9
%57 = add nsw i32 %55, %56
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %52, i64 %58
%60 = load i32, i32* %59
%61 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %49, i32 %51, i32 %60)
br label %62
62: ; preds = %47
%63 = load i32, i32* %9
%64 = add nsw i32 %63, 1
store i32 %64, i32* %9
br label %43
65: ; preds = %43
br label %66
66: ; preds = %65
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
store i32 %68, i32* %8
br label %36
69: ; preds = %36
store i32 0, i32* %10
br label %70
70: ; preds = %101, %69
%71 = load i32, i32* %10
%72 = load i32, i32* %4
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %104
74: ; preds = %70
%75 = load i32, i32* %10
%76 = add nsw i32 %75, 1
store i32 %76, i32* %11
br label %77
77: ; preds = %97, %74
%78 = load i32, i32* %11
%79 = load i32, i32* %4
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %100
81: ; preds = %77
%82 = load i32, i32* %10
%83 = add nsw i32 %82, 1
%84 = load i32, i32* %11
%85 = add nsw i32 %84, 1
%86 = load i32*, i32** %6
%87 = load i32, i32* %10
%88 = load i32, i32* %4
%89 = mul nsw i32 %87, %88
%90 = load i32, i32* %11
%91 = add nsw i32 %89, %90
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i32, i32* %86, i64 %92
%94 = load i32, i32* %93
%95 = add nsw i32 %94, 1
%96 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %83, i32 %85, i32 %95)
br label %97
97: ; preds = %81
%98 = load i32, i32* %11
%99 = add nsw i32 %98, 1
store i32 %99, i32* %11
br label %77
100: ; preds = %77
br label %101
101: ; preds = %100
%102 = load i32, i32* %10
%103 = add nsw i32 %102, 1
store i32 %103, i32* %10
br label %70
104: ; preds = %70
%105 = load i32*, i32** %6
%106 = load i32, i32* %4
%107 = call i32 @print_optimal_parens(i32* %105, i32 %106, i32 0, i32 5)
%108 = load i32*, i32** %5
%109 = call i32 @free(i32* %108)
%110 = load i32*, i32** %6
%111 = call i32 @free(i32* %110)
%112 = load i32, i32* %1
ret i32 %112
}

LLVM IR (-O2):
@__const.main.p = [7 x i32] [i32 30, i32 35, i32 15, i32 5, i32 10, i32 20, i32 25]
@.str = [16 x i8] c"M[%i, %i] = %i\0A\00"
@.str.1 = [16 x i8] c"S[%i, %i] = %i\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = tail call i32* @malloc(i32 144)
%4 = tail call i32* @malloc(i32 144)
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = call i32 @matrix_chain_multiplication(i32* %5, i32 7, i32* %3, i32* %4)
%7 = getelementptr inbounds i32, i32* %3, i64 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 %8)
%10 = getelementptr inbounds i32, i32* %3, i64 2
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 3, i32 %11)
%13 = getelementptr inbounds i32, i32* %3, i64 3
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 %14)
%16 = getelementptr inbounds i32, i32* %3, i64 4
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 %17)
%19 = getelementptr inbounds i32, i32* %3, i64 5
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1, i32 6, i32 %20)
%22 = getelementptr inbounds i32, i32* %3, i64 8
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 3, i32 %23)
%25 = getelementptr inbounds i32, i32* %3, i64 9
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 %26)
%28 = getelementptr inbounds i32, i32* %3, i64 10
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 5, i32 %29)
%31 = getelementptr inbounds i32, i32* %3, i64 11
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2, i32 6, i32 %32)
%34 = getelementptr inbounds i32, i32* %3, i64 15
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 4, i32 %35)
%37 = getelementptr inbounds i32, i32* %3, i64 16
%38 = load i32, i32* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 5, i32 %38)
%40 = getelementptr inbounds i32, i32* %3, i64 17
%41 = load i32, i32* %40
%42 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 6, i32 %41)
%43 = getelementptr inbounds i32, i32* %3, i64 22
%44 = load i32, i32* %43
%45 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 5, i32 %44)
%46 = getelementptr inbounds i32, i32* %3, i64 23
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 6, i32 %47)
%49 = getelementptr inbounds i32, i32* %3, i64 29
%50 = load i32, i32* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 5, i32 6, i32 %50)
%52 = getelementptr inbounds i32, i32* %4, i64 1
%53 = load i32, i32* %52
%54 = add nsw i32 %53, 1
%55 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2, i32 %54)
%56 = getelementptr inbounds i32, i32* %4, i64 2
%57 = load i32, i32* %56
%58 = add nsw i32 %57, 1
%59 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 3, i32 %58)
%60 = getelementptr inbounds i32, i32* %4, i64 3
%61 = load i32, i32* %60
%62 = add nsw i32 %61, 1
%63 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 4, i32 %62)
%64 = getelementptr inbounds i32, i32* %4, i64 4
%65 = load i32, i32* %64
%66 = add nsw i32 %65, 1
%67 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 5, i32 %66)
%68 = getelementptr inbounds i32, i32* %4, i64 5
%69 = load i32, i32* %68
%70 = add nsw i32 %69, 1
%71 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 6, i32 %70)
%72 = getelementptr inbounds i32, i32* %4, i64 8
%73 = load i32, i32* %72
%74 = add nsw i32 %73, 1
%75 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 3, i32 %74)
%76 = getelementptr inbounds i32, i32* %4, i64 9
%77 = load i32, i32* %76
%78 = add nsw i32 %77, 1
%79 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 4, i32 %78)
%80 = getelementptr inbounds i32, i32* %4, i64 10
%81 = load i32, i32* %80
%82 = add nsw i32 %81, 1
%83 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 5, i32 %82)
%84 = getelementptr inbounds i32, i32* %4, i64 11
%85 = load i32, i32* %84
%86 = add nsw i32 %85, 1
%87 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 6, i32 %86)
%88 = getelementptr inbounds i32, i32* %4, i64 15
%89 = load i32, i32* %88
%90 = add nsw i32 %89, 1
%91 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 4, i32 %90)
%92 = getelementptr inbounds i32, i32* %4, i64 16
%93 = load i32, i32* %92
%94 = add nsw i32 %93, 1
%95 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 5, i32 %94)
%96 = getelementptr inbounds i32, i32* %4, i64 17
%97 = load i32, i32* %96
%98 = add nsw i32 %97, 1
%99 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 6, i32 %98)
%100 = getelementptr inbounds i32, i32* %4, i64 22
%101 = load i32, i32* %100
%102 = add nsw i32 %101, 1
%103 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 5, i32 %102)
%104 = getelementptr inbounds i32, i32* %4, i64 23
%105 = load i32, i32* %104
%106 = add nsw i32 %105, 1
%107 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 6, i32 %106)
%108 = getelementptr inbounds i32, i32* %4, i64 29
%109 = load i32, i32* %108
%110 = add nsw i32 %109, 1
%111 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 6, i32 %110)
%112 = call i32 @print_optimal_parens(i32* %4, i32 6, i32 0, i32 5)
%113 = call i32 @free(i32* %3)
%114 = call i32 @free(i32* %4)
ret i32 0
}