	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g4x_audio_codec_enable
_g4x_audio_codec_enable:                ## @g4x_audio_codec_enable
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	(%rdi), %edi
	callq	_to_i915
	movq	(%rbx), %r15
	movq	(%r15), %r12
	movq	%r12, %rdi
	callq	_drm_eld_size
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_DEBUG_KMS
	movq	_G4X_AUD_VID_DID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I915_READ
	movq	_INTEL_AUDIO_DEVBLC@GOTPCREL(%rip), %rcx
	movq	_INTEL_AUDIO_DEVCL@GOTPCREL(%rip), %rdi
	movq	_G4X_ELDV_DEVCL_DEVBLC@GOTPCREL(%rip), %rdx
	movq	%rdx, %rsi
	cmpl	(%rdi), %eax
	je	LBB0_2
## %bb.1:
	movq	_G4X_ELDV_DEVCTG@GOTPCREL(%rip), %rsi
LBB0_2:
	cmpl	(%rcx), %eax
	cmoveq	%rdx, %rsi
	movl	(%rsi), %r14d
	movq	_G4X_AUD_CNTL_ST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movq	_G4X_ELD_ADDR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_G4X_HDMIW_HDMIEDID@GOTPCREL(%rip), %r13
	movl	(%r13), %r9d
	movq	%r15, %rdi
	movl	%ecx, %esi
	movl	%r14d, %edx
	callq	_intel_eld_uptodate
	testq	%rax, %rax
	je	LBB0_3
## %bb.7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%rbx), %edi
	callq	_I915_READ
	movq	_G4X_ELD_ADDR_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	%r14d, %esi
	notl	%esi
	andl	%eax, %esi
	movl	%esi, %r15d
	shrl	$9, %r15d
	andl	$31, %r15d
	movl	(%rbx), %edi
	callq	_I915_WRITE
	movq	%r12, %rdi
	callq	_drm_eld_size
                                        ## kill: def $eax killed $eax def $rax
	leal	3(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$2, %edi
	movl	%r15d, %esi
	callq	_min
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_DEBUG_DRIVER
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.4:
	movl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movl	(%r12,%rbx,4), %esi
	callq	_I915_WRITE
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_5
LBB0_6:
	movq	_G4X_AUD_CNTL_ST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_I915_READ
	orl	%eax, %r14d
	movl	(%rbx), %edi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Enable audio codec, %u bytes ELD\n"

	.comm	_G4X_AUD_VID_DID,4,2            ## @G4X_AUD_VID_DID
	.comm	_INTEL_AUDIO_DEVBLC,4,2         ## @INTEL_AUDIO_DEVBLC
	.comm	_INTEL_AUDIO_DEVCL,4,2          ## @INTEL_AUDIO_DEVCL
	.comm	_G4X_ELDV_DEVCL_DEVBLC,4,2      ## @G4X_ELDV_DEVCL_DEVBLC
	.comm	_G4X_ELDV_DEVCTG,4,2            ## @G4X_ELDV_DEVCTG
	.comm	_G4X_AUD_CNTL_ST,4,2            ## @G4X_AUD_CNTL_ST
	.comm	_G4X_ELD_ADDR_MASK,4,2          ## @G4X_ELD_ADDR_MASK
	.comm	_G4X_HDMIW_HDMIEDID,4,2         ## @G4X_HDMIW_HDMIEDID
L_.str.1:                               ## @.str.1
	.asciz	"ELD size %d\n"

	.no_dead_strip	_g4x_audio_codec_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g4x_audio_codec_enable
_g4x_audio_codec_enable:                ; @g4x_audio_codec_enable
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	ldr	w0, [x0]
	bl	_to_i915
	ldr	x21, [x19]
	ldr	x19, [x21]
	mov	x0, x19
	bl	_drm_eld_size
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
Lloh2:
	adrp	x8, _G4X_AUD_VID_DID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _G4X_AUD_VID_DID@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_I915_READ
Lloh5:
	adrp	x8, _INTEL_AUDIO_DEVBLC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INTEL_AUDIO_DEVBLC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _INTEL_AUDIO_DEVCL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _INTEL_AUDIO_DEVCL@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w0, w9
Lloh11:
	adrp	x9, _G4X_ELDV_DEVCL_DEVBLC@GOTPAGE
Lloh12:
	ldr	x9, [x9, _G4X_ELDV_DEVCL_DEVBLC@GOTPAGEOFF]
Lloh13:
	adrp	x10, _G4X_ELDV_DEVCTG@GOTPAGE
Lloh14:
	ldr	x10, [x10, _G4X_ELDV_DEVCTG@GOTPAGEOFF]
	ccmp	w0, w8, #4, ne
	csel	x8, x9, x10, eq
	ldr	w20, [x8]
Lloh15:
	adrp	x22, _G4X_AUD_CNTL_ST@GOTPAGE
Lloh16:
	ldr	x22, [x22, _G4X_AUD_CNTL_ST@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh17:
	adrp	x24, _G4X_ELD_ADDR_MASK@GOTPAGE
Lloh18:
	ldr	x24, [x24, _G4X_ELD_ADDR_MASK@GOTPAGEOFF]
	ldr	w4, [x24]
Lloh19:
	adrp	x23, _G4X_HDMIW_HDMIEDID@GOTPAGE
Lloh20:
	ldr	x23, [x23, _G4X_HDMIW_HDMIEDID@GOTPAGEOFF]
	ldr	w5, [x23]
	mov	x0, x21
	mov	x2, x20
	mov	x3, x1
	bl	_intel_eld_uptodate
	cbz	x0, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	ldr	w0, [x22]
	bl	_I915_READ
	ldr	w8, [x24]
	orr	w8, w8, w20
	bic	w1, w0, w8
	ubfx	w21, w1, #9, #5
	ldr	w0, [x22]
	bl	_I915_WRITE
	mov	x0, x19
	bl	_drm_eld_size
	add	w8, w0, #3
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w0, w8, #2
	mov	x1, x21
	bl	_min
	mov	x21, x0
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_DRM_DEBUG_DRIVER
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w21, w21
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	ldr	w1, [x19], #4
	bl	_I915_WRITE
	subs	x21, x21, #1
	b.ne	LBB0_4
LBB0_5:
	ldr	w0, [x22]
	bl	_I915_READ
	orr	w1, w0, w20
	ldr	w0, [x22]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_I915_WRITE
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Enable audio codec, %u bytes ELD\n"

	.comm	_G4X_AUD_VID_DID,4,2            ; @G4X_AUD_VID_DID
	.comm	_INTEL_AUDIO_DEVBLC,4,2         ; @INTEL_AUDIO_DEVBLC
	.comm	_INTEL_AUDIO_DEVCL,4,2          ; @INTEL_AUDIO_DEVCL
	.comm	_G4X_ELDV_DEVCL_DEVBLC,4,2      ; @G4X_ELDV_DEVCL_DEVBLC
	.comm	_G4X_ELDV_DEVCTG,4,2            ; @G4X_ELDV_DEVCTG
	.comm	_G4X_AUD_CNTL_ST,4,2            ; @G4X_AUD_CNTL_ST
	.comm	_G4X_ELD_ADDR_MASK,4,2          ; @G4X_ELD_ADDR_MASK
	.comm	_G4X_HDMIW_HDMIEDID,4,2         ; @G4X_HDMIW_HDMIEDID
l_.str.1:                               ; @.str.1
	.asciz	"ELD size %d\n"

	.no_dead_strip	_g4x_audio_codec_enable
.subsections_via_symbols
