	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scanlun_or_reset_dev
_scanlun_or_reset_dev:                  ## @scanlun_or_reset_dev
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_CAM_BUS_WILDCARD@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	jmp	LBB0_6
LBB0_2:
	movq	%rsi, %r15
	movq	_CAM_TARGET_WILDCARD@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	jmp	LBB0_6
LBB0_4:
	movq	%rdx, %r14
	movq	_CAM_LUN_WILDCARD@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	jne	LBB0_9
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
LBB0_6:
	callq	_warnx
LBB0_7:
	movl	$1, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	%ecx, %r12d
	leaq	-88(%rbp), %rdi
	movl	$48, %esi
	callq	_bzero
	testl	%r12d, %r12d
	je	LBB0_13
## %bb.10:
	movq	_XPT_DEVICE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_19
## %bb.11:
	movl	%eax, %ebx
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jne	LBB0_15
LBB0_12:
	movq	_XPT_RESET_DEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_13:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	xorl	%r8d, %r8d
	callq	_cam_open_btl
	testq	%rax, %rax
	je	LBB0_26
## %bb.14:
	movl	$-1, %ebx
	testl	%r12d, %r12d
	je	LBB0_12
LBB0_15:
	movq	_XPT_SCAN_LUN@GOTPCREL(%rip), %rcx
LBB0_16:
	movl	(%rcx), %ecx
	movl	%ecx, -48(%rbp)
	movq	%r13, -56(%rbp)
	movq	%r15, -64(%rbp)
	movq	%r14, -72(%rbp)
	movq	_CAM_FLAG_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -88(%rbp)
	movl	$5, -80(%rbp)
	je	LBB0_20
## %bb.17:
	movq	_CAMIOCOMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-88(%rbp), %rdx
	movl	%ebx, %edi
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_25
## %bb.18:
	movl	%ebx, %edi
	callq	_close
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-84(%rbp), %eax
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rcx
	leaq	L_.str.8(%rip), %rdx
	cmpl	(%rcx), %eax
	jne	LBB0_23
	jmp	LBB0_24
LBB0_19:
	movq	_XPT_DEVICE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	leaq	L_.str.3(%rip), %rdi
	callq	_warnx
	movq	(%rbx), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_7
LBB0_20:
	leaq	-88(%rbp), %rsi
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_cam_send_ccb
	testq	%rax, %rax
	js	LBB0_27
## %bb.21:
	movq	%rbx, %rdi
	callq	_cam_close_device
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-84(%rbp), %eax
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rcx
	leaq	L_.str.9(%rip), %rdx
	cmpl	(%rcx), %eax
	je	LBB0_24
## %bb.22:
	movq	_CAM_BDR_SENT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_24
LBB0_23:
	movq	_stdout@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, (%rsp)
	leaq	L_.str.10(%rip), %rsi
	movq	%r13, %rcx
	movq	%r15, %r8
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_7
LBB0_24:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.7(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r13, %rcx
	movq	%r15, %r8
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_8
LBB0_25:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movl	%ebx, %edi
	callq	_close
	jmp	LBB0_7
LBB0_26:
	movq	_cam_errbuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_6
LBB0_27:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	movq	%rbx, %rdi
	callq	_cam_close_device
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_CAM_BUS_WILDCARD,8,3           ## @CAM_BUS_WILDCARD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid bus number %d"

	.comm	_CAM_TARGET_WILDCARD,8,3        ## @CAM_TARGET_WILDCARD
L_.str.1:                               ## @.str.1
	.asciz	"invalid target number %d"

	.comm	_CAM_LUN_WILDCARD,8,3           ## @CAM_LUN_WILDCARD
L_.str.2:                               ## @.str.2
	.asciz	"invalid lun number %jx"

	.comm	_XPT_DEVICE,8,3                 ## @XPT_DEVICE
	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.3:                               ## @.str.3
	.asciz	"error opening transport layer device %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"%s"

	.comm	_cam_errbuf,8,3                 ## @cam_errbuf
	.comm	_XPT_SCAN_LUN,4,2               ## @XPT_SCAN_LUN
	.comm	_XPT_RESET_DEV,4,2              ## @XPT_RESET_DEV
	.comm	_CAM_FLAG_NONE,4,2              ## @CAM_FLAG_NONE
	.comm	_CAMIOCOMMAND,4,2               ## @CAMIOCOMMAND
L_.str.5:                               ## @.str.5
	.asciz	"CAMIOCOMMAND ioctl failed"

L_.str.6:                               ## @.str.6
	.asciz	"error sending XPT_RESET_DEV CCB"

	.comm	_CAM_STATUS_MASK,4,2            ## @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ## @CAM_REQ_CMP
	.comm	_CAM_BDR_SENT,4,2               ## @CAM_BDR_SENT
	.comm	_stdout,4,2                     ## @stdout
L_.str.7:                               ## @.str.7
	.asciz	"%s of %d:%d:%jx was successful\n"

L_.str.8:                               ## @.str.8
	.asciz	"Re-scan"

L_.str.9:                               ## @.str.9
	.asciz	"Reset"

L_.str.10:                              ## @.str.10
	.asciz	"%s of %d:%d:%jx returned error %#x\n"

	.no_dead_strip	_scanlun_or_reset_dev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scanlun_or_reset_dev
_scanlun_or_reset_dev:                  ; @scanlun_or_reset_dev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x21, x0
Lloh0:
	adrp	x8, _CAM_BUS_WILDCARD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAM_BUS_WILDCARD@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x0
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	b	LBB0_6
LBB0_2:
	mov	x20, x1
Lloh5:
	adrp	x8, _CAM_TARGET_WILDCARD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CAM_TARGET_WILDCARD@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x1
	b.ne	LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	b	LBB0_6
LBB0_4:
	mov	x19, x2
Lloh10:
	adrp	x8, _CAM_LUN_WILDCARD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CAM_LUN_WILDCARD@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x8, x2
	b.ne	LBB0_9
; %bb.5:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
LBB0_6:
	bl	_warnx
LBB0_7:
	mov	w0, #1
LBB0_8:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_9:
	mov	x22, x3
	add	x0, sp, #16
	mov	w1, #48
	bl	_bzero
	cbz	w22, LBB0_12
; %bb.10:
Lloh15:
	adrp	x24, _XPT_DEVICE@GOTPAGE
Lloh16:
	ldr	x24, [x24, _XPT_DEVICE@GOTPAGEOFF]
	ldr	x0, [x24]
Lloh17:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_17
; %bb.11:
	mov	x23, x0
	mov	x24, #0
	b	LBB0_14
LBB0_12:
Lloh20:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x4, #0
	bl	_cam_open_btl
	cbz	x0, LBB0_24
; %bb.13:
	mov	x24, x0
	mov	w23, #-1
LBB0_14:
Lloh23:
	adrp	x8, _XPT_SCAN_LUN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _XPT_SCAN_LUN@GOTPAGEOFF]
Lloh25:
	adrp	x9, _XPT_RESET_DEV@GOTPAGE
Lloh26:
	ldr	x9, [x9, _XPT_RESET_DEV@GOTPAGEOFF]
	cmp	w22, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [sp, #56]
	stp	x20, x21, [sp, #40]
	str	x19, [sp, #32]
Lloh27:
	adrp	x8, _CAM_FLAG_NONE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CAM_FLAG_NONE@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	mov	w9, #5
	str	w8, [sp, #16]
	str	w9, [sp, #24]
	cbz	w22, LBB0_18
; %bb.15:
Lloh30:
	adrp	x8, _CAMIOCOMMAND@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CAMIOCOMMAND@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x23
	bl	_ioctl
	tbnz	x0, #63, LBB0_23
; %bb.16:
	mov	x0, x23
	bl	_close
	ldr	w8, [sp, #20]
Lloh33:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh34:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh36:
	adrp	x9, _CAM_REQ_CMP@GOTPAGE
Lloh37:
	ldr	x9, [x9, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
Lloh39:
	adrp	x2, l_.str.8@PAGE
Lloh40:
	add	x2, x2, l_.str.8@PAGEOFF
	cmp	w8, w9
	b.ne	LBB0_21
	b	LBB0_22
LBB0_17:
	ldr	x1, [x24]
Lloh41:
	adrp	x0, l_.str.3@PAGE
Lloh42:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warnx
	ldr	x8, [x24]
	str	x8, [sp]
Lloh43:
	adrp	x0, l_.str.4@PAGE
Lloh44:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_warn
	b	LBB0_7
LBB0_18:
	add	x1, sp, #16
	mov	x0, x24
	bl	_cam_send_ccb
	tbnz	x0, #63, LBB0_25
; %bb.19:
	mov	x0, x24
	bl	_cam_close_device
	ldr	w8, [sp, #20]
Lloh45:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh46:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh48:
	adrp	x9, _CAM_REQ_CMP@GOTPAGE
Lloh49:
	ldr	x9, [x9, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
Lloh51:
	adrp	x2, l_.str.9@PAGE
Lloh52:
	add	x2, x2, l_.str.9@PAGEOFF
	cmp	w8, w9
	b.eq	LBB0_22
; %bb.20:
Lloh53:
	adrp	x9, _CAM_BDR_SENT@GOTPAGE
Lloh54:
	ldr	x9, [x9, _CAM_BDR_SENT@GOTPAGEOFF]
Lloh55:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_22
LBB0_21:
Lloh56:
	adrp	x9, _stdout@GOTPAGE
Lloh57:
	ldr	x9, [x9, _stdout@GOTPAGEOFF]
Lloh58:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh59:
	adrp	x1, l_.str.10@PAGE
Lloh60:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x3, x21
	mov	x4, x20
	mov	x5, x19
	bl	_fprintf
	b	LBB0_7
LBB0_22:
Lloh61:
	adrp	x8, _stdout@GOTPAGE
Lloh62:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh63:
	ldr	w0, [x8]
Lloh64:
	adrp	x1, l_.str.7@PAGE
Lloh65:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x3, x21
	mov	x4, x20
	mov	x5, x19
	bl	_fprintf
	mov	w0, #0
	b	LBB0_8
LBB0_23:
Lloh66:
	adrp	x0, l_.str.5@PAGE
Lloh67:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_warn
	mov	x0, x23
	bl	_close
	b	LBB0_7
LBB0_24:
Lloh68:
	adrp	x8, _cam_errbuf@GOTPAGE
Lloh69:
	ldr	x8, [x8, _cam_errbuf@GOTPAGEOFF]
Lloh70:
	ldr	x1, [x8]
Lloh71:
	adrp	x0, l_.str.4@PAGE
Lloh72:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_25:
Lloh73:
	adrp	x0, l_.str.6@PAGE
Lloh74:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_warn
	mov	x0, x24
	bl	_cam_close_device
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpAdd	Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpAdd	Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpAdd	Lloh66, Lloh67
	.loh AdrpAdd	Lloh71, Lloh72
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpAdd	Lloh73, Lloh74
	.cfi_endproc
                                        ; -- End function
	.comm	_CAM_BUS_WILDCARD,8,3           ; @CAM_BUS_WILDCARD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid bus number %d"

	.comm	_CAM_TARGET_WILDCARD,8,3        ; @CAM_TARGET_WILDCARD
l_.str.1:                               ; @.str.1
	.asciz	"invalid target number %d"

	.comm	_CAM_LUN_WILDCARD,8,3           ; @CAM_LUN_WILDCARD
l_.str.2:                               ; @.str.2
	.asciz	"invalid lun number %jx"

	.comm	_XPT_DEVICE,8,3                 ; @XPT_DEVICE
	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.3:                               ; @.str.3
	.asciz	"error opening transport layer device %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"%s"

	.comm	_cam_errbuf,8,3                 ; @cam_errbuf
	.comm	_XPT_SCAN_LUN,4,2               ; @XPT_SCAN_LUN
	.comm	_XPT_RESET_DEV,4,2              ; @XPT_RESET_DEV
	.comm	_CAM_FLAG_NONE,4,2              ; @CAM_FLAG_NONE
	.comm	_CAMIOCOMMAND,4,2               ; @CAMIOCOMMAND
l_.str.5:                               ; @.str.5
	.asciz	"CAMIOCOMMAND ioctl failed"

l_.str.6:                               ; @.str.6
	.asciz	"error sending XPT_RESET_DEV CCB"

	.comm	_CAM_STATUS_MASK,4,2            ; @CAM_STATUS_MASK
	.comm	_CAM_REQ_CMP,4,2                ; @CAM_REQ_CMP
	.comm	_CAM_BDR_SENT,4,2               ; @CAM_BDR_SENT
	.comm	_stdout,4,2                     ; @stdout
l_.str.7:                               ; @.str.7
	.asciz	"%s of %d:%d:%jx was successful\n"

l_.str.8:                               ; @.str.8
	.asciz	"Re-scan"

l_.str.9:                               ; @.str.9
	.asciz	"Reset"

l_.str.10:                              ; @.str.10
	.asciz	"%s of %d:%d:%jx returned error %#x\n"

	.no_dead_strip	_scanlun_or_reset_dev
.subsections_via_symbols
