	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc32xx_irq_set_type
_lpc32xx_irq_set_type:                  ## @lpc32xx_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_irq_data_get_irq_chip_data
	movq	%rax, %r14
	movl	(%r15), %edi
	callq	_BIT
	movl	%eax, %r12d
	leal	-128(%rbx), %eax
	cmpl	$4, %eax
	jae	LBB0_1
## %bb.2:
	andb	$15, %al
	movzbl	%al, %r13d
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_irqd_set_trigger_type
	movq	_LPC32XX_INTC_POL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_lpc32xx_ic_read
	movl	%eax, %edx
	orl	%r12d, %edx
	movl	%r12d, %ebx
	notl	%ebx
	andl	%ebx, %eax
	movl	$9, %ecx
	btl	%r13d, %ecx
	cmovbl	%eax, %edx
	movq	_LPC32XX_INTC_POL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_lpc32xx_ic_write
	movq	_LPC32XX_INTC_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_lpc32xx_ic_read
	andl	%eax, %ebx
	orl	%eax, %r12d
	movl	$3, %eax
	btl	%r13d, %eax
	cmovbl	%ebx, %r12d
	movq	_handle_level_irq@GOTPCREL(%rip), %rax
	cmovaeq	_handle_edge_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_irq_set_handler_locked
	movq	_LPC32XX_INTC_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_lpc32xx_ic_write
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_info
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported irq type %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LPC32XX_INTC_POL,4,2           ## @LPC32XX_INTC_POL
	.comm	_LPC32XX_INTC_TYPE,4,2          ## @LPC32XX_INTC_TYPE
	.comm	_handle_edge_irq,4,2            ## @handle_edge_irq
	.comm	_handle_level_irq,4,2           ## @handle_level_irq
	.no_dead_strip	_lpc32xx_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 lpc32xx_irq_set_type
_lpc32xx_irq_set_type:                  ; @lpc32xx_irq_set_type
	.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	x22, x1
	mov	x20, x0
	bl	_irq_data_get_irq_chip_data
	mov	x19, x0
	ldr	w0, [x20]
	bl	_BIT
	sub	w8, w22, #128
	cmp	w8, #4
	b.hs	LBB0_2
; %bb.1:
	mov	x21, x0
	and	x8, x8, #0xf
	mov	w9, #9
	lsr	w23, w9, w8
	mov	w9, #3
	lsr	w24, w9, w8
	mov	x0, x20
	mov	x1, x22
	bl	_irqd_set_trigger_type
Lloh0:
	adrp	x22, _LPC32XX_INTC_POL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _LPC32XX_INTC_POL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_lpc32xx_ic_read
	orr	w8, w0, w21
	bic	w9, w0, w21
	tst	w23, #0x1
	csel	w2, w8, w9, eq
	ldr	w1, [x22]
	mov	x0, x19
	bl	_lpc32xx_ic_write
Lloh2:
	adrp	x22, _LPC32XX_INTC_TYPE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _LPC32XX_INTC_TYPE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_lpc32xx_ic_read
	bic	w8, w0, w21
	orr	w9, w0, w21
	tst	w24, #0x1
	csel	w21, w9, w8, eq
Lloh4:
	adrp	x8, _handle_level_irq@GOTPAGE
Lloh5:
	ldr	x8, [x8, _handle_level_irq@GOTPAGEOFF]
Lloh6:
	adrp	x9, _handle_edge_irq@GOTPAGE
Lloh7:
	ldr	x9, [x9, _handle_edge_irq@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	mov	x0, x20
	bl	_irq_set_handler_locked
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_lpc32xx_ic_write
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_info
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported irq type %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LPC32XX_INTC_POL,4,2           ; @LPC32XX_INTC_POL
	.comm	_LPC32XX_INTC_TYPE,4,2          ; @LPC32XX_INTC_TYPE
	.comm	_handle_edge_irq,4,2            ; @handle_edge_irq
	.comm	_handle_level_irq,4,2           ; @handle_level_irq
	.no_dead_strip	_lpc32xx_irq_set_type
.subsections_via_symbols
