	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mode_sense                     ## -- Begin function mode_sense
	.p2align	4, 0x90
_mode_sense:                            ## @mode_sense
	.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
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, %ebx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	movl	40(%rbp), %r14d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_cam_getccb
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_2:
	movl	56(%rbp), %r13d
	shll	$6, %ebx
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	testl	%r14d, %r14d
	movl	%r14d, %eax
	movl	$5000, %r14d                    ## imm = 0x1388
	cmovnel	%eax, %r14d
	cmpl	$6, (%r15)
	sete	%al
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$6, (%r15)
	movb	$1, %al
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %ecx
	cmpl	$256, %r13d                     ## imm = 0x100
	movl	$255, %edx
	cmovgel	%edx, %r13d
	testb	$1, %al
	cmovel	%ecx, %r13d
	movq	%r12, %rdi
	callq	_CCB_CLEAR_ALL_EXCEPT_HDR
	movl	(%r15), %eax
	movq	_SSD_FULL_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	subq	$8, %rsp
	movq	%r12, %rdi
	movl	32(%rbp), %esi
	xorl	%edx, %edx
	movl	24(%rbp), %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	pushq	%r13
	pushq	48(%rbp)
	movl	16(%rbp), %eax
	pushq	%rax
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_scsi_mode_sense_subpage
	addq	$64, %rsp
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$10, (%r12)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r12), %rax
	movq	_SMS10_LLBAA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%rax)
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %eax
	movl	%eax, (%r15)
	movq	_CAM_ARG_ERR_RECOVER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_arglist@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r12), %eax
	movq	_CAM_PASS_ERR_RECOVER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r12), %eax
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_CAM_DEV_QFRZDIS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 4(%r12)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_cam_send_ccb
	testq	%rax, %rax
	jns	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_err
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$6, (%r15)
	je	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r12), %eax
	movq	_CAM_REQ_INVALID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	leaq	-84(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-80(%rbp), %rcx
	leaq	-76(%rbp), %r8
	callq	_scsi_extract_sense_ccb
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	-56(%rbp), %eax
	movq	_SSD_KEY_ILLEGAL_REQUEST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_15
LBB0_16:
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r12), %eax
	movq	_CAM_REQ_CMP@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_20
## %bb.17:
	movq	_CAM_ARG_VERBOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_arglist@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.18:
	movq	_CAM_ESF_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CAM_EPF_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_cam_error_print
LBB0_19:
	movq	%r12, %rdi
	callq	_cam_freeccb
	movq	%rbx, %rdi
	callq	_cam_close_device
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_20:
	movq	%r12, %rdi
	callq	_cam_freeccb
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mode_sense: couldn't allocate CCB"

	.comm	_SSD_FULL_SIZE,4,2              ## @SSD_FULL_SIZE
	.comm	_SMS10_LLBAA,4,2                ## @SMS10_LLBAA
	.comm	_arglist,4,2                    ## @arglist
	.comm	_CAM_ARG_ERR_RECOVER,4,2        ## @CAM_ARG_ERR_RECOVER
	.comm	_CAM_PASS_ERR_RECOVER,4,2       ## @CAM_PASS_ERR_RECOVER
	.comm	_CAM_DEV_QFRZDIS,4,2            ## @CAM_DEV_QFRZDIS
L_.str.1:                               ## @.str.1
	.asciz	"error sending mode sense command"

	.comm	_CAM_STATUS_MASK,4,2            ## @CAM_STATUS_MASK
	.comm	_CAM_REQ_INVALID,4,2            ## @CAM_REQ_INVALID
	.comm	_SSD_KEY_ILLEGAL_REQUEST,4,2    ## @SSD_KEY_ILLEGAL_REQUEST
	.comm	_CAM_REQ_CMP,4,2                ## @CAM_REQ_CMP
	.comm	_CAM_ARG_VERBOSE,4,2            ## @CAM_ARG_VERBOSE
	.comm	_CAM_ESF_ALL,4,2                ## @CAM_ESF_ALL
	.comm	_CAM_EPF_ALL,4,2                ## @CAM_EPF_ALL
	.comm	_stderr,4,2                     ## @stderr
L_.str.2:                               ## @.str.2
	.asciz	"mode sense command returned error"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mode_sense                     ; -- Begin function mode_sense
	.p2align	2
_mode_sense:                            ; @mode_sense
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	stp	w6, w7, [sp, #40]               ; 8-byte Folded Spill
	str	w5, [sp, #36]                   ; 4-byte Folded Spill
	mov	x28, x4
	mov	x24, x3
	mov	x25, x2
	mov	x26, x1
	ldr	w20, [x29, #32]
	ldp	w27, w22, [x29, #16]
	mov	x23, x0
	bl	_cam_getccb
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_2:
	ldr	x21, [x29, #24]
	lsl	w28, w28, #6
	mov	w8, #5000
	cmp	w22, #0
	csel	w22, w8, w22, eq
	ldr	w8, [x26]
	cmp	w8, #6
	cset	w8, eq
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #6
	str	w8, [x26]
	mov	w8, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w20, #255
	cset	w9, gt
	tst	w8, w9
	mov	w8, #255
	csel	w20, w8, w20, ne
	mov	x0, x19
	bl	_CCB_CLEAR_ALL_EXCEPT_HDR
	ldr	w8, [x26]
Lloh2:
	adrp	x9, _SSD_FULL_SIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SSD_FULL_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	stp	w9, w22, [sp, #16]
	stp	w20, w8, [sp, #8]
	str	x21, [sp]
	mov	x0, x19
	mov	x1, x27
	mov	x2, #0
	ldp	w7, w3, [sp, #40]               ; 8-byte Folded Reload
	mov	x4, x25
	mov	x5, x28
	ldr	w6, [sp, #36]                   ; 4-byte Folded Reload
	bl	_scsi_mode_sense_subpage
	cbz	w24, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	cmp	w8, #10
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _SMS10_LLBAA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SMS10_LLBAA@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	ldr	w10, [x8]
	orr	w9, w10, w9
	str	w9, [x8]
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	str	w8, [x26]
Lloh8:
	adrp	x8, _arglist@GOTPAGE
Lloh9:
	ldr	x8, [x8, _arglist@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _CAM_ARG_ERR_RECOVER@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CAM_ARG_ERR_RECOVER@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh14:
	adrp	x8, _CAM_PASS_ERR_RECOVER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CAM_PASS_ERR_RECOVER@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #4]
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh17:
	adrp	x9, _CAM_DEV_QFRZDIS@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CAM_DEV_QFRZDIS@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #4]
	mov	x0, x23
	mov	x1, x19
	bl	_cam_send_ccb
	tbz	x0, #63, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_err
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	cmp	w8, #6
	b.eq	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
Lloh22:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh25:
	adrp	x9, _CAM_REQ_INVALID@GOTPAGE
Lloh26:
	ldr	x9, [x9, _CAM_REQ_INVALID@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	add	x1, sp, #60
	add	x2, sp, #56
	add	x3, sp, #52
	add	x4, sp, #48
	mov	x0, x19
	bl	_scsi_extract_sense_ccb
	cbz	x0, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #56]
Lloh28:
	adrp	x9, _SSD_KEY_ILLEGAL_REQUEST@GOTPAGE
Lloh29:
	ldr	x9, [x9, _SSD_KEY_ILLEGAL_REQUEST@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_3
LBB0_16:
	ldr	w8, [x19]
Lloh31:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh32:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh34:
	adrp	x9, _CAM_REQ_CMP@GOTPAGE
Lloh35:
	ldr	x9, [x9, _CAM_REQ_CMP@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_20
; %bb.17:
Lloh37:
	adrp	x8, _arglist@GOTPAGE
Lloh38:
	ldr	x8, [x8, _arglist@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
Lloh40:
	adrp	x9, _CAM_ARG_VERBOSE@GOTPAGE
Lloh41:
	ldr	x9, [x9, _CAM_ARG_VERBOSE@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
Lloh43:
	adrp	x8, _CAM_ESF_ALL@GOTPAGE
Lloh44:
	ldr	x8, [x8, _CAM_ESF_ALL@GOTPAGEOFF]
Lloh45:
	ldr	w2, [x8]
Lloh46:
	adrp	x8, _CAM_EPF_ALL@GOTPAGE
Lloh47:
	ldr	x8, [x8, _CAM_EPF_ALL@GOTPAGEOFF]
Lloh48:
	ldr	w3, [x8]
Lloh49:
	adrp	x8, _stderr@GOTPAGE
Lloh50:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh51:
	ldr	w4, [x8]
	mov	x0, x23
	mov	x1, x19
	bl	_cam_error_print
LBB0_19:
	mov	x0, x19
	bl	_cam_freeccb
	mov	x0, x23
	bl	_cam_close_device
Lloh52:
	adrp	x1, l_.str.2@PAGE
Lloh53:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_20:
	mov	x0, x19
	bl	_cam_freeccb
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mode_sense: couldn't allocate CCB"

	.comm	_SSD_FULL_SIZE,4,2              ; @SSD_FULL_SIZE
	.comm	_SMS10_LLBAA,4,2                ; @SMS10_LLBAA
	.comm	_arglist,4,2                    ; @arglist
	.comm	_CAM_ARG_ERR_RECOVER,4,2        ; @CAM_ARG_ERR_RECOVER
	.comm	_CAM_PASS_ERR_RECOVER,4,2       ; @CAM_PASS_ERR_RECOVER
	.comm	_CAM_DEV_QFRZDIS,4,2            ; @CAM_DEV_QFRZDIS
l_.str.1:                               ; @.str.1
	.asciz	"error sending mode sense command"

	.comm	_CAM_STATUS_MASK,4,2            ; @CAM_STATUS_MASK
	.comm	_CAM_REQ_INVALID,4,2            ; @CAM_REQ_INVALID
	.comm	_SSD_KEY_ILLEGAL_REQUEST,4,2    ; @SSD_KEY_ILLEGAL_REQUEST
	.comm	_CAM_REQ_CMP,4,2                ; @CAM_REQ_CMP
	.comm	_CAM_ARG_VERBOSE,4,2            ; @CAM_ARG_VERBOSE
	.comm	_CAM_ESF_ALL,4,2                ; @CAM_ESF_ALL
	.comm	_CAM_EPF_ALL,4,2                ; @CAM_EPF_ALL
	.comm	_stderr,4,2                     ; @stderr
l_.str.2:                               ; @.str.2
	.asciz	"mode sense command returned error"

.subsections_via_symbols
