	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usb_std_io
_usb_std_io:                            ## @usb_std_io
	.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	%r9d, %r12d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r13d
	movq	%rdx, %r15
	movq	%rdi, %rbx
	callq	_usb_get_transfer_by_ep_no
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_libusb20_tr_pending
	testq	%rax, %rax
	je	LBB0_5
LBB0_3:
	movl	$-1, %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movq	%r14, %rdi
	callq	_libusb20_tr_get_max_total_length
	movl	%eax, %r12d
	movq	%r15, %rax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	cmpl	%r12d, %r13d
	cmovll	%r13d, %r12d
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_libusb20_tr_setup_intr
	jmp	LBB0_9
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_libusb20_tr_setup_bulk
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_libusb20_tr_start
	movq	%rbx, %rdi
	callq	_libusb20_dev_process
	testq	%rax, %rax
	jne	LBB0_3
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	callq	_libusb20_tr_pending
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movl	$-1, %r15d
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_libusb20_dev_wait_process
	movq	%rbx, %rdi
	callq	_libusb20_dev_process
	testq	%rax, %rax
	je	LBB0_11
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_libusb20_tr_get_status
	testl	%eax, %eax
	jne	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_libusb20_tr_get_actual_length
	movslq	%eax, %rcx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	addq	%rcx, %r15
	cmpl	%r12d, %eax
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	subl	%eax, %r13d
	testl	%r13d, %r13d
	jg	LBB0_6
LBB0_16:
	subl	-64(%rbp), %r15d                ## 4-byte Folded Reload
                                        ## kill: def $r15d killed $r15d killed $r15
	jmp	LBB0_4
LBB0_18:
	cmpl	$128, %eax
	jne	LBB0_20
## %bb.19:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_20:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_21:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_usb_std_io
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usb_std_io
_usb_std_io:                            ; @usb_std_io
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x5
	mov	x21, x4
	mov	x22, x3
	mov	x19, x2
	mov	x23, x0
	bl	_usb_get_transfer_by_ep_no
	cbz	x0, LBB0_2
; %bb.1:
	mov	x24, x0
	bl	_libusb20_tr_pending
	cbz	x0, LBB0_4
LBB0_2:
	mov	w28, #-1
LBB0_3:
	mov	x0, x28
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x0, x24
	bl	_libusb20_tr_get_max_total_length
	mov	x26, x0
	mov	x25, x19
	mov	w28, #-1
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	cmp	w22, w26
	csel	w27, w22, w26, lt
	mov	x0, x24
	mov	x1, x25
	mov	x2, x27
	mov	x3, x21
	cbz	w20, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_libusb20_tr_setup_intr
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_libusb20_tr_setup_bulk
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_libusb20_tr_start
	mov	x0, x23
	bl	_libusb20_dev_process
	cbnz	x0, LBB0_2
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	bl	_libusb20_tr_pending
	cbz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x0, x23
	mov	w1, #-1
	bl	_libusb20_dev_wait_process
	mov	x0, x23
	bl	_libusb20_dev_process
	cbz	x0, LBB0_9
	b	LBB0_3
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_libusb20_tr_get_status
	cbnz	w0, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	bl	_libusb20_tr_get_actual_length
	add	x25, x25, w0, sxtw
	cmp	w0, w27
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	sub	w22, w22, w0
	cmp	w22, #0
	b.gt	LBB0_5
LBB0_14:
	sub	w28, w25, w19
	b	LBB0_3
LBB0_15:
	cmp	w0, #128
	b.ne	LBB0_17
; %bb.16:
Lloh0:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w28, w8
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_usb_std_io
.subsections_via_symbols
