	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adb_iop_write
_adb_iop_write:                         ## @adb_iop_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	cmpl	$2, (%rdi)
	jl	LBB0_2
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	_ADB_PACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	callq	_local_irq_save
	movl	$0, 16(%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rbx)
	movq	$0, 40(%rbx)
	movq	_current_req@GOTPCREL(%rip), %rax
	movq	_last_req@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	addq	$24, %rdx
	cmpq	$0, (%rax)
	cmoveq	%rax, %rdx
	movq	%rbx, (%rdx)
	movq	%rbx, (%rcx)
	callq	_local_irq_restore
	movq	_adb_iop_state@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_idle@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_adb_iop_start
	jmp	LBB0_5
LBB0_2:
	movl	$1, 16(%rbx)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADB_PACKET,8,3                 ## @ADB_PACKET
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_current_req,8,3                ## @current_req
	.comm	_last_req,8,3                   ## @last_req
	.comm	_adb_iop_state,8,3              ## @adb_iop_state
	.comm	_idle,8,3                       ## @idle
	.no_dead_strip	_adb_iop_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adb_iop_write
_adb_iop_write:                         ; @adb_iop_write
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #2
	b.lt	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _ADB_PACKET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ADB_PACKET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	bl	_local_irq_save
	str	wzr, [x19, #16]
	stp	xzr, xzr, [x19, #32]
	str	xzr, [x19, #24]
Lloh3:
	adrp	x8, _current_req@GOTPAGE
Lloh4:
	ldr	x8, [x8, _current_req@GOTPAGEOFF]
	ldr	x9, [x8]
Lloh5:
	adrp	x10, _last_req@GOTPAGE
Lloh6:
	ldr	x10, [x10, _last_req@GOTPAGEOFF]
	ldr	x11, [x10]
	add	x11, x11, #24
	cmp	x9, #0
	csel	x8, x8, x11, eq
	str	x19, [x8]
	str	x19, [x10]
	bl	_local_irq_restore
	mov	w0, #0
Lloh7:
	adrp	x8, _adb_iop_state@GOTPAGE
Lloh8:
	ldr	x8, [x8, _adb_iop_state@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _idle@GOTPAGE
Lloh11:
	ldr	x9, [x9, _idle@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	bl	_adb_iop_start
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	mov	w8, #1
	str	w8, [x19, #16]
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ADB_PACKET,8,3                 ; @ADB_PACKET
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_current_req,8,3                ; @current_req
	.comm	_last_req,8,3                   ; @last_req
	.comm	_adb_iop_state,8,3              ; @adb_iop_state
	.comm	_idle,8,3                       ; @idle
	.no_dead_strip	_adb_iop_write
.subsections_via_symbols
