	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_irq_set_type
_rockchip_irq_set_type:                 ## @rockchip_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_irq_data_get_irq_chip_data
	movq	%rax, %r15
	movq	8(%rax), %rbx
	movl	(%r14), %edi
	callq	_BIT
	movl	%eax, %r13d
	movl	(%r14), %esi
	movq	_RK_FUNC_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_rockchip_set_mux
	testl	%eax, %eax
	js	LBB0_17
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	4(%rbx), %edi
	callq	_clk_enable
	movl	%r13d, %r15d
	leaq	8(%rbx), %r13
	movq	%r13, %rdi
	callq	_raw_spin_lock_irqsave
	movq	_GPIO_SWPORT_DDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%rbx), %rdi
	callq	_readl_relaxed
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	notl	%r15d
	andl	%r15d, %eax
	movq	_GPIO_SWPORT_DDR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	addq	16(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel_relaxed
	movq	%r13, %rbx
	movq	%r13, %rdi
	callq	_raw_spin_unlock_irqrestore
	testb	$-124, %r12b
	jne	LBB0_2
## %bb.3:
	movq	_handle_level_irq@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_handle_edge_irq@GOTPCREL(%rip), %rax
LBB0_4:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_irq_set_handler_locked
	movq	%rbx, %rdi
	callq	_raw_spin_lock_irqsave
	movq	%r13, %rdi
	callq	_irq_gc_lock
	movq	_GPIO_INTTYPE_LEVEL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_GPIO_INT_POLARITY@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r13), %rdi
	callq	_readl_relaxed
	addl	$-128, %r12d
	cmpl	$4, %r12d
	ja	LBB0_18
## %bb.5:
	movl	%eax, %r14d
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%r12,4), %rcx
	addq	%rax, %rcx
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmpq	*%rcx
LBB0_13:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	andl	%r15d, (%r12)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	andl	%r15d, %edi
	jmp	LBB0_14
LBB0_18:
	movq	%r13, %rdi
	callq	_irq_gc_unlock
	movq	%rbx, %rdi
	callq	_raw_spin_unlock_irqrestore
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	callq	_clk_disable
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_17
LBB0_12:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	andl	%r15d, (%r12)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	andl	%r15d, %edi
	orl	-52(%rbp), %r14d                ## 4-byte Folded Reload
	jmp	LBB0_15
LBB0_10:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	andl	%r15d, (%r12)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	orl	%eax, %edi
	orl	%eax, %r14d
	jmp	LBB0_15
LBB0_11:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	andl	%r15d, (%r12)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	orl	-52(%rbp), %edi                 ## 4-byte Folded Reload
LBB0_14:
	andl	%r15d, %r14d
LBB0_15:
	movq	_GPIO_INTTYPE_LEVEL@GOTPCREL(%rip), %rax
	movq	_GPIO_INT_POLARITY@GOTPCREL(%rip), %rbx
LBB0_16:
	movq	(%rax), %rsi
	addq	(%r13), %rsi
	callq	_writel_relaxed
	movq	(%rbx), %rsi
	addq	(%r13), %rsi
	movl	%r14d, %edi
	callq	_writel_relaxed
	movq	%r13, %rdi
	callq	_irq_gc_unlock
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_raw_spin_unlock_irqrestore
	movl	4(%r12), %edi
	callq	_clk_disable
	xorl	%eax, %eax
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	orl	%ebx, (%r12)
	orl	%ebx, -48(%rbp)                 ## 4-byte Folded Spill
	movq	_GPIO_EXT_PORT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%r12), %rdi
	callq	_readl
	testl	%ebx, %eax
	je	LBB0_9
## %bb.7:
	andl	%r15d, %r14d
	jmp	LBB0_8
LBB0_9:
	orl	%ebx, %r14d
LBB0_8:
	movq	_GPIO_INTTYPE_LEVEL@GOTPCREL(%rip), %rax
	movq	_GPIO_INT_POLARITY@GOTPCREL(%rip), %rbx
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_16
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
LJTI0_0:
	.long	L0_0_set_13
	.long	L0_0_set_12
	.long	L0_0_set_10
	.long	L0_0_set_11
	.long	L0_0_set_6
	.end_data_region
                                        ## -- End function
	.comm	_RK_FUNC_GPIO,4,2               ## @RK_FUNC_GPIO
	.comm	_GPIO_SWPORT_DDR,8,3            ## @GPIO_SWPORT_DDR
	.comm	_handle_edge_irq,4,2            ## @handle_edge_irq
	.comm	_handle_level_irq,4,2           ## @handle_level_irq
	.comm	_GPIO_INTTYPE_LEVEL,8,3         ## @GPIO_INTTYPE_LEVEL
	.comm	_GPIO_INT_POLARITY,8,3          ## @GPIO_INT_POLARITY
	.comm	_GPIO_EXT_PORT,8,3              ## @GPIO_EXT_PORT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rockchip_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 rockchip_irq_set_type
_rockchip_irq_set_type:                 ; @rockchip_irq_set_type
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x1
	mov	x24, x0
	bl	_irq_data_get_irq_chip_data
	mov	x20, x0
	ldr	x19, [x0, #8]
	ldr	w0, [x24]
	bl	_BIT
	mov	x22, x0
	ldr	w1, [x24]
Lloh0:
	adrp	x8, _RK_FUNC_GPIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RK_FUNC_GPIO@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_rockchip_set_mux
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldr	w0, [x19, #4]
	bl	_clk_enable
	add	x21, x19, #8
	mov	x0, x21
	bl	_raw_spin_lock_irqsave
	ldr	x8, [x19, #16]
Lloh3:
	adrp	x25, _GPIO_SWPORT_DDR@GOTPAGE
Lloh4:
	ldr	x25, [x25, _GPIO_SWPORT_DDR@GOTPAGEOFF]
	ldr	x9, [x25]
	add	x0, x9, x8
	bl	_readl_relaxed
	bic	w0, w0, w22
	ldr	x8, [x19, #16]
	ldr	x9, [x25]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	x0, x21
	bl	_raw_spin_unlock_irqrestore
Lloh5:
	adrp	x8, _handle_level_irq@GOTPAGE
Lloh6:
	ldr	x8, [x8, _handle_level_irq@GOTPAGEOFF]
Lloh7:
	adrp	x9, _handle_edge_irq@GOTPAGE
Lloh8:
	ldr	x9, [x9, _handle_edge_irq@GOTPAGEOFF]
	mov	w10, #132
	tst	w23, w10
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	mov	x0, x24
	bl	_irq_set_handler_locked
	mov	x0, x21
	bl	_raw_spin_lock_irqsave
	mov	x0, x20
	bl	_irq_gc_lock
	ldr	x8, [x20]
Lloh9:
	adrp	x26, _GPIO_INTTYPE_LEVEL@GOTPAGE
Lloh10:
	ldr	x26, [x26, _GPIO_INTTYPE_LEVEL@GOTPAGEOFF]
	ldr	x9, [x26]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x25, x0
	ldr	x8, [x20]
Lloh11:
	adrp	x27, _GPIO_INT_POLARITY@GOTPAGE
Lloh12:
	ldr	x27, [x27, _GPIO_INT_POLARITY@GOTPAGEOFF]
	ldr	x9, [x27]
	add	x0, x9, x8
	bl	_readl_relaxed
	sub	w8, w23, #128
	cmp	w8, #4
	b.hi	LBB0_4
; %bb.2:
	mov	x24, x0
	mvn	w28, w22
Lloh13:
	adrp	x9, lJTI0_0@PAGE
Lloh14:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
	ldr	w8, [x19]
	and	w8, w8, w28
	str	w8, [x19]
	and	w23, w25, w28
	and	w22, w24, w28
	b	LBB0_9
LBB0_4:
	mov	x0, x20
	bl	_irq_gc_unlock
	mov	x0, x21
	bl	_raw_spin_unlock_irqrestore
	ldr	w0, [x19, #4]
	bl	_clk_disable
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_5:
	ldr	w8, [x19]
	and	w8, w8, w28
	str	w8, [x19]
	and	w23, w25, w28
	orr	w22, w24, w22
	b	LBB0_9
LBB0_6:
	ldr	w8, [x19]
	and	w8, w8, w28
	str	w8, [x19]
	orr	w23, w25, w22
	orr	w22, w24, w22
	b	LBB0_9
LBB0_7:
	ldr	w8, [x19]
	and	w8, w8, w28
	str	w8, [x19]
	orr	w23, w25, w22
	and	w22, w24, w28
	b	LBB0_9
LBB0_8:
	ldr	w8, [x19]
	orr	w8, w8, w22
	str	w8, [x19]
	orr	w23, w25, w22
	ldr	x8, [x19, #16]
Lloh18:
	adrp	x9, _GPIO_EXT_PORT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _GPIO_EXT_PORT@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	tst	w0, w22
	orr	w8, w24, w22
	and	w9, w24, w28
	csel	w22, w8, w9, eq
LBB0_9:
	ldr	x8, [x20]
	ldr	x9, [x26]
	add	x1, x9, x8
	mov	x0, x23
	bl	_writel_relaxed
	ldr	x8, [x20]
	ldr	x9, [x27]
	add	x1, x9, x8
	mov	x0, x22
	bl	_writel_relaxed
	mov	x0, x20
	bl	_irq_gc_unlock
	mov	x0, x21
	bl	_raw_spin_unlock_irqrestore
	ldr	w0, [x19, #4]
	bl	_clk_disable
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_5-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_7-LBB0_3)>>2
	.byte	(LBB0_8-LBB0_3)>>2
                                        ; -- End function
	.comm	_RK_FUNC_GPIO,4,2               ; @RK_FUNC_GPIO
	.comm	_GPIO_SWPORT_DDR,8,3            ; @GPIO_SWPORT_DDR
	.comm	_handle_edge_irq,4,2            ; @handle_edge_irq
	.comm	_handle_level_irq,4,2           ; @handle_level_irq
	.comm	_GPIO_INTTYPE_LEVEL,8,3         ; @GPIO_INTTYPE_LEVEL
	.comm	_GPIO_INT_POLARITY,8,3          ; @GPIO_INT_POLARITY
	.comm	_GPIO_EXT_PORT,8,3              ; @GPIO_EXT_PORT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rockchip_irq_set_type
.subsections_via_symbols
