	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apbps2_open
_apbps2_open:                           ## @apbps2_open
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r15
	movq	(%r15), %rsi
	addq	$8, %rsi
	xorl	%edi, %edi
	callq	_iowrite32be
	movq	(%r15), %rdi
	addq	$8, %rdi
	callq	_ioread32be
	movq	_APBPS2_STATUS_DR@GOTPCREL(%rip), %r14
	testq	%rax, (%r14)
	je	LBB0_4
## %bb.1:
	movl	$-1024, %ebx                    ## imm = 0xFC00
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rdi
	addq	$4, %rdi
	callq	_ioread32be
	movq	(%r15), %rdi
	addq	$8, %rdi
	callq	_ioread32be
	testq	%rax, (%r14)
	jne	LBB0_2
LBB0_4:
	movq	_APBPS2_CTRL_RE@GOTPCREL(%rip), %rax
	movq	_APBPS2_CTRL_RI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	(%r15), %rsi
	callq	_iowrite32be
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APBPS2_STATUS_DR,8,3           ## @APBPS2_STATUS_DR
	.comm	_APBPS2_CTRL_RE,4,2             ## @APBPS2_CTRL_RE
	.comm	_APBPS2_CTRL_RI,4,2             ## @APBPS2_CTRL_RI
	.no_dead_strip	_apbps2_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apbps2_open
_apbps2_open:                           ; @apbps2_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	ldr	x19, [x0]
	ldr	x8, [x19]
	add	x1, x8, #8
	mov	w0, #0
	bl	_iowrite32be
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_ioread32be
Lloh0:
	adrp	x20, _APBPS2_STATUS_DR@GOTPAGE
Lloh1:
	ldr	x20, [x20, _APBPS2_STATUS_DR@GOTPAGEOFF]
	ldr	x8, [x20]
	tst	x8, x0
	b.eq	LBB0_4
; %bb.1:
	mov	w21, #-1024
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	adds	w21, w21, #1
	b.hs	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19]
	add	x0, x8, #4
	bl	_ioread32be
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_ioread32be
	ldr	x8, [x20]
	tst	x8, x0
	b.ne	LBB0_2
LBB0_4:
Lloh2:
	adrp	x8, _APBPS2_CTRL_RE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _APBPS2_CTRL_RE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _APBPS2_CTRL_RI@GOTPAGE
Lloh6:
	ldr	x9, [x9, _APBPS2_CTRL_RI@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x1, [x19]
	bl	_iowrite32be
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_APBPS2_STATUS_DR,8,3           ; @APBPS2_STATUS_DR
	.comm	_APBPS2_CTRL_RE,4,2             ; @APBPS2_CTRL_RE
	.comm	_APBPS2_CTRL_RI,4,2             ; @APBPS2_CTRL_RI
	.no_dead_strip	_apbps2_open
.subsections_via_symbols
