	.file	"extr_gdsc.c_gdsc_disable.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	gdsc_disable, @function
gdsc_disable:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	domain_to_gdsc@PLT
	mov	rbp, rax
	mov	rax, QWORD PTR [rax]
	cmp	rax, QWORD PTR PWRSTS_ON[rip]
	je	.L17
	mov	edx, DWORD PTR 8[rbp]
	test	DWORD PTR HW_CTRL[rip], edx
	jne	.L18
.L3:
	movsx	rdx, DWORD PTR PWRSTS_OFF[rip]
	test	rdx, rax
	jne	.L19
.L5:
	mov	esi, DWORD PTR GDSC_OFF[rip]
	mov	rdi, rbp
	call	gdsc_toggle_logic@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR CLAMP_IO[rip], eax
	jne	.L20
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	rdi, rbp
	call	gdsc_clear_mem_on@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L18:
	xor	esi, esi
	mov	rdi, rbp
	call	gdsc_hwctrl@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	edi, 1
	call	udelay@PLT
	mov	esi, DWORD PTR GDSC_ON[rip]
	mov	rdi, rbp
	call	gdsc_poll_status@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR 0[rbp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdi, rbp
	call	gdsc_assert_clamp_io@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	gdsc_assert_reset@PLT
	.cfi_endproc
.LFE0:
	.size	gdsc_disable, .-gdsc_disable
	.comm	PWRSTS_ON,8,8
	.comm	PWRSTS_OFF,4,4
	.comm	HW_CTRL,4,4
	.comm	GDSC_ON,4,4
	.comm	GDSC_OFF,4,4
	.comm	CLAMP_IO,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_gdsc.c_gdsc_disable.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gdsc_disable, %function
gdsc_disable:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	bl	domain_to_gdsc
	ldr	r2, .L21
	ldr	r3, [r0]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L17
	ldr	r2, .L21+4
	ldr	r1, [r0, #4]
	ldr	r2, [r2]
	mov	r4, r0
	tst	r1, r2
	bne	.L18
.L3:
	ldr	r2, .L21+8
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L19
.L5:
	ldr	r3, .L21+12
	mov	r0, r4
	ldr	r1, [r3]
	bl	gdsc_toggle_logic
	subs	r5, r0, #0
	bne	.L1
	ldr	r3, .L21+16
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L20
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L19:
	mov	r0, r4
	bl	gdsc_clear_mem_on
	b	.L5
.L18:
	mov	r1, #0
	bl	gdsc_hwctrl
	subs	r5, r0, #0
	blt	.L1
	mov	r0, #1
	bl	udelay
	ldr	r3, .L21+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	gdsc_poll_status
	subs	r5, r0, #0
	bne	.L1
	ldr	r3, [r4]
	b	.L3
.L20:
	mov	r0, r4
	bl	gdsc_assert_clamp_io
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L17:
	pop	{r4, r5, r6, lr}
	b	gdsc_assert_reset
.L22:
	.align	2
.L21:
	.word	PWRSTS_ON
	.word	HW_CTRL
	.word	PWRSTS_OFF
	.word	GDSC_OFF
	.word	CLAMP_IO
	.word	GDSC_ON
	.size	gdsc_disable, .-gdsc_disable
	.comm	PWRSTS_ON,4,4
	.comm	PWRSTS_OFF,4,4
	.comm	HW_CTRL,4,4
	.comm	GDSC_ON,4,4
	.comm	GDSC_OFF,4,4
	.comm	CLAMP_IO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
