	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_history_q_add                  ## -- Begin function history_q_add
	.p2align	4, 0x90
_history_q_add:                         ## @history_q_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	callq	_dl_strdup
	movq	_history_q@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movq	_history_r@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	leaq	1(%rsi), %rdi
	movq	%rdi, (%rdx)
	movq	%rax, (%rcx,%rsi,8)
	movq	(%rdx), %rsi
	movq	_MAX_HISTORY@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rsi
	jbe	LBB0_3
## %bb.2:
	movq	$0, (%rdx)
	movq	_history_l@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_history_l@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rsi, %rax
	jb	LBB0_6
LBB0_4:
	movq	(%rcx,%rax,8), %rdi
	callq	_dl_strfree
	movq	(%r14), %rcx
	movq	_history_l@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	1(%rdx), %rsi
	movq	%rsi, (%rax)
	movq	$0, (%rcx,%rdx,8)
	movq	(%rax), %rcx
	cmpq	(%rbx), %rcx
	jbe	LBB0_6
## %bb.5:
	movq	$0, (%rax)
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_history_q,8,3                  ## @history_q
	.comm	_history_r,8,3                  ## @history_r
	.comm	_MAX_HISTORY,8,3                ## @MAX_HISTORY
	.comm	_history_l,8,3                  ## @history_l
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_history_q_add                  ; -- Begin function history_q_add
	.p2align	2
_history_q_add:                         ; @history_q_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
	cbz	x0, LBB0_6
; %bb.1:
	bl	_dl_strdup
Lloh0:
	adrp	x20, _history_q@GOTPAGE
Lloh1:
	ldr	x20, [x20, _history_q@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _history_r@GOTPAGE
Lloh3:
	ldr	x9, [x9, _history_r@GOTPAGEOFF]
	ldr	x10, [x9]
	add	x11, x10, #1
	str	x11, [x9]
	str	x0, [x8, x10, lsl #3]
	ldr	x10, [x9]
Lloh4:
	adrp	x21, _MAX_HISTORY@GOTPAGE
Lloh5:
	ldr	x21, [x21, _MAX_HISTORY@GOTPAGEOFF]
	ldr	x11, [x21]
Lloh6:
	adrp	x19, _history_l@GOTPAGE
Lloh7:
	ldr	x19, [x19, _history_l@GOTPAGEOFF]
	cmp	x10, x11
	b.ls	LBB0_3
; %bb.2:
	str	xzr, [x9]
	ldr	x9, [x19]
	b	LBB0_4
LBB0_3:
	ldr	x9, [x19]
	cmp	x9, x10
	b.lo	LBB0_6
LBB0_4:
	ldr	x0, [x8, x9, lsl #3]
	bl	_dl_strfree
	ldr	x8, [x20]
	ldr	x9, [x19]
	add	x10, x9, #1
	str	x10, [x19]
	str	xzr, [x8, x9, lsl #3]
	ldr	x8, [x19]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ls	LBB0_6
; %bb.5:
	str	xzr, [x19]
LBB0_6:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_history_q,8,3                  ; @history_q
	.comm	_history_r,8,3                  ; @history_r
	.comm	_MAX_HISTORY,8,3                ; @MAX_HISTORY
	.comm	_history_l,8,3                  ; @history_l
.subsections_via_symbols
