	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function madera_gpio_direction_out
_madera_gpio_direction_out:             ## @madera_gpio_direction_out
	.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
	movl	%esi, %ebx
	callq	_gpiochip_get_data
	movq	(%rax), %r12
	addl	%ebx, %ebx
	movq	_MADERA_GP1_LVL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%r12), %edi
	movq	_MADERA_GPIO1_CTRL_2@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rbx, %rsi
	movq	_MADERA_GP1_DIR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	testl	%r14d, %r14d
	cmovel	%r14d, %r15d
	movl	(%r12), %edi
	movq	_MADERA_GPIO1_CTRL_1@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	_MADERA_GP1_LVL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	movl	%r15d, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_update_bits             ## TAILCALL
LBB0_1:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MADERA_GP1_LVL,4,2             ## @MADERA_GP1_LVL
	.comm	_MADERA_GPIO1_CTRL_2,8,3        ## @MADERA_GPIO1_CTRL_2
	.comm	_MADERA_GP1_DIR_MASK,4,2        ## @MADERA_GP1_DIR_MASK
	.comm	_MADERA_GPIO1_CTRL_1,8,3        ## @MADERA_GPIO1_CTRL_1
	.comm	_MADERA_GP1_LVL_MASK,4,2        ## @MADERA_GP1_LVL_MASK
	.no_dead_strip	_madera_gpio_direction_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function madera_gpio_direction_out
_madera_gpio_direction_out:             ; @madera_gpio_direction_out
	.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	x20, x1
	bl	_gpiochip_get_data
	ldr	x21, [x0]
	lsl	w20, w20, #1
Lloh0:
	adrp	x8, _MADERA_GP1_LVL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MADERA_GP1_LVL@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x8, _MADERA_GPIO1_CTRL_2@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MADERA_GPIO1_CTRL_2@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh5:
	ldr	x8, [x8]
	add	x1, x8, x20
Lloh6:
	adrp	x8, _MADERA_GP1_DIR_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MADERA_GP1_DIR_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_regmap_update_bits
	tbnz	w0, #31, LBB0_2
; %bb.1:
	cmp	w19, #0
	csel	w3, wzr, w22, eq
	ldr	w0, [x21]
Lloh9:
	adrp	x8, _MADERA_GPIO1_CTRL_1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MADERA_GPIO1_CTRL_1@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, _MADERA_GP1_LVL_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MADERA_GP1_LVL_MASK@GOTPAGEOFF]
	add	x1, x8, x20
Lloh14:
	ldr	w2, [x9]
	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	_regmap_update_bits
LBB0_2:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MADERA_GP1_LVL,4,2             ; @MADERA_GP1_LVL
	.comm	_MADERA_GPIO1_CTRL_2,8,3        ; @MADERA_GPIO1_CTRL_2
	.comm	_MADERA_GP1_DIR_MASK,4,2        ; @MADERA_GP1_DIR_MASK
	.comm	_MADERA_GPIO1_CTRL_1,8,3        ; @MADERA_GPIO1_CTRL_1
	.comm	_MADERA_GP1_LVL_MASK,4,2        ; @MADERA_GP1_LVL_MASK
	.no_dead_strip	_madera_gpio_direction_out
.subsections_via_symbols
