	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function USB_set_host_by_voltage
LCPI0_0:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
LCPI0_1:
	.quad	1                               ## 0x1
	.quad	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_USB_set_host_by_voltage
	.p2align	4, 0x90
_USB_set_host_by_voltage:               ## @USB_set_host_by_voltage
	.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
	movq	_DC_USB_SET_HOST_BY_VOLTAGE_BEGIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DBGC
	movq	_USB_HOST_PORT_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_usb_host_port@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_USB_EXTRA_STATE_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_usb_extra_state@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [1,1,1,1]
	movq	_sr_exp_data@GOTPCREL(%rip), %r12
	movups	%xmm0, (%r12)
	movq	$0, 16(%r12)
	xorl	%eax, %eax
	callq	_SR_EXP_WriteData
	movl	$250, %edi
	callq	_wait_ms
	movq	_ADC_5V@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_adc_get
	movq	_v_5v@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_ADC_5V_START_LEVEL@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jae	LBB0_3
## %bb.1:
	movq	_DC_USB_SET_HOST_5V_LOW_WAITING@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_DBGC
	movl	(%r13), %edi
	callq	_adc_get
	movq	%rax, (%rbx)
	cmpq	(%r14), %rax
	jb	LBB0_2
LBB0_3:
	movq	_ADC_CON1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_adc_get
	movq	_v_con_1@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_ADC_CON2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_adc_get
	movq	_v_con_2@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	(%rbx), %rcx
	movq	_v_con_1_boot@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	movq	_v_con_2_boot@GOTPCREL(%rip), %rdx
	movq	%rax, (%rdx)
	xorl	%edx, %edx
	xorl	%esi, %esi
	cmpq	%rax, %rcx
	setg	%dl
	setle	%sil
	movd	%edx, %xmm0
	pinsrb	$8, %esi, %xmm0
	pand	LCPI0_1(%rip), %xmm0
	movd	%xmm0, (%r12)
	pextrd	$2, %xmm0, 4(%r12)
	pshufd	$40, %xmm0, %xmm0               ## xmm0 = xmm0[0,2,2,0]
	movdqu	%xmm0, 16(%r12)
	jle	LBB0_4
## %bb.5:
	movq	_USB_HOST_PORT_1@GOTPCREL(%rip), %rbx
	jmp	LBB0_6
LBB0_4:
	movq	_USB_HOST_PORT_2@GOTPCREL(%rip), %rbx
LBB0_6:
	xorl	%eax, %eax
	callq	_SR_EXP_WriteData
	movl	$0, 8(%r12)
	xorl	%eax, %eax
	callq	_SR_EXP_WriteData
	movl	(%rbx), %eax
	movq	_usb_host_port@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_USB_EXTRA_STATE_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_usb_extra_state@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_USB_reset
	xorl	%eax, %eax
	callq	_USB_configure
	movq	_DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DBGC                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DC_USB_SET_HOST_BY_VOLTAGE_BEGIN,4,2 ## @DC_USB_SET_HOST_BY_VOLTAGE_BEGIN
	.comm	_USB_HOST_PORT_UNKNOWN,4,2      ## @USB_HOST_PORT_UNKNOWN
	.comm	_usb_host_port,4,2              ## @usb_host_port
	.comm	_USB_EXTRA_STATE_UNKNOWN,4,2    ## @USB_EXTRA_STATE_UNKNOWN
	.comm	_usb_extra_state,4,2            ## @usb_extra_state
	.comm	_sr_exp_data,32,2               ## @sr_exp_data
	.comm	_ADC_5V,4,2                     ## @ADC_5V
	.comm	_v_5v,8,3                       ## @v_5v
	.comm	_ADC_5V_START_LEVEL,8,3         ## @ADC_5V_START_LEVEL
	.comm	_DC_USB_SET_HOST_5V_LOW_WAITING,4,2 ## @DC_USB_SET_HOST_5V_LOW_WAITING
	.comm	_ADC_CON1,4,2                   ## @ADC_CON1
	.comm	_v_con_1,8,3                    ## @v_con_1
	.comm	_ADC_CON2,4,2                   ## @ADC_CON2
	.comm	_v_con_2,8,3                    ## @v_con_2
	.comm	_v_con_1_boot,8,3               ## @v_con_1_boot
	.comm	_v_con_2_boot,8,3               ## @v_con_2_boot
	.comm	_USB_HOST_PORT_1,4,2            ## @USB_HOST_PORT_1
	.comm	_USB_HOST_PORT_2,4,2            ## @USB_HOST_PORT_2
	.comm	_USB_EXTRA_STATE_DISABLED,4,2   ## @USB_EXTRA_STATE_DISABLED
	.comm	_DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE,4,2 ## @DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_USB_set_host_by_voltage        ; -- Begin function USB_set_host_by_voltage
	.p2align	2
_USB_set_host_by_voltage:               ; @USB_set_host_by_voltage
	.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
Lloh0:
	adrp	x8, _DC_USB_SET_HOST_BY_VOLTAGE_BEGIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DC_USB_SET_HOST_BY_VOLTAGE_BEGIN@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_DBGC
Lloh3:
	adrp	x8, _USB_HOST_PORT_UNKNOWN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _USB_HOST_PORT_UNKNOWN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x19, _usb_host_port@GOTPAGE
Lloh7:
	ldr	x19, [x19, _usb_host_port@GOTPAGEOFF]
	str	w8, [x19]
Lloh8:
	adrp	x8, _USB_EXTRA_STATE_UNKNOWN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _USB_EXTRA_STATE_UNKNOWN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x20, _usb_extra_state@GOTPAGE
Lloh12:
	ldr	x20, [x20, _usb_extra_state@GOTPAGEOFF]
	str	w8, [x20]
Lloh13:
	adrp	x21, _sr_exp_data@GOTPAGE
Lloh14:
	ldr	x21, [x21, _sr_exp_data@GOTPAGEOFF]
	movi.4s	v0, #1
	str	q0, [x21]
	str	xzr, [x21, #16]
	bl	_SR_EXP_WriteData
	mov	w0, #250
	bl	_wait_ms
Lloh15:
	adrp	x22, _ADC_5V@GOTPAGE
Lloh16:
	ldr	x22, [x22, _ADC_5V@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_adc_get
Lloh17:
	adrp	x23, _v_5v@GOTPAGE
Lloh18:
	ldr	x23, [x23, _v_5v@GOTPAGEOFF]
	str	x0, [x23]
Lloh19:
	adrp	x24, _ADC_5V_START_LEVEL@GOTPAGE
Lloh20:
	ldr	x24, [x24, _ADC_5V_START_LEVEL@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x0, x8
	b.hs	LBB0_3
; %bb.1:
Lloh21:
	adrp	x25, _DC_USB_SET_HOST_5V_LOW_WAITING@GOTPAGE
Lloh22:
	ldr	x25, [x25, _DC_USB_SET_HOST_5V_LOW_WAITING@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	bl	_DBGC
	ldr	w0, [x22]
	bl	_adc_get
	str	x0, [x23]
	ldr	x8, [x24]
	cmp	x0, x8
	b.lo	LBB0_2
LBB0_3:
Lloh23:
	adrp	x8, _ADC_CON1@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ADC_CON1@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_adc_get
Lloh26:
	adrp	x22, _v_con_1@GOTPAGE
Lloh27:
	ldr	x22, [x22, _v_con_1@GOTPAGEOFF]
	str	x0, [x22]
Lloh28:
	adrp	x8, _ADC_CON2@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ADC_CON2@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_adc_get
Lloh31:
	adrp	x8, _v_con_2@GOTPAGE
Lloh32:
	ldr	x8, [x8, _v_con_2@GOTPAGEOFF]
Lloh33:
	str	x0, [x8]
	ldr	x8, [x22]
Lloh34:
	adrp	x9, _v_con_1_boot@GOTPAGE
Lloh35:
	ldr	x9, [x9, _v_con_1_boot@GOTPAGEOFF]
Lloh36:
	str	x8, [x9]
Lloh37:
	adrp	x9, _v_con_2_boot@GOTPAGE
Lloh38:
	ldr	x9, [x9, _v_con_2_boot@GOTPAGEOFF]
Lloh39:
	str	x0, [x9]
	cmp	x8, x0
	cset	w8, gt
	cset	w9, le
	stp	w9, w8, [x21, #24]
	stp	w8, w9, [x21]
	stp	w8, w9, [x21, #16]
Lloh40:
	adrp	x8, _USB_HOST_PORT_1@GOTPAGE
Lloh41:
	ldr	x8, [x8, _USB_HOST_PORT_1@GOTPAGEOFF]
Lloh42:
	adrp	x9, _USB_HOST_PORT_2@GOTPAGE
Lloh43:
	ldr	x9, [x9, _USB_HOST_PORT_2@GOTPAGEOFF]
	csel	x22, x8, x9, gt
	bl	_SR_EXP_WriteData
	str	wzr, [x21, #8]
	bl	_SR_EXP_WriteData
	ldr	w8, [x22]
	str	w8, [x19]
Lloh44:
	adrp	x8, _USB_EXTRA_STATE_DISABLED@GOTPAGE
Lloh45:
	ldr	x8, [x8, _USB_EXTRA_STATE_DISABLED@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	str	w8, [x20]
	bl	_USB_reset
	bl	_USB_configure
Lloh47:
	adrp	x8, _DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
	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
	b	_DBGC
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotStr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DC_USB_SET_HOST_BY_VOLTAGE_BEGIN,4,2 ; @DC_USB_SET_HOST_BY_VOLTAGE_BEGIN
	.comm	_USB_HOST_PORT_UNKNOWN,4,2      ; @USB_HOST_PORT_UNKNOWN
	.comm	_usb_host_port,4,2              ; @usb_host_port
	.comm	_USB_EXTRA_STATE_UNKNOWN,4,2    ; @USB_EXTRA_STATE_UNKNOWN
	.comm	_usb_extra_state,4,2            ; @usb_extra_state
	.comm	_sr_exp_data,32,2               ; @sr_exp_data
	.comm	_ADC_5V,4,2                     ; @ADC_5V
	.comm	_v_5v,8,3                       ; @v_5v
	.comm	_ADC_5V_START_LEVEL,8,3         ; @ADC_5V_START_LEVEL
	.comm	_DC_USB_SET_HOST_5V_LOW_WAITING,4,2 ; @DC_USB_SET_HOST_5V_LOW_WAITING
	.comm	_ADC_CON1,4,2                   ; @ADC_CON1
	.comm	_v_con_1,8,3                    ; @v_con_1
	.comm	_ADC_CON2,4,2                   ; @ADC_CON2
	.comm	_v_con_2,8,3                    ; @v_con_2
	.comm	_v_con_1_boot,8,3               ; @v_con_1_boot
	.comm	_v_con_2_boot,8,3               ; @v_con_2_boot
	.comm	_USB_HOST_PORT_1,4,2            ; @USB_HOST_PORT_1
	.comm	_USB_HOST_PORT_2,4,2            ; @USB_HOST_PORT_2
	.comm	_USB_EXTRA_STATE_DISABLED,4,2   ; @USB_EXTRA_STATE_DISABLED
	.comm	_DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE,4,2 ; @DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE
.subsections_via_symbols
