	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_hdmi_audio_set_mai_clock
_vc4_hdmi_audio_set_mai_clock:          ## @vc4_hdmi_audio_set_mai_clock
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %rdi
	callq	_to_vc4_dev
	movl	4(%rbx), %edi
	callq	_clk_get_rate
	movl	(%rbx), %esi
	movq	_VC4_HD_MAI_SMP_N_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_VC4_HD_MAI_SMP_N_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	movq	_VC4_HD_MAI_SMP_M_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_VC4_HD_MAI_SMP_M_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %ebx
	incl	%ebx
	leaq	-32(%rbp), %r8
	leaq	-24(%rbp), %r9
	movl	%eax, %edi
	movl	%ebx, %ecx
	callq	_rational_best_approximation
	movq	_VC4_HD_MAI_SMP@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	-32(%rbp), %rdi
	movq	_VC4_HD_MAI_SMP_N@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_VC4_SET_FIELD
	movl	%eax, %ebx
	movq	-24(%rbp), %rdi
	decq	%rdi
	movq	_VC4_HD_MAI_SMP_M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_VC4_SET_FIELD
	orl	%eax, %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_HD_WRITE
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VC4_HD_MAI_SMP_N_MASK,4,2      ## @VC4_HD_MAI_SMP_N_MASK
	.comm	_VC4_HD_MAI_SMP_N_SHIFT,4,2     ## @VC4_HD_MAI_SMP_N_SHIFT
	.comm	_VC4_HD_MAI_SMP_M_MASK,4,2      ## @VC4_HD_MAI_SMP_M_MASK
	.comm	_VC4_HD_MAI_SMP_M_SHIFT,4,2     ## @VC4_HD_MAI_SMP_M_SHIFT
	.comm	_VC4_HD_MAI_SMP,4,2             ## @VC4_HD_MAI_SMP
	.comm	_VC4_HD_MAI_SMP_N,4,2           ## @VC4_HD_MAI_SMP_N
	.comm	_VC4_HD_MAI_SMP_M,4,2           ## @VC4_HD_MAI_SMP_M
	.no_dead_strip	_vc4_hdmi_audio_set_mai_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_hdmi_audio_set_mai_clock
_vc4_hdmi_audio_set_mai_clock:          ; @vc4_hdmi_audio_set_mai_clock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x0, [x8]
	bl	_to_vc4_dev
	ldr	w0, [x19, #4]
	bl	_clk_get_rate
	ldr	w1, [x19]
Lloh0:
	adrp	x8, _VC4_HD_MAI_SMP_N_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VC4_HD_MAI_SMP_N_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _VC4_HD_MAI_SMP_N_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VC4_HD_MAI_SMP_N_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	asr	w2, w8, w9
Lloh6:
	adrp	x8, _VC4_HD_MAI_SMP_M_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VC4_HD_MAI_SMP_M_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _VC4_HD_MAI_SMP_M_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VC4_HD_MAI_SMP_M_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	asr	w8, w8, w9
	add	w3, w8, #1
	add	x4, sp, #8
	mov	x5, sp
	bl	_rational_best_approximation
Lloh12:
	adrp	x8, _VC4_HD_MAI_SMP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VC4_HD_MAI_SMP@GOTPAGEOFF]
Lloh14:
	ldr	w19, [x8]
	ldr	x0, [sp, #8]
Lloh15:
	adrp	x8, _VC4_HD_MAI_SMP_N@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VC4_HD_MAI_SMP_N@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_VC4_SET_FIELD
	mov	x20, x0
	ldr	x8, [sp]
	sub	x0, x8, #1
Lloh18:
	adrp	x8, _VC4_HD_MAI_SMP_M@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VC4_HD_MAI_SMP_M@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_VC4_SET_FIELD
	orr	w1, w0, w20
	mov	x0, x19
	bl	_HD_WRITE
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VC4_HD_MAI_SMP_N_MASK,4,2      ; @VC4_HD_MAI_SMP_N_MASK
	.comm	_VC4_HD_MAI_SMP_N_SHIFT,4,2     ; @VC4_HD_MAI_SMP_N_SHIFT
	.comm	_VC4_HD_MAI_SMP_M_MASK,4,2      ; @VC4_HD_MAI_SMP_M_MASK
	.comm	_VC4_HD_MAI_SMP_M_SHIFT,4,2     ; @VC4_HD_MAI_SMP_M_SHIFT
	.comm	_VC4_HD_MAI_SMP,4,2             ; @VC4_HD_MAI_SMP
	.comm	_VC4_HD_MAI_SMP_N,4,2           ; @VC4_HD_MAI_SMP_N
	.comm	_VC4_HD_MAI_SMP_M,4,2           ; @VC4_HD_MAI_SMP_M
	.no_dead_strip	_vc4_hdmi_audio_set_mai_clock
.subsections_via_symbols
