	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ns2_led_set_mode
_ns2_led_set_mode:                      ## @ns2_led_set_mode
	.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
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_4
## %bb.1:
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%esi, (%rax,%rbx)
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$12, %rbx
	cmpq	%rbx, %rcx
	jne	LBB0_2
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	4(%r15), %r14
	movq	%r14, %rdi
	callq	_write_lock_irqsave
	cmpl	$0, 24(%r15)
	movl	20(%r15), %edi
	movq	8(%r15), %rax
	movl	8(%rax,%rbx), %esi
	je	LBB0_6
## %bb.7:
	callq	_gpio_set_value_cansleep
	movl	16(%r15), %edi
	movq	8(%r15), %rax
	movl	4(%rax,%rbx), %esi
	callq	_gpio_set_value_cansleep
	jmp	LBB0_8
LBB0_6:
	callq	_gpio_set_value
	movl	16(%r15), %edi
	movq	8(%r15), %rax
	movl	4(%rax,%rbx), %esi
	callq	_gpio_set_value
LBB0_8:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_write_unlock_irqrestore        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ns2_led_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ns2_led_set_mode
_ns2_led_set_mode:                      ; @ns2_led_set_mode
	.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
	ldr	w9, [x0]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x0
	mov	x21, #0
	ldr	x8, [x0, #8]
	add	x9, x9, x9, lsl #1
	lsl	x9, x9, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8, x21]
	cmp	w10, w1
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #12
	cmp	x9, x21
	b.ne	LBB0_2
LBB0_4:
	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
LBB0_5:
	add	x20, x19, #4
	mov	x0, x20
	bl	_write_lock_irqsave
	ldp	w0, w8, [x19, #20]
	ldr	x9, [x19, #8]
	add	x9, x9, x21
	ldr	w1, [x9, #8]
	cbz	w8, LBB0_7
; %bb.6:
	bl	_gpio_set_value_cansleep
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	add	x8, x8, x21
	ldr	w1, [x8, #4]
	bl	_gpio_set_value_cansleep
	b	LBB0_8
LBB0_7:
	bl	_gpio_set_value
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	add	x8, x8, x21
	ldr	w1, [x8, #4]
	bl	_gpio_set_value
LBB0_8:
	mov	x0, x20
	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
	b	_write_unlock_irqrestore
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ns2_led_set_mode
.subsections_via_symbols
