	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function raw_cmd_done
_raw_cmd_done:                          ## @raw_cmd_done
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	testl	%edi, %edi
	je	LBB0_1
## %bb.3:
	movq	_inr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_raw_cmd@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_MAX_REPLIES@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpl	(%rdx), %ecx
	cmovlel	%ecx, %esi
	movl	%esi, 4(%rax)
	testl	%esi, %esi
	jle	LBB0_6
## %bb.4:
	movq	_reply_buffer@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	8(%rax), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rsi,4), %edi
	movl	%edi, (%rdx,%rsi,4)
	incq	%rsi
	movslq	4(%rax), %rdi
	cmpq	%rdi, %rsi
	jl	LBB0_5
LBB0_6:
	movq	_FD_RAW_READ@GOTPCREL(%rip), %rcx
	movq	_FD_RAW_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%edx, (%rax)
	je	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_fd_get_dma_residue
	movq	(%r15), %rcx
	movl	%eax, 24(%rcx)
	movq	%rbx, %rdi
	callq	_release_dma_lock
LBB0_8:
	movq	(%r15), %rax
	movl	(%rax), %ecx
	movq	_FD_RAW_SOFTFAILURE@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_12
## %bb.9:
	cmpl	$0, 4(%rax)
	je	LBB0_11
## %bb.10:
	movq	8(%rax), %rdx
	testb	$-64, (%rdx)
	je	LBB0_12
LBB0_11:
	movq	_FD_RAW_FAILURE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, (%rax)
LBB0_12:
	movq	_current_drive@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_disk_change
	movq	_FD_RAW_DISK_CHANGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	(%r15), %rax
	orl	(%rax), %ecx
	jmp	LBB0_15
LBB0_1:
	movq	_FD_RAW_FAILURE@GOTPCREL(%rip), %rax
	movq	_raw_cmd@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	%edx, (%rcx)
	movq	_FD_RAW_HARDFAILURE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, (%rcx)
	jmp	LBB0_2
LBB0_14:
	notl	%ecx
	movq	(%r15), %rax
	andl	(%rax), %ecx
LBB0_15:
	movl	%ecx, (%rax)
	movq	_FD_RAW_NO_MOTOR_AFTER@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_17
## %bb.16:
	movl	(%rbx), %edi
	callq	_motor_off_callback
	movq	(%r15), %rax
LBB0_17:
	movq	16(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.18:
	movl	(%rax), %eax
	movq	_FD_RAW_FAILURE@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_20
## %bb.19:
	movq	_FD_RAW_STOP_IF_FAILURE@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_22
LBB0_2:
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_generic_done                   ## TAILCALL
LBB0_20:
	movq	_FD_RAW_STOP_IF_SUCCESS@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	jne	LBB0_2
LBB0_22:
	movq	%rcx, (%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FD_RAW_FAILURE,4,2             ## @FD_RAW_FAILURE
	.comm	_raw_cmd,8,3                    ## @raw_cmd
	.comm	_FD_RAW_HARDFAILURE,4,2         ## @FD_RAW_HARDFAILURE
	.comm	_inr,4,2                        ## @inr
	.comm	_MAX_REPLIES,4,2                ## @MAX_REPLIES
	.comm	_reply_buffer,8,3               ## @reply_buffer
	.comm	_FD_RAW_READ,4,2                ## @FD_RAW_READ
	.comm	_FD_RAW_WRITE,4,2               ## @FD_RAW_WRITE
	.comm	_FD_RAW_SOFTFAILURE,4,2         ## @FD_RAW_SOFTFAILURE
	.comm	_current_drive,4,2              ## @current_drive
	.comm	_FD_RAW_DISK_CHANGE,4,2         ## @FD_RAW_DISK_CHANGE
	.comm	_FD_RAW_NO_MOTOR_AFTER,4,2      ## @FD_RAW_NO_MOTOR_AFTER
	.comm	_FD_RAW_STOP_IF_FAILURE,4,2     ## @FD_RAW_STOP_IF_FAILURE
	.comm	_FD_RAW_STOP_IF_SUCCESS,4,2     ## @FD_RAW_STOP_IF_SUCCESS
	.no_dead_strip	_raw_cmd_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function raw_cmd_done
_raw_cmd_done:                          ; @raw_cmd_done
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	w0, LBB0_12
; %bb.1:
Lloh0:
	adrp	x8, _inr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _inr@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
Lloh3:
	adrp	x21, _raw_cmd@GOTPAGE
Lloh4:
	ldr	x21, [x21, _raw_cmd@GOTPAGEOFF]
Lloh5:
	adrp	x10, _MAX_REPLIES@GOTPAGE
Lloh6:
	ldr	x10, [x10, _MAX_REPLIES@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, w10
	csel	w9, wzr, w9, gt
	str	w9, [x8, #4]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x9, #0
Lloh8:
	adrp	x10, _reply_buffer@GOTPAGE
Lloh9:
	ldr	x10, [x10, _reply_buffer@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	ldr	x11, [x8, #8]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x9, #2
	ldr	w13, [x10, x12]
	str	w13, [x11, x12]
	add	x9, x9, #1
	ldrsw	x12, [x8, #4]
	cmp	x9, x12
	b.lt	LBB0_3
LBB0_4:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _FD_RAW_READ@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FD_RAW_READ@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _FD_RAW_WRITE@GOTPAGE
Lloh15:
	ldr	x10, [x10, _FD_RAW_WRITE@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	bl	_claim_dma_lock
	mov	x20, x0
	bl	_fd_get_dma_residue
	ldr	x8, [x21]
	str	w0, [x8, #24]
	mov	x0, x20
	bl	_release_dma_lock
LBB0_6:
	ldr	x8, [x21]
	ldr	w9, [x8]
Lloh17:
	adrp	x10, _FD_RAW_SOFTFAILURE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _FD_RAW_SOFTFAILURE@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
Lloh20:
	adrp	x20, _FD_RAW_FAILURE@GOTPAGE
Lloh21:
	ldr	x20, [x20, _FD_RAW_FAILURE@GOTPAGEOFF]
	tst	w10, w9
	b.eq	LBB0_10
; %bb.7:
	ldr	w10, [x8, #4]
	cbz	w10, LBB0_9
; %bb.8:
	ldr	x10, [x8, #8]
	ldrb	w10, [x10]
	tst	w10, #0xc0
	b.eq	LBB0_10
LBB0_9:
	ldr	w10, [x20]
	orr	w9, w10, w9
	str	w9, [x8]
LBB0_10:
Lloh22:
	adrp	x22, _current_drive@GOTPAGE
Lloh23:
	ldr	x22, [x22, _current_drive@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_disk_change
Lloh24:
	adrp	x8, _FD_RAW_DISK_CHANGE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FD_RAW_DISK_CHANGE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x8]
	cbz	x0, LBB0_13
; %bb.11:
	ldr	x8, [x21]
	ldr	w10, [x8]
	orr	w9, w10, w9
	b	LBB0_14
LBB0_12:
Lloh27:
	adrp	x8, _FD_RAW_FAILURE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FD_RAW_FAILURE@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _raw_cmd@GOTPAGE
Lloh31:
	ldr	x9, [x9, _raw_cmd@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
Lloh33:
	adrp	x10, _FD_RAW_HARDFAILURE@GOTPAGE
Lloh34:
	ldr	x10, [x10, _FD_RAW_HARDFAILURE@GOTPAGEOFF]
Lloh35:
	ldr	w10, [x10]
	orr	w8, w10, w8
	str	w8, [x9]
	b	LBB0_21
LBB0_13:
	ldr	x8, [x21]
	ldr	w10, [x8]
	bic	w9, w10, w9
LBB0_14:
	str	w9, [x8]
Lloh36:
	adrp	x10, _FD_RAW_NO_MOTOR_AFTER@GOTPAGE
Lloh37:
	ldr	x10, [x10, _FD_RAW_NO_MOTOR_AFTER@GOTPAGEOFF]
Lloh38:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_16
; %bb.15:
	ldr	w0, [x22]
	bl	_motor_off_callback
	ldr	x8, [x21]
LBB0_16:
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_21
; %bb.17:
	ldr	w8, [x8]
	ldr	w10, [x20]
	tst	w10, w8
	b.eq	LBB0_19
; %bb.18:
Lloh39:
	adrp	x10, _FD_RAW_STOP_IF_FAILURE@GOTPAGE
Lloh40:
	ldr	x10, [x10, _FD_RAW_STOP_IF_FAILURE@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh41:
	adrp	x10, _FD_RAW_STOP_IF_SUCCESS@GOTPAGE
Lloh42:
	ldr	x10, [x10, _FD_RAW_STOP_IF_SUCCESS@GOTPAGEOFF]
LBB0_20:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_22
LBB0_21:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_generic_done
LBB0_22:
	str	x9, [x21]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_FD_RAW_FAILURE,4,2             ; @FD_RAW_FAILURE
	.comm	_raw_cmd,8,3                    ; @raw_cmd
	.comm	_FD_RAW_HARDFAILURE,4,2         ; @FD_RAW_HARDFAILURE
	.comm	_inr,4,2                        ; @inr
	.comm	_MAX_REPLIES,4,2                ; @MAX_REPLIES
	.comm	_reply_buffer,8,3               ; @reply_buffer
	.comm	_FD_RAW_READ,4,2                ; @FD_RAW_READ
	.comm	_FD_RAW_WRITE,4,2               ; @FD_RAW_WRITE
	.comm	_FD_RAW_SOFTFAILURE,4,2         ; @FD_RAW_SOFTFAILURE
	.comm	_current_drive,4,2              ; @current_drive
	.comm	_FD_RAW_DISK_CHANGE,4,2         ; @FD_RAW_DISK_CHANGE
	.comm	_FD_RAW_NO_MOTOR_AFTER,4,2      ; @FD_RAW_NO_MOTOR_AFTER
	.comm	_FD_RAW_STOP_IF_FAILURE,4,2     ; @FD_RAW_STOP_IF_FAILURE
	.comm	_FD_RAW_STOP_IF_SUCCESS,4,2     ; @FD_RAW_STOP_IF_SUCCESS
	.no_dead_strip	_raw_cmd_done
.subsections_via_symbols
