	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w83687thf_read_vid
_w83687thf_read_vid:                    ## @w83687thf_read_vid
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_dev_get_platdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_superio_enter
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_warn
	movl	$255, %ebx
	jmp	LBB0_9
LBB0_2:
	movq	_W83627HF_LD_HWM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_superio_select
	movq	_W83687THF_VID_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_superio_inb
	testb	$4, %al
	jne	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_5:
	movq	_W83687THF_VID_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_superio_inb
	testb	$16, %al
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movq	%rbx, %rdi
	callq	_dev_dbg
	movl	$255, %ebx
	jmp	LBB0_8
LBB0_7:
	movq	_W83687THF_VID_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_superio_inb
	movl	%eax, %ebx
	andl	$63, %ebx
LBB0_8:
	movq	%r14, %rdi
	callq	_superio_exit
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can not read VID data: Failed to enable SuperIO access\n"

	.comm	_W83627HF_LD_HWM,4,2            ## @W83627HF_LD_HWM
	.comm	_W83687THF_VID_EN,4,2           ## @W83687THF_VID_EN
L_.str.1:                               ## @.str.1
	.asciz	"VID disabled, no VID function\n"

	.comm	_W83687THF_VID_CFG,4,2          ## @W83687THF_VID_CFG
L_.str.2:                               ## @.str.2
	.asciz	"VID configured as output, no VID function\n"

	.comm	_W83687THF_VID_DATA,4,2         ## @W83687THF_VID_DATA
	.no_dead_strip	_w83687thf_read_vid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w83687thf_read_vid
_w83687thf_read_vid:                    ; @w83687thf_read_vid
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	bl	_dev_get_platdata
	mov	x19, x0
	bl	_superio_enter
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
	mov	w20, #255
	b	LBB0_9
LBB0_2:
Lloh2:
	adrp	x8, _W83627HF_LD_HWM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _W83627HF_LD_HWM@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_superio_select
Lloh5:
	adrp	x8, _W83687THF_VID_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _W83687THF_VID_EN@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_superio_inb
	tbnz	w0, #2, LBB0_4
; %bb.3:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh10:
	adrp	x8, _W83687THF_VID_CFG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _W83687THF_VID_CFG@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_superio_inb
	tbnz	w0, #4, LBB0_7
; %bb.5:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_dev_dbg
	mov	w20, #255
	b	LBB0_8
LBB0_7:
Lloh15:
	adrp	x8, _W83687THF_VID_DATA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _W83687THF_VID_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_superio_inb
	and	w20, w0, #0x3f
LBB0_8:
	mov	x0, x19
	bl	_superio_exit
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can not read VID data: Failed to enable SuperIO access\n"

	.comm	_W83627HF_LD_HWM,4,2            ; @W83627HF_LD_HWM
	.comm	_W83687THF_VID_EN,4,2           ; @W83687THF_VID_EN
l_.str.1:                               ; @.str.1
	.asciz	"VID disabled, no VID function\n"

	.comm	_W83687THF_VID_CFG,4,2          ; @W83687THF_VID_CFG
l_.str.2:                               ; @.str.2
	.asciz	"VID configured as output, no VID function\n"

	.comm	_W83687THF_VID_DATA,4,2         ; @W83687THF_VID_DATA
	.no_dead_strip	_w83687thf_read_vid
.subsections_via_symbols
