	.file	"159560.c"
	.intel_syntax noprefix
	.text
	.globl	MatrixChainOrder
	.type	MatrixChainOrder, @function
MatrixChainOrder:
.LFB0:
	.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, 104
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -120[rbp], rdi
	mov	DWORD PTR -124[rbp], esi
	mov	rbx, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rbx
	xor	ebx, ebx
	mov	rcx, rsp
	mov	r15, rcx
	mov	esi, DWORD PTR -124[rbp]
	mov	edi, DWORD PTR -124[rbp]
	movsx	rcx, esi
	sub	rcx, 1
	mov	QWORD PTR -80[rbp], rcx
	movsx	rcx, esi
	mov	QWORD PTR -144[rbp], rcx
	mov	QWORD PTR -136[rbp], 0
	movsx	rcx, esi
	sal	rcx, 2
	movsx	rbx, edi
	sub	rbx, 1
	mov	QWORD PTR -72[rbp], rbx
	movsx	rbx, esi
	mov	r12, rbx
	mov	r13d, 0
	movsx	rbx, edi
	mov	rax, rbx
	mov	edx, 0
	mov	r14, r13
	imul	r14, rax
	mov	rbx, rdx
	imul	rbx, r12
	add	rbx, r14
	mul	r12
	add	rbx, rdx
	mov	rdx, rbx
	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	rbx, [rdx+rax]
	mov	rax, r10
	mul	r8
	lea	r8, [rbx+rdx]
	mov	rdx, r8
	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	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rsi, rax
	and	rsi, -4096
	mov	rdx, rsp
	sub	rdx, rsi
.L2:
	cmp	rsp, rdx
	je	.L3
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L2
.L3:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L4
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L4:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -64[rbp], rax
	mov	DWORD PTR -92[rbp], 1
	jmp	.L5
.L6:
	mov	rdx, rcx
	shr	rdx, 2
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, 1[rdx]
	mov	edx, DWORD PTR -92[rbp]
	movsx	rdx, edx
	imul	rdx, rsi
	mov	DWORD PTR [rax+rdx*4], 0
	add	DWORD PTR -92[rbp], 1
.L5:
	mov	eax, DWORD PTR -92[rbp]
	cmp	eax, DWORD PTR -124[rbp]
	jl	.L6
	mov	DWORD PTR -100[rbp], 2
	jmp	.L7
.L13:
	mov	DWORD PTR -92[rbp], 1
	jmp	.L8
.L12:
	mov	edx, DWORD PTR -92[rbp]
	mov	eax, DWORD PTR -100[rbp]
	add	eax, edx
	sub	eax, 1
	mov	DWORD PTR -88[rbp], eax
	mov	rsi, rcx
	shr	rsi, 2
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -88[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -92[rbp]
	movsx	rdx, edx
	imul	rdx, rsi
	add	rdx, rdi
	mov	DWORD PTR [rax+rdx*4], 2147483647
	mov	eax, DWORD PTR -92[rbp]
	mov	DWORD PTR -96[rbp], eax
	jmp	.L9
.L11:
	mov	rsi, rcx
	shr	rsi, 2
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -92[rbp]
	movsx	rdx, edx
	imul	rdx, rsi
	add	rdx, rdi
	mov	r8d, DWORD PTR [rax+rdx*4]
	mov	rsi, rcx
	shr	rsi, 2
	mov	eax, DWORD PTR -96[rbp]
	lea	edi, 1[rax]
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -88[rbp]
	movsx	r9, edx
	movsx	rdx, edi
	imul	rdx, rsi
	add	rdx, r9
	mov	eax, DWORD PTR [rax+rdx*4]
	lea	esi, [r8+rax]
	mov	eax, DWORD PTR -92[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -120[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	eax, DWORD PTR -96[rbp]
	cdqe
	lea	rdi, 0[0+rax*4]
	mov	rax, QWORD PTR -120[rbp]
	add	rax, rdi
	mov	eax, DWORD PTR [rax]
	imul	edx, eax
	mov	eax, DWORD PTR -88[rbp]
	cdqe
	lea	rdi, 0[0+rax*4]
	mov	rax, QWORD PTR -120[rbp]
	add	rax, rdi
	mov	eax, DWORD PTR [rax]
	imul	eax, edx
	add	eax, esi
	mov	DWORD PTR -84[rbp], eax
	mov	rsi, rcx
	shr	rsi, 2
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -88[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -92[rbp]
	movsx	rdx, edx
	imul	rdx, rsi
	add	rdx, rdi
	mov	eax, DWORD PTR [rax+rdx*4]
	cmp	DWORD PTR -84[rbp], eax
	jge	.L10
	mov	rsi, rcx
	shr	rsi, 2
	mov	rax, QWORD PTR -64[rbp]
	mov	edx, DWORD PTR -88[rbp]
	movsx	rdi, edx
	mov	edx, DWORD PTR -92[rbp]
	movsx	rdx, edx
	imul	rdx, rsi
	lea	rsi, [rdi+rdx]
	mov	edx, DWORD PTR -84[rbp]
	mov	DWORD PTR [rax+rsi*4], edx
.L10:
	add	DWORD PTR -96[rbp], 1
.L9:
	mov	eax, DWORD PTR -88[rbp]
	cmp	eax, DWORD PTR -96[rbp]
	jg	.L11
	add	DWORD PTR -92[rbp], 1
.L8:
	mov	eax, DWORD PTR -124[rbp]
	sub	eax, DWORD PTR -100[rbp]
	cmp	DWORD PTR -92[rbp], eax
	jle	.L12
	add	DWORD PTR -100[rbp], 1
.L7:
	mov	eax, DWORD PTR -100[rbp]
	cmp	eax, DWORD PTR -124[rbp]
	jl	.L13
	shr	rcx, 2
	mov	eax, DWORD PTR -124[rbp]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -64[rbp]
	movsx	rdx, edx
	add	rdx, rcx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	rsp, r15
	mov	rcx, QWORD PTR -56[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MatrixChainOrder, .-MatrixChainOrder
	.section	.rodata
	.align 8
.LC0:
	.string	"Minimum number of multiplications is %d "
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -48[rbp], 5
	mov	DWORD PTR -44[rbp], 10
	mov	DWORD PTR -40[rbp], 3
	mov	DWORD PTR -36[rbp], 12
	mov	DWORD PTR -32[rbp], 5
	mov	DWORD PTR -28[rbp], 50
	mov	DWORD PTR -24[rbp], 6
	mov	DWORD PTR -52[rbp], 7
	mov	edx, DWORD PTR -52[rbp]
	lea	rax, -48[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	MatrixChainOrder
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	call	getchar@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"159560.c"
	.text
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	MatrixChainOrder
	.syntax unified
	.arm
	.fpu softvfp
	.type	MatrixChainOrder, %function
MatrixChainOrder:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #52
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	mov	r3, sp
	mov	r8, r3
	ldr	ip, [fp, #-76]
	ldr	lr, [fp, #-76]
	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	r3, r3, #2
	sub	r2, lr, #1
	str	r2, [fp, #-48]
	mov	r2, ip
	mov	r6, r2
	mov	r7, #0
	mov	r2, lr
	mov	r4, r2
	mov	r5, #0
	mul	r1, r4, r7
	mul	r2, r6, r5
	add	r2, r1, r2
	umull	r0, r1, r6, r4
	add	r2, r2, r1
	mov	r1, r2
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r1, #5
	orr	r5, r5, r0, lsr #27
	lsl	r4, r0, #5
	mov	r2, ip
	mov	r6, r2
	mov	r7, #0
	mov	r2, lr
	mov	r4, r2
	mov	r5, #0
	mul	r1, r4, r7
	mul	r2, r6, r5
	add	r2, r1, r2
	umull	r0, r1, r6, r4
	add	r2, r2, r1
	mov	r1, r2
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r1, #5
	orr	r5, r5, r0, lsr #27
	lsl	r4, r0, #5
	mov	r2, ip
	mov	r1, lr
	mul	r2, r1, r2
	lsl	r2, r2, #2
	add	r2, r2, #7
	lsr	r2, r2, #3
	lsl	r2, r2, #3
	sub	sp, sp, r2
	mov	r2, sp
	add	r2, r2, #3
	lsr	r2, r2, #2
	lsl	r2, r2, #2
	str	r2, [fp, #-44]
	mov	r2, #1
	str	r2, [fp, #-56]
	b	.L2
.L3:
	lsr	r1, r3, #2
	ldr	r2, [fp, #-44]
	add	r1, r1, #1
	ldr	r0, [fp, #-56]
	mul	r1, r0, r1
	mov	r0, #0
	str	r0, [r2, r1, lsl #2]
	ldr	r2, [fp, #-56]
	add	r2, r2, #1
	str	r2, [fp, #-56]
.L2:
	ldr	r1, [fp, #-56]
	ldr	r2, [fp, #-76]
	cmp	r1, r2
	blt	.L3
	mov	r2, #2
	str	r2, [fp, #-64]
	b	.L4
.L10:
	mov	r2, #1
	str	r2, [fp, #-56]
	b	.L5
.L9:
	ldr	r1, [fp, #-56]
	ldr	r2, [fp, #-64]
	add	r2, r1, r2
	sub	r2, r2, #1
	str	r2, [fp, #-40]
	lsr	r1, r3, #2
	ldr	r2, [fp, #-44]
	ldr	r0, [fp, #-56]
	mul	r0, r1, r0
	ldr	r1, [fp, #-40]
	add	r1, r0, r1
	mvn	r0, #-2147483648
	str	r0, [r2, r1, lsl #2]
	ldr	r2, [fp, #-56]
	str	r2, [fp, #-60]
	b	.L6
.L8:
	lsr	r1, r3, #2
	ldr	r2, [fp, #-44]
	ldr	r0, [fp, #-56]
	mul	r0, r1, r0
	ldr	r1, [fp, #-60]
	add	r1, r0, r1
	ldr	r1, [r2, r1, lsl #2]
	lsr	r0, r3, #2
	ldr	r2, [fp, #-60]
	add	ip, r2, #1
	ldr	r2, [fp, #-44]
	mul	ip, r0, ip
	ldr	r0, [fp, #-40]
	add	r0, ip, r0
	ldr	r2, [r2, r0, lsl #2]
	add	r1, r1, r2
	ldr	r2, [fp, #-56]
	sub	r2, r2, #-1073741823
	lsl	r2, r2, #2
	ldr	r0, [fp, #-72]
	add	r2, r0, r2
	ldr	r2, [r2]
	ldr	r0, [fp, #-60]
	lsl	r0, r0, #2
	ldr	ip, [fp, #-72]
	add	r0, ip, r0
	ldr	r0, [r0]
	mul	r2, r0, r2
	ldr	r0, [fp, #-40]
	lsl	r0, r0, #2
	ldr	ip, [fp, #-72]
	add	r0, ip, r0
	ldr	r0, [r0]
	mul	r2, r0, r2
	add	r2, r1, r2
	str	r2, [fp, #-36]
	lsr	r1, r3, #2
	ldr	r2, [fp, #-44]
	ldr	r0, [fp, #-56]
	mul	r0, r1, r0
	ldr	r1, [fp, #-40]
	add	r1, r0, r1
	ldr	r2, [r2, r1, lsl #2]
	ldr	r1, [fp, #-36]
	cmp	r1, r2
	bge	.L7
	lsr	r1, r3, #2
	ldr	r2, [fp, #-44]
	ldr	r0, [fp, #-56]
	mul	r0, r1, r0
	ldr	r1, [fp, #-40]
	add	r1, r0, r1
	ldr	r0, [fp, #-36]
	str	r0, [r2, r1, lsl #2]
.L7:
	ldr	r2, [fp, #-60]
	add	r2, r2, #1
	str	r2, [fp, #-60]
.L6:
	ldr	r1, [fp, #-40]
	ldr	r2, [fp, #-60]
	cmp	r1, r2
	bgt	.L8
	ldr	r2, [fp, #-56]
	add	r2, r2, #1
	str	r2, [fp, #-56]
.L5:
	ldr	r1, [fp, #-76]
	ldr	r2, [fp, #-64]
	sub	r2, r1, r2
	ldr	r1, [fp, #-56]
	cmp	r1, r2
	ble	.L9
	ldr	r2, [fp, #-64]
	add	r2, r2, #1
	str	r2, [fp, #-64]
.L4:
	ldr	r1, [fp, #-64]
	ldr	r2, [fp, #-76]
	cmp	r1, r2
	blt	.L10
	lsr	r1, r3, #2
	ldr	r3, [fp, #-76]
	sub	r2, r3, #1
	ldr	r3, [fp, #-44]
	add	r2, r1, r2
	ldr	r3, [r3, r2, lsl #2]
	mov	sp, r8
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC1
	.size	MatrixChainOrder, .-MatrixChainOrder
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Minimum number of multiplications is %d \000"
	.align	2
.LC0:
	.word	5
	.word	10
	.word	3
	.word	12
	.word	5
	.word	50
	.word	6
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L18+4
	sub	ip, fp, #36
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	mov	r3, #7
	str	r3, [fp, #-40]
	sub	r3, fp, #36
	ldr	r1, [fp, #-40]
	mov	r0, r3
	bl	MatrixChainOrder
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L18+8
	bl	printf
	bl	getchar
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC3
	.word	.LC0
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
