	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bulk_w
_bulk_w:                                ## @bulk_w
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rdi)
	js	LBB0_4
## %bb.1:
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_BULK_OUT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	decl	%r14d
	cmpl	%r14d, %ebx
	cmovll	%ebx, %r14d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rdi)
	addq	$4, %rdi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movq	%r13, %rdi
	movl	$3, %esi
	callq	_usb_sndbulkpipe
	movq	8(%r15), %rdx
	leal	1(%r14), %ecx
	movq	%r13, %rdi
	movl	%eax, %esi
	leaq	-60(%rbp), %r8
	movl	$500, %r9d                      ## imm = 0x1F4
	callq	_usb_bulk_msg
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	subl	%r14d, %ebx
	jle	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r14d, %rax
	leaq	(%r12,%rax,4), %r12
	jmp	LBB0_2
LBB0_3:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_pr_err
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BULK_OUT_SIZE,4,2              ## @BULK_OUT_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bulk write error %d tag=%02x\n"

	.no_dead_strip	_bulk_w
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bulk_w
_bulk_w:                                ; @bulk_w
	.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
	ldr	w8, [x0]
	tbnz	w8, #31, LBB0_6
; %bb.1:
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x23, [x0, #16]
Lloh0:
	adrp	x26, _BULK_OUT_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _BULK_OUT_SIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	sub	w8, w8, #1
	cmp	w21, w8
	csel	w24, w21, w8, lt
	ldr	x0, [x19, #8]
	str	w20, [x0], #4
	mov	x1, x22
	mov	x2, x24
	bl	_memcpy
	mov	x0, x23
	mov	w1, #3
	bl	_usb_sndbulkpipe
	mov	x1, x0
	ldr	x2, [x19, #8]
	add	w3, w24, #1
	add	x4, sp, #12
	mov	x0, x23
	mov	w5, #500
	bl	_usb_bulk_msg
	tbnz	w0, #31, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w21, w21, w24
	cmp	w21, #1
	b.lt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x22, x22, w24, sxtw #2
	b	LBB0_2
LBB0_5:
	mov	x25, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	mov	x2, x20
	bl	_pr_err
	str	w25, [x19]
LBB0_6:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_BULK_OUT_SIZE,4,2              ; @BULK_OUT_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bulk write error %d tag=%02x\n"

	.no_dead_strip	_bulk_w
.subsections_via_symbols
