	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function creg_gpio_validate
_creg_gpio_validate:                    ## @creg_gpio_validate
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %eax
	movq	(%rsi), %rcx
	movl	(%rcx), %edx
	testl	%edx, %edx
	jle	LBB0_8
## %bb.1:
	movq	_MAX_GPIO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jg	LBB0_8
## %bb.2:
	movq	%rdi, %r14
	testl	%eax, %eax
	jle	LBB0_10
## %bb.3:
	cmpl	%eax, %edx
	jl	LBB0_10
## %bb.4:
	movq	%rsi, %r15
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_creg_gpio_validate_pg
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r15), %rax
	movq	8(%rax), %rcx
	movq	16(%rax), %rdx
	movl	(%rcx,%rbx,8), %ecx
	addl	(%rdx,%rbx,8), %ecx
	addl	%ecx, %r12d
	incq	%rbx
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_5
## %bb.7:
	xorl	%eax, %eax
	cmpl	$33, %r12d
	jge	LBB0_8
	jmp	LBB0_9
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_GPIO,4,2                   ## @MAX_GPIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ngpios must be in [1:%u]\n"

	.no_dead_strip	_creg_gpio_validate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function creg_gpio_validate
_creg_gpio_validate:                    ; @creg_gpio_validate
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x8, x2
	ldr	x9, [x1]
	ldr	w2, [x9]
Lloh0:
	adrp	x9, _MAX_GPIO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX_GPIO@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w2, #1
	ccmp	w2, w9, #0, ge
	b.gt	LBB0_9
; %bb.1:
	mov	x19, x0
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.2:
	cmp	w2, w8
	b.lt	LBB0_8
; %bb.3:
	mov	x20, x1
	mov	x21, #0
	mov	w22, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_creg_gpio_validate_pg
	cbnz	x0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	lsl	x9, x21, #3
	ldp	x11, x10, [x8, #8]
	ldr	w10, [x10, x9]
	ldr	w9, [x11, x9]
	add	w9, w9, w10
	add	w22, w22, w9
	add	x21, x21, #1
	ldrsw	x8, [x8]
	cmp	x21, x8
	b.lt	LBB0_4
; %bb.6:
	cmp	w22, #33
	b.ge	LBB0_9
; %bb.7:
	mov	w0, #0
	b	LBB0_10
LBB0_8:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_9:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_GPIO,4,2                   ; @MAX_GPIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ngpios must be in [1:%u]\n"

	.no_dead_strip	_creg_gpio_validate
.subsections_via_symbols
