	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function diolan_usb_transfer
_diolan_usb_transfer:                   ## @diolan_usb_transfer
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %r15
	cmpl	$0, 4(%rdi)
	je	LBB0_2
## %bb.3:
	movl	28(%r15), %ebx
	movl	32(%r15), %esi
	movl	%ebx, %edi
	callq	_usb_sndbulkpipe
	movq	8(%r15), %rdx
	movl	(%r15), %ecx
	movq	_DIOLAN_USB_TIMEOUT@GOTPCREL(%rip), %r13
	movl	(%r13), %r9d
	leaq	-44(%rbp), %r8
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_usb_bulk_msg
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_4
LBB0_21:
	movq	$0, (%r15)
	jmp	LBB0_22
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_22:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpl	$0, 4(%r15)
	jle	LBB0_5
## %bb.6:
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_7
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r12d, %r12d
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	subl	(%rax), %r12d
LBB0_20:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%r14d
	cmpl	4(%r15), %r14d
	jge	LBB0_21
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	24(%r15), %esi
	movl	28(%r15), %ebx
	movl	%ebx, %edi
	callq	_usb_rcvbulkpipe
	movq	16(%r15), %rdx
	movl	(%r13), %r9d
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$8, %ecx
	leaq	-44(%rbp), %r8
	callq	_usb_bulk_msg
	testl	%r12d, %r12d
	js	LBB0_20
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	testl	%eax, %eax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %ecx
	movl	%eax, %r12d
	testl	%ecx, %ecx
	jle	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%r15), %rax
	decl	%ecx
	movl	(%rax,%rcx,4), %eax
	cmpl	$128, %eax
	je	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%ecx, %r12d
	cmpl	$129, %eax
	je	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$130, %eax
	jne	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_EIO@GOTPCREL(%rip), %rax
	cmpl	$1, %r14d
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r12d, %r12d
	jmp	LBB0_19
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %r12d
	jmp	LBB0_20
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r12d, %r12d
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_5:
	xorl	%r12d, %r12d
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DIOLAN_USB_TIMEOUT,4,2         ## @DIOLAN_USB_TIMEOUT
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EIO,4,2                        ## @EIO
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_diolan_usb_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function diolan_usb_transfer
_diolan_usb_transfer:                   ; @diolan_usb_transfer
	.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]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_4
; %bb.2:
	ldp	w20, w1, [x19, #28]
	mov	x0, x20
	bl	_usb_sndbulkpipe
	mov	x1, x0
	ldr	x2, [x19, #8]
	ldr	w3, [x19]
Lloh0:
	adrp	x22, _DIOLAN_USB_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DIOLAN_USB_TIMEOUT@GOTPAGEOFF]
	ldr	w5, [x22]
	add	x4, sp, #12
	mov	x0, x20
	bl	_usb_bulk_msg
	mov	x20, x0
	cbz	w0, LBB0_6
LBB0_3:
	str	xzr, [x19]
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x20
	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
LBB0_6:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.7:
	mov	w23, #0
	mov	w20, #0
Lloh5:
	adrp	x24, _ETIMEDOUT@GOTPAGE
Lloh6:
	ldr	x24, [x24, _ETIMEDOUT@GOTPAGEOFF]
Lloh7:
	adrp	x25, _ENXIO@GOTPAGE
Lloh8:
	ldr	x25, [x25, _ENXIO@GOTPAGEOFF]
Lloh9:
	adrp	x26, _EIO@GOTPAGE
Lloh10:
	ldr	x26, [x26, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x26]
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	neg	w20, w8
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w23, w23, #1
	ldr	w8, [x19, #4]
	cmp	w23, w8
	b.ge	LBB0_3
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldp	w1, w21, [x19, #24]
	mov	x0, x21
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	x2, [x19, #16]
	ldr	w5, [x22]
	add	x4, sp, #12
	mov	x0, x21
	mov	w3, #8
	bl	_usb_bulk_msg
	tbnz	w20, #31, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [sp, #12]
	cmp	w0, #0
	ccmp	w8, #1, #8, eq
	mov	x20, x0
	b.lt	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x9, [x19, #16]
	sub	w20, w8, #1
	ldr	w8, [x9, w20, uxtw #2]
	cmp	w8, #128
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	w8, #129
	b.eq	LBB0_10
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	w8, #130
	b.ne	LBB0_8
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	w23, #1
	csel	x8, x25, x26, eq
	ldr	w8, [x8]
	b	LBB0_9
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	w8, [x24]
	b	LBB0_9
LBB0_18:
	mov	w20, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DIOLAN_USB_TIMEOUT,4,2         ; @DIOLAN_USB_TIMEOUT
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EIO,4,2                        ; @EIO
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_diolan_usb_transfer
.subsections_via_symbols
