	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mes_v10_1_load_microcode
_mes_v10_1_load_microcode:              ## @mes_v10_1_load_microcode
	.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
	cmpl	$0, 24(%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	callq	_mes_v10_1_allocate_ucode_buffer
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	callq	_mes_v10_1_allocate_ucode_data_buffer
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mes_v10_1_free_ucode_buffers
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_mes_v10_1_enable
	movq	_GC@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_mmCP_MES_IC_BASE_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_WREG32_SOC15
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	movl	$3, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nv_grbm_select
	movl	(%r13), %edi
	movq	_mmCP_MES_PRGRM_CNTR_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r14), %ecx
	sarl	$2, %ecx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	movl	(%r13), %r15d
	movq	_mmCP_MES_IC_BASE_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	12(%r14), %edi
	callq	_lower_32_bits
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movl	(%r13), %r15d
	movq	_mmCP_MES_IC_BASE_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	12(%r14), %edi
	callq	_upper_32_bits
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movl	(%r13), %edi
	movq	_mmCP_MES_MIBOUND_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	movl	$2097151, %ecx                  ## imm = 0x1FFFFF
	callq	_WREG32_SOC15
	movl	(%r13), %r15d
	movq	_mmCP_MES_MDBASE_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	8(%r14), %edi
	callq	_lower_32_bits
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movl	(%r13), %r15d
	movq	_mmCP_MES_MDBASE_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	8(%r14), %edi
	callq	_upper_32_bits
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movl	(%r13), %edi
	movq	_mmCP_MES_MDBOUND_LO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	movl	$262143, %ecx                   ## imm = 0x3FFFF
	callq	_WREG32_SOC15
	movl	(%r13), %edi
	movq	_mmCP_MES_IC_OP_CNTL@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movq	_CP_MES_IC_OP_CNTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_PRIME_ICACHE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%ecx, %ecx
	callq	_REG_SET_FIELD
	movl	(%r12), %esi
	movq	_INVALIDATE_CACHE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
	movl	(%r13), %edi
	movl	(%r15), %edx
	xorl	%esi, %esi
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movl	(%r13), %edi
	movl	(%r15), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movl	(%r12), %esi
	movq	_PRIME_ICACHE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$1, %ecx
	callq	_REG_SET_FIELD
	movl	(%r13), %edi
	movl	(%r15), %edx
	xorl	%esi, %esi
	movl	%eax, %ecx
	callq	_WREG32_SOC15
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nv_grbm_select
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GC,4,2                         ## @GC
	.comm	_mmCP_MES_IC_BASE_CNTL,4,2      ## @mmCP_MES_IC_BASE_CNTL
	.comm	_mmCP_MES_PRGRM_CNTR_START,4,2  ## @mmCP_MES_PRGRM_CNTR_START
	.comm	_mmCP_MES_IC_BASE_LO,4,2        ## @mmCP_MES_IC_BASE_LO
	.comm	_mmCP_MES_IC_BASE_HI,4,2        ## @mmCP_MES_IC_BASE_HI
	.comm	_mmCP_MES_MIBOUND_LO,4,2        ## @mmCP_MES_MIBOUND_LO
	.comm	_mmCP_MES_MDBASE_LO,4,2         ## @mmCP_MES_MDBASE_LO
	.comm	_mmCP_MES_MDBASE_HI,4,2         ## @mmCP_MES_MDBASE_HI
	.comm	_mmCP_MES_MDBOUND_LO,4,2        ## @mmCP_MES_MDBOUND_LO
	.comm	_mmCP_MES_IC_OP_CNTL,4,2        ## @mmCP_MES_IC_OP_CNTL
	.comm	_CP_MES_IC_OP_CNTL,4,2          ## @CP_MES_IC_OP_CNTL
	.comm	_PRIME_ICACHE,4,2               ## @PRIME_ICACHE
	.comm	_INVALIDATE_CACHE,4,2           ## @INVALIDATE_CACHE
	.no_dead_strip	_mes_v10_1_load_microcode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mes_v10_1_load_microcode
_mes_v10_1_load_microcode:              ; @mes_v10_1_load_microcode
	.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
	ldr	w8, [x0, #24]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x19, x0
	bl	_mes_v10_1_allocate_ucode_buffer
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_mes_v10_1_allocate_ucode_data_buffer
	cbz	w0, LBB0_5
; %bb.3:
	mov	x20, x0
	mov	x0, x19
	bl	_mes_v10_1_free_ucode_buffers
	b	LBB0_6
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	mov	w1, #0
	bl	_mes_v10_1_enable
Lloh3:
	adrp	x22, _GC@GOTPAGE
Lloh4:
	ldr	x22, [x22, _GC@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh5:
	adrp	x8, _mmCP_MES_IC_BASE_CNTL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mmCP_MES_IC_BASE_CNTL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #0
	bl	_WREG32_SOC15
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	w1, #3
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_nv_grbm_select
	ldr	w0, [x22]
Lloh8:
	adrp	x8, _mmCP_MES_PRGRM_CNTR_START@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mmCP_MES_PRGRM_CNTR_START@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	ldr	w8, [x19, #16]
	asr	w3, w8, #2
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w20, [x22]
Lloh11:
	adrp	x8, _mmCP_MES_IC_BASE_LO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmCP_MES_IC_BASE_LO@GOTPAGEOFF]
Lloh13:
	ldr	w21, [x8]
	ldr	w0, [x19, #12]
	bl	_lower_32_bits
	mov	x3, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
	ldr	w20, [x22]
Lloh14:
	adrp	x8, _mmCP_MES_IC_BASE_HI@GOTPAGE
Lloh15:
	ldr	x8, [x8, _mmCP_MES_IC_BASE_HI@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	ldr	w0, [x19, #12]
	bl	_upper_32_bits
	mov	x3, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh17:
	adrp	x8, _mmCP_MES_MIBOUND_LO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mmCP_MES_MIBOUND_LO@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #2097151
	bl	_WREG32_SOC15
	ldr	w20, [x22]
Lloh20:
	adrp	x8, _mmCP_MES_MDBASE_LO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mmCP_MES_MDBASE_LO@GOTPAGEOFF]
Lloh22:
	ldr	w21, [x8]
	ldr	w0, [x19, #8]
	bl	_lower_32_bits
	mov	x3, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
	ldr	w20, [x22]
Lloh23:
	adrp	x8, _mmCP_MES_MDBASE_HI@GOTPAGE
Lloh24:
	ldr	x8, [x8, _mmCP_MES_MDBASE_HI@GOTPAGEOFF]
Lloh25:
	ldr	w21, [x8]
	ldr	w0, [x19, #8]
	bl	_upper_32_bits
	mov	x3, x0
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh26:
	adrp	x8, _mmCP_MES_MDBOUND_LO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _mmCP_MES_MDBOUND_LO@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #262143
	bl	_WREG32_SOC15
	ldr	w0, [x22]
Lloh29:
	adrp	x20, _mmCP_MES_IC_OP_CNTL@GOTPAGE
Lloh30:
	ldr	x20, [x20, _mmCP_MES_IC_OP_CNTL@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	w1, #0
	bl	_RREG32_SOC15
Lloh31:
	adrp	x21, _CP_MES_IC_OP_CNTL@GOTPAGE
Lloh32:
	ldr	x21, [x21, _CP_MES_IC_OP_CNTL@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh33:
	adrp	x23, _PRIME_ICACHE@GOTPAGE
Lloh34:
	ldr	x23, [x23, _PRIME_ICACHE@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	w3, #0
	bl	_REG_SET_FIELD
	ldr	w1, [x21]
Lloh35:
	adrp	x8, _INVALIDATE_CACHE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _INVALIDATE_CACHE@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	w3, #1
	bl	_REG_SET_FIELD
	mov	x3, x0
	ldr	w0, [x22]
	ldr	w2, [x20]
	mov	w1, #0
	bl	_WREG32_SOC15
	ldr	w0, [x22]
	ldr	w2, [x20]
	mov	w1, #0
	bl	_RREG32_SOC15
	ldr	w1, [x21]
	ldr	w2, [x23]
	mov	w3, #1
	bl	_REG_SET_FIELD
	mov	x3, x0
	ldr	w0, [x22]
	ldr	w2, [x20]
	mov	w1, #0
	bl	_WREG32_SOC15
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_nv_grbm_select
	mov	x0, x19
	bl	_mutex_unlock
	mov	w20, #0
LBB0_6:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GC,4,2                         ; @GC
	.comm	_mmCP_MES_IC_BASE_CNTL,4,2      ; @mmCP_MES_IC_BASE_CNTL
	.comm	_mmCP_MES_PRGRM_CNTR_START,4,2  ; @mmCP_MES_PRGRM_CNTR_START
	.comm	_mmCP_MES_IC_BASE_LO,4,2        ; @mmCP_MES_IC_BASE_LO
	.comm	_mmCP_MES_IC_BASE_HI,4,2        ; @mmCP_MES_IC_BASE_HI
	.comm	_mmCP_MES_MIBOUND_LO,4,2        ; @mmCP_MES_MIBOUND_LO
	.comm	_mmCP_MES_MDBASE_LO,4,2         ; @mmCP_MES_MDBASE_LO
	.comm	_mmCP_MES_MDBASE_HI,4,2         ; @mmCP_MES_MDBASE_HI
	.comm	_mmCP_MES_MDBOUND_LO,4,2        ; @mmCP_MES_MDBOUND_LO
	.comm	_mmCP_MES_IC_OP_CNTL,4,2        ; @mmCP_MES_IC_OP_CNTL
	.comm	_CP_MES_IC_OP_CNTL,4,2          ; @CP_MES_IC_OP_CNTL
	.comm	_PRIME_ICACHE,4,2               ; @PRIME_ICACHE
	.comm	_INVALIDATE_CACHE,4,2           ; @INVALIDATE_CACHE
	.no_dead_strip	_mes_v10_1_load_microcode
.subsections_via_symbols
