	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gpiod_find
_gpiod_find:                            ## @gpiod_find
	.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
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
	movq	%rax, %r13
	movq	%r15, %rdi
	callq	_gpiod_find_lookup_table
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	(%rax), %r14
	cmpq	$0, 24(%r14)
	je	LBB0_14
## %bb.2:
	addq	$32, %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 32(%r14)
	leaq	40(%r14), %r14
	je	LBB0_14
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r12d, -32(%r14)
	jne	LBB0_13
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_13
LBB0_7:
	movq	-8(%r14), %rdi
	callq	_find_chip_by_name
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	movl	4(%rax), %ecx
	movl	-16(%r14), %esi
	cmpl	%esi, %ecx
	jle	LBB0_11
## %bb.12:
	movq	%rax, %rdi
	callq	_gpiochip_get_desc
	movq	-24(%r14), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rcx, (%rdx)
	jmp	LBB0_15
LBB0_14:
	movq	%r13, %rax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	-8(%r14), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_warn
	movq	_EPROBE_DEFER@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_11:
	movl	(%rax), %r8d
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot find GPIO chip %s, deferring\n"

	.comm	_EPROBE_DEFER,4,2               ## @EPROBE_DEFER
L_.str.1:                               ## @.str.1
	.asciz	"requested GPIO %d is out of range [0..%d] for chip %s\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_gpiod_find
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gpiod_find
_gpiod_find:                            ; @gpiod_find
	.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	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x23, x0
	mov	x0, x20
	bl	_gpiod_find_lookup_table
	cbz	x0, LBB0_11
; %bb.1:
	ldr	x8, [x0]
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_11
; %bb.2:
	add	x24, x8, #32
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #32]
	add	x24, x24, #40
	cbz	x8, LBB0_11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w8, [x24, #-32]
	cmp	w8, w21
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x24]
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	x22, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, x22
	bl	_strcmp
	cbnz	x0, LBB0_3
LBB0_8:
	ldur	x0, [x24, #-8]
	bl	_find_chip_by_name
	cbz	x0, LBB0_13
; %bb.9:
	ldr	w3, [x0, #4]
	ldur	w1, [x24, #-16]
	cmp	w3, w1
	b.le	LBB0_14
; %bb.10:
	bl	_gpiochip_get_desc
	ldur	x8, [x24, #-24]
	str	x8, [x19]
	b	LBB0_12
LBB0_11:
	mov	x0, x23
LBB0_12:
	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
LBB0_13:
	ldur	x2, [x24, #-8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
Lloh5:
	adrp	x8, _EPROBE_DEFER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EPROBE_DEFER@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
	ldr	w4, [x0]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
	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
	b	_ERR_PTR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot find GPIO chip %s, deferring\n"

	.comm	_EPROBE_DEFER,4,2               ; @EPROBE_DEFER
l_.str.1:                               ; @.str.1
	.asciz	"requested GPIO %d is out of range [0..%d] for chip %s\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_gpiod_find
.subsections_via_symbols
