	.file	"extr_mem.c_register_mem_int.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	register_mem_int, @function
register_mem_int:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	mov	edi, 32
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	malloc@PLT
	mov	r13d, DWORD PTR ENOMEM[rip]
	test	rax, rax
	je	.L1
	movdqu	xmm0, XMMWORD PTR [rbx]
	mov	rbp, rax
	lea	rdi, mmio_rwlock[rip]
	movups	XMMWORD PTR 16[rax], xmm0
	mov	rax, QWORD PTR [rbx]
	mov	QWORD PTR 8[rbp], rax
	add	rax, QWORD PTR 8[rbx]
	sub	rax, 1
	mov	QWORD PTR 0[rbp], rax
	call	pthread_rwlock_wrlock@PLT
	mov	rsi, QWORD PTR [rbx]
	mov	rdx, rsp
	mov	rdi, r12
	call	mmio_rb_lookup@PLT
	test	rax, rax
	jne	.L3
	lea	rdi, mmio_rwlock[rip]
	xor	r13d, r13d
	call	pthread_rwlock_unlock@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	rdi, r12
	mov	rsi, rbp
	call	mmio_rb_add@PLT
	lea	rdi, mmio_rwlock[rip]
	mov	r13d, eax
	call	pthread_rwlock_unlock@PLT
	test	r13d, r13d
	je	.L1
	mov	rdi, rbp
	call	free@PLT
	jmp	.L1
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	register_mem_int, .-register_mem_int
	.comm	mmio_rwlock,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mem.c_register_mem_int.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	register_mem_int, %function
register_mem_int:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L12
	sub	sp, sp, #8
	mov	r6, r0
	mov	r0, #16
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	malloc
	subs	r4, r0, #0
	beq	.L2
	ldm	r5, {r0, r1}
	add	r3, r0, r1
	add	ip, r4, #8
	sub	r3, r3, #1
	stm	ip, {r0, r1}
	str	r3, [r4]
	str	r0, [r4, #4]
	ldr	r0, .L12+4
	bl	pthread_rwlock_wrlock
	ldr	r1, [r5]
	mov	r2, sp
	mov	r0, r6
	bl	mmio_rb_lookup
	subs	r5, r0, #0
	bne	.L3
	ldr	r0, .L12+4
	bl	pthread_rwlock_unlock
.L1:
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L3:
	mov	r1, r4
	mov	r0, r6
	bl	mmio_rb_add
	mov	r5, r0
	ldr	r0, .L12+4
	bl	pthread_rwlock_unlock
	cmp	r5, #0
	beq	.L1
	mov	r0, r4
	bl	free
	b	.L1
.L2:
	ldr	r3, .L12+8
	ldr	r5, [r3]
	b	.L1
.L11:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	.LC0
	.word	mmio_rwlock
	.word	ENOMEM
	.size	register_mem_int, .-register_mem_int
	.comm	mmio_rwlock,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
