	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pciehp_handle_presence_or_link_change ## -- Begin function pciehp_handle_presence_or_link_change
	.p2align	4, 0x90
_pciehp_handle_presence_or_link_change: ## @pciehp_handle_presence_or_link_change
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_3
## %bb.1:
	cmpl	$131, %eax
	jne	LBB0_8
## %bb.2:
	leaq	12(%rbx), %rdi
	callq	_cancel_delayed_work
LBB0_3:
	movq	_POWEROFF_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_PCI_EXP_SLTSTA_DLLSC@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_slot_name
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ctrl_info
LBB0_5:
	movq	_PCI_EXP_SLTSTA_PDC@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_slot_name
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ctrl_info
LBB0_7:
	movq	_SURPRISE_REMOVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pciehp_disable_slot
	jmp	LBB0_9
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_pciehp_card_present
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_pciehp_check_link_active
	movl	%eax, %r15d
	movl	%r12d, %eax
	orl	%r15d, %eax
	je	LBB0_18
## %bb.10:
	movl	(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_13
## %bb.11:
	cmpl	$130, %eax
	jne	LBB0_18
## %bb.12:
	leaq	12(%rbx), %rdi
	callq	_cancel_delayed_work
LBB0_13:
	movq	_POWERON_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r12d, %r12d
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	callq	_slot_name
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ctrl_info
LBB0_15:
	testl	%r15d, %r15d
	je	LBB0_17
## %bb.16:
	movq	%rbx, %rdi
	callq	_slot_name
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ctrl_info
LBB0_17:
	movq	%rbx, %rdi
	callq	_pciehp_enable_slot
	movl	%eax, 8(%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_POWEROFF_STATE,4,2             ## @POWEROFF_STATE
	.comm	_PCI_EXP_SLTSTA_DLLSC,4,2       ## @PCI_EXP_SLTSTA_DLLSC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Slot(%s): Link Down\n"

	.comm	_PCI_EXP_SLTSTA_PDC,4,2         ## @PCI_EXP_SLTSTA_PDC
L_.str.1:                               ## @.str.1
	.asciz	"Slot(%s): Card not present\n"

	.comm	_SURPRISE_REMOVAL,4,2           ## @SURPRISE_REMOVAL
	.comm	_POWERON_STATE,4,2              ## @POWERON_STATE
L_.str.2:                               ## @.str.2
	.asciz	"Slot(%s): Card present\n"

L_.str.3:                               ## @.str.3
	.asciz	"Slot(%s): Link Up\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pciehp_handle_presence_or_link_change ; -- Begin function pciehp_handle_presence_or_link_change
	.p2align	2
_pciehp_handle_presence_or_link_change: ; @pciehp_handle_presence_or_link_change
	.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	x21, x1
	mov	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #131
	b.ne	LBB0_8
; %bb.2:
	add	x0, x19, #12
	bl	_cancel_delayed_work
LBB0_3:
Lloh0:
	adrp	x8, _POWEROFF_STATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWEROFF_STATE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x20
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _PCI_EXP_SLTSTA_DLLSC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_EXP_SLTSTA_DLLSC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ctrl_info
LBB0_5:
Lloh8:
	adrp	x8, _PCI_EXP_SLTSTA_PDC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PCI_EXP_SLTSTA_PDC@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ctrl_info
LBB0_7:
Lloh13:
	adrp	x8, _SURPRISE_REMOVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SURPRISE_REMOVAL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pciehp_disable_slot
	b	LBB0_9
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	bl	_pciehp_card_present
	mov	x22, x0
	mov	x0, x19
	bl	_pciehp_check_link_active
	orr	w8, w22, w0
	cbz	w8, LBB0_18
; %bb.10:
	mov	x21, x0
	ldr	w8, [x19]
	cmp	w8, #129
	b.eq	LBB0_13
; %bb.11:
	cmp	w8, #130
	b.ne	LBB0_18
; %bb.12:
	add	x0, x19, #12
	bl	_cancel_delayed_work
LBB0_13:
Lloh16:
	adrp	x8, _POWERON_STATE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POWERON_STATE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x20
	bl	_mutex_unlock
	cbz	w22, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ctrl_info
LBB0_15:
	cbz	w21, LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_ctrl_info
LBB0_17:
	mov	x0, x19
	bl	_pciehp_enable_slot
	str	w0, [x19, #8]
	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_18:
	mov	x0, x20
	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
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_POWEROFF_STATE,4,2             ; @POWEROFF_STATE
	.comm	_PCI_EXP_SLTSTA_DLLSC,4,2       ; @PCI_EXP_SLTSTA_DLLSC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Slot(%s): Link Down\n"

	.comm	_PCI_EXP_SLTSTA_PDC,4,2         ; @PCI_EXP_SLTSTA_PDC
l_.str.1:                               ; @.str.1
	.asciz	"Slot(%s): Card not present\n"

	.comm	_SURPRISE_REMOVAL,4,2           ; @SURPRISE_REMOVAL
	.comm	_POWERON_STATE,4,2              ; @POWERON_STATE
l_.str.2:                               ; @.str.2
	.asciz	"Slot(%s): Card present\n"

l_.str.3:                               ; @.str.3
	.asciz	"Slot(%s): Link Up\n"

.subsections_via_symbols
