	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_wopcm_init               ## -- Begin function intel_wopcm_init
	.p2align	4, 0x90
_intel_wopcm_init:                      ## @intel_wopcm_init
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_wopcm_to_i915
	movq	%rax, %r12
	leaq	8(%rax), %rbx
	leaq	12(%rax), %rdi
	callq	_intel_uc_fw_get_upload_size
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_intel_uc_fw_get_upload_size
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_context_reserved_size
	testq	%r13, %r13
	je	LBB0_19
## %bb.1:
	movq	%rax, %r14
	xorl	%edi, %edi
	cmpq	$0, (%r15)
	sete	%dil
	callq	_GEM_BUG_ON
	movl	8(%r15), %edi
	callq	_GEM_BUG_ON
	movl	12(%r15), %edi
	callq	_GEM_BUG_ON
	xorl	%edi, %edi
	cmpq	(%r15), %r13
	setge	%dil
	callq	_GEM_BUG_ON
	xorl	%edi, %edi
	cmpq	(%r15), %rbx
	setge	%dil
	callq	_GEM_BUG_ON
	movq	_WOPCM_RESERVED_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%r14, %rax
	xorl	%edi, %edi
	cmpq	(%r15), %rax
	setge	%dil
	callq	_GEM_BUG_ON
	movq	%r12, %rdi
	callq	_i915_inject_probe_failure
	testq	%rax, %rax
	jne	LBB0_19
## %bb.2:
	movl	4(%r12), %edi
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	callq	___wopcm_regs_locked
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	movl	(%r12), %edi
	movq	-48(%rbp), %rax
	movq	_SZ_1K@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	%rax, %rcx
	orq	%rsi, %rcx
	shrq	$32, %rcx
	je	LBB0_4
## %bb.5:
	cqto
	idivq	%rsi
	movq	%rax, %rcx
	jmp	LBB0_6
LBB0_10:
	movq	_WOPCM_RESERVED_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	addq	%rbx, %rdi
	movq	%rdi, -48(%rbp)
	movq	_GUC_WOPCM_OFFSET_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ALIGN
	movq	%rax, -48(%rbp)
	movq	(%r15), %rsi
	subq	%r14, %rsi
	movq	%rax, %rdi
	callq	_min
	movq	%rax, -48(%rbp)
	movq	(%r15), %rcx
	addq	%rax, %r14
	subq	%r14, %rcx
	movq	_GUC_WOPCM_SIZE_MASK@GOTPCREL(%rip), %rdx
	andq	(%rdx), %rcx
	movq	%rcx, -56(%rbp)
	movl	(%r12), %edi
	movq	_SZ_1K@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_11
## %bb.12:
	cqto
	idivq	%rsi
	movq	%rax, %r8
	jmp	LBB0_13
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %ecx
LBB0_6:
	movq	%rbx, %r14
	movq	-56(%rbp), %rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_7
## %bb.8:
	cqto
	idivq	%rsi
	jmp	LBB0_9
LBB0_7:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%rcx, %rdx
	jmp	LBB0_17
LBB0_11:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r8d
LBB0_13:
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_14
## %bb.15:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	jmp	LBB0_16
LBB0_14:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_16:
	leaq	L_.str.1(%rip), %rsi
	movq	%r8, %rdx
LBB0_17:
	movq	%rax, %rcx
	callq	_DRM_DEV_DEBUG_DRIVER
	movq	(%r15), %rsi
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rcx
	movq	%r12, %rdi
	movq	%r13, %r8
	movq	%r14, %r9
	callq	___check_layout
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movl	-48(%rbp), %eax
	movl	%eax, 8(%r15)
	movl	-56(%rbp), %ecx
	movl	%ecx, 12(%r15)
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	xorl	%edi, %edi
	cmpl	$0, 12(%r15)
	sete	%dil
	callq	_GEM_BUG_ON
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WOPCM_RESERVED_SIZE,8,3        ## @WOPCM_RESERVED_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GuC WOPCM is already locked [%uK, %uK)\n"

	.comm	_SZ_1K,8,3                      ## @SZ_1K
	.comm	_GUC_WOPCM_OFFSET_ALIGNMENT,4,2 ## @GUC_WOPCM_OFFSET_ALIGNMENT
	.comm	_GUC_WOPCM_SIZE_MASK,8,3        ## @GUC_WOPCM_SIZE_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Calculated GuC WOPCM [%uK, %uK)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_wopcm_init               ; -- Begin function intel_wopcm_init
	.p2align	2
_intel_wopcm_init:                      ; @intel_wopcm_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	bl	_wopcm_to_i915
	mov	x20, x0
	add	x22, x0, #8
	add	x0, x0, #12
	bl	_intel_uc_fw_get_upload_size
	mov	x21, x0
	mov	x0, x22
	bl	_intel_uc_fw_get_upload_size
	mov	x22, x0
	mov	x0, x20
	bl	_context_reserved_size
	cbz	x21, LBB0_7
; %bb.1:
	mov	x23, x0
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w0, [x19, #8]
	bl	_GEM_BUG_ON
	ldr	w0, [x19, #12]
	bl	_GEM_BUG_ON
	ldr	x8, [x19]
	cmp	x21, x8
	cset	w0, ge
	bl	_GEM_BUG_ON
	ldr	x8, [x19]
	cmp	x22, x8
	cset	w0, ge
	bl	_GEM_BUG_ON
Lloh0:
	adrp	x24, _WOPCM_RESERVED_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _WOPCM_RESERVED_SIZE@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x9, [x19]
	add	x8, x8, x23
	cmp	x8, x9
	cset	w0, ge
	bl	_GEM_BUG_ON
	mov	x0, x20
	bl	_i915_inject_probe_failure
	cbnz	x0, LBB0_7
; %bb.2:
	ldr	w0, [x20, #4]
	add	x1, sp, #8
	mov	x2, sp
	bl	___wopcm_regs_locked
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x20]
	ldr	x8, [sp, #8]
Lloh2:
	adrp	x9, _SZ_1K@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SZ_1K@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	sdiv	x2, x8, x9
	ldr	x8, [sp]
	sdiv	x3, x8, x9
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:
	ldr	x8, [x24]
	add	x0, x8, x22
	str	x0, [sp, #8]
Lloh7:
	adrp	x8, _GUC_WOPCM_OFFSET_ALIGNMENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GUC_WOPCM_OFFSET_ALIGNMENT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_ALIGN
	str	x0, [sp, #8]
	ldr	x8, [x19]
	sub	x1, x8, x23
	bl	_min
	str	x0, [sp, #8]
	ldr	x8, [x19]
	add	x9, x0, x23
	sub	x8, x8, x9
Lloh10:
	adrp	x9, _GUC_WOPCM_SIZE_MASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GUC_WOPCM_SIZE_MASK@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	and	x9, x9, x8
	str	x9, [sp]
	ldr	w8, [x20]
Lloh13:
	adrp	x10, _SZ_1K@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SZ_1K@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	sdiv	x2, x0, x10
	sdiv	x3, x9, x10
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
LBB0_5:
	bl	_DRM_DEV_DEBUG_DRIVER
	ldr	x1, [x19]
	ldp	x3, x2, [sp]
	mov	x0, x20
	mov	x4, x21
	mov	x5, x22
	bl	___check_layout
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w8, [sp, #8]
	ldr	x9, [sp]
	stp	w8, w9, [x19, #8]
	cmp	w8, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w8, [x19, #12]
	cmp	w8, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_WOPCM_RESERVED_SIZE,8,3        ; @WOPCM_RESERVED_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GuC WOPCM is already locked [%uK, %uK)\n"

	.comm	_SZ_1K,8,3                      ; @SZ_1K
	.comm	_GUC_WOPCM_OFFSET_ALIGNMENT,4,2 ; @GUC_WOPCM_OFFSET_ALIGNMENT
	.comm	_GUC_WOPCM_SIZE_MASK,8,3        ; @GUC_WOPCM_SIZE_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Calculated GuC WOPCM [%uK, %uK)\n"

.subsections_via_symbols
