	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ucs1002_set_usb_type
_ucs1002_set_usb_type:                  ## @ucs1002_set_usb_type
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_3
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_ucs1002_usb_types@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cmpl	%ebx, %eax
	jle	LBB0_3
## %bb.2:
	movq	(%r15), %rax
	movl	%ebx, %ecx
	movl	(%rax,%rcx,4), %eax
	addl	$-128, %eax
	cmpl	$4, %eax
	jae	LBB0_3
## %bb.4:
	cltq
	leaq	l_switch.table.ucs1002_set_usb_type(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %ecx
	movl	(%r14), %edi
	movq	_UCS1002_REG_SWITCH_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_V_SET_ACTIVE_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_update_bits             ## TAILCALL
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ucs1002_usb_types,8,3          ## @ucs1002_usb_types
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V_SET_ACTIVE_MODE_DEDICATED,4,2 ## @V_SET_ACTIVE_MODE_DEDICATED
	.comm	_V_SET_ACTIVE_MODE_BC12_SDP,4,2 ## @V_SET_ACTIVE_MODE_BC12_SDP
	.comm	_V_SET_ACTIVE_MODE_BC12_DCP,4,2 ## @V_SET_ACTIVE_MODE_BC12_DCP
	.comm	_V_SET_ACTIVE_MODE_BC12_CDP,4,2 ## @V_SET_ACTIVE_MODE_BC12_CDP
	.comm	_UCS1002_REG_SWITCH_CFG,4,2     ## @UCS1002_REG_SWITCH_CFG
	.comm	_V_SET_ACTIVE_MODE_MASK,4,2     ## @V_SET_ACTIVE_MODE_MASK
	.no_dead_strip	_ucs1002_set_usb_type
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ucs1002_set_usb_type
l_switch.table.ucs1002_set_usb_type:
	.quad	_V_SET_ACTIVE_MODE_BC12_SDP
	.quad	_V_SET_ACTIVE_MODE_DEDICATED
	.quad	_V_SET_ACTIVE_MODE_BC12_DCP
	.quad	_V_SET_ACTIVE_MODE_BC12_CDP

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ucs1002_set_usb_type
_ucs1002_set_usb_type:                  ; @ucs1002_set_usb_type
	.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
	tbnz	w1, #31, LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _ucs1002_usb_types@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ucs1002_usb_types@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, w20
	b.le	LBB0_4
; %bb.2:
	ldr	x8, [x21]
	ldr	w8, [x8, w20, uxtw #2]
	sub	w8, w8, #128
	cmp	w8, #4
	b.hs	LBB0_4
; %bb.3:
Lloh2:
	adrp	x9, l_switch.table.ucs1002_set_usb_type@PAGE
Lloh3:
	add	x9, x9, l_switch.table.ucs1002_set_usb_type@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w3, [x8]
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _UCS1002_REG_SWITCH_CFG@GOTPAGE
Lloh5:
	ldr	x8, [x8, _UCS1002_REG_SWITCH_CFG@GOTPAGEOFF]
Lloh6:
	adrp	x9, _V_SET_ACTIVE_MODE_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _V_SET_ACTIVE_MODE_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	ldr	w2, [x9]
	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
	b	_regmap_update_bits
LBB0_4:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ucs1002_usb_types,8,3          ; @ucs1002_usb_types
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V_SET_ACTIVE_MODE_DEDICATED,4,2 ; @V_SET_ACTIVE_MODE_DEDICATED
	.comm	_V_SET_ACTIVE_MODE_BC12_SDP,4,2 ; @V_SET_ACTIVE_MODE_BC12_SDP
	.comm	_V_SET_ACTIVE_MODE_BC12_DCP,4,2 ; @V_SET_ACTIVE_MODE_BC12_DCP
	.comm	_V_SET_ACTIVE_MODE_BC12_CDP,4,2 ; @V_SET_ACTIVE_MODE_BC12_CDP
	.comm	_UCS1002_REG_SWITCH_CFG,4,2     ; @UCS1002_REG_SWITCH_CFG
	.comm	_V_SET_ACTIVE_MODE_MASK,4,2     ; @V_SET_ACTIVE_MODE_MASK
	.no_dead_strip	_ucs1002_set_usb_type
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ucs1002_set_usb_type
l_switch.table.ucs1002_set_usb_type:
	.quad	_V_SET_ACTIVE_MODE_BC12_SDP
	.quad	_V_SET_ACTIVE_MODE_DEDICATED
	.quad	_V_SET_ACTIVE_MODE_BC12_DCP
	.quad	_V_SET_ACTIVE_MODE_BC12_CDP

.subsections_via_symbols
