	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function winbond_gpio_configure_port
_winbond_gpio_configure_port:           ## @winbond_gpio_configure_port
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_winbond_gpio_infos@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	%esi, %eax
	imulq	$56, %rax, %rbx
	cmpq	$0, 32(%r12,%rbx)
	je	LBB0_6
## %bb.1:
	movq	24(%r12,%rbx), %rsi
	movq	_WB_SIO_DEV_NONE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_winbond_sio_select_logical
LBB0_3:
	movl	48(%r12,%rbx), %edx
	movl	52(%r12,%rbx), %esi
	movq	%r14, %rdi
	callq	_winbond_sio_reg_btest
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	leaq	(%r12,%rbx), %rax
	addq	$32, %rax
	leal	1(%r15), %esi
	cmpq	$0, 40(%r12,%rbx)
	movq	(%rax), %rdx
	je	LBB0_17
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
LBB0_6:
	cmpl	$1, %r15d
	je	LBB0_9
## %bb.7:
	testl	%r15d, %r15d
	jne	LBB0_10
## %bb.8:
	movq	%r14, %rdi
	callq	_winbond_gpio_configure_port0_pins
	jmp	LBB0_10
LBB0_9:
	movq	%r14, %rdi
	callq	_winbond_gpio_configure_port1_check_i2c
LBB0_10:
	movq	(%r12,%rbx), %rsi
	movq	%r14, %rdi
	callq	_winbond_sio_select_logical
	movl	16(%r12,%rbx), %edx
	movl	20(%r12,%rbx), %esi
	movq	%r14, %rdi
	callq	_winbond_sio_reg_bset
	movq	_params@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r15d, %edi
	callq	_BIT
	testl	%r13d, %eax
	je	LBB0_12
## %bb.11:
	movl	8(%r12,%rbx), %edx
	movl	12(%r12,%rbx), %esi
	movq	%r14, %rdi
	callq	_winbond_sio_reg_bset
	jmp	LBB0_15
LBB0_12:
	movq	_params@GOTPCREL(%rip), %rax
	movl	4(%rax), %r13d
	movl	%r15d, %edi
	callq	_BIT
	testl	%r13d, %eax
	je	LBB0_14
## %bb.13:
	movl	8(%r12,%rbx), %edx
	movl	12(%r12,%rbx), %esi
	movq	%r14, %rdi
	callq	_winbond_sio_reg_bclear
	jmp	LBB0_15
LBB0_17:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_warn
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_14:
	incl	%r15d
	movl	8(%r12,%rbx), %edx
	movl	12(%r12,%rbx), %esi
	movq	%r14, %rdi
	callq	_winbond_sio_reg_btest
	testq	%rax, %rax
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	callq	_pr_notice
LBB0_15:
	movl	$1, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_winbond_gpio_infos,8,3         ## @winbond_gpio_infos
	.comm	_WB_SIO_DEV_NONE,8,3            ## @WB_SIO_DEV_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enabled GPIO%u share pins with active %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"disabling GPIO%u as %s is enabled\n"

	.comm	_params,8,2                     ## @params
L_.str.2:                               ## @.str.2
	.asciz	"GPIO%u pins are %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"push-pull"

L_.str.4:                               ## @.str.4
	.asciz	"open drain"

	.no_dead_strip	_winbond_gpio_configure_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function winbond_gpio_configure_port
_winbond_gpio_configure_port:           ; @winbond_gpio_configure_port
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _winbond_gpio_infos@GOTPAGE
Lloh1:
	ldr	x8, [x8, _winbond_gpio_infos@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	mov	w22, w1
	mov	w8, #56
	umaddl	x23, w1, w8, x21
	ldr	x8, [x23, #32]!
	cbz	x8, LBB0_6
; %bb.1:
	mov	w8, #56
	madd	x8, x22, x8, x21
	ldr	x1, [x8, #24]
Lloh3:
	adrp	x8, _WB_SIO_DEV_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WB_SIO_DEV_NONE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_winbond_sio_select_logical
LBB0_3:
	mov	w8, #56
	madd	x8, x22, x8, x21
	ldp	w2, w1, [x8, #48]
	mov	x0, x19
	bl	_winbond_sio_reg_btest
	cbz	x0, LBB0_6
; %bb.4:
	mov	w8, #56
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #40]
	add	w1, w20, #1
	ldr	x2, [x23]
	cbz	x8, LBB0_14
; %bb.5:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_6:
	cmp	w20, #1
	b.eq	LBB0_9
; %bb.7:
	cbnz	w20, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_winbond_gpio_configure_port0_pins
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_winbond_gpio_configure_port1_check_i2c
LBB0_10:
	mov	w8, #56
	madd	x23, x22, x8, x21
	ldr	x1, [x23]
	mov	x0, x19
	bl	_winbond_sio_select_logical
	ldp	w2, w1, [x23, #16]
	mov	x0, x19
	bl	_winbond_sio_reg_bset
Lloh8:
	adrp	x23, _params@GOTPAGE
Lloh9:
	ldr	x23, [x23, _params@GOTPAGEOFF]
	ldr	w24, [x23]
	mov	x0, x20
	bl	_BIT
	tst	w0, w24
	b.eq	LBB0_12
; %bb.11:
	mov	w8, #56
	madd	x8, x22, x8, x21
	ldp	w2, w1, [x8, #8]
	mov	x0, x19
	bl	_winbond_sio_reg_bset
	b	LBB0_16
LBB0_12:
	ldr	w23, [x23, #4]
	mov	x0, x20
	bl	_BIT
	tst	w0, w23
	b.eq	LBB0_15
; %bb.13:
	mov	w8, #56
	madd	x8, x22, x8, x21
	ldp	w2, w1, [x8, #8]
	mov	x0, x19
	bl	_winbond_sio_reg_bclear
	b	LBB0_16
LBB0_14:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_warn
	mov	w0, #0
	b	LBB0_17
LBB0_15:
	add	w20, w20, #1
	mov	w8, #56
	madd	x8, x22, x8, x21
	ldp	w2, w1, [x8, #8]
	mov	x0, x19
	bl	_winbond_sio_reg_btest
Lloh12:
	adrp	x8, l_.str.3@PAGE
Lloh13:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh14:
	adrp	x9, l_.str.4@PAGE
Lloh15:
	add	x9, x9, l_.str.4@PAGEOFF
	cmp	x0, #0
	csel	x2, x9, x8, eq
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_pr_notice
LBB0_16:
	mov	w0, #1
LBB0_17:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_winbond_gpio_infos,8,3         ; @winbond_gpio_infos
	.comm	_WB_SIO_DEV_NONE,8,3            ; @WB_SIO_DEV_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enabled GPIO%u share pins with active %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"disabling GPIO%u as %s is enabled\n"

	.comm	_params,8,2                     ; @params
l_.str.2:                               ; @.str.2
	.asciz	"GPIO%u pins are %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"push-pull"

l_.str.4:                               ; @.str.4
	.asciz	"open drain"

	.no_dead_strip	_winbond_gpio_configure_port
.subsections_via_symbols
