	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcifront_detach_devices
_pcifront_detach_devices:               ## @pcifront_detach_devices
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movl	8(%rax), %edi
	callq	_xenbus_read_driver_state
	movq	_XenbusStateConnected@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.1:
	movq	_XBT_NIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rax
	movl	4(%rax), %esi
	leaq	L_.str(%rip), %rdx
	leaq	L_.str.1(%rip), %rcx
	leaq	-132(%rbp), %r8
	xorl	%eax, %eax
	callq	_xenbus_scanf
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.2:
	cmpl	$0, -132(%rbp)
	jle	LBB0_15
## %bb.3:
	leaq	L_.str.3(%rip), %r15
	leaq	-112(%rbp), %r12
	movq	_XenbusStateUnknown@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	movq	%rbx, -144(%rbp)                ## 8-byte Spill
	jmp	LBB0_4
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	movq	(%rbx), %rdi
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %ecx
	movl	-120(%rbp), %r8d
	movl	-116(%rbp), %r9d
	leaq	L_.str.7(%rip), %rsi
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	callq	_dev_dbg
	movq	%r12, %r15
	leaq	-112(%rbp), %r12
	movq	_XenbusStateUnknown@GOTPCREL(%rip), %r13
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%r14d
	cmpl	-132(%rbp), %r14d
	jge	LBB0_15
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$64, %esi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	callq	_snprintf
	xorl	%edi, %edi
	cmpl	$63, %eax
	setae	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%rbx), %rax
	movl	4(%rax), %edi
	movl	(%r13), %edx
	movq	%r12, %rsi
	callq	_xenbus_read_unsigned
	movq	_XenbusStateClosing@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movl	$64, %esi
	leaq	L_.str.4(%rip), %rdx
	movl	%r14d, %ecx
	callq	_snprintf
	xorl	%edi, %edi
	cmpl	$63, %eax
	setae	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_XBT_NIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rax
	movl	4(%rax), %esi
	movq	%r12, %rdx
	leaq	L_.str.5(%rip), %rcx
	leaq	-128(%rbp), %r8
	leaq	-124(%rbp), %r9
	xorl	%eax, %eax
	leaq	-116(%rbp), %rbx
	pushq	%rbx
	leaq	-120(%rbp), %rbx
	pushq	%rbx
	callq	_xenbus_scanf
	addq	$16, %rsp
	cmpl	$4, %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %r12
	movl	-128(%rbp), %r13d
	movl	-124(%rbp), %r15d
	movl	-120(%rbp), %edi
	movl	-116(%rbp), %esi
	callq	_PCI_DEVFN
	movl	%r13d, %edi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_pci_get_domain_bus_and_slot
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_pci_lock_rescan_remove
	movq	%r13, %rdi
	callq	_pci_stop_and_remove_bus_device
	movq	%r13, %rdi
	callq	_pci_dev_put
	xorl	%eax, %eax
	callq	_pci_unlock_rescan_remove
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	movq	(%rbx), %rdi
	movl	-128(%rbp), %edx
	movl	-124(%rbp), %ecx
	movl	-120(%rbp), %r8d
	movl	-116(%rbp), %r9d
	leaq	L_.str.8(%rip), %rsi
	jmp	LBB0_13
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	subl	(%rcx), %r15d
	testl	%eax, %eax
	cmovsl	%eax, %r15d
	movq	(%rbx), %rdi
	leaq	L_.str.2(%rip), %rdx
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_xenbus_dev_fatal
	jmp	LBB0_16
LBB0_15:
	movq	(%rbx), %rdi
	movq	_XenbusStateReconfiguring@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_xenbus_switch_state
	movl	%eax, %r15d
	jmp	LBB0_16
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_16
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	subl	(%rcx), %r15d
	testl	%eax, %eax
	cmovsl	%eax, %r15d
	movq	-144(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rdi
	leaq	L_.str.6(%rip), %rdx
	movl	%r15d, %esi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_xenbus_dev_fatal
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.17:
	movl	%r15d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_XenbusStateConnected,8,3       ## @XenbusStateConnected
	.comm	_XBT_NIL,4,2                    ## @XBT_NIL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"num_devs"

L_.str.1:                               ## @.str.1
	.asciz	"%d"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Error reading number of PCI devices"

L_.str.3:                               ## @.str.3
	.asciz	"state-%d"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_XenbusStateUnknown,4,2         ## @XenbusStateUnknown
	.comm	_XenbusStateClosing,4,2         ## @XenbusStateClosing
L_.str.4:                               ## @.str.4
	.asciz	"vdev-%d"

L_.str.5:                               ## @.str.5
	.asciz	"%x:%x:%x.%x"

L_.str.6:                               ## @.str.6
	.asciz	"Error reading PCI device %d"

L_.str.7:                               ## @.str.7
	.asciz	"Cannot get PCI device %04x:%02x:%02x.%d\n"

L_.str.8:                               ## @.str.8
	.asciz	"PCI device %04x:%02x:%02x.%d removed.\n"

	.comm	_XenbusStateReconfiguring,4,2   ## @XenbusStateReconfiguring
	.no_dead_strip	_pcifront_detach_devices
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcifront_detach_devices
_pcifront_detach_devices:               ; @pcifront_detach_devices
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x28, x27, [sp, #128]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
	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, #-88]
	ldr	x8, [x0]
	ldr	w0, [x8, #8]
	bl	_xenbus_read_driver_state
Lloh3:
	adrp	x8, _XenbusStateConnected@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XenbusStateConnected@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.1:
Lloh6:
	adrp	x28, _XBT_NIL@GOTPAGE
Lloh7:
	ldr	x28, [x28, _XBT_NIL@GOTPAGEOFF]
	ldr	w0, [x28]
	ldr	x8, [x19]
	ldr	w1, [x8, #4]
	add	x8, sp, #52
	str	x8, [sp]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
Lloh10:
	adrp	x3, l_.str.1@PAGE
Lloh11:
	add	x3, x3, l_.str.1@PAGEOFF
	bl	_xenbus_scanf
	cmp	w0, #1
	b.ne	LBB0_14
; %bb.2:
	ldr	w8, [sp, #52]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.3:
	mov	w20, #0
Lloh12:
	adrp	x21, l_.str.3@PAGE
Lloh13:
	add	x21, x21, l_.str.3@PAGEOFF
Lloh14:
	adrp	x24, _XenbusStateUnknown@GOTPAGE
Lloh15:
	ldr	x24, [x24, _XenbusStateUnknown@GOTPAGEOFF]
Lloh16:
	adrp	x25, _XenbusStateClosing@GOTPAGE
Lloh17:
	ldr	x25, [x25, _XenbusStateClosing@GOTPAGEOFF]
Lloh18:
	adrp	x22, l_.str.4@PAGE
Lloh19:
	add	x22, x22, l_.str.4@PAGEOFF
Lloh20:
	adrp	x23, l_.str.5@PAGE
Lloh21:
	add	x23, x23, l_.str.5@PAGEOFF
	b	LBB0_8
LBB0_4:
	mov	w21, #0
	b	LBB0_18
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x19]
	ldp	w3, w2, [sp, #44]
	ldp	w5, w4, [sp, #36]
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	bl	_dev_dbg
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w20, w20, #1
	ldr	w8, [sp, #52]
	cmp	w20, w8
	b.ge	LBB0_16
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #56
	mov	w1, #64
	mov	x2, x21
	mov	x3, x20
	bl	_snprintf
	cmp	w0, #62
	cset	w0, hi
	bl	_unlikely
	cbnz	x0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	ldr	w2, [x24]
	add	x1, sp, #56
	bl	_xenbus_read_unsigned
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x0, sp, #56
	mov	w1, #64
	mov	x2, x22
	mov	x3, x20
	bl	_snprintf
	cmp	w0, #62
	cset	w0, hi
	bl	_unlikely
	cbnz	x0, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x28]
	ldr	x8, [x19]
	ldr	w1, [x8, #4]
	add	x8, sp, #36
	str	x8, [sp, #24]
	add	x8, sp, #40
	str	x8, [sp, #16]
	add	x2, sp, #56
	add	x8, sp, #44
	str	x8, [sp, #8]
	add	x8, sp, #48
	str	x8, [sp]
	mov	x3, x23
	bl	_xenbus_scanf
	cmp	w0, #4
	b.ne	LBB0_20
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldp	w27, w26, [sp, #44]
	ldp	w1, w0, [sp, #36]
	bl	_PCI_DEVFN
	mov	x2, x0
	mov	x0, x26
	mov	x1, x27
	bl	_pci_get_domain_bus_and_slot
	cbz	x0, LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x26, x0
	bl	_pci_lock_rescan_remove
	mov	x0, x26
	bl	_pci_stop_and_remove_bus_device
	mov	x0, x26
	bl	_pci_dev_put
	bl	_pci_unlock_rescan_remove
	ldr	x0, [x19]
	ldp	w3, w2, [sp, #44]
	ldp	w5, w4, [sp, #36]
Lloh24:
	adrp	x1, l_.str.8@PAGE
Lloh25:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_6
LBB0_14:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w21, w0, w8, lt
	ldr	x0, [x19]
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_15:
	mov	x1, x21
	bl	_xenbus_dev_fatal
	b	LBB0_18
LBB0_16:
	ldr	x0, [x19]
Lloh31:
	adrp	x8, _XenbusStateReconfiguring@GOTPAGE
Lloh32:
	ldr	x8, [x8, _XenbusStateReconfiguring@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	bl	_xenbus_switch_state
	mov	x21, x0
	b	LBB0_18
LBB0_17:
Lloh34:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_18:
	ldur	x8, [x29, #-88]
Lloh37:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh38:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.19:
	mov	x0, x21
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_20:
Lloh40:
	adrp	x8, _EINVAL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w21, w0, w8, lt
	ldr	x0, [x19]
	str	x20, [sp]
Lloh43:
	adrp	x2, l_.str.6@PAGE
Lloh44:
	add	x2, x2, l_.str.6@PAGEOFF
	b	LBB0_15
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_XenbusStateConnected,8,3       ; @XenbusStateConnected
	.comm	_XBT_NIL,4,2                    ; @XBT_NIL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"num_devs"

l_.str.1:                               ; @.str.1
	.asciz	"%d"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Error reading number of PCI devices"

l_.str.3:                               ; @.str.3
	.asciz	"state-%d"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_XenbusStateUnknown,4,2         ; @XenbusStateUnknown
	.comm	_XenbusStateClosing,4,2         ; @XenbusStateClosing
l_.str.4:                               ; @.str.4
	.asciz	"vdev-%d"

l_.str.5:                               ; @.str.5
	.asciz	"%x:%x:%x.%x"

l_.str.6:                               ; @.str.6
	.asciz	"Error reading PCI device %d"

l_.str.7:                               ; @.str.7
	.asciz	"Cannot get PCI device %04x:%02x:%02x.%d\n"

l_.str.8:                               ; @.str.8
	.asciz	"PCI device %04x:%02x:%02x.%d removed.\n"

	.comm	_XenbusStateReconfiguring,4,2   ; @XenbusStateReconfiguring
	.no_dead_strip	_pcifront_detach_devices
.subsections_via_symbols
