	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hso_create_mux_serial_device
_hso_create_mux_serial_device:          ## @hso_create_mux_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r15
	movq	_HSO_INTF_MUX@GOTPCREL(%rip), %rax
	movq	_HSO_PORT_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	notl	%ebx
	andl	(%rax), %ebx
	movl	%esi, %edi
	callq	_hso_mux_to_port
	orl	%ebx, %eax
	movl	(%r12), %ecx
	andl	%eax, %ecx
	movq	_HSO_PORT_NO_PORT@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	je	LBB0_7
## %bb.1:
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_hso_create_device
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %r15
	movq	%rax, 32(%rbx)
	movq	%rbx, 24(%rax)
	movq	_CTRL_URB_RX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CTRL_URB_TX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_hso_serial_common_create
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_tty_drv@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %esi
	callq	_tty_unregister_device
	movq	%r15, %rdi
	callq	_kfree
LBB0_6:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	decl	20(%r15)
	movq	_hso_mux_serial_write_data@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	%r14, 8(%r15)
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r15), %rdi
	incl	4(%rdi)
	callq	_mutex_unlock
	movl	(%r15), %edi
	movq	%r15, %rsi
	callq	_set_serial_by_index
	movq	%rbx, %rdi
	callq	_hso_log_port
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_HSO_INTF_MUX,4,2               ## @HSO_INTF_MUX
	.comm	_HSO_PORT_MASK,4,2              ## @HSO_PORT_MASK
	.comm	_HSO_PORT_NO_PORT,4,2           ## @HSO_PORT_NO_PORT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_CTRL_URB_RX_SIZE,4,2           ## @CTRL_URB_RX_SIZE
	.comm	_CTRL_URB_TX_SIZE,4,2           ## @CTRL_URB_TX_SIZE
	.comm	_hso_mux_serial_write_data,4,2  ## @hso_mux_serial_write_data
	.comm	_tty_drv,4,2                    ## @tty_drv
	.no_dead_strip	_hso_create_mux_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_create_mux_serial_device
_hso_create_mux_serial_device:          ; @hso_create_mux_serial_device
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x19, x0
Lloh0:
	adrp	x8, _HSO_INTF_MUX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HSO_INTF_MUX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x21, _HSO_PORT_MASK@GOTPAGE
Lloh4:
	ldr	x21, [x21, _HSO_PORT_MASK@GOTPAGEOFF]
	ldr	w9, [x21]
	bic	w22, w8, w9
	mov	x0, x1
	bl	_hso_mux_to_port
	orr	w1, w22, w0
	ldr	w8, [x21]
	and	w8, w1, w8
Lloh5:
	adrp	x9, _HSO_PORT_NO_PORT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HSO_PORT_NO_PORT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_hso_create_device
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.2:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x21, x0
	str	x0, [x19, #32]
	str	x19, [x0, #24]
Lloh11:
	adrp	x8, _CTRL_URB_RX_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CTRL_URB_RX_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _CTRL_URB_TX_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CTRL_URB_TX_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	w1, #1
	bl	_hso_serial_common_create
	cbz	x0, LBB0_8
; %bb.4:
Lloh17:
	adrp	x8, _tty_drv@GOTPAGE
Lloh18:
	ldr	x8, [x8, _tty_drv@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	w1, [x21]
	bl	_tty_unregister_device
	mov	x0, x21
	bl	_kfree
LBB0_5:
	mov	x0, x19
	bl	_kfree
LBB0_6:
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	w8, [x21, #20]
	sub	w8, w8, #1
Lloh20:
	adrp	x9, _hso_mux_serial_write_data@GOTPAGE
Lloh21:
	ldr	x9, [x9, _hso_mux_serial_write_data@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #16]
	str	x20, [x21, #8]
	mov	x0, x20
	bl	_mutex_lock
	ldr	x0, [x21, #8]
	ldr	w8, [x0, #4]
	add	w8, w8, #1
	str	w8, [x0, #4]
	bl	_mutex_unlock
	ldr	w0, [x21]
	mov	x1, x21
	bl	_set_serial_by_index
	mov	x0, x19
	bl	_hso_log_port
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_HSO_INTF_MUX,4,2               ; @HSO_INTF_MUX
	.comm	_HSO_PORT_MASK,4,2              ; @HSO_PORT_MASK
	.comm	_HSO_PORT_NO_PORT,4,2           ; @HSO_PORT_NO_PORT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_CTRL_URB_RX_SIZE,4,2           ; @CTRL_URB_RX_SIZE
	.comm	_CTRL_URB_TX_SIZE,4,2           ; @CTRL_URB_TX_SIZE
	.comm	_hso_mux_serial_write_data,4,2  ; @hso_mux_serial_write_data
	.comm	_tty_drv,4,2                    ; @tty_drv
	.no_dead_strip	_hso_create_mux_serial_device
.subsections_via_symbols
