	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_work_atio                      ## -- Begin function work_atio
	.p2align	4, 0x90
_work_atio:                             ## @work_atio
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_debug@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_warnx
LBB0_2:
	movq	16(%r14), %r15
	xorl	%eax, %eax
	callq	_get_ctio
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	movl	(%r15), %edi
	movl	%edi, 8(%rax)
	movl	32(%r14), %edx
	movl	%edx, 24(%rax)
	movl	28(%r14), %ecx
	movl	%ecx, (%rax)
	movq	16(%rax), %rax
	movq	%r14, 8(%rax)
	movq	_CAM_DIR_IN@GOTPCREL(%rip), %rsi
	testl	%edi, (%rsi)
	je	LBB0_6
## %bb.5:
	movq	8(%r15), %rsi
	leaq	24(%r15), %rdi
	jmp	LBB0_8
LBB0_3:
	movl	$1, %ebx
	jmp	LBB0_17
LBB0_6:
	movq	_CAM_DIR_MASK@GOTPCREL(%rip), %rsi
	andl	(%rsi), %edi
	movq	_CAM_DIR_OUT@GOTPCREL(%rip), %r8
	movq	8(%r15), %rsi
	cmpl	(%r8), %edi
	jne	LBB0_9
## %bb.7:
	leaq	16(%r15), %rdi
LBB0_8:
	addq	(%rdi), %rsi
LBB0_9:
	movq	%rsi, (%rax)
	movl	(%r14), %esi
	testl	%esi, %esi
	je	LBB0_13
## %bb.10:
	cmpq	$0, (%r12)
	movl	%ecx, %edi
	je	LBB0_12
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
	movl	(%rbx), %edi
	movl	28(%r14), %ecx
	movl	32(%r14), %edx
LBB0_12:
	movl	24(%r14), %r8d
	movq	%rbx, %rsi
	callq	_tcmd_sense
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_send_ccb
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_13:
	leaq	8(%r14), %r12
	movq	_CAM_STATUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	(%r12), %esi
	cmpl	$128, %esi
	je	LBB0_16
## %bb.14:
	cmpl	$129, %esi
	jne	LBB0_15
## %bb.18:
	movq	_ATIO_WORK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tcmd_handle                    ## TAILCALL
LBB0_16:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_warn
	movq	_periph_links@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_work_queue@GOTPCREL(%rip), %rdi
	movq	%r12, %rsi
	callq	_TAILQ_REMOVE
	movl	$1, %ebx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_send_ccb
LBB0_17:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_warnx
	xorl	%eax, %eax
	callq	_abort
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,8,3                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Working on ATIO %p"

	.comm	_CAM_DIR_IN,4,2                 ## @CAM_DIR_IN
	.comm	_CAM_DIR_MASK,4,2               ## @CAM_DIR_MASK
	.comm	_CAM_DIR_OUT,4,2                ## @CAM_DIR_OUT
L_.str.1:                               ## @.str.1
	.asciz	"ATIO with %u bytes sense received"

	.comm	_CAM_STATUS_MASK,4,2            ## @CAM_STATUS_MASK
	.comm	_ATIO_WORK,4,2                  ## @ATIO_WORK
L_.str.2:                               ## @.str.2
	.asciz	"ATIO %p aborted"

	.comm	_work_queue,4,2                 ## @work_queue
	.comm	_periph_links,4,2               ## @periph_links
L_.str.3:                               ## @.str.3
	.asciz	"ATIO completed with unhandled status %#x"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_work_atio                      ; -- Begin function work_atio
	.p2align	2
_work_atio:                             ; @work_atio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x22, _debug@GOTPAGE
Lloh1:
	ldr	x22, [x22, _debug@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_2
; %bb.1:
	str	x19, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
LBB0_2:
	ldr	x21, [x19, #16]
	bl	_get_ctio
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	ldr	w9, [x21]
	str	w9, [x0, #8]
	ldp	w3, w2, [x19, #28]
	str	w2, [x0, #24]
	str	w3, [x0]
	ldr	x8, [x0, #16]
	str	x19, [x8, #8]
Lloh4:
	adrp	x10, _CAM_DIR_IN@GOTPAGE
Lloh5:
	ldr	x10, [x10, _CAM_DIR_IN@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.4:
	ldr	x9, [x21, #8]
	add	x10, x21, #24
	b	LBB0_8
LBB0_5:
	mov	w20, #1
	b	LBB0_18
LBB0_6:
Lloh7:
	adrp	x10, _CAM_DIR_MASK@GOTPAGE
Lloh8:
	ldr	x10, [x10, _CAM_DIR_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	and	w10, w10, w9
Lloh10:
	adrp	x9, _CAM_DIR_OUT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CAM_DIR_OUT@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x9]
	ldr	x9, [x21, #8]
	cmp	w10, w11
	b.ne	LBB0_9
; %bb.7:
	add	x10, x21, #16
LBB0_8:
	ldr	x10, [x10]
	add	x9, x10, x9
LBB0_9:
	str	x9, [x8]
	ldr	w8, [x19]
	cbz	w8, LBB0_12
; %bb.10:
	ldr	x9, [x22]
	cbz	x9, LBB0_15
; %bb.11:
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warnx
	ldr	w0, [x20]
	ldp	w3, w2, [x19, #28]
	b	LBB0_16
LBB0_12:
	add	x22, x19, #8
	ldr	w8, [x22]
Lloh15:
	adrp	x9, _CAM_STATUS_MASK@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CAM_STATUS_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #128
	b.eq	LBB0_17
; %bb.13:
	cmp	w8, #129
	b.ne	LBB0_19
; %bb.14:
Lloh18:
	adrp	x8, _ATIO_WORK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ATIO_WORK@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_tcmd_handle
LBB0_15:
	mov	x0, x3
LBB0_16:
	ldr	w4, [x19, #24]
	mov	x1, x20
	bl	_tcmd_sense
	mov	x0, x20
	mov	w1, #1
	bl	_send_ccb
	mov	w20, #0
	b	LBB0_18
LBB0_17:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_warn
Lloh23:
	adrp	x8, _periph_links@GOTPAGE
Lloh24:
	ldr	x8, [x8, _periph_links@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
Lloh26:
	adrp	x0, _work_queue@GOTPAGE
Lloh27:
	ldr	x0, [x0, _work_queue@GOTPAGEOFF]
	mov	x1, x22
	bl	_TAILQ_REMOVE
	mov	w20, #1
	mov	x0, x19
	mov	w1, #1
	bl	_send_ccb
LBB0_18:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_19:
	str	x8, [sp]
Lloh28:
	adrp	x0, l_.str.3@PAGE
Lloh29:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warnx
	bl	_abort
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,8,3                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Working on ATIO %p"

	.comm	_CAM_DIR_IN,4,2                 ; @CAM_DIR_IN
	.comm	_CAM_DIR_MASK,4,2               ; @CAM_DIR_MASK
	.comm	_CAM_DIR_OUT,4,2                ; @CAM_DIR_OUT
l_.str.1:                               ; @.str.1
	.asciz	"ATIO with %u bytes sense received"

	.comm	_CAM_STATUS_MASK,4,2            ; @CAM_STATUS_MASK
	.comm	_ATIO_WORK,4,2                  ; @ATIO_WORK
l_.str.2:                               ; @.str.2
	.asciz	"ATIO %p aborted"

	.comm	_work_queue,4,2                 ; @work_queue
	.comm	_periph_links,4,2               ; @periph_links
l_.str.3:                               ; @.str.3
	.asciz	"ATIO completed with unhandled status %#x"

.subsections_via_symbols
