	.file	"extr_qcom_scm.c_qcom_scm_set_download_mode.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"No available mechanism for setting download mode\n"
	.align 8
.LC1:
	.string	"failed to set download mode: %d\n"
	.text
	.p2align 4
	.type	qcom_scm_set_download_mode, @function
qcom_scm_set_download_mode:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rax, QWORD PTR __scm[rip]
	mov	edx, DWORD PTR QCOM_SCM_SET_DLOAD_MODE[rip]
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, edi
	mov	esi, DWORD PTR QCOM_SCM_SVC_BOOT[rip]
	mov	edi, DWORD PTR [rax]
	call	__qcom_scm_is_call_available@PLT
	test	eax, eax
	jne	.L11
	mov	rax, QWORD PTR __scm[rip]
	mov	rsi, QWORD PTR 8[rax]
	mov	edi, DWORD PTR [rax]
	test	rsi, rsi
	je	.L4
	test	r12d, r12d
	cmovne	r12d, DWORD PTR QCOM_SCM_SET_DLOAD_MODE[rip]
	mov	edx, r12d
	call	__qcom_scm_io_writel@PLT
	test	eax, eax
	jne	.L12
.L1:
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	xor	eax, eax
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	dev_err@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rax, QWORD PTR __scm[rip]
	mov	esi, r12d
	mov	edi, DWORD PTR [rax]
	call	__qcom_scm_set_dload_mode@PLT
	test	eax, eax
	je	.L1
.L12:
	mov	edx, eax
	mov	rax, QWORD PTR __scm[rip]
	lea	rsi, .LC1[rip]
	pop	r12
	.cfi_def_cfa_offset 8
	mov	edi, DWORD PTR [rax]
	xor	eax, eax
	jmp	dev_err@PLT
	.cfi_endproc
.LFE0:
	.size	qcom_scm_set_download_mode, .-qcom_scm_set_download_mode
	.comm	__scm,8,8
	.comm	QCOM_SCM_SVC_BOOT,4,4
	.comm	QCOM_SCM_SET_DLOAD_MODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_qcom_scm.c_qcom_scm_set_download_mode.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"No available mechanism for setting download mode\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"failed to set download mode: %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qcom_scm_set_download_mode, %function
qcom_scm_set_download_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, .L14
	ldr	r3, .L14+4
	ldr	r2, [r5]
	ldr	r6, .L14+8
	ldr	r1, [r3]
	mov	r4, r0
	ldr	r0, [r2]
	ldr	r2, [r6]
	bl	__qcom_scm_is_call_available
	cmp	r0, #0
	ldr	r3, [r5]
	bne	.L12
	ldm	r3, {r0, r1}
	cmp	r1, #0
	beq	.L4
	cmp	r4, #0
	ldrne	r4, [r6]
	mov	r2, r4
	bl	__qcom_scm_io_writel
	cmp	r0, #0
	popeq	{r4, r5, r6, pc}
.L13:
	ldr	r3, [r5]
	mov	r2, r0
	pop	{r4, r5, r6, lr}
	ldr	r0, [r3]
	ldr	r1, .L14+12
	b	dev_err
.L4:
	ldr	r1, .L14+16
	pop	{r4, r5, r6, lr}
	b	dev_err
.L12:
	mov	r1, r4
	ldr	r0, [r3]
	bl	__qcom_scm_set_dload_mode
	cmp	r0, #0
	popeq	{r4, r5, r6, pc}
	b	.L13
.L15:
	.align	2
.L14:
	.word	__scm
	.word	QCOM_SCM_SVC_BOOT
	.word	QCOM_SCM_SET_DLOAD_MODE
	.word	.LC1
	.word	.LC0
	.size	qcom_scm_set_download_mode, .-qcom_scm_set_download_mode
	.comm	__scm,4,4
	.comm	QCOM_SCM_SVC_BOOT,4,4
	.comm	QCOM_SCM_SET_DLOAD_MODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
