	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function guc_wait_ucode
_guc_wait_ucode:                        ## @guc_wait_ucode
	.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, %r14
	leaq	-20(%rbp), %rsi
	callq	_guc_ready
	movl	%eax, %edi
	movl	$100, %esi
	callq	_wait_for
	movl	%eax, %ebx
	movl	-20(%rbp), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_DRIVER
	movl	-20(%rbp), %eax
	movq	_GS_BOOTROM_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_GS_BOOTROM_RSA_FAILED@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOEXEC@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	-20(%rbp), %eax
LBB0_2:
	movq	_GS_UKERNEL_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_GS_UKERNEL_EXCEPTION@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	movl	$13, %edi
	callq	_SOFT_SCRATCH
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_intel_uncore_read
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GuC status %#x\n"

	.comm	_GS_BOOTROM_MASK,4,2            ## @GS_BOOTROM_MASK
	.comm	_GS_BOOTROM_RSA_FAILED,4,2      ## @GS_BOOTROM_RSA_FAILED
L_.str.1:                               ## @.str.1
	.asciz	"GuC firmware signature verification failed\n"

	.comm	_ENOEXEC,4,2                    ## @ENOEXEC
	.comm	_GS_UKERNEL_MASK,4,2            ## @GS_UKERNEL_MASK
	.comm	_GS_UKERNEL_EXCEPTION,4,2       ## @GS_UKERNEL_EXCEPTION
L_.str.2:                               ## @.str.2
	.asciz	"GuC firmware exception. EIP: %#x\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.no_dead_strip	_guc_wait_ucode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function guc_wait_ucode
_guc_wait_ucode:                        ; @guc_wait_ucode
	.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
	add	x1, sp, #12
	bl	_guc_ready
	mov	w1, #100
	bl	_wait_for
	mov	x20, x0
	ldr	w1, [sp, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _GS_BOOTROM_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GS_BOOTROM_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w9, w9, w8
Lloh5:
	adrp	x10, _GS_BOOTROM_RSA_FAILED@GOTPAGE
Lloh6:
	ldr	x10, [x10, _GS_BOOTROM_RSA_FAILED@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh10:
	adrp	x8, _ENOEXEC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOEXEC@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	w8, [sp, #12]
LBB0_2:
Lloh13:
	adrp	x9, _GS_UKERNEL_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _GS_UKERNEL_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh16:
	adrp	x9, _GS_UKERNEL_EXCEPTION@GOTPAGE
Lloh17:
	ldr	x9, [x9, _GS_UKERNEL_EXCEPTION@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #13
	bl	_SOFT_SCRATCH
	mov	x1, x0
	mov	x0, x19
	bl	_intel_uncore_read
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh21:
	adrp	x8, _ENXIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x20
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GuC status %#x\n"

	.comm	_GS_BOOTROM_MASK,4,2            ; @GS_BOOTROM_MASK
	.comm	_GS_BOOTROM_RSA_FAILED,4,2      ; @GS_BOOTROM_RSA_FAILED
l_.str.1:                               ; @.str.1
	.asciz	"GuC firmware signature verification failed\n"

	.comm	_ENOEXEC,4,2                    ; @ENOEXEC
	.comm	_GS_UKERNEL_MASK,4,2            ; @GS_UKERNEL_MASK
	.comm	_GS_UKERNEL_EXCEPTION,4,2       ; @GS_UKERNEL_EXCEPTION
l_.str.2:                               ; @.str.2
	.asciz	"GuC firmware exception. EIP: %#x\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.no_dead_strip	_guc_wait_ucode
.subsections_via_symbols
