	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nmk_prcm_altcx_set_mode
_nmk_prcm_altcx_set_mode:               ## @nmk_prcm_altcx_set_mode
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	je	LBB0_12
## %bb.1:
	movl	%edx, %ecx
	movq	%rdi, %r8
	movq	_PRCM_IDX_GPIOCR_ALTC_MAX@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r10d
	cmpl	%ecx, %r10d
	jae	LBB0_2
## %bb.13:
	movl	8(%r8), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_2:
	movl	%esi, %r15d
	movq	16(%r8), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_3
## %bb.14:
	movq	16(%rax), %rbx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%r15d, (%rbx)
	je	LBB0_4
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	incq	%rdi
	addq	$16, %rbx
	cmpq	%rdi, %rsi
	jne	LBB0_15
	jmp	LBB0_17
LBB0_3:
	xorl	%edi, %edi
LBB0_4:
	cmpl	%esi, %edi
	jne	LBB0_5
LBB0_17:
	movl	8(%r8), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
LBB0_5:
	movq	8(%rax), %rsi
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	16(%rax), %rax
	movl	%edi, %esi
	testl	%ecx, %ecx
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	je	LBB0_6
## %bb.18:
	leal	-1(%rcx), %r9d
	shlq	$4, %rsi
	movq	8(%rax,%rsi), %rdi
	leaq	(%r9,%r9,2), %rbx
	cmpl	$0, (%rdi,%rbx,8)
	je	LBB0_28
## %bb.19:
	testl	%r10d, %r10d
	je	LBB0_27
## %bb.20:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	addq	%rsi, %rax
	addq	$8, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$16, %r14d
	xorl	%ebx, %ebx
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_21 Depth=1
	incq	%rbx
	movl	(%rdx), %eax
	addq	$24, %r14
	cmpq	%rax, %rbx
	jae	LBB0_26
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, %r9
	je	LBB0_25
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpl	$1, -16(%rax,%r14)
	jne	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	-8(%rax,%r14), %rcx
	movq	(%rax,%r14), %r12
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %r13
	movq	(%r8), %rdi
	addq	%r13, %rdi
	callq	_readl
	movl	%eax, %r15d
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_BIT
	movq	_PRCM_IDX_GPIOCR_ALTC_MAX@GOTPCREL(%rip), %rdx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	testl	%r15d, %eax
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_21 Depth=1
	addq	(%r8), %r13
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_BIT
	movq	%r13, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_nmk_write_masked
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	leal	1(%rbx), %ecx
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_PRCM_IDX_GPIOCR_ALTC_MAX@GOTPCREL(%rip), %rdx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	jmp	LBB0_25
LBB0_6:
	testl	%r10d, %r10d
	je	LBB0_12
## %bb.7:
	shlq	$4, %rsi
	addq	%rsi, %rax
	addq	$8, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$16, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r12
	movq	_PRCM_IDX_GPIOCR_ALTC_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %r14
	cmpq	%rax, %r12
	jae	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	cmpl	$1, -16(%rax,%r14)
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	-8(%rax,%r14), %rcx
	movq	(%rax,%r14), %r13
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rbx
	movq	(%r8), %rdi
	addq	%rbx, %rdi
	callq	_readl
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_BIT
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	testl	%r15d, %eax
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	addq	(%r8), %rbx
	movq	%r13, %rdi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_nmk_write_masked
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	leal	1(%r12), %ecx
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	jmp	LBB0_11
LBB0_12:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
LBB0_27:
	movq	8(%rdi,%rbx,8), %rax
	movl	%r15d, %edx
	movq	16(%rdi,%rbx,8), %r15
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%rax,8), %rbx
	movl	8(%r8), %edi
	incq	%r9
	leaq	L_.str.4(%rip), %rsi
	movq	%r9, %rcx
	xorl	%eax, %eax
	movq	%r8, %r14
	callq	_dev_dbg
	addq	(%r14), %rbx
	movq	%r15, %rdi
	callq	_BIT
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_BIT
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nmk_write_masked               ## TAILCALL
LBB0_28:
	movl	8(%r8), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%r15d, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PRCM_IDX_GPIOCR_ALTC_MAX,4,2   ## @PRCM_IDX_GPIOCR_ALTC_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PRCM GPIOCR: alternate-C%i is invalid\n"

L_.str.1:                               ## @.str.1
	.asciz	"PRCM GPIOCR: pin %i is not found\n"

L_.str.2:                               ## @.str.2
	.asciz	"PRCM GPIOCR: pin %i: alternate-C%i has been disabled\n"

L_.str.3:                               ## @.str.3
	.asciz	"PRCM GPIOCR: pin %i: alternate-C%i does not exist\n"

L_.str.4:                               ## @.str.4
	.asciz	"PRCM GPIOCR: pin %i: alternate-C%i has been selected\n"

	.no_dead_strip	_nmk_prcm_altcx_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nmk_prcm_altcx_set_mode
_nmk_prcm_altcx_set_mode:               ; @nmk_prcm_altcx_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x0]
	cbz	x8, LBB0_25
; %bb.1:
	mov	x3, x2
	mov	x20, x0
Lloh0:
	adrp	x24, _PRCM_IDX_GPIOCR_ALTC_MAX@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PRCM_IDX_GPIOCR_ALTC_MAX@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w2
	b.hs	LBB0_3
; %bb.2:
	ldr	w0, [x20, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x3
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_dev_err
LBB0_3:
	mov	x19, x1
	ldr	x9, [x20, #16]
	ldr	w10, [x9]
	cmp	w10, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x11, #0
	ldr	x12, [x9, #16]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x12]
	cmp	w13, w19
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x11, x11, #1
	add	x12, x12, #16
	cmp	x10, x11
	b.ne	LBB0_5
	b	LBB0_9
LBB0_7:
	mov	w11, #0
LBB0_8:
	cmp	w11, w10
	b.ne	LBB0_10
LBB0_9:
	ldr	w0, [x20, #8]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_dev_dbg
LBB0_10:
	mov	w10, w11
	ldp	x9, x11, [x9, #8]
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	cbz	w3, LBB0_19
; %bb.11:
	sub	w26, w3, #1
	add	x27, x11, x10, lsl #4
	ldr	x9, [x27, #8]!
	mov	w10, #24
	umull	x10, w26, w10
	ldr	w10, [x9, x10]
	cbz	w10, LBB0_28
; %bb.12:
	cbz	w8, LBB0_27
; %bb.13:
	mov	x28, #0
	mov	w21, #8
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x28, x28, #1
	ldr	w8, [x24]
	add	x21, x21, #24
	cmp	x28, x8
	b.hs	LBB0_26
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	cmp	x26, x28
	b.eq	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x27]
	add	x8, x8, x21
	ldur	w9, [x8, #-8]
	cmp	w9, #1
	b.ne	LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldp	x9, x22, [x8]
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x25, [x8, x9, lsl #3]
	ldr	x8, [x20]
	add	x0, x8, x25
	bl	_readl
	mov	x23, x0
	mov	x0, x22
	bl	_BIT
	tst	w0, w23
	b.eq	LBB0_14
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x20]
	add	x23, x8, x25
	mov	x0, x22
	bl	_BIT
	mov	x1, x0
	mov	x0, x23
	mov	w2, #0
	bl	_nmk_write_masked
	ldr	w0, [x20, #8]
	add	x8, x28, #1
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	b	LBB0_14
LBB0_19:
	cbz	w8, LBB0_25
; %bb.20:
	mov	x26, #0
	mov	x27, #0
	add	x8, x11, x10, lsl #4
	add	x28, x8, #8
Lloh8:
	adrp	x21, l_.str.2@PAGE
Lloh9:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	add	x27, x27, #1
	ldr	w8, [x24]
	add	x26, x26, #24
	cmp	x27, x8
	b.hs	LBB0_25
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x28]
	ldr	w9, [x8, x26]
	cmp	w9, #1
	b.ne	LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	add	x8, x8, x26
	ldp	x9, x22, [x8, #8]
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x25, [x8, x9, lsl #3]
	ldr	x8, [x20]
	add	x0, x8, x25
	bl	_readl
	mov	x23, x0
	mov	x0, x22
	bl	_BIT
	tst	w0, w23
	b.eq	LBB0_21
; %bb.24:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	x8, [x20]
	add	x23, x8, x25
	mov	x0, x22
	bl	_BIT
	mov	x1, x0
	mov	x0, x23
	mov	w2, #0
	bl	_nmk_write_masked
	ldr	w0, [x20, #8]
	add	x8, x27, #1
	str	x8, [sp]
	mov	x1, x21
	mov	x2, x19
	bl	_dev_dbg
	b	LBB0_21
LBB0_25:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_26:
	ldr	x9, [x27]
LBB0_27:
	mov	w8, #24
	madd	x8, x26, x8, x9
	ldp	x9, x21, [x8, #8]
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x22, [x8, x9, lsl #3]
	ldr	w0, [x20, #8]
	add	x8, x26, #1
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	ldr	x8, [x20]
	add	x19, x8, x22
	mov	x0, x21
	bl	_BIT
	mov	x20, x0
	mov	x0, x21
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_nmk_write_masked
LBB0_28:
	ldr	w0, [x20, #8]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_dev_warn
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PRCM_IDX_GPIOCR_ALTC_MAX,4,2   ; @PRCM_IDX_GPIOCR_ALTC_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PRCM GPIOCR: alternate-C%i is invalid\n"

l_.str.1:                               ; @.str.1
	.asciz	"PRCM GPIOCR: pin %i is not found\n"

l_.str.2:                               ; @.str.2
	.asciz	"PRCM GPIOCR: pin %i: alternate-C%i has been disabled\n"

l_.str.3:                               ; @.str.3
	.asciz	"PRCM GPIOCR: pin %i: alternate-C%i does not exist\n"

l_.str.4:                               ; @.str.4
	.asciz	"PRCM GPIOCR: pin %i: alternate-C%i has been selected\n"

	.no_dead_strip	_nmk_prcm_altcx_set_mode
.subsections_via_symbols
