	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tc3589x_gpio_irq_set_type
_tc3589x_gpio_irq_set_type:             ## @tc3589x_gpio_irq_set_type
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_irq_data_get_irq_chip_data
	movq	%rax, %rdi
	callq	_gpiochip_get_data
	movl	(%rbx), %edi
	leal	7(%rdi), %ecx
	testl	%edi, %edi
	cmovnsl	%edi, %ecx
	movq	%rax, %r15
	movl	%ecx, %ebx
	sarl	$3, %ebx
	andl	$-8, %ecx
	subl	%ecx, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_BIT
	movq	_IRQ_TYPE_EDGE_BOTH@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	(%r15), %rcx
	movq	_REG_IBE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rcx,%rdx,8), %rcx
	movslq	%ebx, %rdx
	orl	%eax, (%rcx,%rdx,4)
	jmp	LBB0_7
LBB0_2:
	movl	%eax, %ecx
	notl	%ecx
	movq	(%r15), %r10
	movq	_REG_IBE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%r10,%rdx,8), %rsi
	movslq	%ebx, %rdx
	andl	%ecx, (%rsi,%rdx,4)
	movq	_IRQ_TYPE_LEVEL_LOW@GOTPCREL(%rip), %r8
	movq	_IRQ_TYPE_LEVEL_HIGH@GOTPCREL(%rip), %r9
	movq	_REG_IS@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rbx
	movq	(%r10,%rbx,8), %rbx
	movl	(%rbx,%rdx,4), %edi
	movl	%edi, %esi
	andl	%ecx, %esi
	orl	%eax, %edi
	cmpl	%r14d, (%r9)
	cmovel	%edi, %esi
	cmpl	%r14d, (%r8)
	cmovel	%edi, %esi
	movl	%esi, (%rbx,%rdx,4)
	movq	_IRQ_TYPE_EDGE_RISING@GOTPCREL(%rip), %rsi
	movq	_REG_IEV@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movq	(%r10,%rdi,8), %rdi
	movl	(%rdi,%rdx,4), %ebx
	cmpl	%r14d, (%rsi)
	je	LBB0_4
## %bb.3:
	cmpl	%r14d, (%r9)
	je	LBB0_4
## %bb.5:
	andl	%ecx, %ebx
	jmp	LBB0_6
LBB0_4:
	orl	%eax, %ebx
LBB0_6:
	movl	%ebx, (%rdi,%rdx,4)
LBB0_7:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_TYPE_EDGE_BOTH,4,2         ## @IRQ_TYPE_EDGE_BOTH
	.comm	_REG_IBE,8,3                    ## @REG_IBE
	.comm	_IRQ_TYPE_LEVEL_LOW,4,2         ## @IRQ_TYPE_LEVEL_LOW
	.comm	_IRQ_TYPE_LEVEL_HIGH,4,2        ## @IRQ_TYPE_LEVEL_HIGH
	.comm	_REG_IS,8,3                     ## @REG_IS
	.comm	_IRQ_TYPE_EDGE_RISING,4,2       ## @IRQ_TYPE_EDGE_RISING
	.comm	_REG_IEV,8,3                    ## @REG_IEV
	.no_dead_strip	_tc3589x_gpio_irq_set_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tc3589x_gpio_irq_set_type
_tc3589x_gpio_irq_set_type:             ; @tc3589x_gpio_irq_set_type
	.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, x1
	mov	x21, x0
	bl	_irq_data_get_irq_chip_data
	bl	_gpiochip_get_data
	mov	x20, x0
	ldr	w8, [x21]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w21, w9, #3
	and	w9, w9, #0xfffffff8
	sub	w0, w8, w9
	bl	_BIT
Lloh0:
	adrp	x8, _IRQ_TYPE_EDGE_BOTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IRQ_TYPE_EDGE_BOTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _REG_IBE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _REG_IBE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	sbfiz	x9, x21, #2, #32
	ldr	w10, [x8, x9]
	orr	w10, w10, w0
	str	w10, [x8, x9]
	b	LBB0_7
LBB0_2:
	ldr	x10, [x20]
Lloh6:
	adrp	x8, _REG_IBE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_IBE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x8, [x10, x8, lsl #3]
	sbfiz	x11, x21, #2, #32
	ldr	w9, [x8, x11]
	bic	w9, w9, w0
	str	w9, [x8, x11]
Lloh9:
	adrp	x8, _IRQ_TYPE_LEVEL_LOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IRQ_TYPE_LEVEL_LOW@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x8]
Lloh12:
	adrp	x8, _IRQ_TYPE_LEVEL_HIGH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IRQ_TYPE_LEVEL_HIGH@GOTPAGEOFF]
	ldr	w12, [x8]
Lloh14:
	adrp	x13, _REG_IS@GOTPAGE
Lloh15:
	ldr	x13, [x13, _REG_IS@GOTPAGEOFF]
	cmp	w12, w19
Lloh16:
	ldr	x12, [x13]
	ldr	x12, [x10, x12, lsl #3]
	ldr	w13, [x12, x11]
	ccmp	w9, w19, #4, ne
	bic	w9, w13, w0
	orr	w13, w13, w0
	csel	w9, w13, w9, eq
	str	w9, [x12, x11]
	sxtw	x9, w21
Lloh17:
	adrp	x12, _IRQ_TYPE_EDGE_RISING@GOTPAGE
Lloh18:
	ldr	x12, [x12, _IRQ_TYPE_EDGE_RISING@GOTPAGEOFF]
Lloh19:
	ldr	w12, [x12]
Lloh20:
	adrp	x13, _REG_IEV@GOTPAGE
Lloh21:
	ldr	x13, [x13, _REG_IEV@GOTPAGEOFF]
Lloh22:
	ldr	x13, [x13]
	ldr	x10, [x10, x13, lsl #3]
	ldr	w11, [x10, x11]
	cmp	w12, w19
	b.eq	LBB0_5
; %bb.3:
	ldr	w8, [x8]
	cmp	w8, w19
	b.eq	LBB0_5
; %bb.4:
	mvn	w8, w0
	and	w8, w11, w8
	b	LBB0_6
LBB0_5:
	orr	w8, w11, w0
LBB0_6:
	str	w8, [x10, x9, lsl #2]
LBB0_7:
	mov	w0, #0
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_TYPE_EDGE_BOTH,4,2         ; @IRQ_TYPE_EDGE_BOTH
	.comm	_REG_IBE,8,3                    ; @REG_IBE
	.comm	_IRQ_TYPE_LEVEL_LOW,4,2         ; @IRQ_TYPE_LEVEL_LOW
	.comm	_IRQ_TYPE_LEVEL_HIGH,4,2        ; @IRQ_TYPE_LEVEL_HIGH
	.comm	_REG_IS,8,3                     ; @REG_IS
	.comm	_IRQ_TYPE_EDGE_RISING,4,2       ; @IRQ_TYPE_EDGE_RISING
	.comm	_REG_IEV,8,3                    ; @REG_IEV
	.no_dead_strip	_tc3589x_gpio_irq_set_type
.subsections_via_symbols
