	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ftgpio_gpio_set_config
_ftgpio_gpio_set_config:                ## @ftgpio_gpio_set_config
	.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	%rdx, %rbx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	%rdx, %rdi
	callq	_pinconf_to_config_param
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_pinconf_to_config_argument
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_gpiochip_get_data
	movq	%rax, %r15
	movq	_PIN_CONFIG_INPUT_DEBOUNCE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_1
## %bb.2:
	movl	12(%r15), %edi
	callq	_clk_get_rate
	movq	%rax, %r13
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_DIV_ROUND_CLOSEST
	cmpl	$16777217, %eax                 ## imm = 0x1000001
	jge	LBB0_1
## %bb.3:
	movl	%eax, %r12d
	movl	8(%r15), %edi
	movslq	%eax, %rcx
	movq	%r13, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rcx
	jmp	LBB0_6
LBB0_4:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%eax, %ecx
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_dbg
	movq	_GPIO_DEBOUNCE_PRESCALE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_readl
	movl	%eax, %r13d
	movq	_GPIO_DEBOUNCE_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r15), %rdi
	callq	_readl
	movl	%eax, %ebx
	cmpl	%r12d, %r13d
	jne	LBB0_8
## %bb.7:
	movl	%r14d, %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	_GPIO_DEBOUNCE_EN@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	%ebx, %edi
	jmp	LBB0_10
LBB0_8:
	movq	_GPIO_DEBOUNCE_EN@GOTPCREL(%rip), %r13
	testl	%ebx, %ebx
	je	LBB0_9
LBB0_1:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_GPIO_DEBOUNCE_PRESCALE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	%r12d, %edi
	callq	_writel
	movl	%r14d, %edi
	callq	_BIT
	movq	(%r13), %rsi
	addq	(%r15), %rsi
	movl	%eax, %edi
LBB0_10:
	callq	_writel
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_PIN_CONFIG_INPUT_DEBOUNCE,4,2  ## @PIN_CONFIG_INPUT_DEBOUNCE
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"prescale divisor: %08x, resulting frequency %lu Hz\n"

	.comm	_GPIO_DEBOUNCE_PRESCALE,8,3     ## @GPIO_DEBOUNCE_PRESCALE
	.comm	_GPIO_DEBOUNCE_EN,8,3           ## @GPIO_DEBOUNCE_EN
	.no_dead_strip	_ftgpio_gpio_set_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ftgpio_gpio_set_config
_ftgpio_gpio_set_config:                ; @ftgpio_gpio_set_config
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
	mov	x0, x2
	bl	_pinconf_to_config_param
	mov	x23, x0
	mov	x0, x20
	bl	_pinconf_to_config_argument
	mov	x21, x0
	mov	x0, x22
	bl	_gpiochip_get_data
Lloh0:
	adrp	x8, _PIN_CONFIG_INPUT_DEBOUNCE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIN_CONFIG_INPUT_DEBOUNCE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w0, [x0, #12]
	bl	_clk_get_rate
	mov	x22, x0
	mov	x1, x21
	bl	_DIV_ROUND_CLOSEST
	mov	w8, #1
	movk	w8, #256, lsl #16
	cmp	w0, w8
	b.ge	LBB0_5
; %bb.2:
	mov	x21, x0
	ldr	w0, [x20, #8]
	sxtw	x8, w21
	udiv	x3, x22, x8
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	ldr	x8, [x20]
Lloh5:
	adrp	x25, _GPIO_DEBOUNCE_PRESCALE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _GPIO_DEBOUNCE_PRESCALE@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readl
	mov	x23, x0
	ldr	x8, [x20]
Lloh7:
	adrp	x24, _GPIO_DEBOUNCE_EN@GOTPAGE
Lloh8:
	ldr	x24, [x24, _GPIO_DEBOUNCE_EN@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	mov	x22, x0
	cmp	w23, w21
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_BIT
	orr	w0, w0, w22
	b	LBB0_8
LBB0_4:
	cbz	w22, LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	x8, [x20]
	ldr	x9, [x25]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	mov	x0, x19
	bl	_BIT
LBB0_8:
	ldr	x8, [x20]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PIN_CONFIG_INPUT_DEBOUNCE,4,2  ; @PIN_CONFIG_INPUT_DEBOUNCE
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"prescale divisor: %08x, resulting frequency %lu Hz\n"

	.comm	_GPIO_DEBOUNCE_PRESCALE,8,3     ; @GPIO_DEBOUNCE_PRESCALE
	.comm	_GPIO_DEBOUNCE_EN,8,3           ; @GPIO_DEBOUNCE_EN
	.no_dead_strip	_ftgpio_gpio_set_config
.subsections_via_symbols
