	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zap_shader_load_mdt
_zap_shader_load_mdt:                   ## @zap_shader_load_mdt
	.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
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	(%rdi), %r14
	movq	_CONFIG_ARCH_QCOM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_of_get_child_by_name
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, %r13
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%edx, %edx
	callq	_of_parse_phandle
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_of_node_put
	testq	%r12, %r12
	je	LBB0_11
## %bb.3:
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_of_address_to_resource
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_of_node_put
	testl	%ebx, %ebx
	jne	LBB0_10
## %bb.4:
	movl	-48(%rbp), %r13d
	movq	%r15, %rdi
	callq	_to_adreno_gpu
	movq	%rax, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_adreno_request_fw
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_6:
	movq	_zap_available@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_zap_available@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_zap_available@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_12:
	movq	%r12, %rdi
	callq	_qcom_mdt_get_size
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_27
## %bb.13:
	leaq	-48(%rbp), %rdi
	callq	_resource_size
	cmpl	%eax, %ebx
	jle	LBB0_15
## %bb.14:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	movq	_E2BIG@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_15:
	movq	_MEMREMAP_WC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movl	%r13d, %edi
	movl	%ebx, %esi
	callq	_memremap
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_to_adreno_gpu
	movq	(%rax), %rax
	movq	_FW_LOCATION_LEGACY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.17:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%r13, %r8
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	pushq	$0
	pushq	%rbx
	callq	_qcom_mdt_load
	addq	$16, %rsp
	movl	%eax, %ebx
	jmp	LBB0_20
LBB0_18:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_19:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_kasprintf
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rax, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%r13, %r8
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	pushq	$0
	pushq	%rbx
	callq	_qcom_mdt_load
	addq	$16, %rsp
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_kfree
LBB0_20:
	testl	%ebx, %ebx
	jne	LBB0_26
## %bb.21:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_qcom_scm_pas_auth_and_reset
	movl	%eax, %ebx
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_23
## %bb.22:
	movq	_zap_available@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	jmp	LBB0_26
LBB0_23:
	testl	%ebx, %ebx
	je	LBB0_25
## %bb.24:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	jmp	LBB0_26
LBB0_25:
	xorl	%ebx, %ebx
LBB0_26:
	movq	%r13, %rdi
	callq	_memunmap
LBB0_27:
	movq	%r12, %rdi
	callq	_release_firmware
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_ARCH_QCOM,4,2           ## @CONFIG_ARCH_QCOM
	.comm	_zap_available,4,2              ## @zap_available
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"zap-shader"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"memory-region"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to load %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"memory region is too small to load the MDT\n"

	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_MEMREMAP_WC,4,2                ## @MEMREMAP_WC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_FW_LOCATION_LEGACY,8,3         ## @FW_LOCATION_LEGACY
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.4:                               ## @.str.4
	.asciz	"qcom/%s"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
L_.str.5:                               ## @.str.5
	.asciz	"Unable to authorize the image\n"

	.no_dead_strip	_zap_shader_load_mdt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zap_shader_load_mdt
_zap_shader_load_mdt:                   ; @zap_shader_load_mdt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x23, x1
	mov	x24, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _CONFIG_ARCH_QCOM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONFIG_ARCH_QCOM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_IS_ENABLED
	cbz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_of_get_child_by_name
	cbz	x0, LBB0_7
; %bb.2:
	mov	x22, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #0
	bl	_of_parse_phandle
	mov	x20, x0
	mov	x0, x22
	bl	_of_node_put
	cbz	x20, LBB0_6
; %bb.3:
	add	x2, sp, #8
	mov	x0, x20
	mov	w1, #0
	bl	_of_address_to_resource
	mov	x22, x0
	mov	x0, x20
	bl	_of_node_put
	cbnz	w22, LBB0_9
; %bb.4:
	ldr	w26, [sp, #8]
	mov	x0, x24
	bl	_to_adreno_gpu
	mov	x1, x23
	bl	_adreno_request_fw
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.5:
	str	x23, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_DRM_DEV_ERROR
	mov	x0, x20
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_9
LBB0_6:
Lloh9:
	adrp	x8, _zap_available@GOTPAGE
Lloh10:
	ldr	x8, [x8, _zap_available@GOTPAGEOFF]
Lloh11:
	str	wzr, [x8]
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh14:
	adrp	x8, _zap_available@GOTPAGE
Lloh15:
	ldr	x8, [x8, _zap_available@GOTPAGEOFF]
Lloh16:
	str	wzr, [x8]
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	mov	x0, x20
	bl	_qcom_mdt_get_size
	mov	x22, x0
	tbnz	w0, #31, LBB0_25
; %bb.11:
	add	x0, sp, #8
	bl	_resource_size
	cmp	w22, w0
	b.le	LBB0_13
; %bb.12:
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_DRM_DEV_ERROR
Lloh21:
	adrp	x8, _E2BIG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
	b	LBB0_17
LBB0_13:
Lloh23:
	adrp	x8, _MEMREMAP_WC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MEMREMAP_WC@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x26
	mov	x1, x22
	bl	_memremap
	cbz	x0, LBB0_16
; %bb.14:
	mov	x25, x0
	mov	x0, x24
	bl	_to_adreno_gpu
	ldr	x8, [x0]
Lloh26:
	adrp	x9, _FW_LOCATION_LEGACY@GOTPAGE
Lloh27:
	ldr	x9, [x9, _FW_LOCATION_LEGACY@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.15:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	mov	x3, x21
	mov	x4, x25
	mov	x5, x26
	mov	x6, x22
	mov	x7, #0
	bl	_qcom_mdt_load
	mov	x22, x0
	b	LBB0_19
LBB0_16:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_25
LBB0_18:
Lloh31:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x23
	bl	_kasprintf
	mov	x23, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	mov	x3, x21
	mov	x4, x25
	mov	x5, x26
	mov	x6, x22
	mov	x7, #0
	bl	_qcom_mdt_load
	mov	x22, x0
	mov	x0, x23
	bl	_kfree
LBB0_19:
	cbnz	w22, LBB0_24
; %bb.20:
	mov	x0, x21
	bl	_qcom_scm_pas_auth_and_reset
	mov	x22, x0
Lloh36:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_22
; %bb.21:
Lloh39:
	adrp	x8, _zap_available@GOTPAGE
Lloh40:
	ldr	x8, [x8, _zap_available@GOTPAGEOFF]
Lloh41:
	str	wzr, [x8]
	b	LBB0_24
LBB0_22:
	cbz	w22, LBB0_24
; %bb.23:
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_DRM_DEV_ERROR
LBB0_24:
	mov	x0, x25
	bl	_memunmap
LBB0_25:
	mov	x0, x20
	bl	_release_firmware
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_ARCH_QCOM,4,2           ; @CONFIG_ARCH_QCOM
	.comm	_zap_available,4,2              ; @zap_available
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"zap-shader"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"memory-region"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to load %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"memory region is too small to load the MDT\n"

	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_MEMREMAP_WC,4,2                ; @MEMREMAP_WC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_FW_LOCATION_LEGACY,8,3         ; @FW_LOCATION_LEGACY
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.4:                               ; @.str.4
	.asciz	"qcom/%s"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
l_.str.5:                               ; @.str.5
	.asciz	"Unable to authorize the image\n"

	.no_dead_strip	_zap_shader_load_mdt
.subsections_via_symbols
