	.file	"961310.c"
	.intel_syntax noprefix
	.text
	.globl	shrdPtr
	.bss
	.align 8
	.type	shrdPtr, @object
	.size	shrdPtr, 8
shrdPtr:
	.zero	8
	.globl	shrdPtr2
	.align 8
	.type	shrdPtr2, @object
	.size	shrdPtr2, 8
shrdPtr2:
	.zero	8
	.globl	lock
	.align 32
	.type	lock, @object
	.size	lock, 40
lock:
	.zero	40
	.globl	lock2
	.align 32
	.type	lock2, @object
	.size	lock2, 40
lock2:
	.zero	40
	.text
	.globl	accessorThread
	.type	accessorThread, @function
accessorThread:
.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	edi, 8
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], 0
	jmp	.L2
.L4:
	lea	rdi, lock[rip]
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR shrdPtr[rip]
	test	rax, rax
	je	.L3
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR shrdPtr[rip]
	mov	eax, DWORD PTR [rax]
	cdqe
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
.L3:
	lea	rdi, lock[rip]
	call	pthread_mutex_unlock@PLT
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	add	eax, 1
	mov	edi, eax
	call	usleep@PLT
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	rax, 39999
	jbe	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_exit@PLT
	.cfi_endproc
.LFE6:
	.size	accessorThread, .-accessorThread
	.globl	accessorThread2
	.type	accessorThread2, @function
accessorThread2:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	edi, 8
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], 0
	jmp	.L6
.L8:
	lea	rdi, lock2[rip]
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR shrdPtr2[rip]
	test	rax, rax
	je	.L7
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR shrdPtr2[rip]
	mov	eax, DWORD PTR [rax]
	cdqe
	add	rdx, rax
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
.L7:
	lea	rdi, lock2[rip]
	call	pthread_mutex_unlock@PLT
	call	rand@PLT
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	add	eax, 1
	mov	edi, eax
	call	usleep@PLT
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	rax, 39999
	jbe	.L8
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.size	accessorThread2, .-accessorThread2
	.section	.rodata
.LC0:
	.string	"Final value of res was %d\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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -52[rbp], 0
	mov	edi, 4
	call	malloc@PLT
	mov	QWORD PTR shrdPtr[rip], rax
	mov	rax, QWORD PTR shrdPtr[rip]
	mov	DWORD PTR [rax], 1
	mov	edi, 4
	call	malloc@PLT
	mov	QWORD PTR shrdPtr2[rip], rax
	mov	rax, QWORD PTR shrdPtr2[rip]
	mov	DWORD PTR [rax], 2
	mov	esi, 0
	lea	rdi, lock[rip]
	call	pthread_mutex_init@PLT
	mov	esi, 0
	lea	rdi, lock2[rip]
	call	pthread_mutex_init@PLT
	mov	rdx, QWORD PTR shrdPtr2[rip]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	lea	rdx, accessorThread2[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	edi, 10
	call	usleep@PLT
	mov	rax, QWORD PTR shrdPtr[rip]
	lea	rdx, -48[rbp]
	lea	rdi, 8[rdx]
	mov	rcx, rax
	lea	rdx, accessorThread[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	edi, 10
	call	usleep@PLT
	mov	rax, QWORD PTR shrdPtr[rip]
	lea	rdx, -48[rbp]
	lea	rdi, 16[rdx]
	mov	rcx, rax
	lea	rdx, accessorThread[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	edi, 10
	call	usleep@PLT
	mov	rax, QWORD PTR shrdPtr2[rip]
	lea	rdx, -48[rbp]
	lea	rdi, 24[rdx]
	mov	rcx, rax
	lea	rdx, accessorThread2[rip]
	mov	esi, 0
	call	pthread_create@PLT
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, -52[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	edx, DWORD PTR -56[rbp]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"961310.c"
	.text
	.comm	shrdPtr,4,4
	.comm	shrdPtr2,4,4
	.comm	lock,24,4
	.comm	lock2,24,4
	.align	2
	.global	accessorThread
	.syntax unified
	.arm
	.fpu softvfp
	.type	accessorThread, %function
accessorThread:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #16
	str	r0, [fp, #-24]
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r1, [fp, #-16]
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	b	.L2
.L4:
	ldr	r0, .L5
	bl	pthread_mutex_lock
	ldr	r3, .L5+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-16]
	ldmia	r3, {r0-r1}
	ldr	r3, .L5+4
	ldr	r3, [r3]
	ldr	r3, [r3]
	mov	r2, r3
	asr	r3, r2, #31
	adds	r4, r0, r2
	adc	r5, r1, r3
	ldr	r3, [fp, #-16]
	stm	r3, {r4-r5}
.L3:
	ldr	r0, .L5
	bl	pthread_mutex_unlock
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	add	r3, r3, #1
	mov	r0, r3
	bl	usleep
.L2:
	ldr	r3, [fp, #-16]
	ldmia	r3, {r2-r3}
	ldr	r0, .L5+8
	mov	r1, #0
	cmp	r3, r1
	cmpeq	r2, r0
	bls	.L4
	ldr	r0, [fp, #-16]
	bl	pthread_exit
.L6:
	.align	2
.L5:
	.word	lock
	.word	shrdPtr
	.word	39999
	.size	accessorThread, .-accessorThread
	.align	2
	.global	accessorThread2
	.syntax unified
	.arm
	.fpu softvfp
	.type	accessorThread2, %function
accessorThread2:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #16
	str	r0, [fp, #-24]
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r1, [fp, #-16]
	mov	r2, #0
	mov	r3, #0
	stm	r1, {r2-r3}
	b	.L8
.L10:
	ldr	r0, .L11
	bl	pthread_mutex_lock
	ldr	r3, .L11+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L9
	ldr	r3, [fp, #-16]
	ldmia	r3, {r0-r1}
	ldr	r3, .L11+4
	ldr	r3, [r3]
	ldr	r3, [r3]
	mov	r2, r3
	asr	r3, r2, #31
	adds	r4, r0, r2
	adc	r5, r1, r3
	ldr	r3, [fp, #-16]
	stm	r3, {r4-r5}
.L9:
	ldr	r0, .L11
	bl	pthread_mutex_unlock
	bl	rand
	mov	r3, r0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	add	r3, r3, #1
	mov	r0, r3
	bl	usleep
.L8:
	ldr	r3, [fp, #-16]
	ldmia	r3, {r2-r3}
	ldr	r0, .L11+8
	mov	r1, #0
	cmp	r3, r1
	cmpeq	r2, r0
	bls	.L10
	ldr	r0, [fp, #-16]
	bl	pthread_exit
.L12:
	.align	2
.L11:
	.word	lock2
	.word	shrdPtr2
	.word	39999
	.size	accessorThread2, .-accessorThread2
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Final value of res was %d\012\000"
	.align	2
.LC1:
	.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
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L16+4
	str	r2, [r3]
	ldr	r3, .L16+4
	ldr	r3, [r3]
	mov	r2, #1
	str	r2, [r3]
	mov	r0, #4
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L16+8
	str	r2, [r3]
	ldr	r3, .L16+8
	ldr	r3, [r3]
	mov	r2, #2
	str	r2, [r3]
	mov	r1, #0
	ldr	r0, .L16+12
	bl	pthread_mutex_init
	mov	r1, #0
	ldr	r0, .L16+16
	bl	pthread_mutex_init
	ldr	r3, .L16+8
	ldr	r3, [r3]
	sub	r0, fp, #24
	ldr	r2, .L16+20
	mov	r1, #0
	bl	pthread_create
	mov	r0, #10
	bl	usleep
	ldr	r3, .L16+4
	ldr	r2, [r3]
	sub	r3, fp, #24
	add	r0, r3, #4
	mov	r3, r2
	ldr	r2, .L16+24
	mov	r1, #0
	bl	pthread_create
	mov	r0, #10
	bl	usleep
	ldr	r3, .L16+4
	ldr	r2, [r3]
	sub	r3, fp, #24
	add	r0, r3, #8
	mov	r3, r2
	ldr	r2, .L16+24
	mov	r1, #0
	bl	pthread_create
	mov	r0, #10
	bl	usleep
	ldr	r3, .L16+8
	ldr	r2, [r3]
	sub	r3, fp, #24
	add	r0, r3, #12
	mov	r3, r2
	ldr	r2, .L16+20
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-24]
	sub	r2, fp, #32
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-20]
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-16]
	sub	r2, fp, #28
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-12]
	sub	r2, fp, #32
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L16+28
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	ldr	r1, .L16+32
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC1
	.word	shrdPtr
	.word	shrdPtr2
	.word	lock
	.word	lock2
	.word	accessorThread2
	.word	accessorThread
	.word	stderr
	.word	.LC0
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
