	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_zd_usb_iowrite16v_async        ## -- Begin function zd_usb_iowrite16v_async
	.p2align	4, 0x90
_zd_usb_iowrite16v_async:               ## @zd_usb_iowrite16v_async
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_zd_usb_to_chip
	movq	%rax, %rdi
	callq	_mutex_is_locked
	movl	%eax, %edi
	callq	_ZD_ASSERT
	movl	8(%rbx), %edi
	callq	_ZD_ASSERT
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.1:
	movq	_USB_MAX_IOWRITE16_COUNT@GOTPCREL(%rip), %r14
	cmpl	%r12d, (%r14)
	jae	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_zd_usb_dev
	movl	(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%eax, %edi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg_f
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_3:
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_4:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_in_atomic
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	%rbx, %rdi
	callq	_zd_usb_dev
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_dev_dbg_f
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rax
LBB0_6:
	subl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	callq	_zd_usb_to_usbdev
	movq	%rax, %r14
	movq	_EP_REGS_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_usb_sndintpipe
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_usb_pipe_endpoint
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_usb_alloc_urb
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	movq	_reg_writes@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	movl	%r12d, %edx
	callq	_struct_size
	movl	(%r13), %esi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.11:
	movq	%rax, %r13
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	_USB_REQ_WRITE_REGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, 8(%r13)
	movl	%r12d, %r14d
	shlq	$4, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %r12
	movl	8(%r15,%rbx), %edi
	callq	_cpu_to_le16
	movq	%rax, 8(%r12,%rbx)
	movl	(%r15,%rbx), %edi
	callq	_cpu_to_le16
	movq	%rax, (%r12,%rbx)
	addq	$16, %rbx
	cmpq	%rbx, %r14
	jne	LBB0_12
## %bb.13:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_usb_endpoint_xfer_int
	movq	_EP_REGS_OUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	testq	%rax, %rax
	je	LBB0_18
## %bb.14:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_usb_sndintpipe
	movq	_iowrite16v_urb_complete@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movl	(%rbx), %r10d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	movq	%r13, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	pushq	%r10
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	pushq	%rbx
	callq	_usb_fill_int_urb
	jmp	LBB0_19
LBB0_15:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_16:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_18:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_usb_sndbulkpipe
	movq	_iowrite16v_urb_complete@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	subq	$8, %rsp
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	movq	%r13, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	pushq	%rbx
	callq	_usb_fill_bulk_urb
LBB0_19:
	addq	$16, %rsp
	movq	_URB_FREE_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_zd_submit_waiting_urb
	testl	%eax, %eax
	je	LBB0_22
## %bb.20:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_zd_usb_dev
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg_f
	movl	%r15d, %r14d
LBB0_21:
	movq	%r12, %rdi
	callq	_usb_free_urb
	jmp	LBB0_7
LBB0_22:
	movq	%r12, (%rbx)
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_USB_MAX_IOWRITE16_COUNT,4,2    ## @USB_MAX_IOWRITE16_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error: count %u exceeds possible max %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"error: io in atomic context not supported\n"

	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
	.comm	_EP_REGS_OUT,4,2                ## @EP_REGS_OUT
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_reg_writes,4,2                 ## @reg_writes
	.comm	_USB_REQ_WRITE_REGS,4,2         ## @USB_REQ_WRITE_REGS
	.comm	_iowrite16v_urb_complete,4,2    ## @iowrite16v_urb_complete
	.comm	_URB_FREE_BUFFER,4,2            ## @URB_FREE_BUFFER
L_.str.2:                               ## @.str.2
	.asciz	"error in zd_submit_waiting_usb(). Error number %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_zd_usb_iowrite16v_async        ; -- Begin function zd_usb_iowrite16v_async
	.p2align	2
_zd_usb_iowrite16v_async:               ; @zd_usb_iowrite16v_async
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	bl	_zd_usb_to_chip
	bl	_mutex_is_locked
	bl	_ZD_ASSERT
	ldr	w0, [x19, #8]
	bl	_ZD_ASSERT
	cbz	w23, LBB0_3
; %bb.1:
Lloh0:
	adrp	x20, _USB_MAX_IOWRITE16_COUNT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _USB_MAX_IOWRITE16_COUNT@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, w23
	b.hs	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_zd_usb_dev
	ldr	w8, [x20]
	stp	x23, x8, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg_f
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
	mov	w21, #0
	b	LBB0_7
LBB0_4:
	bl	_in_atomic
	cbz	x0, LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_zd_usb_dev
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg_f
Lloh8:
	adrp	x8, _EWOULDBLOCK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EWOULDBLOCK@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_8:
	mov	x0, x19
	bl	_zd_usb_to_usbdev
	mov	x22, x0
Lloh10:
	adrp	x8, _EP_REGS_OUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EP_REGS_OUT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_usb_sndintpipe
	mov	x1, x0
	mov	x0, x22
	bl	_usb_pipe_endpoint
	cbz	x0, LBB0_15
; %bb.9:
	mov	x24, x0
Lloh13:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	w0, #0
	bl	_usb_alloc_urb
	cbz	x0, LBB0_16
; %bb.10:
	mov	x20, x0
Lloh15:
	adrp	x8, _reg_writes@GOTPAGE
Lloh16:
	ldr	x8, [x8, _reg_writes@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, #0
	mov	x2, x23
	bl	_struct_size
	mov	x25, x0
	ldr	w1, [x26]
	bl	_kmalloc
	cbz	x0, LBB0_17
; %bb.11:
	mov	x26, x0
	str	w25, [sp, #28]                  ; 4-byte Folded Spill
Lloh18:
	adrp	x8, _USB_REQ_WRITE_REGS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _USB_REQ_WRITE_REGS@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	mov	x28, #0
	str	x0, [x26, #8]
	mov	w8, w23
	lsl	x23, x8, #4
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x26]
	add	x27, x21, x28
	ldr	w0, [x27, #8]
	bl	_cpu_to_le16
	add	x25, x25, x28
	str	x0, [x25, #8]
	ldr	w0, [x27]
	bl	_cpu_to_le16
	str	x0, [x25]
	add	x28, x28, #16
	cmp	x23, x28
	b.ne	LBB0_12
; %bb.13:
	mov	x0, x24
	bl	_usb_endpoint_xfer_int
Lloh21:
	adrp	x8, _EP_REGS_OUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EP_REGS_OUT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	cbz	x0, LBB0_18
; %bb.14:
	mov	x0, x22
	bl	_usb_sndintpipe
	mov	x2, x0
Lloh24:
	adrp	x8, _iowrite16v_urb_complete@GOTPAGE
Lloh25:
	ldr	x8, [x8, _iowrite16v_urb_complete@GOTPAGEOFF]
Lloh26:
	ldr	w5, [x8]
	ldr	w7, [x24]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x26
	ldr	w4, [sp, #28]                   ; 4-byte Folded Reload
	mov	x6, x19
	bl	_usb_fill_int_urb
	b	LBB0_19
LBB0_15:
Lloh27:
	adrp	x8, _ENOENT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_6
LBB0_16:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_17:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_18:
	mov	x0, x22
	bl	_usb_sndbulkpipe
	mov	x2, x0
Lloh34:
	adrp	x8, _iowrite16v_urb_complete@GOTPAGE
Lloh35:
	ldr	x8, [x8, _iowrite16v_urb_complete@GOTPAGEOFF]
Lloh36:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x26
	ldr	w4, [sp, #28]                   ; 4-byte Folded Reload
	mov	x6, x19
	bl	_usb_fill_bulk_urb
LBB0_19:
Lloh37:
	adrp	x8, _URB_FREE_BUFFER@GOTPAGE
Lloh38:
	ldr	x8, [x8, _URB_FREE_BUFFER@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	x0, x19
	mov	w1, #0
	bl	_zd_submit_waiting_urb
	mov	x21, x0
	cbz	w0, LBB0_22
; %bb.20:
	mov	x0, x19
	bl	_zd_usb_dev
	str	x21, [sp]
Lloh40:
	adrp	x1, l_.str.2@PAGE
Lloh41:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg_f
LBB0_21:
	mov	x0, x20
	bl	_usb_free_urb
	b	LBB0_7
LBB0_22:
	str	x20, [x19]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_USB_MAX_IOWRITE16_COUNT,4,2    ; @USB_MAX_IOWRITE16_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error: count %u exceeds possible max %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"error: io in atomic context not supported\n"

	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
	.comm	_EP_REGS_OUT,4,2                ; @EP_REGS_OUT
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_reg_writes,4,2                 ; @reg_writes
	.comm	_USB_REQ_WRITE_REGS,4,2         ; @USB_REQ_WRITE_REGS
	.comm	_iowrite16v_urb_complete,4,2    ; @iowrite16v_urb_complete
	.comm	_URB_FREE_BUFFER,4,2            ; @URB_FREE_BUFFER
l_.str.2:                               ; @.str.2
	.asciz	"error in zd_submit_waiting_usb(). Error number %d\n"

.subsections_via_symbols
