	.file	"877043.c"
	.intel_syntax noprefix
	.text
	.globl	lock
	.bss
	.align 32
	.type	lock, @object
	.size	lock, 56
lock:
	.zero	56
	.globl	glob
	.align 4
	.type	glob, @object
	.size	glob, 4
glob:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	yptr
	.section	.data.rel.local,"aw"
	.align 8
	.type	yptr, @object
	.size	yptr, 8
yptr:
	.quad	y
	.text
	.globl	reader
	.type	reader, @function
reader:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	lea	rdi, lock[rip]
	call	pthread_rwlock_rdlock@PLT
	mov	rax, QWORD PTR yptr[rip]
	mov	edx, DWORD PTR glob[rip]
	mov	DWORD PTR [rax], edx
	lea	rdi, lock[rip]
	call	pthread_rwlock_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	reader, .-reader
	.globl	writer
	.type	writer, @function
writer:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	lea	rdi, lock[rip]
	call	pthread_rwlock_wrlock@PLT
	mov	eax, DWORD PTR glob[rip]
	add	eax, 1
	mov	DWORD PTR glob[rip], eax
	lea	rdi, lock[rip]
	call	pthread_rwlock_unlock@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	writer, .-writer
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 0
	lea	rdi, lock[rip]
	call	pthread_rwlock_init@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L4
.L7:
	mov	edx, DWORD PTR -36[rbp]
	movsx	rax, edx
	imul	rax, rax, 1431655766
	shr	rax, 32
	mov	ecx, edx
	sar	ecx, 31
	sub	eax, ecx
	mov	ecx, eax
	add	ecx, ecx
	add	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	test	eax, eax
	jne	.L5
	lea	rdx, -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, writer[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	jmp	.L6
.L5:
	lea	rdx, -32[rbp]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	ecx, 0
	lea	rdx, reader[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
.L6:
	add	DWORD PTR -36[rbp], 1
.L4:
	cmp	DWORD PTR -36[rbp], 2
	jle	.L7
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE2:
	.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	"877043.c"
	.text
	.comm	lock,32,4
	.global	glob
	.bss
	.align	2
	.type	glob, %object
	.size	glob, 4
glob:
	.space	4
	.global	y
	.align	2
	.type	y, %object
	.size	y, 4
y:
	.space	4
	.global	yptr
	.data
	.align	2
	.type	yptr, %object
	.size	yptr, 4
yptr:
	.word	y
	.text
	.align	2
	.global	reader
	.syntax unified
	.arm
	.fpu softvfp
	.type	reader, %function
reader:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, .L2
	bl	pthread_rwlock_rdlock
	ldr	r3, .L2+4
	ldr	r3, [r3]
	ldr	r2, .L2+8
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r0, .L2
	bl	pthread_rwlock_unlock
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	lock
	.word	yptr
	.word	glob
	.size	reader, .-reader
	.align	2
	.global	writer
	.syntax unified
	.arm
	.fpu softvfp
	.type	writer, %function
writer:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, .L5
	bl	pthread_rwlock_wrlock
	ldr	r3, .L5+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L5+4
	str	r3, [r2]
	ldr	r0, .L5
	bl	pthread_rwlock_unlock
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	lock
	.word	glob
	.size	writer, .-writer
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #0
	ldr	r0, .L13+4
	bl	pthread_rwlock_init
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L8
.L11:
	ldr	r1, [fp, #-24]
	ldr	r3, .L13+8
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L9
	sub	r2, fp, #20
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L13+12
	mov	r1, #0
	bl	pthread_create
	b	.L10
.L9:
	sub	r2, fp, #20
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	add	r0, r2, r3
	mov	r3, #0
	ldr	r2, .L13+16
	mov	r1, #0
	bl	pthread_create
.L10:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L8:
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	ble	.L11
	mov	r0, #0
	bl	pthread_exit
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	lock
	.word	1431655766
	.word	writer
	.word	reader
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
