	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_state_add
_write_state_add:                       ## @write_state_add
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	(%rdi), %r12d
	cmpl	4(%rdi), %r12d
	jne	LBB0_5
## %bb.1:
	movl	8(%rbx), %esi
	cmpl	%esi, %r12d
	jne	LBB0_4
## %bb.2:
	movl	24(%rbx), %edi
	movq	16(%rbx), %rsi
	movl	%r12d, %edx
	callq	_writev
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
	jmp	LBB0_5
LBB0_4:
	movslq	%r12d, %rdi
	movq	_STEP@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_min
	movl	%eax, 4(%rbx)
	movq	16(%rbx), %rdi
	shll	$4, %eax
	movl	%eax, %esi
	callq	_erealloc
	movq	%rax, 16(%rbx)
	movl	(%rbx), %r12d
LBB0_5:
	movq	16(%rbx), %rax
	movslq	%r12d, %rcx
	movq	%rcx, %rdx
	shlq	$4, %rdx
	movq	%r15, 8(%rax,%rdx)
	movq	%r14, (%rax,%rdx)
	incl	%ecx
	movl	%ecx, (%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writev"

	.comm	_STEP,8,3                       ## @STEP
	.no_dead_strip	_write_state_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_state_add
_write_state_add:                       ; @write_state_add
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldp	w2, w8, [x0]
	cmp	w2, w8
	b.ne	LBB0_6
; %bb.1:
	ldr	w1, [x19, #8]
	cmp	w2, w1
	b.ne	LBB0_5
; %bb.2:
	ldr	w0, [x19, #24]
	ldr	x1, [x19, #16]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_writev
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
	mov	w2, #0
	b	LBB0_6
LBB0_5:
	sxtw	x8, w2
Lloh2:
	adrp	x9, _STEP@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STEP@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_min
	str	w0, [x19, #4]
	ldr	x8, [x19, #16]
	lsl	w1, w0, #4
	mov	x0, x8
	bl	_erealloc
	str	x0, [x19, #16]
	ldr	w2, [x19]
LBB0_6:
	ldr	x8, [x19, #16]
	add	x8, x8, w2, sxtw #4
	stp	x20, x21, [x8]
	add	w8, w2, #1
	str	w8, [x19]
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writev"

	.comm	_STEP,8,3                       ; @STEP
	.no_dead_strip	_write_state_add
.subsections_via_symbols
