	.file	"extr_apbps2.c_apbps2_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	apbps2_open, @function
apbps2_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, 1024
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rbp, QWORD PTR [rdi]
	xor	edi, edi
	mov	rax, QWORD PTR 0[rbp]
	lea	rsi, 8[rax]
	call	iowrite32be@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	sub	ebx, 1
	je	.L4
	lea	rdi, 4[rsi]
	call	ioread32be@PLT
.L2:
	mov	rax, QWORD PTR 0[rbp]
	lea	rdi, 8[rax]
	call	ioread32be@PLT
	mov	rsi, QWORD PTR 0[rbp]
	test	QWORD PTR APBPS2_STATUS_DR[rip], rax
	jne	.L3
.L4:
	mov	edi, DWORD PTR APBPS2_CTRL_RE[rip]
	or	edi, DWORD PTR APBPS2_CTRL_RI[rip]
	call	iowrite32be@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	apbps2_open, .-apbps2_open
	.comm	APBPS2_STATUS_DR,8,8
	.comm	APBPS2_CTRL_RI,4,4
	.comm	APBPS2_CTRL_RE,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_apbps2.c_apbps2_open.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	apbps2_open, %function
apbps2_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, [r0]
	mov	r0, #0
	ldr	r1, [r5]
	mov	r4, #1024
	add	r1, r1, #8
	bl	iowrite32be
	ldr	r6, .L8
	b	.L2
.L3:
	subs	r4, r4, #1
	ldr	r1, [r5]
	beq	.L4
	add	r0, r1, #4
	bl	ioread32be
.L2:
	ldr	r0, [r5]
	add	r0, r0, #8
	bl	ioread32be
	ldr	r3, [r6]
	tst	r0, r3
	bne	.L3
	ldr	r1, [r5]
.L4:
	ldr	r2, .L8+4
	ldr	r3, .L8+8
	ldr	r0, [r2]
	ldr	r3, [r3]
	orr	r0, r0, r3
	bl	iowrite32be
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L9:
	.align	2
.L8:
	.word	APBPS2_STATUS_DR
	.word	APBPS2_CTRL_RE
	.word	APBPS2_CTRL_RI
	.size	apbps2_open, .-apbps2_open
	.comm	APBPS2_STATUS_DR,4,4
	.comm	APBPS2_CTRL_RI,4,4
	.comm	APBPS2_CTRL_RE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
