	.file	"170775.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"A%d"
	.text
	.globl	print_bracket
	.type	print_bracket, @function
print_bracket:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	DWORD PTR -36[rbp], edi
	mov	DWORD PTR -40[rbp], esi
	mov	QWORD PTR -48[rbp], rdx
	mov	eax, DWORD PTR -40[rbp]
	lea	ebx, 1[rax]
	movsx	rax, ebx
	sub	rax, 1
	mov	QWORD PTR -24[rbp], rax
	movsx	rax, ebx
	mov	r8, rax
	mov	r9d, 0
	mov	eax, DWORD PTR -36[rbp]
	cmp	eax, DWORD PTR -40[rbp]
	jne	.L2
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L4
.L2:
	mov	edi, 40
	call	putchar@PLT
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	movsx	rax, ebx
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	mov	ecx, DWORD PTR [rdx+rax*4]
	mov	rdx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	print_bracket
	mov	eax, DWORD PTR -36[rbp]
	movsx	rdx, eax
	movsx	rax, ebx
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -40[rbp]
	cdqe
	mov	eax, DWORD PTR [rdx+rax*4]
	lea	ecx, 1[rax]
	mov	rdx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, eax
	mov	edi, ecx
	call	print_bracket
	mov	edi, 41
	call	putchar@PLT
.L4:
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	print_bracket, .-print_bracket
	.section	.rodata
.LC1:
	.string	"Optimal parenthesis: "
	.text
	.globl	MatrixChainMultiplication
	.type	MatrixChainMultiplication, @function
MatrixChainMultiplication:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 200
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -136[rbp], rdi
	mov	DWORD PTR -140[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	QWORD PTR -216[rbp], rax
	mov	esi, DWORD PTR -140[rbp]
	mov	edi, DWORD PTR -140[rbp]
	movsx	rax, esi
	sub	rax, 1
	mov	QWORD PTR -104[rbp], rax
	movsx	rax, esi
	mov	rcx, rax
	mov	ebx, 0
	movsx	rax, esi
	lea	rbx, 0[0+rax*4]
	movsx	rax, edi
	sub	rax, 1
	mov	QWORD PTR -96[rbp], rax
	movsx	rax, esi
	mov	r10, rax
	mov	r11d, 0
	movsx	rax, edi
	mov	r8, rax
	mov	r9d, 0
	mov	rdx, r11
	imul	rdx, r8
	mov	rax, r9
	imul	rax, r10
	lea	rcx, [rdx+rax]
	mov	rax, r10
	mul	r8
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rax, esi
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, edi
	mov	r12, rax
	mov	r13d, 0
	mov	rdx, r15
	imul	rdx, r12
	mov	rax, r13
	imul	rax, r14
	lea	rcx, [rdx+rax]
	mov	rax, r14
	mul	r12
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rdx, esi
	movsx	rax, edi
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L6:
	cmp	rsp, rdx
	je	.L7
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L6
.L7:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L8
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L8:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -88[rbp], rax
	mov	edi, DWORD PTR -140[rbp]
	mov	r8d, DWORD PTR -140[rbp]
	movsx	rax, edi
	sub	rax, 1
	mov	QWORD PTR -80[rbp], rax
	movsx	rax, edi
	mov	QWORD PTR -240[rbp], rax
	mov	QWORD PTR -232[rbp], 0
	movsx	rax, edi
	lea	rsi, 0[0+rax*4]
	movsx	rax, r8d
	sub	rax, 1
	mov	QWORD PTR -72[rbp], rax
	movsx	rax, edi
	mov	QWORD PTR -160[rbp], rax
	mov	QWORD PTR -152[rbp], 0
	movsx	rax, r8d
	mov	QWORD PTR -176[rbp], rax
	mov	QWORD PTR -168[rbp], 0
	mov	r14, QWORD PTR -160[rbp]
	mov	r15, QWORD PTR -152[rbp]
	mov	rdx, r15
	mov	r11, QWORD PTR -176[rbp]
	mov	r12, QWORD PTR -168[rbp]
	imul	rdx, r11
	mov	rax, r12
	imul	rax, r14
	lea	rcx, [rdx+rax]
	mov	rax, r14
	mul	r11
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rax, edi
	mov	QWORD PTR -192[rbp], rax
	mov	QWORD PTR -184[rbp], 0
	movsx	rax, r8d
	mov	QWORD PTR -208[rbp], rax
	mov	QWORD PTR -200[rbp], 0
	mov	r11, QWORD PTR -192[rbp]
	mov	r12, QWORD PTR -184[rbp]
	mov	rdx, r12
	mov	r9, QWORD PTR -208[rbp]
	mov	r10, QWORD PTR -200[rbp]
	imul	rdx, r9
	mov	rax, r10
	imul	rax, r11
	lea	rcx, [rdx+rax]
	mov	rax, r11
	mul	r9
	add	rcx, rdx
	mov	rdx, rcx
	movsx	rdx, edi
	movsx	rax, r8d
	imul	rax, rdx
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L9:
	cmp	rsp, rdx
	je	.L10
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L9
.L10:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L11
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L11:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -64[rbp], rax
	mov	DWORD PTR -116[rbp], 1
	jmp	.L12
.L13:
	mov	rdx, rbx
	shr	rdx, 2
	mov	rax, QWORD PTR -88[rbp]
	lea	rcx, 1[rdx]
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	imul	rdx, rcx
	mov	DWORD PTR [rax+rdx*4], 0
	add	DWORD PTR -116[rbp], 1
.L12:
	mov	eax, DWORD PTR -116[rbp]
	cmp	eax, DWORD PTR -140[rbp]
	jl	.L13
	mov	DWORD PTR -124[rbp], 2
	jmp	.L14
.L20:
	mov	DWORD PTR -116[rbp], 1
	jmp	.L15
.L19:
	mov	edx, DWORD PTR -116[rbp]
	mov	eax, DWORD PTR -124[rbp]
	add	eax, edx
	sub	eax, 1
	mov	DWORD PTR -112[rbp], eax
	mov	rcx, rbx
	shr	rcx, 2
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	imul	rdx, rcx
	add	rdx, rdi
	mov	DWORD PTR [rax+rdx*4], 2147483647
	mov	eax, DWORD PTR -116[rbp]
	mov	DWORD PTR -120[rbp], eax
	jmp	.L16
.L18:
	mov	rcx, rbx
	shr	rcx, 2
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	imul	rdx, rcx
	add	rdx, rdi
	mov	r8d, DWORD PTR [rax+rdx*4]
	mov	rcx, rbx
	shr	rcx, 2
	mov	eax, DWORD PTR -120[rbp]
	lea	edi, 1[rax]
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	r9, edx
	movsx	rdx, edi
	imul	rdx, rcx
	add	rdx, r9
	mov	eax, DWORD PTR [rax+rdx*4]
	lea	ecx, [r8+rax]
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -136[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	lea	rdi, 0[0+rax*4]
	mov	rax, QWORD PTR -136[rbp]
	add	rax, rdi
	mov	eax, DWORD PTR [rax]
	imul	edx, eax
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	lea	rdi, 0[0+rax*4]
	mov	rax, QWORD PTR -136[rbp]
	add	rax, rdi
	mov	eax, DWORD PTR [rax]
	imul	eax, edx
	add	eax, ecx
	mov	DWORD PTR -108[rbp], eax
	mov	rcx, rbx
	shr	rcx, 2
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	imul	rdx, rcx
	add	rdx, rdi
	mov	eax, DWORD PTR [rax+rdx*4]
	cmp	DWORD PTR -108[rbp], eax
	jge	.L17
	mov	rcx, rbx
	shr	rcx, 2
	mov	rax, QWORD PTR -88[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	imul	rdx, rcx
	lea	rcx, [rdi+rdx]
	mov	edx, DWORD PTR -108[rbp]
	mov	DWORD PTR [rax+rcx*4], edx
	mov	rcx, rsi
	shr	rcx, 2
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -116[rbp]
	movsx	rdx, edx
	imul	rdx, rcx
	lea	rcx, [rdi+rdx]
	mov	edx, DWORD PTR -120[rbp]
	mov	DWORD PTR [rax+rcx*4], edx
.L17:
	add	DWORD PTR -120[rbp], 1
.L16:
	mov	eax, DWORD PTR -112[rbp]
	cmp	eax, DWORD PTR -120[rbp]
	jg	.L18
	add	DWORD PTR -116[rbp], 1
.L15:
	mov	eax, DWORD PTR -140[rbp]
	sub	eax, DWORD PTR -124[rbp]
	cmp	DWORD PTR -116[rbp], eax
	jle	.L19
	add	DWORD PTR -124[rbp], 1
.L14:
	mov	eax, DWORD PTR -124[rbp]
	cmp	eax, DWORD PTR -140[rbp]
	jl	.L20
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -140[rbp]
	lea	ecx, -1[rax]
	mov	rax, QWORD PTR -64[rbp]
	mov	rdx, rax
	mov	esi, ecx
	mov	edi, 1
	call	print_bracket
	shr	rbx, 2
	mov	rcx, rbx
	mov	eax, DWORD PTR -140[rbp]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -88[rbp]
	movsx	rdx, edx
	add	rdx, rcx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	rsp, QWORD PTR -216[rbp]
	mov	rsi, QWORD PTR -56[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	MatrixChainMultiplication, .-MatrixChainMultiplication
	.section	.rodata
.LC2:
	.string	"Enter number of matrices"
.LC3:
	.string	"%d"
.LC4:
	.string	"Enter dimensions "
.LC5:
	.string	"Enter p%d :: "
	.align 8
.LC6:
	.string	"\nMinimum number of multiplications is %d "
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r12
	push	rbx
	sub	rsp, 64
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	r12, rax
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rax, -68[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -68[rbp]
	add	eax, 1
	mov	DWORD PTR -68[rbp], eax
	mov	ebx, DWORD PTR -68[rbp]
	movsx	rax, ebx
	sub	rax, 1
	mov	QWORD PTR -56[rbp], rax
	movsx	rax, ebx
	mov	QWORD PTR -96[rbp], rax
	mov	QWORD PTR -88[rbp], 0
	movsx	rax, ebx
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, ebx
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L24:
	cmp	rsp, rdx
	je	.L25
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L24
.L25:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L26
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L26:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -48[rbp], rax
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	DWORD PTR -64[rbp], 0
	jmp	.L27
.L28:
	mov	eax, DWORD PTR -64[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -64[rbp], 1
.L27:
	mov	eax, DWORD PTR -68[rbp]
	cmp	DWORD PTR -64[rbp], eax
	jl	.L28
	movsx	rax, ebx
	sal	rax, 2
	shr	rax, 2
	mov	DWORD PTR -60[rbp], eax
	mov	edx, DWORD PTR -60[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	MatrixChainMultiplication
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rsp, r12
	mov	eax, 0
	mov	rcx, QWORD PTR -40[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"170775.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"A%d\000"
	.text
	.align	2
	.global	print_bracket
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_bracket, %function
print_bracket:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r3, [fp, #-28]
	add	r4, r3, #1
	sub	r3, r4, #1
	str	r3, [fp, #-16]
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bne	.L2
	ldr	r1, [fp, #-24]
	ldr	r0, .L5
	bl	printf
	b	.L4
.L2:
	mov	r0, #40
	bl	putchar
	mov	r2, r4
	ldr	r3, [fp, #-24]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-32]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	print_bracket
	mov	r2, r4
	ldr	r3, [fp, #-24]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	ldr	r3, [r3, r2, lsl #2]
	add	r3, r3, #1
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-28]
	mov	r0, r3
	bl	print_bracket
	mov	r0, #41
	bl	putchar
.L4:
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC0
	.size	print_bracket, .-print_bracket
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Optimal parenthesis: \000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	MatrixChainMultiplication
	.syntax unified
	.arm
	.fpu softvfp
	.type	MatrixChainMultiplication, %function
MatrixChainMultiplication:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #56
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, .L19
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	mov	r3, sp
	mov	r9, r3
	ldr	ip, [fp, #-84]
	ldr	lr, [fp, #-84]
	sub	r3, ip, #1
	str	r3, [fp, #-76]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r4, r3, #2
	sub	r3, lr, #1
	str	r3, [fp, #-60]
	mov	r3, ip
	mov	r6, r3
	mov	r7, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r7
	mul	r3, r6, r1
	add	r5, r2, r3
	umull	r2, r3, r6, r0
	add	r1, r5, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r6, r3
	mov	r7, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r7
	mul	r3, r6, r1
	add	r5, r2, r3
	umull	r2, r3, r6, r0
	add	r1, r5, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r2, lr
	mul	r3, r2, r3
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-56]
	ldr	ip, [fp, #-84]
	ldr	lr, [fp, #-84]
	sub	r3, ip, #1
	str	r3, [fp, #-52]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r5, r3, #2
	sub	r3, lr, #1
	str	r3, [fp, #-48]
	mov	r3, ip
	mov	r6, r3
	mov	r7, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r7
	mul	r3, r6, r1
	add	r8, r2, r3
	umull	r2, r3, r6, r0
	add	r1, r8, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r6, r3
	mov	r7, #0
	mov	r3, lr
	mov	r0, r3
	mov	r1, #0
	mul	r2, r0, r7
	mul	r3, r6, r1
	add	r8, r2, r3
	umull	r2, r3, r6, r0
	add	r1, r8, r3
	mov	r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r3, ip
	mov	r2, lr
	mul	r3, r2, r3
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-44]
	mov	r3, #1
	str	r3, [fp, #-64]
	b	.L8
.L9:
	lsr	r2, r4, #2
	ldr	r3, [fp, #-56]
	add	r2, r2, #1
	ldr	r1, [fp, #-64]
	mul	r2, r1, r2
	mov	r1, #0
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L8:
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-84]
	cmp	r2, r3
	blt	.L9
	mov	r3, #2
	str	r3, [fp, #-72]
	b	.L10
.L16:
	mov	r3, #1
	str	r3, [fp, #-64]
	b	.L11
.L15:
	ldr	r2, [fp, #-64]
	ldr	r3, [fp, #-72]
	add	r3, r2, r3
	sub	r3, r3, #1
	str	r3, [fp, #-40]
	lsr	r2, r4, #2
	ldr	r3, [fp, #-56]
	ldr	r1, [fp, #-64]
	mul	r1, r2, r1
	ldr	r2, [fp, #-40]
	add	r2, r1, r2
	mvn	r1, #-2147483648
	str	r1, [r3, r2, lsl #2]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-68]
	b	.L12
.L14:
	lsr	r2, r4, #2
	ldr	r3, [fp, #-56]
	ldr	r1, [fp, #-64]
	mul	r1, r2, r1
	ldr	r2, [fp, #-68]
	add	r2, r1, r2
	ldr	r2, [r3, r2, lsl #2]
	lsr	r1, r4, #2
	ldr	r3, [fp, #-68]
	add	r0, r3, #1
	ldr	r3, [fp, #-56]
	mul	r0, r1, r0
	ldr	r1, [fp, #-40]
	add	r1, r0, r1
	ldr	r3, [r3, r1, lsl #2]
	add	r2, r2, r3
	ldr	r3, [fp, #-64]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r1, [fp, #-80]
	add	r3, r1, r3
	ldr	r3, [r3]
	ldr	r1, [fp, #-68]
	lsl	r1, r1, #2
	ldr	r0, [fp, #-80]
	add	r1, r0, r1
	ldr	r1, [r1]
	mul	r3, r1, r3
	ldr	r1, [fp, #-40]
	lsl	r1, r1, #2
	ldr	r0, [fp, #-80]
	add	r1, r0, r1
	ldr	r1, [r1]
	mul	r3, r1, r3
	add	r3, r2, r3
	str	r3, [fp, #-36]
	lsr	r2, r4, #2
	ldr	r3, [fp, #-56]
	ldr	r1, [fp, #-64]
	mul	r1, r2, r1
	ldr	r2, [fp, #-40]
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	bge	.L13
	lsr	r2, r4, #2
	ldr	r3, [fp, #-56]
	ldr	r1, [fp, #-64]
	mul	r1, r2, r1
	ldr	r2, [fp, #-40]
	add	r2, r1, r2
	ldr	r1, [fp, #-36]
	str	r1, [r3, r2, lsl #2]
	lsr	r2, r5, #2
	ldr	r3, [fp, #-44]
	ldr	r1, [fp, #-64]
	mul	r1, r2, r1
	ldr	r2, [fp, #-40]
	add	r2, r1, r2
	ldr	r1, [fp, #-68]
	str	r1, [r3, r2, lsl #2]
.L13:
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L12:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	bgt	.L14
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L11:
	ldr	r2, [fp, #-84]
	ldr	r3, [fp, #-72]
	sub	r3, r2, r3
	ldr	r2, [fp, #-64]
	cmp	r2, r3
	ble	.L15
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L10:
	ldr	r2, [fp, #-72]
	ldr	r3, [fp, #-84]
	cmp	r2, r3
	blt	.L16
	ldr	r0, .L19+4
	bl	printf
	ldr	r3, [fp, #-84]
	sub	r3, r3, #1
	ldr	r2, [fp, #-44]
	mov	r1, r3
	mov	r0, #1
	bl	print_bracket
	lsr	r1, r4, #2
	ldr	r3, [fp, #-84]
	sub	r2, r3, #1
	ldr	r3, [fp, #-56]
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	mov	sp, r9
	ldr	r2, .L19
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC2
	.word	.LC1
	.size	MatrixChainMultiplication, .-MatrixChainMultiplication
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Enter number of matrices\000"
	.align	2
.LC4:
	.ascii	"%d\000"
	.align	2
.LC5:
	.ascii	"Enter dimensions \000"
	.align	2
.LC6:
	.ascii	"Enter p%d :: \000"
	.align	2
.LC7:
	.ascii	"\012Minimum number of multiplications is %d \000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #24
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	ldr	r0, .L26+4
	bl	puts
	sub	r3, fp, #36
	mov	r1, r3
	ldr	r0, .L26+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
	ldr	r4, [fp, #-36]
	sub	r3, r4, #1
	str	r3, [fp, #-28]
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, r4
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-24]
	ldr	r0, .L26+12
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L22
.L23:
	ldr	r1, [fp, #-32]
	ldr	r0, .L26+16
	bl	printf
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L26+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L22:
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L23
	mov	r3, r4
	lsl	r3, r3, #2
	lsr	r3, r3, #2
	str	r3, [fp, #-20]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	MatrixChainMultiplication
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L26+20
	bl	printf
	mov	sp, r5
	mov	r3, #0
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC8
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
