	.file	"extr_tegra124_pmc.c_tegra124_pmc_set_powergate.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Timeout when waiting for TOGGLE_START\n"
	.text
	.p2align 4
	.type	tegra124_pmc_set_powergate, @function
tegra124_pmc_set_powergate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, edx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	PMC_LOCK@PLT
	mov	esi, DWORD PTR PMC_PWRGATE_STATUS[rip]
	mov	rdi, rbp
	call	RD4@PLT
	mov	edi, r12d
	mov	r13d, eax
	call	PMC_PWRGATE_STATUS_PARTID@PLT
	test	r13d, eax
	setne	dl
	test	ebx, ebx
	sete	al
	cmp	dl, al
	jne	.L5
	mov	ebx, 100
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, 1
	call	DELAY@PLT
	sub	ebx, 1
	je	.L21
.L2:
	mov	esi, DWORD PTR PMC_PWRGATE_TOGGLE[rip]
	mov	rdi, rbp
	call	RD4@PLT
	test	DWORD PTR PMC_PWRGATE_TOGGLE_START[rip], eax
	jne	.L22
.L3:
	mov	edi, r12d
	mov	ebx, 100
	call	PMC_PWRGATE_TOGGLE_PARTID@PLT
	mov	esi, DWORD PTR PMC_PWRGATE_TOGGLE[rip]
	or	eax, DWORD PTR PMC_PWRGATE_TOGGLE_START[rip]
	mov	rdi, rbp
	mov	edx, eax
	call	WR4@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	mov	edi, 1
	call	DELAY@PLT
	sub	ebx, 1
	je	.L23
.L6:
	mov	esi, DWORD PTR PMC_PWRGATE_TOGGLE[rip]
	mov	rdi, rbp
	call	RD4@PLT
	test	DWORD PTR PMC_PWRGATE_TOGGLE_START[rip], eax
	jne	.L24
.L5:
	mov	rdi, rbp
	call	PMC_UNLOCK@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC0[rip]
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L23:
	mov	edi, DWORD PTR 0[rbp]
	lea	rsi, .LC0[rip]
	call	device_printf@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	tegra124_pmc_set_powergate, .-tegra124_pmc_set_powergate
	.comm	PMC_PWRGATE_TOGGLE_START,4,4
	.comm	PMC_PWRGATE_TOGGLE,4,4
	.comm	PMC_PWRGATE_STATUS,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_tegra124_pmc.c_tegra124_pmc_set_powergate.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Timeout when waiting for TOGGLE_START\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tegra124_pmc_set_powergate, %function
tegra124_pmc_set_powergate:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	mov	r4, r2
	mov	r8, r1
	bl	PMC_LOCK
	ldr	r3, .L24
	mov	r0, r5
	ldr	r1, [r3]
	bl	RD4
	mov	r6, r0
	mov	r0, r8
	bl	PMC_PWRGATE_STATUS_PARTID
	clz	r2, r4
	tst	r6, r0
	movne	r3, #1
	moveq	r3, #0
	lsr	r2, r2, #5
	cmp	r3, r2
	bne	.L5
	mov	r4, #100
	ldr	r6, .L24+4
	ldr	r7, .L24+8
	b	.L2
.L21:
	mov	r0, #1
	bl	DELAY
	subs	r4, r4, #1
	beq	.L20
.L2:
	mov	r0, r5
	ldr	r1, [r6]
	bl	RD4
	ldr	r3, [r7]
	tst	r0, r3
	bne	.L21
.L3:
	mov	r0, r8
	ldr	r4, [r6]
	bl	PMC_PWRGATE_TOGGLE_PARTID
	ldr	r2, [r7]
	mov	r1, r4
	orr	r2, r0, r2
	mov	r0, r5
	bl	WR4
	mov	r4, #100
	b	.L6
.L23:
	mov	r0, #1
	bl	DELAY
	subs	r4, r4, #1
	beq	.L22
.L6:
	mov	r0, r5
	ldr	r1, [r6]
	bl	RD4
	ldr	r3, [r7]
	tst	r0, r3
	bne	.L23
.L5:
	mov	r0, r5
	bl	PMC_UNLOCK
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	ldr	r1, .L24+12
	ldr	r0, [r5]
	bl	device_printf
	b	.L3
.L22:
	ldr	r1, .L24+12
	ldr	r0, [r5]
	bl	device_printf
	b	.L5
.L25:
	.align	2
.L24:
	.word	PMC_PWRGATE_STATUS
	.word	PMC_PWRGATE_TOGGLE
	.word	PMC_PWRGATE_TOGGLE_START
	.word	.LC0
	.size	tegra124_pmc_set_powergate, .-tegra124_pmc_set_powergate
	.comm	PMC_PWRGATE_TOGGLE_START,4,4
	.comm	PMC_PWRGATE_TOGGLE,4,4
	.comm	PMC_PWRGATE_STATUS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
