	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_set_polarity            ## -- Begin function ioapic_set_polarity
	.p2align	4, 0x90
_ioapic_set_polarity:                   ## @ioapic_set_polarity
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	%rsi, (%rdi)
	jbe	LBB0_2
## %bb.1:
	movq	_INTR_POLARITY_CONFORM@GOTPCREL(%rip), %rcx
	cmpl	%edx, (%rcx)
	je	LBB0_2
## %bb.3:
	movq	%rsi, %rax
	movq	16(%rdi), %rcx
	shlq	$4, %rsi
	cmpq	$0, (%rcx,%rsi)
	js	LBB0_2
## %bb.4:
	movq	_INTR_POLARITY_HIGH@GOTPCREL(%rip), %r8
	xorl	%ebx, %ebx
	cmpl	%edx, (%r8)
	sete	%bl
	xorl	%r14d, %r14d
	cmpl	%ebx, 8(%rcx,%rsi)
	je	LBB0_7
## %bb.5:
	addq	%rsi, %rcx
	addq	$8, %rcx
	movl	%ebx, (%rcx)
	movq	_bootverbose@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_7
## %bb.6:
	movl	8(%rdi), %esi
	cmpl	%edx, (%r8)
	leaq	L_.str.1(%rip), %rdx
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rdx, %rcx
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rdx
	callq	_printf
	jmp	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTR_POLARITY_CONFORM,4,2      ## @INTR_POLARITY_CONFORM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_INTR_POLARITY_HIGH,4,2         ## @INTR_POLARITY_HIGH
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ioapic%u: intpin %d polarity: %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"high"

L_.str.2:                               ## @.str.2
	.asciz	"low"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ioapic_set_polarity            ; -- Begin function ioapic_set_polarity
	.p2align	2
_ioapic_set_polarity:                   ; @ioapic_set_polarity
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	ldr	x9, [x0]
Lloh0:
	adrp	x10, _INTR_POLARITY_CONFORM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _INTR_POLARITY_CONFORM@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	cmp	x9, x1
	ccmp	w10, w2, #4, hi
	b.eq	LBB0_6
; %bb.1:
	mov	x8, x1
	ldr	x10, [x0, #16]
	lsl	x9, x1, #4
	ldr	x9, [x10, x9]
	tbnz	x9, #63, LBB0_6
; %bb.2:
Lloh3:
	adrp	x9, _INTR_POLARITY_HIGH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _INTR_POLARITY_HIGH@GOTPAGEOFF]
	ldr	w11, [x9]
	cmp	w11, w2
	cset	w11, eq
	add	x10, x10, x8, lsl #4
	ldr	w12, [x10, #8]!
	cmp	w12, w11
	b.eq	LBB0_5
; %bb.3:
	str	w11, [x10]
Lloh5:
	adrp	x10, _bootverbose@GOTPAGE
Lloh6:
	ldr	x10, [x10, _bootverbose@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	cbz	x10, LBB0_5
; %bb.4:
	ldr	w1, [x0, #8]
	ldr	w9, [x9]
Lloh8:
	adrp	x10, l_.str.2@PAGE
Lloh9:
	add	x10, x10, l_.str.2@PAGEOFF
Lloh10:
	adrp	x11, l_.str.1@PAGE
Lloh11:
	add	x11, x11, l_.str.1@PAGEOFF
	cmp	w9, w2
	csel	x3, x11, x10, eq
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x8
	bl	_printf
LBB0_5:
	mov	w0, #0
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_INTR_POLARITY_CONFORM,4,2      ; @INTR_POLARITY_CONFORM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_INTR_POLARITY_HIGH,4,2         ; @INTR_POLARITY_HIGH
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ioapic%u: intpin %d polarity: %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"high"

l_.str.2:                               ; @.str.2
	.asciz	"low"

.subsections_via_symbols
