	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcom_scm_set_download_mode
_qcom_scm_set_download_mode:            ## @qcom_scm_set_download_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	___scm@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	(%rax), %edi
	movq	_QCOM_SCM_SVC_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_QCOM_SCM_SET_DLOAD_MODE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	callq	___qcom_scm_is_call_available
	movq	(%r14), %rcx
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rcx), %edi
	movl	%ebx, %esi
	callq	___qcom_scm_set_dload_mode
	testl	%eax, %eax
	je	LBB0_7
LBB0_9:
	movq	(%r14), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_2:
	movq	8(%rcx), %rsi
	movl	(%rcx), %edi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.3:
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.4:
	movl	(%r15), %ebx
LBB0_5:
	movl	%ebx, %edx
	callq	___qcom_scm_io_writel
	testl	%eax, %eax
	jne	LBB0_9
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	___scm,8,3                      ## @__scm
	.comm	_QCOM_SCM_SVC_BOOT,4,2          ## @QCOM_SCM_SVC_BOOT
	.comm	_QCOM_SCM_SET_DLOAD_MODE,4,2    ## @QCOM_SCM_SET_DLOAD_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No available mechanism for setting download mode\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to set download mode: %d\n"

	.no_dead_strip	_qcom_scm_set_download_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcom_scm_set_download_mode
_qcom_scm_set_download_mode:            ; @qcom_scm_set_download_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, ___scm@GOTPAGE
Lloh1:
	ldr	x20, [x20, ___scm@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	w0, [x8]
Lloh2:
	adrp	x8, _QCOM_SCM_SVC_BOOT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QCOM_SCM_SVC_BOOT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x21, _QCOM_SCM_SET_DLOAD_MODE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _QCOM_SCM_SET_DLOAD_MODE@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	___qcom_scm_is_call_available
	ldr	x8, [x20]
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w0, [x8]
	mov	x1, x19
	bl	___qcom_scm_set_dload_mode
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_3
LBB0_2:
	ldr	x8, [x20]
	ldr	w8, [x8]
	str	x0, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	bl	_dev_err
LBB0_3:
	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
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	x1, [x8, #8]
	ldr	w0, [x8]
	cbz	x1, LBB0_6
; %bb.5:
	ldr	w8, [x21]
	cmp	w19, #0
	csel	w2, wzr, w8, eq
	bl	___qcom_scm_io_writel
                                        ; kill: def $w0 killed $w0 def $x0
	cbnz	w0, LBB0_2
	b	LBB0_3
LBB0_6:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	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
	add	sp, sp, #64
	b	_dev_err
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	___scm,8,3                      ; @__scm
	.comm	_QCOM_SCM_SVC_BOOT,4,2          ; @QCOM_SCM_SVC_BOOT
	.comm	_QCOM_SCM_SET_DLOAD_MODE,4,2    ; @QCOM_SCM_SET_DLOAD_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No available mechanism for setting download mode\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to set download mode: %d\n"

	.no_dead_strip	_qcom_scm_set_download_mode
.subsections_via_symbols
