	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra124_pmc_set_powergate
_tegra124_pmc_set_powergate:            ## @tegra124_pmc_set_powergate
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_PMC_LOCK
	movq	_PMC_PWRGATE_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_RD4
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_PMC_PWRGATE_STATUS_PARTID
	andl	%ebx, %eax
	setne	%cl
	testl	%r15d, %r15d
	setne	%dl
	testb	%cl, %dl
	jne	LBB0_10
## %bb.1:
	orl	%r15d, %eax
	je	LBB0_10
## %bb.2:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	$101, %ebx
	movq	_PMC_PWRGATE_TOGGLE@GOTPCREL(%rip), %r13
	movq	_PMC_PWRGATE_TOGGLE_START@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_RD4
	movl	(%r14), %r15d
	testl	%eax, %r15d
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	callq	_DELAY
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_3
## %bb.5:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	movl	(%r14), %r15d
LBB0_6:
	movl	(%r13), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PMC_PWRGATE_TOGGLE_PARTID
	orl	%eax, %r15d
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_WR4
	movl	$101, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_RD4
	testl	%eax, (%r14)
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, %edi
	callq	_DELAY
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_7
## %bb.9:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
LBB0_10:
	movq	%r12, %rdi
	callq	_PMC_UNLOCK
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PMC_PWRGATE_STATUS,4,2         ## @PMC_PWRGATE_STATUS
	.comm	_PMC_PWRGATE_TOGGLE,4,2         ## @PMC_PWRGATE_TOGGLE
	.comm	_PMC_PWRGATE_TOGGLE_START,4,2   ## @PMC_PWRGATE_TOGGLE_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout when waiting for TOGGLE_START\n"

	.no_dead_strip	_tegra124_pmc_set_powergate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra124_pmc_set_powergate
_tegra124_pmc_set_powergate:            ; @tegra124_pmc_set_powergate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_PMC_LOCK
Lloh0:
	adrp	x8, _PMC_PWRGATE_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMC_PWRGATE_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_RD4
	mov	x22, x0
	mov	x0, x20
	bl	_PMC_PWRGATE_STATUS_PARTID
	ands	w8, w0, w22
	ccmp	w21, #0, #4, ne
	orr	w8, w8, w21
	ccmp	w8, #0, #4, eq
	b.eq	LBB0_9
; %bb.1:
	mov	w21, #101
Lloh3:
	adrp	x22, _PMC_PWRGATE_TOGGLE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PMC_PWRGATE_TOGGLE@GOTPAGEOFF]
Lloh5:
	adrp	x23, _PMC_PWRGATE_TOGGLE_START@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PMC_PWRGATE_TOGGLE_START@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_RD4
	ldr	w24, [x23]
	tst	w24, w0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_DELAY
	sub	w21, w21, #1
	cmp	w21, #1
	b.hi	LBB0_2
; %bb.4:
	ldr	w0, [x19]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	ldr	w24, [x23]
LBB0_5:
	ldr	w21, [x22]
	mov	x0, x20
	bl	_PMC_PWRGATE_TOGGLE_PARTID
	orr	w2, w0, w24
	mov	x0, x19
	mov	x1, x21
	bl	_WR4
	mov	w20, #101
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_RD4
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1
	bl	_DELAY
	sub	w20, w20, #1
	cmp	w20, #1
	b.hi	LBB0_6
; %bb.8:
	ldr	w0, [x19]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
LBB0_9:
	mov	x0, x19
	bl	_PMC_UNLOCK
	mov	w0, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PMC_PWRGATE_STATUS,4,2         ; @PMC_PWRGATE_STATUS
	.comm	_PMC_PWRGATE_TOGGLE,4,2         ; @PMC_PWRGATE_TOGGLE
	.comm	_PMC_PWRGATE_TOGGLE_START,4,2   ; @PMC_PWRGATE_TOGGLE_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout when waiting for TOGGLE_START\n"

	.no_dead_strip	_tegra124_pmc_set_powergate
.subsections_via_symbols
