	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpt_rescan_bus                 ## -- Begin function mpt_rescan_bus
	.p2align	4, 0x90
_mpt_rescan_bus:                        ## @mpt_rescan_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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	decl	%edi
	cmpl	$-3, %edi
	ja	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_2:
	movl	%esi, %ebx
	xorl	%eax, %eax
	callq	_xpt_open
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	leaq	-12(%rbp), %rdi
	callq	_fetch_path_id
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	leaq	-48(%rbp), %rdi
	movl	$32, %esi
	callq	_bzero
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	cmpl	$-1, %ebx
	je	LBB0_6
## %bb.7:
	movq	_XPT_SCAN_LUN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	jmp	LBB0_8
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_6:
	movq	_XPT_SCAN_BUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CAM_LUN_WILDCARD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	$5000, -44(%rbp)                ## imm = 0x1388
LBB0_8:
	movl	%eax, -24(%rbp)
	movq	%rcx, -32(%rbp)
	movq	_CAM_FLAG_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	$5, -36(%rbp)
	movq	_xptfd@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CAMIOCOMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.10:
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	-40(%rbp), %esi
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	(%rcx), %esi
	je	LBB0_13
## %bb.11:
	leaq	L_.str(%rip), %rdi
	callq	_warnx
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	movq	_errno@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_XPT_SCAN_BUS,4,2               ## @XPT_SCAN_BUS
	.comm	_CAM_TARGET_WILDCARD,4,2        ## @CAM_TARGET_WILDCARD
	.comm	_CAM_LUN_WILDCARD,8,3           ## @CAM_LUN_WILDCARD
	.comm	_XPT_SCAN_LUN,4,2               ## @XPT_SCAN_LUN
	.comm	_CAM_FLAG_NONE,4,2              ## @CAM_FLAG_NONE
	.comm	_xptfd,4,2                      ## @xptfd
	.comm	_CAMIOCOMMAND,4,2               ## @CAMIOCOMMAND
	.comm	_errno,4,2                      ## @errno
	.comm	_CAM_STATUS_MASK,4,2            ## @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ## @CAM_REQ_CMP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mpt_rescan_bus rescan got CAM error %#x\n"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpt_rescan_bus                 ; -- Begin function mpt_rescan_bus
	.p2align	2
_mpt_rescan_bus:                        ; @mpt_rescan_bus
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	sub	w8, w0, #1
	cmn	w8, #3
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	mov	x19, x1
	bl	_xpt_open
	tbnz	x0, #63, LBB0_6
; %bb.3:
	add	x0, sp, #12
	bl	_fetch_path_id
	cbnz	w0, LBB0_8
; %bb.4:
	add	x0, sp, #16
	mov	w1, #32
	bl	_bzero
	ldr	w8, [sp, #12]
	str	w8, [sp, #44]
	cmn	w19, #1
	b.eq	LBB0_9
; %bb.5:
	mov	x9, #0
Lloh2:
	adrp	x8, _XPT_SCAN_LUN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XPT_SCAN_LUN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	b	LBB0_10
LBB0_6:
Lloh5:
	adrp	x8, _ENXIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
Lloh7:
	adrp	x8, _XPT_SCAN_BUS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _XPT_SCAN_BUS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _CAM_LUN_WILDCARD@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CAM_LUN_WILDCARD@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	mov	w10, #5000
	str	w10, [sp, #20]
LBB0_10:
	str	w8, [sp, #40]
	str	x9, [sp, #32]
Lloh13:
	adrp	x8, _CAM_FLAG_NONE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CAM_FLAG_NONE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	mov	w9, #5
	str	w8, [sp, #16]
	str	w9, [sp, #28]
Lloh16:
	adrp	x8, _xptfd@GOTPAGE
Lloh17:
	ldr	x8, [x8, _xptfd@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	adrp	x8, _CAMIOCOMMAND@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CAMIOCOMMAND@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x2, sp, #16
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.11:
	ldr	w8, [sp, #24]
Lloh22:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	and	w1, w9, w8
Lloh25:
	adrp	x8, _CAM_REQ_CMP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w1, w8
	b.ne	LBB0_14
; %bb.12:
	mov	w0, #0
	b	LBB0_8
LBB0_13:
Lloh28:
	adrp	x8, _errno@GOTPAGE
Lloh29:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	b	LBB0_7
LBB0_14:
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_XPT_SCAN_BUS,4,2               ; @XPT_SCAN_BUS
	.comm	_CAM_TARGET_WILDCARD,4,2        ; @CAM_TARGET_WILDCARD
	.comm	_CAM_LUN_WILDCARD,8,3           ; @CAM_LUN_WILDCARD
	.comm	_XPT_SCAN_LUN,4,2               ; @XPT_SCAN_LUN
	.comm	_CAM_FLAG_NONE,4,2              ; @CAM_FLAG_NONE
	.comm	_xptfd,4,2                      ; @xptfd
	.comm	_CAMIOCOMMAND,4,2               ; @CAMIOCOMMAND
	.comm	_errno,4,2                      ; @errno
	.comm	_CAM_STATUS_MASK,4,2            ; @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ; @CAM_REQ_CMP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mpt_rescan_bus rescan got CAM error %#x\n"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
