	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gen9_check_huc_fw_fits
_gen9_check_huc_fw_fits:                ## @gen9_check_huc_fw_fits
	.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
	movq	_GUC_WOPCM_RESERVED@GOTPCREL(%rip), %r12
	movl	%esi, %ecx
	subl	(%r12), %ecx
	movl	$1, %eax
	cmpl	%edx, %ecx
	jge	LBB0_2
## %bb.1:
	movl	%edx, %r14d
	movl	%esi, %ebx
	movl	(%rdi), %r15d
	movq	_INTEL_UC_FW_TYPE_HUC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_intel_uc_fw_type_repr
	movl	%eax, %ecx
	subl	(%r12), %ebx
	movq	_SZ_1K@GOTPCREL(%rip), %rsi
	movl	%ebx, %eax
	cltd
	idivl	(%rsi)
	leal	1023(%r14), %r8d
	testl	%r14d, %r14d
	cmovnsl	%r14d, %r8d
	sarl	$10, %r8d
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	movl	%ecx, %edx
	movl	%eax, %ecx
	callq	_dev_err
	xorl	%eax, %eax
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GUC_WOPCM_RESERVED,4,2         ## @GUC_WOPCM_RESERVED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WOPCM: no space for %s: %uK < %uK\n"

	.comm	_INTEL_UC_FW_TYPE_HUC,4,2       ## @INTEL_UC_FW_TYPE_HUC
	.comm	_SZ_1K,4,2                      ## @SZ_1K
	.no_dead_strip	_gen9_check_huc_fw_fits
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gen9_check_huc_fw_fits
_gen9_check_huc_fw_fits:                ; @gen9_check_huc_fw_fits
	.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
Lloh0:
	adrp	x22, _GUC_WOPCM_RESERVED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GUC_WOPCM_RESERVED@GOTPAGEOFF]
	ldr	w8, [x22]
	sub	w8, w1, w8
	cmp	w8, w2
	b.ge	LBB0_2
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	ldr	w21, [x0]
Lloh2:
	adrp	x8, _INTEL_UC_FW_TYPE_HUC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INTEL_UC_FW_TYPE_HUC@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_intel_uc_fw_type_repr
	mov	x2, x0
	ldr	w8, [x22]
	sub	w8, w20, w8
Lloh5:
	adrp	x9, _SZ_1K@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SZ_1K@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	sdiv	w3, w8, w9
	add	w8, w19, #1023
	cmp	w19, #0
	csel	w8, w8, w19, lt
	asr	w4, w8, #10
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	mov	w0, #1
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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_GUC_WOPCM_RESERVED,4,2         ; @GUC_WOPCM_RESERVED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WOPCM: no space for %s: %uK < %uK\n"

	.comm	_INTEL_UC_FW_TYPE_HUC,4,2       ; @INTEL_UC_FW_TYPE_HUC
	.comm	_SZ_1K,4,2                      ; @SZ_1K
	.no_dead_strip	_gen9_check_huc_fw_fits
.subsections_via_symbols
