	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function diu_set_pxclk
_diu_set_pxclk:                         ## @diu_set_pxclk
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	callq	_device_get_parent
	movl	%eax, %edi
	callq	_ofw_bus_get_node
	xorl	%eax, %eax
	callq	_mpc85xx_get_platform_clock
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	imull	$1000, %r14d, %ecx              ## imm = 0x3E8
	movl	%ecx, %edx
	shrl	%edx
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$32, %rdx
	je	LBB0_3
## %bb.4:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_6
LBB0_3:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_5:
	movq	%rax, %rdi
	movl	$2, %esi
	callq	_max
	movl	%eax, %edi
	movl	$255, %esi
	callq	_min
	movl	%eax, %r14d
	shll	$16, %r14d
	movq	_OCP85XX_CLKDVDR_PXCKEN@GOTPCREL(%rip), %r15
	orl	(%r15), %r14d
	movq	_OCP85XX_CLKDVDR@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_ccsr_read4
	movq	_OCP85XX_CLKDVDR_PXCKINV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%r15), %ebx
	movq	_OCP85XX_CLKDVDR_PXCLK_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movl	(%r12), %edi
	movl	%ebx, %esi
	callq	_ccsr_write4
	movl	(%r12), %edi
	orl	%r14d, %ebx
	movl	%ebx, %esi
	callq	_ccsr_write4
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to get bus frequency\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_OCP85XX_CLKDVDR_PXCKEN,4,2     ## @OCP85XX_CLKDVDR_PXCKEN
	.comm	_OCP85XX_CLKDVDR,4,2            ## @OCP85XX_CLKDVDR
	.comm	_OCP85XX_CLKDVDR_PXCKINV,4,2    ## @OCP85XX_CLKDVDR_PXCKINV
	.comm	_OCP85XX_CLKDVDR_PXCLK_MASK,4,2 ## @OCP85XX_CLKDVDR_PXCLK_MASK
	.no_dead_strip	_diu_set_pxclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function diu_set_pxclk
_diu_set_pxclk:                         ; @diu_set_pxclk
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_device_get_parent
	bl	_ofw_bus_get_node
	bl	_mpc85xx_get_platform_clock
	cbz	x0, LBB0_2
; %bb.1:
	mov	w8, #1000
	mul	w8, w20, w8
	lsr	w9, w8, #1
	add	x9, x0, x9
	udiv	x0, x9, x8
	mov	w1, #2
	bl	_max
	mov	w1, #255
	bl	_min
Lloh0:
	adrp	x19, _OCP85XX_CLKDVDR_PXCKEN@GOTPAGE
Lloh1:
	ldr	x19, [x19, _OCP85XX_CLKDVDR_PXCKEN@GOTPAGEOFF]
	ldr	w8, [x19]
	orr	w20, w8, w0, lsl #16
Lloh2:
	adrp	x21, _OCP85XX_CLKDVDR@GOTPAGE
Lloh3:
	ldr	x21, [x21, _OCP85XX_CLKDVDR@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_ccsr_read4
	ldr	w8, [x19]
Lloh4:
	adrp	x9, _OCP85XX_CLKDVDR_PXCKINV@GOTPAGE
Lloh5:
	ldr	x9, [x9, _OCP85XX_CLKDVDR_PXCKINV@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh7:
	adrp	x9, _OCP85XX_CLKDVDR_PXCLK_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _OCP85XX_CLKDVDR_PXCLK_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w19, w0, w8
	ldr	w0, [x21]
	mov	x1, x19
	bl	_ccsr_write4
	ldr	w0, [x21]
	orr	w1, w20, w19
	bl	_ccsr_write4
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh12:
	adrp	x8, _ENXIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to get bus frequency\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_OCP85XX_CLKDVDR_PXCKEN,4,2     ; @OCP85XX_CLKDVDR_PXCKEN
	.comm	_OCP85XX_CLKDVDR,4,2            ; @OCP85XX_CLKDVDR
	.comm	_OCP85XX_CLKDVDR_PXCKINV,4,2    ; @OCP85XX_CLKDVDR_PXCKINV
	.comm	_OCP85XX_CLKDVDR_PXCLK_MASK,4,2 ; @OCP85XX_CLKDVDR_PXCLK_MASK
	.no_dead_strip	_diu_set_pxclk
.subsections_via_symbols
