	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amd_set_speed
_amd_set_speed:                         ## @amd_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)
	callq	_amd_offset
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_AMD_ADDRESS_SETUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	addl	%eax, %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pci_read_config_byte
	movl	$3, %r13d
	movl	$3, %eax
	subl	%r12d, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leal	(%rax,%rax), %r15d
	movl	%r15d, %ecx
	shll	%cl, %r13d
	notl	%r13d
	andl	-44(%rbp), %r13d
	movl	20(%r14), %edi
	movq	%r14, %rbx
	movl	$1, %esi
	movl	$4, %edx
	callq	_clamp_val
	movl	$4294967295, %r14d              ## imm = 0xFFFFFFFF
	leaq	(%rax,%r14), %rdx
	movl	%r15d, %ecx
	shlq	%cl, %rdx
	orl	%r13d, %edx
	movq	%rbx, %r15
	movl	%edx, -44(%rbp)
	movq	_AMD_ADDRESS_SETUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	addl	%ebx, %esi
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pci_write_config_byte
	movq	_AMD_8BIT_TIMING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	sarl	%r12d
	movl	%ebx, %ecx
	subl	%r12d, %ecx
	leal	(%rax,%rcx), %r12d
	incl	%r12d
	movl	16(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	shll	$4, %eax
	leal	-16(%rax), %ebx
	movl	12(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	leal	(%rax,%r14), %edx
	orl	%ebx, %edx
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	callq	_pci_write_config_byte
	movq	_AMD_DRIVE_TIMING@GOTPCREL(%rip), %rax
	addl	-56(%rbp), %r12d                ## 4-byte Folded Reload
	movl	(%rax), %ebx
	addl	%r12d, %ebx
	movl	8(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	shll	$4, %eax
	leal	-16(%rax), %r13d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r15), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	addl	%eax, %r14d
	orl	%r13d, %r14d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_pci_write_config_byte
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	addl	$-128, %ecx
	cmpl	$3, %ecx
	ja	LBB0_17
## %bb.1:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rcx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_15
## %bb.3:
	movq	_amd_cyc2udma@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$1, %esi
	movl	$15, %edx
	jmp	LBB0_9
LBB0_4:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_15
## %bb.5:
	movq	_amd_cyc2udma@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$1, %esi
	jmp	LBB0_8
LBB0_6:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_15
## %bb.7:
	movq	_amd_cyc2udma@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$2, %esi
LBB0_8:
	movl	$10, %edx
LBB0_9:
	callq	_clamp_val
	movl	$192, %edx
	orl	(%rbx,%rax,4), %edx
	jmp	LBB0_16
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_15
## %bb.11:
	movl	$2, %esi
	movl	$5, %edx
	callq	_clamp_val
	movq	%rax, %rdx
	addl	$-2, %edx
	orl	$192, %edx
	jmp	LBB0_16
LBB0_15:
	movl	$3, %edx
LBB0_16:
	movl	%edx, -44(%rbp)
	movq	_AMD_UDMA_TIMING@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
	movq	%r15, %rdi
	movl	%r12d, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pci_write_config_byte
LBB0_17:
	addq	$40, %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_2, LBB0_2-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_4
	.long	L0_0_set_6
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.comm	_AMD_ADDRESS_SETUP,4,2          ## @AMD_ADDRESS_SETUP
	.comm	_AMD_8BIT_TIMING,4,2            ## @AMD_8BIT_TIMING
	.comm	_AMD_DRIVE_TIMING,4,2           ## @AMD_DRIVE_TIMING
	.comm	_amd_cyc2udma,8,3               ## @amd_cyc2udma
	.comm	_AMD_UDMA_TIMING,4,2            ## @AMD_UDMA_TIMING
	.no_dead_strip	_amd_set_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amd_set_speed
_amd_set_speed:                         ; @amd_set_speed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
	str	wzr, [sp, #12]
	bl	_amd_offset
	mov	x22, x0
Lloh0:
	adrp	x25, _AMD_ADDRESS_SETUP@GOTPAGE
Lloh1:
	ldr	x25, [x25, _AMD_ADDRESS_SETUP@GOTPAGEOFF]
	ldr	w8, [x25]
	add	w1, w8, w0
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	mov	w9, #3
	sub	w24, w9, w23
	lsl	w26, w24, #1
	lsl	w9, w9, w26
	bic	w27, w8, w9
	ldr	w0, [x20, #20]
	mov	w1, #1
	mov	w2, #4
	bl	_clamp_val
	mov	w8, #-1
	add	x8, x0, x8
	lsl	x8, x8, x26
	orr	w2, w27, w8
	str	w2, [sp, #12]
	ldr	w8, [x25]
	add	w1, w8, w22
	mov	x0, x19
	bl	_pci_write_config_byte
Lloh2:
	adrp	x8, _AMD_8BIT_TIMING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AMD_8BIT_TIMING@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sub	w9, w22, w23, asr #1
	add	w8, w9, w8
	add	w23, w8, #1
	ldr	w0, [x20, #16]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	lsl	w8, w0, #4
	sub	w25, w8, #16
	ldr	w0, [x20, #12]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	sub	w8, w0, #1
	orr	w2, w8, w25
	mov	x0, x19
	mov	x1, x23
	bl	_pci_write_config_byte
Lloh5:
	adrp	x8, _AMD_DRIVE_TIMING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AMD_DRIVE_TIMING@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w23, w22, w24
	add	w22, w23, w8
	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, x22
	bl	_pci_write_config_byte
	sub	w8, w21, #128
	cmp	w8, #3
	b.hi	LBB0_15
; %bb.1:
Lloh8:
	adrp	x9, lJTI0_0@PAGE
Lloh9:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w0, [x20]
	cbz	w0, LBB0_13
; %bb.3:
Lloh10:
	adrp	x8, _amd_cyc2udma@GOTPAGE
Lloh11:
	ldr	x8, [x8, _amd_cyc2udma@GOTPAGEOFF]
Lloh12:
	ldr	x20, [x8]
	mov	w1, #1
	mov	w2, #15
	b	LBB0_9
LBB0_4:
	ldr	w0, [x20]
	cbz	w0, LBB0_13
; %bb.5:
Lloh13:
	adrp	x8, _amd_cyc2udma@GOTPAGE
Lloh14:
	ldr	x8, [x8, _amd_cyc2udma@GOTPAGEOFF]
Lloh15:
	ldr	x20, [x8]
	mov	w1, #1
	b	LBB0_8
LBB0_6:
	ldr	w0, [x20]
	cbz	w0, LBB0_13
; %bb.7:
Lloh16:
	adrp	x8, _amd_cyc2udma@GOTPAGE
Lloh17:
	ldr	x8, [x8, _amd_cyc2udma@GOTPAGEOFF]
Lloh18:
	ldr	x20, [x8]
	mov	w1, #2
LBB0_8:
	mov	w2, #10
LBB0_9:
	bl	_clamp_val
	ldr	w8, [x20, x0, lsl #2]
	b	LBB0_12
LBB0_10:
	ldr	w0, [x20]
	cbz	w0, LBB0_13
; %bb.11:
	mov	w1, #2
	mov	w2, #5
	bl	_clamp_val
	sub	w8, w0, #2
LBB0_12:
	orr	w2, w8, #0xc0
	b	LBB0_14
LBB0_13:
	mov	w2, #3
LBB0_14:
	str	w2, [sp, #12]
Lloh19:
	adrp	x8, _AMD_UDMA_TIMING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AMD_UDMA_TIMING@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	add	w1, w23, w8
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
                                        ; -- End function
	.comm	_AMD_ADDRESS_SETUP,4,2          ; @AMD_ADDRESS_SETUP
	.comm	_AMD_8BIT_TIMING,4,2            ; @AMD_8BIT_TIMING
	.comm	_AMD_DRIVE_TIMING,4,2           ; @AMD_DRIVE_TIMING
	.comm	_amd_cyc2udma,8,3               ; @amd_cyc2udma
	.comm	_AMD_UDMA_TIMING,4,2            ; @AMD_UDMA_TIMING
	.no_dead_strip	_amd_set_speed
.subsections_via_symbols
