	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_gpio_init                 ## -- Begin function cx18_gpio_init
	.p2align	4, 0x90
_cx18_gpio_init:                        ## @cx18_gpio_init
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	16(%rbx), %rdx
	movl	16(%rdx), %eax
	movl	%eax, (%rbx)
	movl	20(%rdx), %ecx
	movl	%ecx, 4(%rbx)
	movq	8(%rdx), %rsi
	movq	(%rsi), %rsi
	movq	_TUNER_XC2028@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rsi
	jne	LBB0_2
## %bb.1:
	movb	(%rdx), %dl
	btsl	%edx, %eax
	movl	%eax, (%rbx)
	btsl	%edx, %ecx
	movl	%ecx, 4(%rbx)
	jmp	LBB0_3
LBB0_2:
	testl	%eax, %eax
	je	LBB0_4
LBB0_3:
	movq	_CX18_REG_GPIO_DIR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cx18_read_reg
	movl	%eax, %r15d
	movq	_CX18_REG_GPIO_DIR2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cx18_read_reg
	movl	%eax, %r12d
	movq	_CX18_REG_GPIO_OUT1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cx18_read_reg
	movl	%eax, %r13d
	movq	_CX18_REG_GPIO_OUT2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cx18_read_reg
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	movl	%eax, %r8d
	callq	_CX18_DEBUG_INFO
	movq	%rbx, %rdi
	callq	_gpio_write
LBB0_4:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TUNER_XC2028,8,3               ## @TUNER_XC2028
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPIO initial dir: %08x/%08x out: %08x/%08x\n"

	.comm	_CX18_REG_GPIO_DIR1,4,2         ## @CX18_REG_GPIO_DIR1
	.comm	_CX18_REG_GPIO_DIR2,4,2         ## @CX18_REG_GPIO_DIR2
	.comm	_CX18_REG_GPIO_OUT1,4,2         ## @CX18_REG_GPIO_OUT1
	.comm	_CX18_REG_GPIO_OUT2,4,2         ## @CX18_REG_GPIO_OUT2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_gpio_init                 ; -- Begin function cx18_gpio_init
	.p2align	2
_cx18_gpio_init:                        ; @cx18_gpio_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x10, [x20, #16]
	ldp	w8, w9, [x10, #16]
	stp	w8, w9, [x20]
	ldr	x11, [x10, #8]
	ldr	x11, [x11]
Lloh0:
	adrp	x12, _TUNER_XC2028@GOTPAGE
Lloh1:
	ldr	x12, [x12, _TUNER_XC2028@GOTPAGEOFF]
Lloh2:
	ldr	x12, [x12]
	cmp	x11, x12
	b.ne	LBB0_2
; %bb.1:
	ldr	w10, [x10]
	mov	w11, #1
	lsl	w10, w11, w10
	orr	w8, w10, w8
	orr	w9, w10, w9
	stp	w8, w9, [x20]
	b	LBB0_3
LBB0_2:
	cbz	w8, LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _CX18_REG_GPIO_DIR1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX18_REG_GPIO_DIR1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cx18_read_reg
	mov	x21, x0
Lloh6:
	adrp	x8, _CX18_REG_GPIO_DIR2@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CX18_REG_GPIO_DIR2@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cx18_read_reg
	mov	x22, x0
Lloh9:
	adrp	x8, _CX18_REG_GPIO_OUT1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CX18_REG_GPIO_OUT1@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cx18_read_reg
	mov	x23, x0
Lloh12:
	adrp	x8, _CX18_REG_GPIO_OUT2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CX18_REG_GPIO_OUT2@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cx18_read_reg
	mov	x4, x0
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x22
	mov	x3, x23
	bl	_CX18_DEBUG_INFO
	mov	x0, x20
	bl	_gpio_write
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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_TUNER_XC2028,8,3               ; @TUNER_XC2028
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPIO initial dir: %08x/%08x out: %08x/%08x\n"

	.comm	_CX18_REG_GPIO_DIR1,4,2         ; @CX18_REG_GPIO_DIR1
	.comm	_CX18_REG_GPIO_DIR2,4,2         ; @CX18_REG_GPIO_DIR2
	.comm	_CX18_REG_GPIO_OUT1,4,2         ; @CX18_REG_GPIO_OUT1
	.comm	_CX18_REG_GPIO_OUT2,4,2         ; @CX18_REG_GPIO_OUT2
.subsections_via_symbols
