	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcmd_handle                    ## -- Begin function tcmd_handle
	.p2align	4, 0x90
_tcmd_handle:                           ## @tcmd_handle
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movl	16(%r15), %ecx
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_warnx
LBB0_2:
	movq	8(%r15), %r12
	movq	_tcmd_handle.last_cmd(%rip), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%rax), %rcx
	movq	(%r12), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_9
LBB0_4:
	movq	_cdb_handlers@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ILLEGAL_CDB@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax), %rdx
	cmpq	%rcx, %rdx
	je	LBB0_8
## %bb.5:
	movq	(%r12), %rsi
	movq	(%rsi), %rsi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rdx, %rsi
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	24(%rax), %rdx
	addq	$24, %rax
	cmpq	%rcx, %rdx
	jne	LBB0_6
LBB0_8:
	movq	%rax, _tcmd_handle.last_cmd(%rip)
LBB0_9:
	movq	_ATIO_WORK@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_10
## %bb.13:
	movq	(%rax), %rax
	movq	_ILLEGAL_CDB@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_15
## %bb.14:
	movq	(%r12), %rax
	movq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_warnx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_tcmd_illegal_req
LBB0_25:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_send_ccb
	jmp	LBB0_30
LBB0_10:
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	*%rax
	movl	$1, %ebx
	jmp	LBB0_30
LBB0_15:
	movl	8(%r14), %edi
	callq	_tcmd_get_istate
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	8(%rbx), %rcx
	testq	%rax, %rax
	je	LBB0_18
LBB0_20:
	movq	%rcx, 16(%rbx)
	movq	%rax, 24(%rbx)
	movq	_CA_NONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rbx)
	movq	_CA_UNIT_ATTN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
## %bb.21:
	movq	_UA_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
LBB0_22:
	movq	_tcmd_handle.last_cmd(%rip), %rax
	movq	(%rax), %rcx
	xorl	%ebx, %ebx
	cmpq	(%r13), %rcx
	je	LBB0_30
## %bb.23:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	*8(%rax)
	movl	%eax, %ebx
	movq	_tcmd_handle.last_cmd(%rip), %rax
	movq	8(%rax), %rax
	cmpq	_tcmd_rdwr@GOTPCREL(%rip), %rax
	je	LBB0_30
## %bb.24:
	movl	(%r14), %eax
	addl	%eax, 8(%r12)
	jmp	LBB0_25
LBB0_12:
	movq	%r14, %rdi
	callq	_free_ccb
	movl	$1, %ebx
	jmp	LBB0_30
LBB0_16:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_tcmd_illegal_req
LBB0_29:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_send_ccb
	xorl	%ebx, %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	testq	%rcx, %rcx
	je	LBB0_19
## %bb.26:
	movq	(%r12), %rdx
	movq	(%rdx), %rdx
	movq	_INQUIRY@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	je	LBB0_20
## %bb.27:
	movl	8(%r14), %edi
	movq	_SSD_KEY_UNIT_ATTENTION@GOTPCREL(%rip), %rax
	movq	_UA_POWER_ON@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpq	(%rdx), %rcx
	movl	(%rax), %edx
	sete	%sil
	movl	$2, %r8d
	subl	%esi, %r8d
	movq	%r14, %rsi
	movl	$41, %ecx
	callq	_tcmd_sense
	movq	_CA_UNIT_ATTN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	_debug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_29
## %bb.28:
	movq	(%r12), %rdi
	movl	(%r15), %edx
	leaq	L_.str.3(%rip), %rsi
	callq	_cdb_debug
	jmp	LBB0_29
LBB0_19:
	xorl	%ecx, %ecx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_tcmd_handle.last_cmd,8,3 ## @tcmd_handle.last_cmd
	.comm	_debug,8,3                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcmd_handle atio %p ctio %p atioflags %#x"

	.comm	_cdb_handlers,8,3               ## @cdb_handlers
	.comm	_ILLEGAL_CDB,8,3                ## @ILLEGAL_CDB
	.comm	_ATIO_WORK,4,2                  ## @ATIO_WORK
L_.str.2:                               ## @.str.2
	.asciz	"cdb %#x not handled"

	.comm	_INQUIRY,8,3                    ## @INQUIRY
	.comm	_SSD_KEY_UNIT_ATTENTION,4,2     ## @SSD_KEY_UNIT_ATTENTION
	.comm	_UA_POWER_ON,8,3                ## @UA_POWER_ON
	.comm	_CA_UNIT_ATTN,8,3               ## @CA_UNIT_ATTN
L_.str.3:                               ## @.str.3
	.asciz	"UA active for %u: "

	.comm	_CA_NONE,8,3                    ## @CA_NONE
	.comm	_UA_NONE,8,3                    ## @UA_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tcmd_handle                    ; -- Begin function tcmd_handle
	.p2align	2
_tcmd_handle:                           ; @tcmd_handle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _debug@GOTPAGE
Lloh1:
	ldr	x24, [x24, _debug@GOTPAGEOFF]
	ldr	x8, [x24]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x20, #16]
	stp	x19, x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_warnx
LBB0_2:
	ldr	x22, [x20, #8]
	adrp	x23, _tcmd_handle.last_cmd@PAGE
	ldr	x8, [x23, _tcmd_handle.last_cmd@PAGEOFF]
Lloh4:
	adrp	x25, _ILLEGAL_CDB@GOTPAGE
Lloh5:
	ldr	x25, [x25, _ILLEGAL_CDB@GOTPAGEOFF]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	x9, [x8]
	ldr	x10, [x22]
	ldr	x10, [x10]
	cmp	x9, x10
	b.eq	LBB0_9
LBB0_4:
Lloh6:
	adrp	x8, _cdb_handlers@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cdb_handlers@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x9, [x25]
	ldr	x10, [x8]
	cmp	x10, x9
	b.eq	LBB0_8
; %bb.5:
	ldr	x11, [x22]
	ldr	x11, [x11]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x11, x10
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x10, [x8, #24]!
	cmp	x10, x9
	b.ne	LBB0_6
LBB0_8:
	str	x8, [x23, _tcmd_handle.last_cmd@PAGEOFF]
LBB0_9:
Lloh9:
	adrp	x9, _ATIO_WORK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATIO_WORK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w9, w21
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x8]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_14
; %bb.11:
	ldr	x8, [x22]
	ldr	x1, [x8]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warnx
	b	LBB0_20
LBB0_12:
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_22
; %bb.13:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	blr	x8
	b	LBB0_23
LBB0_14:
	ldr	w0, [x19, #8]
	bl	_tcmd_get_istate
	cbz	x0, LBB0_20
; %bb.15:
	mov	x21, x0
	ldp	x8, x9, [x0]
	cbz	x8, LBB0_27
LBB0_16:
	stp	x9, x8, [x21, #16]
Lloh14:
	adrp	x9, _CA_NONE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CA_NONE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	str	x9, [x21]
Lloh17:
	adrp	x9, _CA_UNIT_ATTN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CA_UNIT_ATTN@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.17:
Lloh20:
	adrp	x8, _UA_NONE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _UA_NONE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	x8, [x21, #8]
LBB0_18:
	ldr	x8, [x23, _tcmd_handle.last_cmd@PAGEOFF]
	ldr	x9, [x8]
	ldr	x10, [x25]
	cmp	x9, x10
	b.ne	LBB0_25
; %bb.19:
	mov	w20, #0
	b	LBB0_24
LBB0_20:
	mov	x0, x20
	mov	x1, x19
	bl	_tcmd_illegal_req
LBB0_21:
	mov	x0, x19
	mov	w1, #1
	bl	_send_ccb
	mov	w20, #0
	b	LBB0_24
LBB0_22:
	mov	x0, x19
	bl	_free_ccb
LBB0_23:
	mov	w20, #1
LBB0_24:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_25:
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	mov	x20, x0
	ldr	x8, [x23, _tcmd_handle.last_cmd@PAGEOFF]
	ldr	x8, [x8, #8]
Lloh23:
	adrp	x9, _tcmd_rdwr@GOTPAGE
Lloh24:
	ldr	x9, [x9, _tcmd_rdwr@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_24
; %bb.26:
	ldr	w8, [x19]
	ldr	w9, [x22, #8]
	add	w8, w9, w8
	str	w8, [x22, #8]
	mov	x0, x19
	mov	w1, #1
	bl	_send_ccb
	b	LBB0_24
LBB0_27:
	cbz	x9, LBB0_16
; %bb.28:
	ldr	x10, [x22]
	ldr	x10, [x10]
Lloh25:
	adrp	x11, _INQUIRY@GOTPAGE
Lloh26:
	ldr	x11, [x11, _INQUIRY@GOTPAGEOFF]
Lloh27:
	ldr	x11, [x11]
	cmp	x10, x11
	b.eq	LBB0_16
; %bb.29:
	ldr	w0, [x19, #8]
Lloh28:
	adrp	x8, _SSD_KEY_UNIT_ATTENTION@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SSD_KEY_UNIT_ATTENTION@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
Lloh31:
	adrp	x8, _UA_POWER_ON@GOTPAGE
Lloh32:
	ldr	x8, [x8, _UA_POWER_ON@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	cmp	x9, x8
	mov	w8, #1
	cinc	w4, w8, ne
	mov	x1, x19
	mov	w3, #41
	bl	_tcmd_sense
Lloh34:
	adrp	x8, _CA_UNIT_ATTN@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CA_UNIT_ATTN@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	str	x8, [x21]
	ldr	x8, [x24]
	cbz	x8, LBB0_21
; %bb.30:
	ldr	x0, [x22]
	ldr	w2, [x20]
Lloh37:
	adrp	x1, l_.str.3@PAGE
Lloh38:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_cdb_debug
	b	LBB0_21
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_tcmd_handle.last_cmd,8,3 ; @tcmd_handle.last_cmd
	.comm	_debug,8,3                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcmd_handle atio %p ctio %p atioflags %#x"

	.comm	_cdb_handlers,8,3               ; @cdb_handlers
	.comm	_ILLEGAL_CDB,8,3                ; @ILLEGAL_CDB
	.comm	_ATIO_WORK,4,2                  ; @ATIO_WORK
l_.str.2:                               ; @.str.2
	.asciz	"cdb %#x not handled"

	.comm	_INQUIRY,8,3                    ; @INQUIRY
	.comm	_SSD_KEY_UNIT_ATTENTION,4,2     ; @SSD_KEY_UNIT_ATTENTION
	.comm	_UA_POWER_ON,8,3                ; @UA_POWER_ON
	.comm	_CA_UNIT_ATTN,8,3               ; @CA_UNIT_ATTN
l_.str.3:                               ; @.str.3
	.asciz	"UA active for %u: "

	.comm	_CA_NONE,8,3                    ; @CA_NONE
	.comm	_UA_NONE,8,3                    ; @UA_NONE
.subsections_via_symbols
