	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra124_pmc_attach
_tegra124_pmc_attach:                   ## @tegra124_pmc_attach
	.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, %r15d
	callq	_device_get_softc
	movq	%rax, %r14
	movl	%r15d, 16(%rax)
	movl	%r15d, %edi
	callq	_ofw_bus_get_node
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_tegra124_pmc_parse_fdt
	movl	16(%r14), %edi
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_10
LBB0_2:
	movq	%r14, %rcx
	addq	$20, %rcx
	leaq	L_.str.1(%rip), %rdx
	xorl	%esi, %esi
	callq	_clk_get_by_ofw_name
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	16(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_6:
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movl	$0, -28(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-28(%rbp), %rdx
	movl	%r15d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%r14, %rdi
	callq	_PMC_LOCK_INIT
	movq	_PMC_CNTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_RD4
	movq	_PMC_CNTRL_CPU_PWRREQ_OE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_WR4
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_RD4
	movq	_PMC_CNTRL_SYSCLK_POLARITY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, %ecx
	notl	%ecx
	andl	%eax, %ecx
	orl	%eax, %edx
	cmpq	$0, (%r14)
	cmovnel	%ecx, %edx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_WR4
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_RD4
	movq	_PMC_CNTRL_SYSCLK_OE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_WR4
	movq	_PMC_IO_DPD_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_RD4
	movq	_PMC_IO_DPD_STATUS_HDMI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_WR4
	movq	_PMC_IO_DPD2_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_RD4
	movq	_PMC_IO_DPD2_STATUS_HV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_WR4
	movq	_pmc_sc@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.8:
	leaq	L_.str.4(%rip), %rdi
	callq	_panic
LBB0_9:
	movq	%r14, (%rbx)
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edi
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot parse FDT data\n"

L_.str.1:                               ## @.str.1
	.asciz	"pclk"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot get \"pclk\" clock\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.3:                               ## @.str.3
	.asciz	"Cannot allocate memory resources\n"

	.comm	_PMC_CNTRL,4,2                  ## @PMC_CNTRL
	.comm	_PMC_CNTRL_CPU_PWRREQ_OE,4,2    ## @PMC_CNTRL_CPU_PWRREQ_OE
	.comm	_PMC_CNTRL_SYSCLK_POLARITY,4,2  ## @PMC_CNTRL_SYSCLK_POLARITY
	.comm	_PMC_CNTRL_SYSCLK_OE,4,2        ## @PMC_CNTRL_SYSCLK_OE
	.comm	_PMC_IO_DPD_STATUS,4,2          ## @PMC_IO_DPD_STATUS
	.comm	_PMC_IO_DPD_STATUS_HDMI,4,2     ## @PMC_IO_DPD_STATUS_HDMI
	.comm	_PMC_IO_DPD2_STATUS,4,2         ## @PMC_IO_DPD2_STATUS
	.comm	_PMC_IO_DPD2_STATUS_HV,4,2      ## @PMC_IO_DPD2_STATUS_HV
	.comm	_pmc_sc,8,3                     ## @pmc_sc
L_.str.4:                               ## @.str.4
	.asciz	"tegra124_pmc: double driver attach"

	.no_dead_strip	_tegra124_pmc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra124_pmc_attach
_tegra124_pmc_attach:                   ; @tegra124_pmc_attach
	.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	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	str	w20, [x0, #16]
	mov	x0, x20
	bl	_ofw_bus_get_node
	mov	x1, x0
	mov	x0, x19
	bl	_tegra124_pmc_parse_fdt
	mov	x21, x0
	ldr	w0, [x19, #16]
	cbz	w21, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	b	LBB0_9
LBB0_2:
	add	x3, x19, #20
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #0
	bl	_clk_get_by_ofw_name
	cbz	w0, LBB0_5
; %bb.3:
	ldr	w0, [x19, #16]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_4:
	bl	_device_printf
Lloh6:
	adrp	x8, _ENXIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
	b	LBB0_9
LBB0_5:
	str	wzr, [sp, #12]
Lloh9:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #8]
	cbz	x0, LBB0_10
; %bb.6:
	mov	x0, x19
	bl	_PMC_LOCK_INIT
Lloh15:
	adrp	x20, _PMC_CNTRL@GOTPAGE
Lloh16:
	ldr	x20, [x20, _PMC_CNTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_RD4
Lloh17:
	adrp	x8, _PMC_CNTRL_CPU_PWRREQ_OE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PMC_CNTRL_CPU_PWRREQ_OE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x20]
	mov	x0, x19
	bl	_WR4
	ldr	w1, [x20]
	mov	x0, x19
	bl	_RD4
	ldr	x8, [x19]
Lloh20:
	adrp	x9, _PMC_CNTRL_SYSCLK_POLARITY@GOTPAGE
Lloh21:
	ldr	x9, [x9, _PMC_CNTRL_SYSCLK_POLARITY@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	bic	w10, w0, w9
	orr	w9, w9, w0
	cmp	x8, #0
	csel	w2, w9, w10, eq
	ldr	w1, [x20]
	mov	x0, x19
	bl	_WR4
	ldr	w1, [x20]
	mov	x0, x19
	bl	_RD4
Lloh23:
	adrp	x8, _PMC_CNTRL_SYSCLK_OE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PMC_CNTRL_SYSCLK_OE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x20]
	mov	x0, x19
	bl	_WR4
Lloh26:
	adrp	x20, _PMC_IO_DPD_STATUS@GOTPAGE
Lloh27:
	ldr	x20, [x20, _PMC_IO_DPD_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_RD4
Lloh28:
	adrp	x8, _PMC_IO_DPD_STATUS_HDMI@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PMC_IO_DPD_STATUS_HDMI@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	bic	w2, w0, w8
	ldr	w1, [x20]
	mov	x0, x19
	bl	_WR4
Lloh31:
	adrp	x20, _PMC_IO_DPD2_STATUS@GOTPAGE
Lloh32:
	ldr	x20, [x20, _PMC_IO_DPD2_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_RD4
Lloh33:
	adrp	x8, _PMC_IO_DPD2_STATUS_HV@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PMC_IO_DPD2_STATUS_HV@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	bic	w2, w0, w8
	ldr	w1, [x20]
	mov	x0, x19
	bl	_WR4
Lloh36:
	adrp	x20, _pmc_sc@GOTPAGE
Lloh37:
	ldr	x20, [x20, _pmc_sc@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.7:
Lloh38:
	adrp	x0, l_.str.4@PAGE
Lloh39:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_panic
LBB0_8:
	mov	w21, #0
	str	x19, [x20]
LBB0_9:
	mov	x0, x21
	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_10:
Lloh40:
	adrp	x1, l_.str.3@PAGE
Lloh41:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot parse FDT data\n"

l_.str.1:                               ; @.str.1
	.asciz	"pclk"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot get \"pclk\" clock\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.3:                               ; @.str.3
	.asciz	"Cannot allocate memory resources\n"

	.comm	_PMC_CNTRL,4,2                  ; @PMC_CNTRL
	.comm	_PMC_CNTRL_CPU_PWRREQ_OE,4,2    ; @PMC_CNTRL_CPU_PWRREQ_OE
	.comm	_PMC_CNTRL_SYSCLK_POLARITY,4,2  ; @PMC_CNTRL_SYSCLK_POLARITY
	.comm	_PMC_CNTRL_SYSCLK_OE,4,2        ; @PMC_CNTRL_SYSCLK_OE
	.comm	_PMC_IO_DPD_STATUS,4,2          ; @PMC_IO_DPD_STATUS
	.comm	_PMC_IO_DPD_STATUS_HDMI,4,2     ; @PMC_IO_DPD_STATUS_HDMI
	.comm	_PMC_IO_DPD2_STATUS,4,2         ; @PMC_IO_DPD2_STATUS
	.comm	_PMC_IO_DPD2_STATUS_HV,4,2      ; @PMC_IO_DPD2_STATUS_HV
	.comm	_pmc_sc,8,3                     ; @pmc_sc
l_.str.4:                               ; @.str.4
	.asciz	"tegra124_pmc: double driver attach"

	.no_dead_strip	_tegra124_pmc_attach
.subsections_via_symbols
