	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pciehp_sysfs_enable_slot       ## -- Begin function pciehp_sysfs_enable_slot
	.p2align	4, 0x90
_pciehp_sysfs_enable_slot:              ## @pciehp_sysfs_enable_slot
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_to_ctrl
	movq	%rax, %rbx
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_7
## %bb.1:
	movl	$38, %ecx
	btl	%eax, %ecx
	jae	LBB0_2
## %bb.6:
	movq	%rbx, %rdi
	callq	_slot_name
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_2:
	movl	$24, %ecx
	btl	%eax, %ecx
	jae	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, 4(%rbx)
	movq	_PCI_EXP_SLTSTA_PDC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pciehp_request
	movl	16(%rbx), %r14d
	movq	%rbx, %rdi
	addq	$12, %rdi
	callq	_atomic_read
	xorl	%esi, %esi
	testl	%eax, %eax
	sete	%sil
	movl	%r14d, %edi
	callq	_wait_event
	movl	4(%rbx), %eax
	jmp	LBB0_9
LBB0_7:
	movq	%rbx, %rdi
	callq	_slot_name
	movl	(%rbx), %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ctrl_err
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	callq	_slot_name
	leaq	L_.str(%rip), %rsi
LBB0_5:
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ctrl_info
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_PCI_EXP_SLTSTA_PDC,4,2         ## @PCI_EXP_SLTSTA_PDC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Slot(%s): Already in powering on state\n"

L_.str.1:                               ## @.str.1
	.asciz	"Slot(%s): Already enabled\n"

L_.str.2:                               ## @.str.2
	.asciz	"Slot(%s): Invalid state %#x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pciehp_sysfs_enable_slot       ; -- Begin function pciehp_sysfs_enable_slot
	.p2align	2
_pciehp_sysfs_enable_slot:              ; @pciehp_sysfs_enable_slot
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_to_ctrl
	mov	x19, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_5
; %bb.1:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #38
	tst	w8, w9
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_3:
	tst	w8, #0x18
	b.eq	LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_mutex_unlock
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w8, w8
	str	w8, [x19, #4]
Lloh5:
	adrp	x8, _PCI_EXP_SLTSTA_PDC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCI_EXP_SLTSTA_PDC@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pciehp_request
	ldr	w20, [x19, #16]
	add	x0, x19, #12
	bl	_atomic_read
	cmp	w0, #0
	cset	w1, eq
	mov	x0, x20
	bl	_wait_event
	ldr	w0, [x19, #4]
	b	LBB0_9
LBB0_5:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
	ldr	w3, [x19]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ctrl_err
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_slot_name
	mov	x2, x0
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_ctrl_info
LBB0_8:
	mov	x0, x20
	bl	_mutex_unlock
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_PCI_EXP_SLTSTA_PDC,4,2         ; @PCI_EXP_SLTSTA_PDC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Slot(%s): Already in powering on state\n"

l_.str.1:                               ; @.str.1
	.asciz	"Slot(%s): Already enabled\n"

l_.str.2:                               ; @.str.2
	.asciz	"Slot(%s): Invalid state %#x\n"

.subsections_via_symbols
