	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isp1704_charger_type
_isp1704_charger_type:                  ## @isp1704_charger_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	%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	%rdi, %r13
	movq	_POWER_SUPPLY_TYPE_USB_DCP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_ULPI_FUNC_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_isp1704_read
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_ULPI_OTG_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_isp1704_read
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_ULPI_OTG_CTRL_DM_PULLDOWN@GOTPCREL(%rip), %rax
	movq	_ULPI_OTG_CTRL_DP_PULLDOWN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	(%r12), %edi
	callq	_ULPI_CLR
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_isp1704_write
	movl	(%r15), %edi
	callq	_ULPI_CLR
	movq	_ULPI_FUNC_CTRL_XCVRSEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_isp1704_write
	movl	(%r15), %edi
	callq	_ULPI_SET
	movq	_ULPI_FUNC_CTRL_FULL_SPEED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_isp1704_write
	movq	_ULPI_FUNC_CTRL_TERMSELECT@GOTPCREL(%rip), %rax
	movq	_ULPI_FUNC_CTRL_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movl	(%r15), %edi
	callq	_ULPI_SET
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_isp1704_write
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	_ULPI_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_isp1704_read
	notl	%eax
	testb	$3, %al
	je	LBB0_2
## %bb.1:
	movq	_POWER_SUPPLY_TYPE_USB_CDP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_2:
	movl	(%r15), %esi
	movq	%r13, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_isp1704_write
	movq	_ULPI_OTG_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_isp1704_write
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_SUPPLY_TYPE_USB_DCP,4,2  ## @POWER_SUPPLY_TYPE_USB_DCP
	.comm	_ULPI_FUNC_CTRL,4,2             ## @ULPI_FUNC_CTRL
	.comm	_ULPI_OTG_CTRL,4,2              ## @ULPI_OTG_CTRL
	.comm	_ULPI_OTG_CTRL_DM_PULLDOWN,4,2  ## @ULPI_OTG_CTRL_DM_PULLDOWN
	.comm	_ULPI_OTG_CTRL_DP_PULLDOWN,4,2  ## @ULPI_OTG_CTRL_DP_PULLDOWN
	.comm	_ULPI_FUNC_CTRL_XCVRSEL_MASK,4,2 ## @ULPI_FUNC_CTRL_XCVRSEL_MASK
	.comm	_ULPI_FUNC_CTRL_FULL_SPEED,4,2  ## @ULPI_FUNC_CTRL_FULL_SPEED
	.comm	_ULPI_FUNC_CTRL_TERMSELECT,4,2  ## @ULPI_FUNC_CTRL_TERMSELECT
	.comm	_ULPI_FUNC_CTRL_RESET,4,2       ## @ULPI_FUNC_CTRL_RESET
	.comm	_ULPI_DEBUG,4,2                 ## @ULPI_DEBUG
	.comm	_POWER_SUPPLY_TYPE_USB_CDP,4,2  ## @POWER_SUPPLY_TYPE_USB_CDP
	.no_dead_strip	_isp1704_charger_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isp1704_charger_type
_isp1704_charger_type:                  ; @isp1704_charger_type
	.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	x19, x0
Lloh0:
	adrp	x8, _POWER_SUPPLY_TYPE_USB_DCP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWER_SUPPLY_TYPE_USB_DCP@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
Lloh3:
	adrp	x24, _ULPI_FUNC_CTRL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _ULPI_FUNC_CTRL@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_isp1704_read
	mov	x20, x0
Lloh5:
	adrp	x25, _ULPI_OTG_CTRL@GOTPAGE
Lloh6:
	ldr	x25, [x25, _ULPI_OTG_CTRL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_isp1704_read
	mov	x21, x0
Lloh7:
	adrp	x8, _ULPI_OTG_CTRL_DM_PULLDOWN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ULPI_OTG_CTRL_DM_PULLDOWN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _ULPI_OTG_CTRL_DP_PULLDOWN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ULPI_OTG_CTRL_DP_PULLDOWN@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w22, w9, w8
	ldr	w0, [x25]
	bl	_ULPI_CLR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_isp1704_write
	ldr	w0, [x24]
	bl	_ULPI_CLR
	mov	x1, x0
Lloh13:
	adrp	x8, _ULPI_FUNC_CTRL_XCVRSEL_MASK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ULPI_FUNC_CTRL_XCVRSEL_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_isp1704_write
	ldr	w0, [x24]
	bl	_ULPI_SET
	mov	x1, x0
Lloh16:
	adrp	x8, _ULPI_FUNC_CTRL_FULL_SPEED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ULPI_FUNC_CTRL_FULL_SPEED@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_isp1704_write
Lloh19:
	adrp	x8, _ULPI_FUNC_CTRL_TERMSELECT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ULPI_FUNC_CTRL_TERMSELECT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _ULPI_FUNC_CTRL_RESET@GOTPAGE
Lloh23:
	ldr	x9, [x9, _ULPI_FUNC_CTRL_RESET@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w22, w9, w8
	ldr	w0, [x24]
	bl	_ULPI_SET
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_isp1704_write
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
Lloh25:
	adrp	x8, _ULPI_DEBUG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ULPI_DEBUG@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_isp1704_read
Lloh28:
	adrp	x8, _POWER_SUPPLY_TYPE_USB_CDP@GOTPAGE
Lloh29:
	ldr	x8, [x8, _POWER_SUPPLY_TYPE_USB_CDP@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	mov	w9, #3
	bics	wzr, w9, w0
	csel	w22, w23, w8, eq
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x20
	bl	_isp1704_write
	ldr	w1, [x25]
	mov	x0, x19
	mov	x2, x21
	bl	_isp1704_write
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_SUPPLY_TYPE_USB_DCP,4,2  ; @POWER_SUPPLY_TYPE_USB_DCP
	.comm	_ULPI_FUNC_CTRL,4,2             ; @ULPI_FUNC_CTRL
	.comm	_ULPI_OTG_CTRL,4,2              ; @ULPI_OTG_CTRL
	.comm	_ULPI_OTG_CTRL_DM_PULLDOWN,4,2  ; @ULPI_OTG_CTRL_DM_PULLDOWN
	.comm	_ULPI_OTG_CTRL_DP_PULLDOWN,4,2  ; @ULPI_OTG_CTRL_DP_PULLDOWN
	.comm	_ULPI_FUNC_CTRL_XCVRSEL_MASK,4,2 ; @ULPI_FUNC_CTRL_XCVRSEL_MASK
	.comm	_ULPI_FUNC_CTRL_FULL_SPEED,4,2  ; @ULPI_FUNC_CTRL_FULL_SPEED
	.comm	_ULPI_FUNC_CTRL_TERMSELECT,4,2  ; @ULPI_FUNC_CTRL_TERMSELECT
	.comm	_ULPI_FUNC_CTRL_RESET,4,2       ; @ULPI_FUNC_CTRL_RESET
	.comm	_ULPI_DEBUG,4,2                 ; @ULPI_DEBUG
	.comm	_POWER_SUPPLY_TYPE_USB_CDP,4,2  ; @POWER_SUPPLY_TYPE_USB_CDP
	.no_dead_strip	_isp1704_charger_type
.subsections_via_symbols
