	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function as102_read_ep2
_as102_read_ep2:                        ## @as102_read_ep2
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_usb_rcvbulkpipe
	leaq	-36(%rbp), %r8
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	movl	$200, %r9d
	callq	_usb_bulk_msg
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	%ebx, %r15d
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_4:
	movl	-36(%rbp), %edx
	cmpl	%r15d, %edx
	je	LBB0_6
## %bb.5:
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	$-1, %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"usb_bulk_msg(recv) failed, err %i\n"

L_.str.1:                               ## @.str.1
	.asciz	"only read %d of %d bytes\n"

	.no_dead_strip	_as102_read_ep2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function as102_read_ep2
_as102_read_ep2:                        ; @as102_read_ep2
	.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
	cbz	x1, LBB0_3
; %bb.1:
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x22, [x0]
	mov	x0, x22
	mov	w1, #2
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	add	x4, sp, #12
	mov	x0, x22
	mov	x2, x21
	mov	x3, x19
	mov	w5, #200
	bl	_usb_bulk_msg
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
	ldr	x0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	mov	x19, x21
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_6
LBB0_4:
	ldr	w2, [sp, #12]
	cmp	w2, w19
	b.eq	LBB0_6
; %bb.5:
	ldr	x0, [x20]
	str	x19, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w19, #-1
LBB0_6:
	mov	x0, x19
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"usb_bulk_msg(recv) failed, err %i\n"

l_.str.1:                               ; @.str.1
	.asciz	"only read %d of %d bytes\n"

	.no_dead_strip	_as102_read_ep2
.subsections_via_symbols
