	.file	"76699777.c"
	.intel_syntax noprefix
	.text
	.globl	mutexsum
	.bss
	.align 32
	.type	mutexsum, @object
	.size	mutexsum, 40
mutexsum:
	.zero	40
	.globl	a
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.globl	b
	.align 8
	.type	b, @object
	.size	b, 8
b:
	.zero	8
	.globl	sum
	.align 8
	.type	sum, @object
	.size	sum, 8
sum:
	.zero	8
	.section	.rodata
	.align 8
.LC0:
	.string	"thread: %ld starting. start=%d end=%d\n"
	.align 8
.LC1:
	.string	"thread: %ld done. Global sum now is=%li\n"
	.text
	.globl	dotprod
	.type	dotprod, @function
dotprod:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	DWORD PTR -20[rbp], 100000
	mov	eax, DWORD PTR -24[rbp]
	imul	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	add	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	lea	ecx, -1[rax]
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR -28[rbp], eax
	jmp	.L2
.L3:
	lea	rdi, mutexsum[rip]
	call	pthread_mutex_lock@PLT
	mov	rdx, QWORD PTR a[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rcx, QWORD PTR b[rip]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	imul	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR sum[rip]
	add	rax, rdx
	mov	QWORD PTR sum[rip], rax
	lea	rdi, mutexsum[rip]
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -28[rbp], 1
.L2:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jl	.L3
	mov	rdx, QWORD PTR sum[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE6:
	.size	dotprod, .-dotprod
	.section	.rodata
.LC2:
	.string	"Final Global Sum=%li\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 176
	mov	DWORD PTR -164[rbp], edi
	mov	QWORD PTR -176[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 3200000
	call	malloc@PLT
	mov	QWORD PTR a[rip], rax
	mov	edi, 3200000
	call	malloc@PLT
	mov	QWORD PTR b[rip], rax
	mov	QWORD PTR -152[rbp], 0
	jmp	.L5
.L6:
	mov	rdx, QWORD PTR b[rip]
	mov	rax, QWORD PTR -152[rbp]
	sal	rax, 2
	add	rax, rdx
	mov	DWORD PTR [rax], 1
	mov	rcx, QWORD PTR a[rip]
	mov	rdx, QWORD PTR -152[rbp]
	sal	rdx, 2
	add	rdx, rcx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rdx], eax
	add	QWORD PTR -152[rbp], 1
.L5:
	cmp	QWORD PTR -152[rbp], 799999
	jle	.L6
	mov	esi, 0
	lea	rdi, mutexsum[rip]
	call	pthread_mutex_init@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	pthread_attr_init@PLT
	lea	rax, -144[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_attr_setdetachstate@PLT
	mov	QWORD PTR -152[rbp], 0
	jmp	.L7
.L8:
	mov	rdx, QWORD PTR -152[rbp]
	lea	rcx, -80[rbp]
	mov	rax, QWORD PTR -152[rbp]
	sal	rax, 3
	lea	rdi, [rcx+rax]
	lea	rax, -144[rbp]
	mov	rcx, rdx
	lea	rdx, dotprod[rip]
	mov	rsi, rax
	call	pthread_create@PLT
	add	QWORD PTR -152[rbp], 1
.L7:
	cmp	QWORD PTR -152[rbp], 7
	jle	.L8
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	pthread_attr_destroy@PLT
	mov	QWORD PTR -152[rbp], 0
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR -80[rbp+rax*8]
	lea	rdx, -160[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	add	QWORD PTR -152[rbp], 1
.L9:
	cmp	QWORD PTR -152[rbp], 7
	jle	.L10
	mov	rax, QWORD PTR sum[rip]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR a[rip]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR b[rip]
	mov	rdi, rax
	call	free@PLT
	lea	rdi, mutexsum[rip]
	call	pthread_mutex_destroy@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.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	"76699777.c"
	.text
	.comm	mutexsum,24,4
	.comm	a,4,4
	.comm	b,4,4
	.global	sum
	.bss
	.align	2
	.type	sum, %object
	.size	sum, 4
sum:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"thread: %ld starting. start=%d end=%d\012\000"
	.align	2
.LC1:
	.ascii	"thread: %ld done. Global sum now is=%li\012\000"
	.text
	.align	2
	.global	dotprod
	.syntax unified
	.arm
	.fpu softvfp
	.type	dotprod, %function
dotprod:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-20]
	ldr	r3, .L4
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	mul	r3, r2, r3
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-24]
	ldr	r0, .L4+4
	bl	printf
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-28]
	b	.L2
.L3:
	ldr	r0, .L4+8
	bl	pthread_mutex_lock
	ldr	r3, .L4+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, .L4+16
	ldr	r1, [r2]
	ldr	r2, [fp, #-28]
	lsl	r2, r2, #2
	add	r2, r1, r2
	ldr	r2, [r2]
	mul	r2, r3, r2
	ldr	r3, .L4+20
	ldr	r3, [r3]
	add	r3, r2, r3
	ldr	r2, .L4+20
	str	r3, [r2]
	ldr	r0, .L4+8
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L2:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L3
	ldr	r3, .L4+20
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, .L4+24
	bl	printf
	mov	r0, #0
	bl	pthread_exit
.L5:
	.align	2
.L4:
	.word	100000
	.word	.LC0
	.word	mutexsum
	.word	a
	.word	b
	.word	sum
	.word	.LC1
	.size	dotprod, .-dotprod
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Final Global Sum=%li\012\000"
	.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 = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-88]
	str	r1, [fp, #-92]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L14+4
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L14+8
	str	r2, [r3]
	ldr	r0, .L14+4
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L14+12
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L7
.L8:
	ldr	r3, .L14+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	add	r3, r2, r3
	mov	r2, #1
	str	r2, [r3]
	ldr	r2, .L14+8
	ldr	r1, [r2]
	ldr	r2, [fp, #-80]
	lsl	r2, r2, #2
	add	r2, r1, r2
	ldr	r3, [r3]
	str	r3, [r2]
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L7:
	ldr	r3, [fp, #-80]
	ldr	r2, .L14+16
	cmp	r3, r2
	blt	.L8
	mov	r1, #0
	ldr	r0, .L14+20
	bl	pthread_mutex_init
	sub	r3, fp, #44
	mov	r0, r3
	bl	pthread_attr_init
	sub	r3, fp, #44
	mov	r1, #0
	mov	r0, r3
	bl	pthread_attr_setdetachstate
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L9
.L10:
	sub	r2, fp, #76
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	add	r0, r2, r3
	ldr	r3, [fp, #-80]
	sub	r1, fp, #44
	ldr	r2, .L14+24
	bl	pthread_create
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L9:
	ldr	r3, [fp, #-80]
	cmp	r3, #7
	ble	.L10
	sub	r3, fp, #44
	mov	r0, r3
	bl	pthread_attr_destroy
	mov	r3, #0
	str	r3, [fp, #-80]
	b	.L11
.L12:
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-72]
	sub	r2, fp, #84
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-80]
	add	r3, r3, #1
	str	r3, [fp, #-80]
.L11:
	ldr	r3, [fp, #-80]
	cmp	r3, #7
	ble	.L12
	ldr	r3, .L14+28
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L14+32
	bl	printf
	ldr	r3, .L14+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L14+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r0, .L14+20
	bl	pthread_mutex_destroy
	mov	r0, #0
	bl	pthread_exit
.L15:
	.align	2
.L14:
	.word	.LC3
	.word	3200000
	.word	a
	.word	b
	.word	800000
	.word	mutexsum
	.word	dotprod
	.word	sum
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
