	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ergo_set_errlog_state
_ergo_set_errlog_state:                 ## @ergo_set_errlog_state
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_CARD_STATE_RUN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.1:
	movl	%esi, %r15d
	leaq	20(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%rbx), %rax
	testl	%r15d, %r15d
	jne	LBB0_3
## %bb.2:
	movq	_ERRLOG_STATE_OFF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
LBB0_3:
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.4:
	movq	_ERRLOG_STATE_ON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
LBB0_10:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_9:
	movq	_ERRLOG_STATE_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:
	movq	_ERRLOG_STATE_START@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_ERRLOG_STATE_STOP@GOTPCREL(%rip), %rax
LBB0_8:
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	addq	$16, %rbx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_schedule_work                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_STATE_RUN,8,3             ## @CARD_STATE_RUN
	.comm	_ERRLOG_STATE_OFF,8,3           ## @ERRLOG_STATE_OFF
	.comm	_ERRLOG_STATE_ON,8,3            ## @ERRLOG_STATE_ON
	.comm	_ERRLOG_STATE_START,8,3         ## @ERRLOG_STATE_START
	.comm	_ERRLOG_STATE_STOP,8,3          ## @ERRLOG_STATE_STOP
	.no_dead_strip	_ergo_set_errlog_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ergo_set_errlog_state
_ergo_set_errlog_state:                 ; @ergo_set_errlog_state
	.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, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CARD_STATE_RUN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CARD_STATE_RUN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	mov	x20, x1
	add	x21, x19, #20
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	cbnz	w20, LBB0_3
; %bb.2:
Lloh3:
	adrp	x9, _ERRLOG_STATE_OFF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ERRLOG_STATE_OFF@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
LBB0_3:
	cbz	w20, LBB0_7
; %bb.4:
Lloh6:
	adrp	x9, _ERRLOG_STATE_ON@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ERRLOG_STATE_ON@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
LBB0_5:
	mov	x0, x21
	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
	b	_spin_unlock_irqrestore
LBB0_6:
Lloh9:
	adrp	x8, _ERRLOG_STATE_OFF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERRLOG_STATE_OFF@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	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
LBB0_7:
Lloh12:
	adrp	x8, _ERRLOG_STATE_START@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERRLOG_STATE_START@GOTPAGEOFF]
Lloh14:
	adrp	x9, _ERRLOG_STATE_STOP@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ERRLOG_STATE_STOP@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x8, x9, ne
	ldr	x8, [x8]
	str	x8, [x19, #8]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	add	x0, x19, #16
	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
	b	_schedule_work
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_STATE_RUN,8,3             ; @CARD_STATE_RUN
	.comm	_ERRLOG_STATE_OFF,8,3           ; @ERRLOG_STATE_OFF
	.comm	_ERRLOG_STATE_ON,8,3            ; @ERRLOG_STATE_ON
	.comm	_ERRLOG_STATE_START,8,3         ; @ERRLOG_STATE_START
	.comm	_ERRLOG_STATE_STOP,8,3          ; @ERRLOG_STATE_STOP
	.no_dead_strip	_ergo_set_errlog_state
.subsections_via_symbols
