	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpci_hp_register_bus           ## -- Begin function cpci_hp_register_bus
	.p2align	4, 0x90
_cpci_hp_register_bus:                  ## @cpci_hp_register_bus
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SLOT_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	je	LBB0_6
## %bb.1:
	movq	_controller@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.2:
	xorl	%r14d, %r14d
	cmpl	%ebx, %r12d
	jg	LBB0_12
## %bb.3:
	incl	%ebx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r13
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, 24(%rax)
	movl	%r12d, (%rax)
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_PCI_DEVFN
	movl	%eax, 16(%r13)
	movq	_SLOT_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %ecx
	movq	%r15, %rdi
	leaq	L_.str(%rip), %rdx
	movl	%r12d, %r8d
	callq	_snprintf
	leaq	8(%r13), %rbx
	movq	_cpci_hotplug_slot_ops@GOTPCREL(%rip), %rax
	movq	%rax, 8(%r13)
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	callq	_dbg
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r12d, %edx
	movq	%r15, %rcx
	callq	_pci_hp_register
	testl	%eax, %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_slot_name
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rsi
	callq	_dbg
	movq	_list_rwsem@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_down_write
	addq	$4, %r13
	movq	%r13, %rdi
	movq	_slot_list@GOTPCREL(%rip), %rsi
	callq	_list_add
	movq	_slots@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	%rbx, %rdi
	callq	_up_write
	incl	%r12d
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%r12d, %ebx
	jne	LBB0_4
## %bb.11:
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_err
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_12
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SLOT_NAME_SIZE,4,2             ## @SLOT_NAME_SIZE
	.comm	_controller,8,3                 ## @controller
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%02x:%02x"

	.comm	_cpci_hotplug_slot_ops,4,2      ## @cpci_hotplug_slot_ops
L_.str.1:                               ## @.str.1
	.asciz	"registering slot %s"

L_.str.2:                               ## @.str.2
	.asciz	"pci_hp_register failed with error %d"

L_.str.3:                               ## @.str.3
	.asciz	"slot registered with name: %s"

	.comm	_list_rwsem,4,2                 ## @list_rwsem
	.comm	_slot_list,4,2                  ## @slot_list
	.comm	_slots,4,2                      ## @slots
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpci_hp_register_bus           ; -- Begin function cpci_hp_register_bus
	.p2align	2
_cpci_hp_register_bus:                  ; @cpci_hp_register_bus
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x22, _SLOT_NAME_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _SLOT_NAME_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	cbz	x0, LBB0_8
; %bb.1:
Lloh7:
	adrp	x8, _controller@GOTPAGE
Lloh8:
	ldr	x8, [x8, _controller@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.2:
	cmp	w19, w2
	b.gt	LBB0_7
; %bb.3:
	add	w25, w2, #1
Lloh10:
	adrp	x24, _list_rwsem@GOTPAGE
Lloh11:
	ldr	x24, [x24, _list_rwsem@GOTPAGEOFF]
Lloh12:
	adrp	x23, _slots@GOTPAGE
Lloh13:
	ldr	x23, [x23, _slots@GOTPAGEOFF]
Lloh14:
	adrp	x26, l_.str.3@PAGE
Lloh15:
	add	x26, x26, l_.str.3@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
Lloh16:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, x0
	str	x20, [x0, #24]
	str	w19, [x0]
	mov	x0, x19
	mov	w1, #0
	bl	_PCI_DEVFN
	str	w0, [x27, #16]
	ldr	w1, [x22]
	ldr	w3, [x20]
	mov	x0, x21
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x4, x19
	bl	_snprintf
	mov	x28, x27
Lloh21:
	adrp	x8, _cpci_hotplug_slot_ops@GOTPAGE
Lloh22:
	ldr	x8, [x8, _cpci_hotplug_slot_ops@GOTPAGEOFF]
	str	x8, [x28, #8]!
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_dbg
	mov	x0, x28
	mov	x1, x20
	mov	x2, x19
	mov	x3, x21
	bl	_pci_hp_register
	cbnz	w0, LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_slot_name
	mov	x1, x0
	mov	x0, x26
	bl	_dbg
	mov	x0, x24
	bl	_down_write
	add	x0, x27, #4
Lloh25:
	adrp	x1, _slot_list@GOTPAGE
Lloh26:
	ldr	x1, [x1, _slot_list@GOTPAGEOFF]
	bl	_list_add
	ldr	w8, [x23]
	add	w8, w8, #1
	str	w8, [x23]
	mov	x0, x24
	bl	_up_write
	add	w19, w19, #1
	cmp	w25, w19
	b.ne	LBB0_4
LBB0_7:
	mov	w28, #0
	b	LBB0_10
LBB0_8:
Lloh27:
	adrp	x8, _ENODEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w28, w8
LBB0_10:
	ldur	x8, [x29, #-88]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.11:
	mov	x0, x28
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
Lloh32:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
LBB0_13:
	mov	x28, x0
Lloh34:
	adrp	x0, l_.str.2@PAGE
Lloh35:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x28
	bl	_err
	mov	x0, x27
	bl	_kfree
	b	LBB0_10
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_SLOT_NAME_SIZE,4,2             ; @SLOT_NAME_SIZE
	.comm	_controller,8,3                 ; @controller
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%02x:%02x"

	.comm	_cpci_hotplug_slot_ops,4,2      ; @cpci_hotplug_slot_ops
l_.str.1:                               ; @.str.1
	.asciz	"registering slot %s"

l_.str.2:                               ; @.str.2
	.asciz	"pci_hp_register failed with error %d"

l_.str.3:                               ; @.str.3
	.asciz	"slot registered with name: %s"

	.comm	_list_rwsem,4,2                 ; @list_rwsem
	.comm	_slot_list,4,2                  ; @slot_list
	.comm	_slots,4,2                      ; @slots
.subsections_via_symbols
