	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hso_start_serial_device
_hso_start_serial_device:               ## @hso_start_serial_device
	.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
	movl	%esi, %r15d
	movq	%rdi, %r12
	callq	_dev2ser
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	8(%rax), %rax
	movq	_HSO_INTF_MUX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_3
## %bb.10:
	movq	24(%r13), %rdi
	callq	_mutex_lock
	movq	24(%r13), %rdi
	movl	4(%rdi), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movl	(%r12), %esi
	movl	%r15d, %edx
	callq	_hso_mux_submit_intr_urb
	movl	%eax, %ebx
	movq	24(%r13), %rdi
	movl	4(%rdi), %eax
LBB0_12:
	incl	%eax
	movl	%eax, 4(%rdi)
	callq	_mutex_unlock
LBB0_13:
	movq	16(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
## %bb.14:
	movq	8(%r13), %rax
	movq	8(%rax), %rdx
	movq	%r13, %rdi
	callq	_tiocmget_submit_urb
	jmp	LBB0_15
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%ebx, %ebx
	cmpl	$0, (%r13)
	jle	LBB0_13
## %bb.4:
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r13), %rcx
	movq	56(%r13), %rdx
	movl	-4(%rcx,%r14,4), %r12d
	movq	8(%rax), %rbx
	movl	(%rdx), %esi
	andl	$127, %esi
	movq	%rbx, %rdi
	callq	_usb_rcvbulkpipe
	movq	48(%r13), %rcx
	movl	-4(%rcx,%r14,4), %ecx
	movl	40(%r13), %r8d
	movq	_hso_std_serial_read_bulk_callback@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movq	%r13, (%rsp)
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_usb_fill_bulk_urb
	movq	32(%r13), %rax
	movl	-4(%rax,%r14,4), %edi
	movl	%r15d, %esi
	callq	_usb_submit_urb
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_8 Depth=1
	movslq	(%r13), %rax
	cmpq	%rax, %r14
	jge	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r13), %rax
	incq	%r14
	jmp	LBB0_8
LBB0_9:
	movl	%eax, %ebx
	movq	8(%r13), %rax
	movq	8(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_warn
	jmp	LBB0_13
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_HSO_INTF_MUX,4,2               ## @HSO_INTF_MUX
	.comm	_hso_std_serial_read_bulk_callback,4,2 ## @hso_std_serial_read_bulk_callback
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to submit urb - res %d\n"

	.no_dead_strip	_hso_start_serial_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hso_start_serial_device
_hso_start_serial_device:               ; @hso_start_serial_device
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x21, x0
	bl	_dev2ser
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w9, [x8]
Lloh0:
	adrp	x10, _HSO_INTF_MUX@GOTPAGE
Lloh1:
	ldr	x10, [x10, _HSO_INTF_MUX@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
; %bb.2:
	ldr	x0, [x19, #24]
	bl	_mutex_lock
	ldr	x0, [x19, #24]
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_11
; %bb.3:
	mov	w21, #0
	b	LBB0_12
LBB0_4:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_5:
	ldr	w9, [x19]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x23, #0
Lloh6:
	adrp	x24, _hso_std_serial_read_bulk_callback@GOTPAGE
Lloh7:
	ldr	x24, [x24, _hso_std_serial_read_bulk_callback@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #32]
	lsl	x25, x23, #2
	ldr	w21, [x9, x25]
	ldr	x22, [x8, #8]
	ldr	x8, [x19, #56]
	ldr	w8, [x8]
	and	w1, w8, #0x7f
	mov	x0, x22
	bl	_usb_rcvbulkpipe
	mov	x2, x0
	ldr	x8, [x19, #48]
	ldr	w3, [x8, x25]
	ldr	w4, [x19, #40]
	ldr	w5, [x24]
	mov	x0, x21
	mov	x1, x22
	mov	x6, x19
	bl	_usb_fill_bulk_urb
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x25]
	mov	x1, x20
	bl	_usb_submit_urb
	cbnz	w0, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #8]
	b	LBB0_7
LBB0_10:
	mov	w21, #0
	ldr	x1, [x19, #16]
	cbnz	x1, LBB0_13
	b	LBB0_14
LBB0_11:
	ldr	w1, [x21]
	mov	x2, x20
	bl	_hso_mux_submit_intr_urb
	mov	x21, x0
	ldr	x0, [x19, #24]
	ldr	w8, [x0, #4]
LBB0_12:
	add	w8, w8, #1
	str	w8, [x0, #4]
	bl	_mutex_unlock
	ldr	x1, [x19, #16]
	cbz	x1, LBB0_14
LBB0_13:
	ldr	x8, [x19, #8]
	ldr	x2, [x8, #8]
	mov	x0, x19
	bl	_tiocmget_submit_urb
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_15:
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
	ldr	x1, [x19, #16]
	cbnz	x1, LBB0_13
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_HSO_INTF_MUX,4,2               ; @HSO_INTF_MUX
	.comm	_hso_std_serial_read_bulk_callback,4,2 ; @hso_std_serial_read_bulk_callback
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to submit urb - res %d\n"

	.no_dead_strip	_hso_start_serial_device
.subsections_via_symbols
