	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gpio_open_device               ## -- Begin function gpio_open_device
	.p2align	4, 0x90
_gpio_open_device:                      ## @gpio_open_device
	.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
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	movq	_GPIOMAXPIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movl	%ebx, %edi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_4
## %bb.2:
	movq	_errno@GOTPCREL(%rip), %r14
	movl	(%r14), %r15d
	movl	%ebx, %edi
	callq	_close
	movl	%r15d, (%r14)
LBB0_3:
	movq	_GPIO_INVALID_HANDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_GPIO_INVALID_HANDLE,4,2        ## @GPIO_INVALID_HANDLE
	.comm	_GPIOMAXPIN,4,2                 ## @GPIOMAXPIN
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gpio_open_device               ; -- Begin function gpio_open_device
	.p2align	2
_gpio_open_device:                      ; @gpio_open_device
	.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
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _GPIOMAXPIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPIOMAXPIN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_ioctl
	tbz	x0, #63, LBB0_4
; %bb.2:
Lloh6:
	adrp	x20, _errno@GOTPAGE
Lloh7:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w21, [x20]
	mov	x0, x19
	bl	_close
	str	w21, [x20]
LBB0_3:
Lloh8:
	adrp	x8, _GPIO_INVALID_HANDLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GPIO_INVALID_HANDLE@GOTPAGEOFF]
Lloh10:
	ldr	w19, [x8]
LBB0_4:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_GPIO_INVALID_HANDLE,4,2        ; @GPIO_INVALID_HANDLE
	.comm	_GPIOMAXPIN,4,2                 ; @GPIOMAXPIN
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
