	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_agpioc_acquire_wrap            ## -- Begin function agpioc_acquire_wrap
	.p2align	4, 0x90
_agpioc_acquire_wrap:                   ## @agpioc_acquire_wrap
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movq	_AGP_FF_ALLOW_CONTROLLER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_agp_fe@GOTPCREL(%rip), %r15
	cmpq	$0, 8(%r15)
	je	LBB0_5
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_agp_bridge@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.7:
	callq	_atomic_read
	testq	%rax, %rax
	jne	LBB0_4
## %bb.8:
	movq	(%r12), %rdi
	callq	_atomic_inc
	movl	$1, (%r15)
	movl	4(%rbx), %edi
	callq	_agp_find_controller_by_pid
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	movl	4(%rbx), %edi
	callq	_agp_create_controller
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_agp_insert_controller
LBB0_12:
	movq	%r14, %rdi
	callq	_agp_controller_make_current
	movq	_AGP_FF_IS_CONTROLLER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	_AGP_FF_IS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_10:
	movl	$0, (%r15)
	movq	(%r12), %rdi
	callq	_agp_backend_release
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_AGP_FF_ALLOW_CONTROLLER,4,2    ## @AGP_FF_ALLOW_CONTROLLER
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_agp_fe,16,3                    ## @agp_fe
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_agp_bridge,8,3                 ## @agp_bridge
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AGP_FF_IS_CONTROLLER,4,2       ## @AGP_FF_IS_CONTROLLER
	.comm	_AGP_FF_IS_VALID,4,2            ## @AGP_FF_IS_VALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_agpioc_acquire_wrap            ; -- Begin function agpioc_acquire_wrap
	.p2align	2
_agpioc_acquire_wrap:                   ; @agpioc_acquire_wrap
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
Lloh2:
	adrp	x8, _AGP_FF_ALLOW_CONTROLLER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AGP_FF_ALLOW_CONTROLLER@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_bit
	cbz	w0, LBB0_3
; %bb.1:
Lloh5:
	adrp	x21, _agp_fe@GOTPAGE
Lloh6:
	ldr	x21, [x21, _agp_fe@GOTPAGEOFF]
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_6
LBB0_2:
Lloh7:
	adrp	x8, _EBUSY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _EPERM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
LBB0_6:
Lloh11:
	adrp	x22, _agp_bridge@GOTPAGE
Lloh12:
	ldr	x22, [x22, _agp_bridge@GOTPAGEOFF]
	ldr	x0, [x22]
	cbz	x0, LBB0_12
; %bb.7:
	bl	_atomic_read
	cbnz	x0, LBB0_2
; %bb.8:
	ldr	x0, [x22]
	bl	_atomic_inc
	mov	w8, #1
	str	w8, [x21]
	ldr	w0, [x19, #4]
	bl	_agp_find_controller_by_pid
	mov	x20, x0
	cbnz	x0, LBB0_11
; %bb.9:
	ldr	w0, [x19, #4]
	bl	_agp_create_controller
	cbz	x0, LBB0_13
; %bb.10:
	mov	x20, x0
	bl	_agp_insert_controller
LBB0_11:
	mov	x0, x20
	bl	_agp_controller_make_current
Lloh13:
	adrp	x8, _AGP_FF_IS_CONTROLLER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AGP_FF_IS_CONTROLLER@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
Lloh16:
	adrp	x8, _AGP_FF_IS_VALID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AGP_FF_IS_VALID@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
	mov	w0, #0
	b	LBB0_5
LBB0_12:
Lloh19:
	adrp	x8, _ENODEV@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
LBB0_13:
	str	wzr, [x21]
	ldr	x0, [x22]
	bl	_agp_backend_release
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_AGP_FF_ALLOW_CONTROLLER,4,2    ; @AGP_FF_ALLOW_CONTROLLER
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_agp_fe,16,3                    ; @agp_fe
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_agp_bridge,8,3                 ; @agp_bridge
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AGP_FF_IS_CONTROLLER,4,2       ; @AGP_FF_IS_CONTROLLER
	.comm	_AGP_FF_IS_VALID,4,2            ; @AGP_FF_IS_VALID
.subsections_via_symbols
