	.file	"667808.c"
	.intel_syntax noprefix
	.text
	.globl	iter_per_thread
	.data
	.align 4
	.type	iter_per_thread, @object
	.size	iter_per_thread, 4
iter_per_thread:
	.long	6250
	.globl	tid
	.bss
	.align 32
	.type	tid, @object
	.size	tid, 128
tid:
	.zero	128
	.globl	mutex
	.align 32
	.type	mutex, @object
	.size	mutex, 32
mutex:
	.zero	32
	.globl	count
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	pi
	.align 8
	.type	pi, @object
	.size	pi, 8
pi:
	.zero	8
	.globl	seed
	.data
	.align 4
	.type	seed, @object
	.size	seed, 4
seed:
	.long	676767676
	.text
	.globl	generateRandom
	.type	generateRandom, @function
generateRandom:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR seed[rip]
	imul	eax, eax, 1103515245
	add	eax, 123456
	mov	DWORD PTR seed[rip], eax
	mov	eax, DWORD PTR seed[rip]
	mov	eax, eax
	test	rax, rax
	js	.L2
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L3
.L2:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L3:
	movsd	xmm1, QWORD PTR .LC0[rip]
	divsd	xmm0, xmm1
	movq	rax, xmm0
	movq	xmm0, rax
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	generateRandom, .-generateRandom
	.globl	calculatePi
	.type	calculatePi, @function
calculatePi:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -28[rbp], 0
	jmp	.L6
.L9:
	mov	eax, 0
	call	generateRandom
	movq	rax, xmm0
	mov	QWORD PTR -24[rbp], rax
	mov	eax, 0
	call	generateRandom
	movq	rax, xmm0
	mov	QWORD PTR -16[rbp], rax
	movsd	xmm0, QWORD PTR -24[rbp]
	movapd	xmm1, xmm0
	mulsd	xmm1, xmm0
	movsd	xmm0, QWORD PTR -16[rbp]
	mulsd	xmm0, xmm0
	addsd	xmm0, xmm1
	movsd	QWORD PTR -8[rbp], xmm0
	movsd	xmm0, QWORD PTR .LC1[rip]
	comisd	xmm0, QWORD PTR -8[rbp]
	jb	.L7
	lea	rdi, mutex[rip]
	call	sem_wait@PLT
	mov	eax, DWORD PTR count[rip]
	add	eax, 1
	mov	DWORD PTR count[rip], eax
	lea	rdi, mutex[rip]
	call	sem_post@PLT
.L7:
	add	DWORD PTR -28[rbp], 1
.L6:
	mov	eax, DWORD PTR iter_per_thread[rip]
	cmp	DWORD PTR -28[rbp], eax
	jl	.L9
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	calculatePi, .-calculatePi
	.section	.rodata
	.align 8
.LC6:
	.string	"# of trials = %d, estimate of pi is %1.16f and an absolute error of %g\n"
	.align 8
.LC8:
	.string	"Elapsed time: %4f seconds || Threads: %d threads\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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
	call	clock@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	edx, 1
	mov	esi, 0
	lea	rdi, mutex[rip]
	call	sem_init@PLT
	mov	DWORD PTR -32[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, tid[rip]
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, calculatePi[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -32[rbp], 1
.L13:
	cmp	DWORD PTR -32[rbp], 15
	jle	.L14
	mov	DWORD PTR -28[rbp], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, tid[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -28[rbp], 1
.L15:
	cmp	DWORD PTR -28[rbp], 15
	jle	.L16
	mov	eax, DWORD PTR count[rip]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	movsd	xmm2, QWORD PTR .LC2[rip]
	movapd	xmm1, xmm0
	divsd	xmm1, xmm2
	movsd	xmm0, QWORD PTR .LC3[rip]
	mulsd	xmm0, xmm1
	movsd	QWORD PTR pi[rip], xmm0
	movsd	xmm0, QWORD PTR pi[rip]
	movsd	xmm1, QWORD PTR .LC4[rip]
	subsd	xmm0, xmm1
	movq	xmm1, QWORD PTR .LC5[rip]
	andpd	xmm0, xmm1
	mov	rax, QWORD PTR pi[rip]
	movapd	xmm1, xmm0
	movq	xmm0, rax
	mov	esi, 100000
	lea	rdi, .LC6[rip]
	mov	eax, 2
	call	printf@PLT
	call	clock@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, QWORD PTR -24[rbp]
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	movsd	xmm1, QWORD PTR .LC7[rip]
	divsd	xmm0, xmm1
	movsd	QWORD PTR -8[rbp], xmm0
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 16
	movq	xmm0, rax
	lea	rdi, .LC8[rip]
	mov	eax, 1
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-2097152
	.long	1106247679
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	0
	.long	1090021888
	.align 8
.LC3:
	.long	0
	.long	1074790400
	.align 8
.LC4:
	.long	1413754136
	.long	1074340347
	.align 16
.LC5:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.align 8
.LC7:
	.long	0
	.long	1093567616
	.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	"667808.c"
	.text
	.global	iter_per_thread
	.data
	.align	2
	.type	iter_per_thread, %object
	.size	iter_per_thread, 4
iter_per_thread:
	.word	6250
	.comm	tid,64,4
	.comm	mutex,16,4
	.global	count
	.bss
	.align	2
	.type	count, %object
	.size	count, 4
count:
	.space	4
	.global	pi
	.align	3
	.type	pi, %object
	.size	pi, 8
pi:
	.space	8
	.global	seed
	.data
	.align	2
	.type	seed, %object
	.size	seed, 4
seed:
	.word	676767676
	.global	__aeabi_ui2d
	.global	__aeabi_ddiv
	.text
	.align	2
	.global	generateRandom
	.syntax unified
	.arm
	.fpu softvfp
	.type	generateRandom, %function
generateRandom:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L3
	ldr	r3, [r3]
	ldr	r2, .L3+4
	mul	r3, r2, r3
	add	r3, r3, #122880
	add	r3, r3, #576
	ldr	r2, .L3
	str	r3, [r2]
	ldr	r3, .L3
	ldr	r3, [r3]
	mov	r0, r3
	bl	__aeabi_ui2d
	ldr	r2, .L3+8
	ldr	r3, .L3+12
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	seed
	.word	1103515245
	.word	-2097152
	.word	1106247679
	.size	generateRandom, .-generateRandom
	.global	__aeabi_dmul
	.global	__aeabi_dadd
	.global	__aeabi_dcmple
	.align	2
	.global	calculatePi
	.syntax unified
	.arm
	.fpu softvfp
	.type	calculatePi, %function
calculatePi:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #40
	str	r0, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L6
.L9:
	bl	generateRandom
	str	r0, [fp, #-36]
	str	r1, [fp, #-32]
	bl	generateRandom
	str	r0, [fp, #-28]
	str	r1, [fp, #-24]
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	sub	r1, fp, #28
	ldmia	r1, {r0-r1}
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_dadd
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	mov	r2, #0
	ldr	r3, .L12
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	bl	__aeabi_dcmple
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r0, .L12+4
	bl	sem_wait
	ldr	r3, .L12+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L12+8
	str	r3, [r2]
	ldr	r0, .L12+4
	bl	sem_post
.L7:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L6:
	ldr	r3, .L12+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	blt	.L9
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L13:
	.align	2
.L12:
	.word	1072693248
	.word	mutex
	.word	count
	.word	iter_per_thread
	.size	calculatePi, .-calculatePi
	.global	__aeabi_i2d
	.global	__aeabi_dsub
	.section	.rodata
	.align	2
.LC0:
	.ascii	"# of trials = %d, estimate of pi is %1.16f and an a"
	.ascii	"bsolute error of %g\012\000"
	.align	2
.LC1:
	.ascii	"Elapsed time: %4f seconds || Threads: %d threads\012"
	.ascii	"\000"
	.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, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #32
	bl	clock
	str	r0, [fp, #-36]
	mov	r2, #1
	mov	r1, #0
	ldr	r0, .L20
	bl	sem_init
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L15
.L16:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, .L20+4
	add	r0, r3, r2
	mov	r3, #0
	ldr	r2, .L20+8
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L15:
	ldr	r3, [fp, #-44]
	cmp	r3, #15
	ble	.L16
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L17
.L18:
	ldr	r2, .L20+4
	ldr	r3, [fp, #-40]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L17:
	ldr	r3, [fp, #-40]
	cmp	r3, #15
	ble	.L18
	ldr	r3, .L20+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, #0
	ldr	r3, .L20+16
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	mov	r2, #0
	ldr	r3, .L20+20
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	ldr	r1, .L20+24
	stm	r1, {r2-r3}
	ldr	r3, .L20+24
	ldmia	r3, {r6-r7}
	ldr	r3, .L20+24
	ldmia	r3, {r0-r1}
	ldr	r2, .L20+28
	ldr	r3, .L20+32
	bl	__aeabi_dsub
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	bic	r5, r3, #-2147483648
	stm	sp, {r4-r5}
	mov	r2, r6
	mov	r3, r7
	ldr	r1, .L20+36
	ldr	r0, .L20+40
	bl	printf
	bl	clock
	str	r0, [fp, #-32]
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-36]
	sub	r3, r2, r3
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, #0
	ldr	r3, .L20+44
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	str	r2, [fp, #-28]
	str	r3, [fp, #-24]
	mov	r3, #16
	str	r3, [sp]
	sub	r3, fp, #28
	ldmia	r3, {r2-r3}
	ldr	r0, .L20+48
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L21:
	.align	2
.L20:
	.word	mutex
	.word	tid
	.word	calculatePi
	.word	count
	.word	1090021888
	.word	1074790400
	.word	pi
	.word	1413754136
	.word	1074340347
	.word	100000
	.word	.LC0
	.word	1093567616
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
