	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_set_speed
_via_set_speed:                         ## @via_set_speed
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r12d
	movl	(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_pci_get_drvdata
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	_VIA_BAD_AST@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_VIA_ADDRESS_SETUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	leal	(%r12,%r12), %eax
	movb	$6, %bl
	subb	%al, %bl
	movl	$3, %r13d
	movl	%ebx, %ecx
	shll	%cl, %r13d
	notl	%r13d
	andl	-44(%rbp), %r13d
	movl	20(%r15), %edi
	movl	$1, %esi
	movl	$4, %edx
	callq	_clamp_val
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	orl	%r13d, %edx
	movl	%edx, -44(%rbp)
	movq	_VIA_ADDRESS_SETUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_pci_write_config_byte
LBB0_2:
	movq	_VIA_8BIT_TIMING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r12d, %ecx
	sarl	%ecx
	negl	%ecx
	leal	(%rax,%rcx), %r13d
	incl	%r13d
	movl	16(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
                                        ## kill: def $eax killed $eax def $rax
	shll	$4, %eax
	leal	-16(%rax), %ebx
	movl	12(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edx
	orl	%ebx, %edx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_pci_write_config_byte
	movq	_VIA_DRIVE_TIMING@GOTPCREL(%rip), %rax
	movl	$3, %r13d
	subl	%r12d, %r13d
	movl	(%rax), %ebx
	addl	%r13d, %ebx
	movl	8(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
                                        ## kill: def $eax killed $eax def $rax
	shll	$4, %eax
	leal	-16(%rax), %r12d
	movl	4(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edx
	orl	%r12d, %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_write_config_byte
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	4(%rax), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_14
## %bb.3:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_4:
	movl	(%r15), %edi
	testl	%edi, %edi
	je	LBB0_5
## %bb.7:
	movl	$2, %esi
	movl	$9, %edx
	jmp	LBB0_12
LBB0_8:
	movl	(%r15), %edi
	testl	%edi, %edi
	je	LBB0_15
## %bb.9:
	movl	$2, %esi
	movl	$9, %edx
	callq	_clamp_val
	movl	%eax, %edx
	addl	$-2, %edx
	orl	$232, %edx
	jmp	LBB0_13
LBB0_10:
	movl	(%r15), %edi
	testl	%edi, %edi
	je	LBB0_16
## %bb.11:
	movl	$2, %esi
	movl	$5, %edx
LBB0_12:
	callq	_clamp_val
	movl	%eax, %edx
	addl	$-2, %edx
	orl	$224, %edx
	jmp	LBB0_13
LBB0_5:
	movl	$7, %edx
	jmp	LBB0_13
LBB0_15:
	movl	$15, %edx
	jmp	LBB0_13
LBB0_16:
	movl	$3, %edx
LBB0_13:
	movl	%edx, -44(%rbp)
	movq	_VIA_UDMA_TIMING@GOTPCREL(%rip), %rax
	addl	(%rax), %r13d
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_pci_write_config_byte
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_4
	.long	L0_0_set_4
	.long	L0_0_set_8
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_VIA_BAD_AST,4,2                ## @VIA_BAD_AST
	.comm	_VIA_ADDRESS_SETUP,4,2          ## @VIA_ADDRESS_SETUP
	.comm	_VIA_8BIT_TIMING,4,2            ## @VIA_8BIT_TIMING
	.comm	_VIA_DRIVE_TIMING,4,2           ## @VIA_DRIVE_TIMING
	.comm	_VIA_UDMA_TIMING,4,2            ## @VIA_UDMA_TIMING
	.no_dead_strip	_via_set_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_set_speed
_via_set_speed:                         ; @via_set_speed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x2
	mov	x21, x1
	ldr	w0, [x0]
	bl	_to_pci_dev
	mov	x19, x0
	bl	_pci_get_drvdata
	ldr	x23, [x0]
	ldr	x8, [x23]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _VIA_BAD_AST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIA_BAD_AST@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bics	wzr, w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x22, _VIA_ADDRESS_SETUP@GOTPAGE
Lloh4:
	ldr	x22, [x22, _VIA_ADDRESS_SETUP@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	mov	w9, #6
	sub	w24, w9, w21, lsl #1
	mov	w9, #3
	lsl	w9, w9, w24
	bic	w25, w8, w9
	ldr	w0, [x20, #20]
	mov	w1, #1
	mov	w2, #4
	bl	_clamp_val
	sub	w8, w0, #1
	lsl	w8, w8, w24
	orr	w2, w8, w25
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_2:
Lloh5:
	adrp	x8, _VIA_8BIT_TIMING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VIA_8BIT_TIMING@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	sub	w8, w8, w21, asr #1
	add	w22, w8, #1
	ldr	w0, [x20, #16]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	lsl	w8, w0, #4
	sub	w24, w8, #16
	ldr	w0, [x20, #12]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	sub	w8, w0, #1
	orr	w2, w8, w24
	mov	x0, x19
	mov	x1, x22
	bl	_pci_write_config_byte
Lloh8:
	adrp	x8, _VIA_DRIVE_TIMING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VIA_DRIVE_TIMING@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mov	w9, #3
	sub	w22, w9, w21
	add	w21, w8, w22
	ldr	w0, [x20, #8]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	lsl	w8, w0, #4
	sub	w24, w8, #16
	ldr	w0, [x20, #4]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	sub	w8, w0, #1
	orr	w2, w8, w24
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
	ldr	x8, [x23]
	ldr	w8, [x8, #4]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_15
; %bb.3:
Lloh11:
	adrp	x9, lJTI0_0@PAGE
Lloh12:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_4
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_4:
	ldr	w0, [x20]
	cbz	w0, LBB0_11
; %bb.5:
	mov	w1, #2
	mov	w2, #9
	b	LBB0_10
LBB0_6:
	ldr	w0, [x20]
	cbz	w0, LBB0_12
; %bb.7:
	mov	w1, #2
	mov	w2, #9
	bl	_clamp_val
	sub	w8, w0, #2
	mov	w9, #232
	orr	w2, w8, w9
	b	LBB0_14
LBB0_8:
	ldr	w0, [x20]
	cbz	w0, LBB0_13
; %bb.9:
	mov	w1, #2
	mov	w2, #5
LBB0_10:
	bl	_clamp_val
	sub	w8, w0, #2
	orr	w2, w8, #0xe0
	b	LBB0_14
LBB0_11:
	mov	w2, #7
	b	LBB0_14
LBB0_12:
	mov	w2, #15
	b	LBB0_14
LBB0_13:
	mov	w2, #3
LBB0_14:
	str	w2, [sp, #12]
Lloh13:
	adrp	x8, _VIA_UDMA_TIMING@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VIA_UDMA_TIMING@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	add	w1, w8, w22
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
                                        ; -- End function
	.comm	_VIA_BAD_AST,4,2                ; @VIA_BAD_AST
	.comm	_VIA_ADDRESS_SETUP,4,2          ; @VIA_ADDRESS_SETUP
	.comm	_VIA_8BIT_TIMING,4,2            ; @VIA_8BIT_TIMING
	.comm	_VIA_DRIVE_TIMING,4,2           ; @VIA_DRIVE_TIMING
	.comm	_VIA_UDMA_TIMING,4,2            ; @VIA_UDMA_TIMING
	.no_dead_strip	_via_set_speed
.subsections_via_symbols
