	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nmk_gpio_request_enable
_nmk_gpio_request_enable:               ## @nmk_gpio_request_enable
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	callq	_pinctrl_dev_get_drvdata
	movq	%rax, %r15
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.5:
	callq	_gpiochip_get_data
	movq	%rax, %r12
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	movl	(%r12), %edi
	callq	_clk_enable
	movq	_NMK_GPIO_PER_CHIP@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	(%rcx)
	movq	_NMK_GPIO_ALT_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, %rdi
	movl	%edx, %esi
	movl	%eax, %edx
	callq	___nmk_gpio_set_mode
	movl	(%r12), %edi
	callq	_clk_disable
	jmp	LBB0_6
LBB0_1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid range\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"missing GPIO chip in range\n"

L_.str.2:                               ## @.str.2
	.asciz	"enable pin %u as GPIO\n"

	.comm	_NMK_GPIO_PER_CHIP,4,2          ## @NMK_GPIO_PER_CHIP
	.comm	_NMK_GPIO_ALT_GPIO,4,2          ## @NMK_GPIO_ALT_GPIO
	.no_dead_strip	_nmk_gpio_request_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nmk_gpio_request_enable
_nmk_gpio_request_enable:               ; @nmk_gpio_request_enable
	.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
	mov	x19, x2
	mov	x21, x1
	bl	_pinctrl_dev_get_drvdata
	mov	x20, x0
	cbz	x21, LBB0_3
; %bb.1:
	ldr	x0, [x21]
	cbz	x0, LBB0_4
; %bb.2:
	bl	_gpiochip_get_data
	mov	x21, x0
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str.2@PAGE
Lloh1:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	ldr	w0, [x21]
	bl	_clk_enable
Lloh2:
	adrp	x8, _NMK_GPIO_PER_CHIP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NMK_GPIO_PER_CHIP@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	udiv	w9, w19, w8
	msub	w1, w9, w8, w19
Lloh5:
	adrp	x8, _NMK_GPIO_ALT_GPIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NMK_GPIO_ALT_GPIO@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x21
	bl	___nmk_gpio_set_mode
	ldr	w0, [x21]
	bl	_clk_disable
	mov	w0, #0
	b	LBB0_6
LBB0_3:
	ldr	w0, [x20]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:
	ldr	w0, [x20]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid range\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"missing GPIO chip in range\n"

l_.str.2:                               ; @.str.2
	.asciz	"enable pin %u as GPIO\n"

	.comm	_NMK_GPIO_PER_CHIP,4,2          ; @NMK_GPIO_PER_CHIP
	.comm	_NMK_GPIO_ALT_GPIO,4,2          ; @NMK_GPIO_ALT_GPIO
	.no_dead_strip	_nmk_gpio_request_enable
.subsections_via_symbols
