	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vip_gpio_reserve
_vip_gpio_reserve:                      ## @vip_gpio_reserve
	.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, %r14
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%esi, %edi
	callq	_gpio_is_valid
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%r15d, %edi
	movq	%r14, %rsi
	callq	_gpio_request
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movq	%r14, %rcx
	callq	_dev_err
	jmp	LBB0_8
LBB0_1:
	negl	%ebx
	jmp	LBB0_8
LBB0_4:
	movl	%r15d, %edi
	movl	%r13d, %esi
	callq	_gpio_direction_output
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movq	%r14, %rcx
	callq	_dev_err
	movl	%r15d, %edi
	callq	_gpio_free
	jmp	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
	movl	%r15d, %edi
	xorl	%esi, %esi
	callq	_gpio_export
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	movq	%r14, %rcx
	callq	_dev_err
	movl	%r15d, %edi
	callq	_gpio_free
	movl	%r13d, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate pin %d (%s)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to set direction for pin %d (%s)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to export pin %d (%s)\n"

	.no_dead_strip	_vip_gpio_reserve
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vip_gpio_reserve
_vip_gpio_reserve:                      ; @vip_gpio_reserve
	.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	x20, x3
	mov	x23, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x1
	bl	_gpio_is_valid
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_gpio_request
	cbz	w0, LBB0_4
; %bb.2:
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x19
	mov	x3, x20
	bl	_dev_err
	b	LBB0_9
LBB0_3:
	neg	w21, w21
	b	LBB0_9
LBB0_4:
	mov	x0, x19
	mov	x1, x23
	bl	_gpio_direction_output
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	bl	_gpio_export
	mov	x21, x0
	cbz	w0, LBB0_9
; %bb.7:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x0, x22
	mov	x2, x19
	mov	x3, x20
	bl	_dev_err
	mov	x0, x19
	bl	_gpio_free
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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate pin %d (%s)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to set direction for pin %d (%s)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to export pin %d (%s)\n"

	.no_dead_strip	_vip_gpio_reserve
.subsections_via_symbols
