	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcie_port_device_register      ## -- Begin function pcie_port_device_register
	.p2align	4, 0x90
_pcie_port_device_register:             ## @pcie_port_device_register
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PCIE_PORT_DEVICE_MAXSERVICES@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%r15, %rdi
	callq	_pci_enable_device
	testl	%eax, %eax
	jne	LBB0_13
## %bb.1:
	movq	%r15, %rdi
	callq	_get_port_device_capability
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_pci_set_master
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_pcie_init_service_irqs
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	movq	_PCIE_PORT_SERVICE_HP@GOTPCREL(%rip), %rax
	andl	(%rax), %r13d
	je	LBB0_12
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movq	%r12, %rdx
	xorl	%r12d, %r12d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	(%rdx), %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %esi
	movl	%ebx, %ecx
	shll	%cl, %esi
	btl	%ebx, %r13d
	jae	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r14,%rbx,4), %edx
	movq	%r15, %rdi
	callq	_pcie_device_init
	cmpl	$1, %eax
	adcl	$0, %r12d
	movq	_PCIE_PORT_DEVICE_MAXSERVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_10:
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jne	LBB0_13
LBB0_11:
	movq	%r15, %rdi
	callq	_pci_free_irq_vectors
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
LBB0_12:
	movq	%r15, %rdi
	callq	_pci_disable_device
	movl	%ebx, %eax
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIE_PORT_DEVICE_MAXSERVICES,4,2 ## @PCIE_PORT_DEVICE_MAXSERVICES
	.comm	_PCIE_PORT_SERVICE_HP,4,2       ## @PCIE_PORT_SERVICE_HP
	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcie_port_device_register      ; -- Begin function pcie_port_device_register
	.p2align	2
_pcie_port_device_register:             ; @pcie_port_device_register
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x23, _PCIE_PORT_DEVICE_MAXSERVICES@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PCIE_PORT_DEVICE_MAXSERVICES@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	x8, x8, #2
	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, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	bl	_pci_enable_device
	mov	x22, x0
	cbnz	w0, LBB0_14
; %bb.1:
	mov	x0, x19
	bl	_get_port_device_capability
	cbz	w0, LBB0_10
; %bb.2:
	mov	x21, x0
	mov	x0, x19
	bl	_pci_set_master
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_pcie_init_service_irqs
	cbz	w0, LBB0_4
; %bb.3:
Lloh7:
	adrp	x8, _PCIE_PORT_SERVICE_HP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PCIE_PORT_SERVICE_HP@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ands	w21, w8, w21
	b.eq	LBB0_12
LBB0_4:
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w22, [x8]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.5:
	mov	x25, #0
	mov	w24, #0
	mov	w26, #1
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
	cmp	x25, w8, sxtw
	b.ge	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w1, w26, w25
	tst	w1, w21
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w2, [x20, x25, lsl #2]
	mov	x0, x19
	bl	_pcie_device_init
	cmp	w0, #0
	cinc	w24, w24, eq
	ldr	w8, [x23]
	b	LBB0_6
LBB0_9:
	cbz	w24, LBB0_11
LBB0_10:
	mov	w22, #0
	b	LBB0_14
LBB0_11:
	neg	w22, w22
	mov	x0, x19
	bl	_pci_free_irq_vectors
	b	LBB0_13
LBB0_12:
	mov	x22, x0
LBB0_13:
	mov	x0, x19
	bl	_pci_disable_device
LBB0_14:
	ldur	x8, [x29, #-72]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x22
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIE_PORT_DEVICE_MAXSERVICES,4,2 ; @PCIE_PORT_DEVICE_MAXSERVICES
	.comm	_PCIE_PORT_SERVICE_HP,4,2       ; @PCIE_PORT_SERVICE_HP
	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
