	.file	"212642590.c"
	.intel_syntax noprefix
	.text
	.local	thread_dotproduct
	.comm	thread_dotproduct,8,8
	.globl	mutex
	.bss
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.text
	.globl	thread_dotprod
	.type	thread_dotprod, @function
thread_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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -16[rbp], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	DWORD PTR -12[rbp], eax
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	imul	eax, edx
	add	DWORD PTR -16[rbp], eax
	add	DWORD PTR -12[rbp], 1
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 16[rax]
	add	eax, 24999
	cmp	DWORD PTR -12[rbp], eax
	jle	.L3
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR thread_dotproduct[rip]
	add	rax, rdx
	mov	QWORD PTR thread_dotproduct[rip], rax
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	thread_dotprod, .-thread_dotprod
	.section	.rodata
.LC0:
	.string	"Ground truth dot product: %d\n"
.LC1:
	.string	"Test with 4 threads"
.LC2:
	.string	"Answer with 4 threads: %lld\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
	lea	r11, -798720[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 1376
	mov	DWORD PTR -800084[rbp], edi
	mov	QWORD PTR -800096[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	DWORD PTR -800076[rbp], 0
	mov	DWORD PTR -800072[rbp], 0
	jmp	.L6
.L7:
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 274877907
	shr	rdx, 32
	sar	edx, 6
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 1000
	sub	eax, ecx
	mov	edx, eax
	sub	edx, 500
	mov	eax, DWORD PTR -800072[rbp]
	cdqe
	mov	DWORD PTR -800016[rbp+rax*4], edx
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, 274877907
	shr	rdx, 32
	sar	edx, 6
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 1000
	sub	eax, ecx
	mov	edx, eax
	sub	edx, 500
	mov	eax, DWORD PTR -800072[rbp]
	cdqe
	mov	DWORD PTR -400016[rbp+rax*4], edx
	mov	eax, DWORD PTR -800072[rbp]
	cdqe
	mov	edx, DWORD PTR -400016[rbp+rax*4]
	mov	eax, DWORD PTR -800072[rbp]
	cdqe
	mov	eax, DWORD PTR -800016[rbp+rax*4]
	imul	eax, edx
	add	DWORD PTR -800076[rbp], eax
	add	DWORD PTR -800072[rbp], 1
.L6:
	cmp	DWORD PTR -800072[rbp], 99999
	jle	.L7
	mov	eax, DWORD PTR -800076[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 96
	call	malloc@PLT
	mov	QWORD PTR -800056[rbp], rax
	mov	DWORD PTR -800068[rbp], 0
	jmp	.L8
.L9:
	mov	eax, DWORD PTR -800068[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	mov	rax, QWORD PTR -800056[rbp]
	add	rdx, rax
	lea	rax, -800016[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR -800068[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	mov	rax, QWORD PTR -800056[rbp]
	add	rdx, rax
	lea	rax, -400016[rbp]
	mov	QWORD PTR 8[rdx], rax
	mov	eax, DWORD PTR -800068[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	mov	rax, QWORD PTR -800056[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -800068[rbp]
	imul	eax, eax, 25000
	mov	DWORD PTR 16[rdx], eax
	add	DWORD PTR -800068[rbp], 1
.L8:
	cmp	DWORD PTR -800068[rbp], 3
	jle	.L9
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	pthread_mutex_init@PLT
	mov	DWORD PTR -800064[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -800064[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 3
	mov	rdx, rax
	mov	rax, QWORD PTR -800056[rbp]
	add	rdx, rax
	lea	rcx, -800048[rbp]
	mov	eax, DWORD PTR -800064[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, thread_dotprod[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -800064[rbp], 1
.L10:
	cmp	DWORD PTR -800064[rbp], 3
	jle	.L11
	mov	DWORD PTR -800060[rbp], 0
	jmp	.L12
.L13:
	mov	eax, DWORD PTR -800060[rbp]
	cdqe
	mov	rax, QWORD PTR -800048[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -800060[rbp], 1
.L12:
	cmp	DWORD PTR -800060[rbp], 3
	jle	.L13
	lea	rdi, mutex[rip]
	call	pthread_mutex_destroy@PLT
	mov	rax, QWORD PTR thread_dotproduct[rip]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -800056[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR -800056[rbp], 0
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.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	"212642590.c"
	.text
	.local	thread_dotproduct
	.comm	thread_dotproduct,8,8
	.comm	mutex,24,4
	.align	2
	.global	thread_dotprod
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_dotprod, %function
thread_dotprod:
	@ 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
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-20]
	b	.L2
.L3:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	ldr	r1, [r2]
	ldr	r2, [fp, #-20]
	lsl	r2, r2, #2
	add	r2, r1, r2
	ldr	r2, [r2]
	mul	r3, r2, r3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	add	r3, r3, #24832
	add	r3, r3, #167
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	ble	.L3
	ldr	r0, .L5
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-24]
	mov	r0, r3
	asr	r1, r0, #31
	ldr	r3, .L5+4
	ldmia	r3, {r2-r3}
	adds	r4, r0, r2
	adc	r5, r1, r3
	ldr	r3, .L5+4
	stm	r3, {r4-r5}
	ldr	r0, .L5
	bl	pthread_mutex_unlock
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L6:
	.align	2
.L5:
	.word	mutex
	.word	thread_dotproduct
	.size	thread_dotprod, .-thread_dotprod
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Ground truth dot product: %d\012\000"
	.align	2
.LC1:
	.ascii	"Test with 4 threads\000"
	.align	2
.LC2:
	.ascii	"Answer with 4 threads: %lld\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 = 800056
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #798720
	sub	sp, sp, #1328
	sub	sp, sp, #12
	sub	r3, fp, #798720
	sub	r3, r3, #12
	str	r0, [r3, #-1332]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	str	r1, [r3, #-1336]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1324]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1320]
	b	.L8
.L9:
	bl	rand
	mov	r1, r0
	ldr	r3, .L18+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #6
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	sub	r2, r2, #500
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1320]
	lsl	r3, r3, #2
	add	r3, r1, r3
	str	r2, [r3, #-1284]
	bl	rand
	mov	r1, r0
	ldr	r3, .L18+4
	smull	r2, r3, r1, r3
	asr	r2, r3, #6
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r2, r1, r3
	sub	r2, r2, #500
	sub	r3, fp, #397312
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1320]
	lsl	r3, r3, #2
	add	r3, r1, r3
	str	r2, [r3, #-2692]
	sub	r3, fp, #397312
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1320]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3, #-2692]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1320]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3, #-1284]
	mul	r3, r2, r3
	sub	r2, fp, #798720
	sub	r2, r2, #12
	mov	r1, r2
	sub	r2, fp, #798720
	sub	r2, r2, #12
	ldr	r2, [r2, #-1324]
	add	r3, r2, r3
	str	r3, [r1, #-1324]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1320]
	add	r3, r3, #1
	str	r3, [r2, #-1320]
.L8:
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1320]
	ldr	r2, .L18+8
	cmp	r3, r2
	blt	.L9
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r1, [r3, #-1324]
	ldr	r0, .L18+12
	bl	printf
	ldr	r0, .L18+16
	bl	puts
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r4, r3
	mov	r0, #48
	bl	malloc
	mov	r3, r0
	str	r3, [r4, #-1304]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1316]
	b	.L10
.L11:
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r2, [r3, #-1316]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1304]
	add	r2, r3, r2
	ldr	r3, .L18+20
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r3, [r2]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r2, [r3, #-1316]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1304]
	add	r2, r3, r2
	ldr	r3, .L18+24
	sub	r1, fp, #12
	add	r3, r1, r3
	str	r3, [r2, #4]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r2, [r3, #-1316]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1304]
	add	r3, r3, r2
	sub	r2, fp, #798720
	sub	r2, r2, #12
	ldr	r2, [r2, #-1316]
	ldr	r1, .L18+28
	mul	r2, r1, r2
	str	r2, [r3, #8]
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1316]
	add	r3, r3, #1
	str	r3, [r2, #-1316]
.L10:
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1316]
	cmp	r3, #3
	ble	.L11
	mov	r1, #0
	ldr	r0, .L18+32
	bl	pthread_mutex_init
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1312]
	b	.L12
.L13:
	ldr	r3, .L18+36
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r2, fp, #798720
	sub	r2, r2, #12
	ldr	r2, [r2, #-1312]
	lsl	r2, r2, #2
	add	r0, r3, r2
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r2, [r3, #-1312]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1304]
	add	r3, r3, r2
	ldr	r2, .L18+40
	mov	r1, #0
	bl	pthread_create
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1312]
	add	r3, r3, #1
	str	r3, [r2, #-1312]
.L12:
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1312]
	cmp	r3, #3
	ble	.L13
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1308]
	b	.L14
.L15:
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1308]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3, #-1300]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1308]
	add	r3, r3, #1
	str	r3, [r2, #-1308]
.L14:
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r3, [r3, #-1308]
	cmp	r3, #3
	ble	.L15
	ldr	r0, .L18+32
	bl	pthread_mutex_destroy
	ldr	r3, .L18+44
	ldmia	r3, {r2-r3}
	ldr	r0, .L18+48
	bl	printf
	sub	r3, fp, #798720
	sub	r3, r3, #12
	ldr	r0, [r3, #-1304]
	bl	free
	sub	r3, fp, #798720
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1304]
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC3
	.word	274877907
	.word	100000
	.word	.LC0
	.word	.LC1
	.word	-800004
	.word	-400004
	.word	25000
	.word	mutex
	.word	-800020
	.word	thread_dotprod
	.word	thread_dotproduct
	.word	.LC2
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
