	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_regs
_write_regs:                            ## @write_regs
	.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
                                        ## kill: def $r8d killed $r8d def $r8
	movq	_CSR_REGISTER_BASE@GOTPCREL(%rip), %rax
	subl	(%rax), %r8d
	orl	%r8d, %r9d
	movq	_RCODE_TYPE_ERROR@GOTPCREL(%rip), %rax
	testb	$3, %r9b
	je	LBB0_3
LBB0_1:
	movq	%rax, %r12
LBB0_2:
	movl	(%r12), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_RCODE_ADDRESS_ERROR@GOTPCREL(%rip), %r12
	addl	$-128, %r8d
	cmpl	$13, %r8d
	ja	LBB0_2
## %bb.4:
	movq	%rcx, %rbx
	movq	%rdi, %r14
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%r8,4), %rdx
	addq	%rcx, %rdx
	jmpq	*%rdx
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_printk
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	callq	_printk
LBB0_8:
	movq	_NODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$16, %eax
	andl	%eax, 4(%r14)
	movl	(%rbx), %edi
	callq	_be32_to_cpu
	movq	_BUS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	shll	$16, %edx
	andl	%eax, %edx
	orl	4(%r14), %edx
	movl	%edx, 4(%r14)
	movl	%edx, %eax
	sarl	$16, %eax
	movl	%eax, (%r14)
	movq	32(%r14), %rax
	movq	_SET_BUS_ID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	sarl	$22, %edx
	movq	%r14, %rdi
	callq	*(%rax)
	jmp	LBB0_2
LBB0_9:
	movl	(%rbx), %edi
	addq	$4, %rbx
	callq	_be32_to_cpu
	andl	$7, %eax
	leaq	4(%r14), %rdi
	movl	%eax, 8(%r14)
	callq	_calculate_expire
LBB0_10:
	movl	(%rbx), %edi
	callq	_be32_to_cpu
	andl	$-524288, %eax                  ## imm = 0xFFF80000
	movl	%eax, 12(%r14)
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_calculate_expire
	jmp	LBB0_2
LBB0_11:
	movl	(%rbx), %edi
	callq	_be32_to_cpu
	movl	%eax, 16(%r14)
	movq	32(%r14), %rax
	movq	(%rax), %r13
	movq	_SET_CYCLE_COUNTER@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	(%rbx), %edi
	addq	$4, %rbx
	callq	_be32_to_cpu
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	*%r13
LBB0_12:
	movl	(%rbx), %edi
	callq	_be32_to_cpu
	andl	$-128, %eax
	movl	%eax, 20(%r14)
	jmp	LBB0_2
LBB0_13:
	movl	$-1073741825, %r15d             ## imm = 0xBFFFFFFF
	andl	24(%r14), %r15d
	movl	(%rbx), %edi
	callq	_be32_to_cpu
	andl	$1073741824, %eax               ## imm = 0x40000000
	orl	%r15d, %eax
	movl	%eax, 24(%r14)
	jmp	LBB0_2
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_1, LBB0_1-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
LJTI0_0:
	.long	L0_0_set_7
	.long	L0_0_set_6
	.long	L0_0_set_10
	.long	L0_0_set_9
	.long	L0_0_set_2
	.long	L0_0_set_8
	.long	L0_0_set_11
	.long	L0_0_set_1
	.long	L0_0_set_1
	.long	L0_0_set_12
	.long	L0_0_set_1
	.long	L0_0_set_2
	.long	L0_0_set_13
	.long	L0_0_set_1
	.end_data_region
                                        ## -- End function
	.comm	_CSR_REGISTER_BASE,4,2          ## @CSR_REGISTER_BASE
	.comm	_RCODE_TYPE_ERROR,4,2           ## @RCODE_TYPE_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doh, someone wants to mess with state clear\n"

	.comm	_out,4,2                        ## @out
L_.str.1:                               ## @.str.1
	.asciz	"doh, someone wants to mess with state set\n"

	.comm	_NODE_MASK,4,2                  ## @NODE_MASK
	.comm	_BUS_MASK,4,2                   ## @BUS_MASK
	.comm	_SET_BUS_ID,4,2                 ## @SET_BUS_ID
	.comm	_RCODE_ADDRESS_ERROR,4,2        ## @RCODE_ADDRESS_ERROR
	.comm	_SET_CYCLE_COUNTER,4,2          ## @SET_CYCLE_COUNTER
	.comm	_RCODE_COMPLETE,4,2             ## @RCODE_COMPLETE
	.no_dead_strip	_write_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_regs
_write_regs:                            ; @write_regs
	.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
Lloh0:
	adrp	x8, _CSR_REGISTER_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSR_REGISTER_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w9, w4, w8
	orr	w8, w9, w5
	tst	x8, #0x3
	b.eq	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _RCODE_TYPE_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RCODE_TYPE_ERROR@GOTPAGEOFF]
	b	LBB0_13
LBB0_2:
Lloh5:
	adrp	x8, _RCODE_ADDRESS_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RCODE_ADDRESS_ERROR@GOTPAGEOFF]
	sub	w9, w9, #128
	cmp	w9, #13
	b.hi	LBB0_13
; %bb.3:
	mov	x20, x3
	mov	x19, x0
Lloh7:
	adrp	x10, lJTI0_0@PAGE
Lloh8:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_1
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_4:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
LBB0_5:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
LBB0_6:
Lloh13:
	adrp	x8, _NODE_MASK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NODE_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	and	w8, w9, w8, lsl #16
	str	w8, [x19, #4]
	ldr	w0, [x20]
	bl	_be32_to_cpu
Lloh16:
	adrp	x8, _BUS_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BUS_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w0, w8, lsl #16
	ldr	w9, [x19, #4]
	orr	w8, w8, w9
	asr	w9, w8, #16
	stp	w9, w8, [x19]
	ldr	x9, [x19, #32]
	ldr	x9, [x9]
Lloh19:
	adrp	x10, _SET_BUS_ID@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SET_BUS_ID@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x10]
	asr	w2, w8, #22
	mov	x0, x19
	blr	x9
	b	LBB0_12
LBB0_7:
	ldr	w0, [x20], #4
	bl	_be32_to_cpu
	and	w8, w0, #0x7
	add	x0, x19, #4
	str	w8, [x19, #8]
	bl	_calculate_expire
LBB0_8:
	ldr	w0, [x20]
	bl	_be32_to_cpu
	and	w8, w0, #0xfff80000
	add	x0, x19, #4
	str	w8, [x19, #12]
	bl	_calculate_expire
	b	LBB0_12
LBB0_9:
	ldr	w0, [x20]
	bl	_be32_to_cpu
	str	w0, [x19, #16]
	ldr	x8, [x19, #32]
	ldr	x22, [x8]
Lloh22:
	adrp	x8, _SET_CYCLE_COUNTER@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SET_CYCLE_COUNTER@GOTPAGEOFF]
Lloh24:
	ldr	w21, [x8]
	ldr	w0, [x20], #4
	bl	_be32_to_cpu
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	blr	x22
LBB0_10:
	ldr	w0, [x20]
	bl	_be32_to_cpu
	and	w8, w0, #0xffffff80
	str	w8, [x19, #20]
	b	LBB0_12
LBB0_11:
	ldr	w21, [x19, #24]
	ldr	w0, [x20]
	bl	_be32_to_cpu
	lsr	w8, w0, #30
	bfi	w21, w8, #30, #1
	str	w21, [x19, #24]
LBB0_12:
Lloh25:
	adrp	x8, _RCODE_ADDRESS_ERROR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _RCODE_ADDRESS_ERROR@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_1)>>2
	.byte	(LBB0_4-LBB0_1)>>2
	.byte	(LBB0_8-LBB0_1)>>2
	.byte	(LBB0_7-LBB0_1)>>2
	.byte	(LBB0_13-LBB0_1)>>2
	.byte	(LBB0_6-LBB0_1)>>2
	.byte	(LBB0_9-LBB0_1)>>2
	.byte	(LBB0_1-LBB0_1)>>2
	.byte	(LBB0_1-LBB0_1)>>2
	.byte	(LBB0_10-LBB0_1)>>2
	.byte	(LBB0_1-LBB0_1)>>2
	.byte	(LBB0_13-LBB0_1)>>2
	.byte	(LBB0_11-LBB0_1)>>2
	.byte	(LBB0_1-LBB0_1)>>2
                                        ; -- End function
	.comm	_CSR_REGISTER_BASE,4,2          ; @CSR_REGISTER_BASE
	.comm	_RCODE_TYPE_ERROR,4,2           ; @RCODE_TYPE_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doh, someone wants to mess with state clear\n"

	.comm	_out,4,2                        ; @out
l_.str.1:                               ; @.str.1
	.asciz	"doh, someone wants to mess with state set\n"

	.comm	_NODE_MASK,4,2                  ; @NODE_MASK
	.comm	_BUS_MASK,4,2                   ; @BUS_MASK
	.comm	_SET_BUS_ID,4,2                 ; @SET_BUS_ID
	.comm	_RCODE_ADDRESS_ERROR,4,2        ; @RCODE_ADDRESS_ERROR
	.comm	_SET_CYCLE_COUNTER,4,2          ; @SET_CYCLE_COUNTER
	.comm	_RCODE_COMPLETE,4,2             ; @RCODE_COMPLETE
	.no_dead_strip	_write_regs
.subsections_via_symbols
