	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_gpio
_setup_gpio:                            ## @setup_gpio
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$272, %rsp                      ## imm = 0x110
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	leaq	L_.str(%rip), %rdx
	leaq	-288(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$256, %esi                      ## imm = 0x100
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_snprintf
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_1
LBB0_6:
	leaq	L_.str.6(%rip), %rdi
	movl	$4, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	_fwrite
	movq	%rbx, %rdi
	callq	_fclose
	movl	$1, %eax
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str.2(%rip), %rdx
	leaq	-288(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$256, %esi                      ## imm = 0x100
	xorl	%eax, %eax
	callq	_snprintf
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %rbx
	leaq	L_.str.4(%rip), %rsi
	movq	%rax, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	%rbx, %rdi
	callq	_fclose
	leaq	L_.str(%rip), %rdx
	leaq	-288(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$256, %esi                      ## imm = 0x100
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_snprintf
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.3(%rip), %rdi
LBB0_3:
	movl	%r14d, %esi
	callq	_RARCH_WARN
	movl	$-1, %eax
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_9
## %bb.8:
	addq	$272, %rsp                      ## imm = 0x110
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/sys/class/gpio/gpio%d/direction"

L_.str.1:                               ## @.str.1
	.asciz	"w"

L_.str.2:                               ## @.str.2
	.asciz	"/sys/class/gpio/export"

L_.str.3:                               ## @.str.3
	.asciz	"[LED]: failed to export GPIO %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"%d\n"

L_.str.5:                               ## @.str.5
	.asciz	"[LED]: failed to set direction GPIO %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"out\n"

	.no_dead_strip	_setup_gpio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_gpio
_setup_gpio:                            ; @setup_gpio
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #320
	.cfi_def_cfa_offset 320
	stp	x28, x27, [sp, #272]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #288]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #304]            ; 16-byte Folded Spill
	add	x29, sp, #304
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w27, -40
	.cfi_offset w28, -48
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	mov	x8, x0
	str	x8, [sp]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #256
	bl	_snprintf
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_fopen
	mov	x20, x0
	cbz	x0, LBB0_2
LBB0_1:
Lloh7:
	adrp	x0, l_.str.6@PAGE
Lloh8:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	w19, #1
	mov	w1, #4
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	mov	x0, x20
	bl	_fclose
	b	LBB0_7
LBB0_2:
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x0, sp, #8
	mov	w1, #256
	bl	_snprintf
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_fopen
	cbz	x0, LBB0_5
; %bb.3:
	mov	x20, x0
	str	x19, [sp]
Lloh13:
	adrp	x1, l_.str.4@PAGE
Lloh14:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
	mov	x0, x20
	bl	_fclose
	str	x19, [sp]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #256
	bl	_snprintf
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_fopen
	mov	x20, x0
	cbnz	x0, LBB0_1
; %bb.4:
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_6:
	mov	x1, x19
	bl	_RARCH_WARN
	mov	w19, #-1
LBB0_7:
	ldur	x8, [x29, #-40]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x19
	ldp	x29, x30, [sp, #304]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #288]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #272]            ; 16-byte Folded Reload
	add	sp, sp, #320
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/sys/class/gpio/gpio%d/direction"

l_.str.1:                               ; @.str.1
	.asciz	"w"

l_.str.2:                               ; @.str.2
	.asciz	"/sys/class/gpio/export"

l_.str.3:                               ; @.str.3
	.asciz	"[LED]: failed to export GPIO %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"%d\n"

l_.str.5:                               ; @.str.5
	.asciz	"[LED]: failed to set direction GPIO %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"out\n"

	.no_dead_strip	_setup_gpio
.subsections_via_symbols
