	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smi_data_write
_smi_data_write:                        ## @smi_data_write
	.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
	leaq	(%r9,%r8), %rbx
	movq	_MAX_SMI_DATA_BUF_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jbe	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
	jmp	LBB0_5
LBB0_2:
	movq	%r9, %r15
	movq	%r8, %r12
	movq	%rcx, %r14
	movq	_smi_data_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_smi_data_buf_realloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_smi_data_buf@GOTPCREL(%rip), %rax
	addq	(%rax), %r12
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	%r15, %rbx
LBB0_4:
	movq	_smi_data_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_5:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SMI_DATA_BUF_SIZE,8,3      ## @MAX_SMI_DATA_BUF_SIZE
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_smi_data_lock,4,2              ## @smi_data_lock
	.comm	_smi_data_buf,8,3               ## @smi_data_buf
	.no_dead_strip	_smi_data_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smi_data_write
_smi_data_write:                        ; @smi_data_write
	.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, _MAX_SMI_DATA_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_SMI_DATA_BUF_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x22, x5, x4
	cmp	x22, x8
	b.ls	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	neg	x22, x8
	b	LBB0_5
LBB0_2:
	mov	x19, x5
	mov	x21, x4
	mov	x20, x3
Lloh6:
	adrp	x0, _smi_data_lock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _smi_data_lock@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x22
	bl	_smi_data_buf_realloc
	mov	x22, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _smi_data_buf@GOTPAGE
Lloh9:
	ldr	x8, [x8, _smi_data_buf@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	add	x0, x8, x21
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
	mov	x22, x19
LBB0_4:
Lloh11:
	adrp	x0, _smi_data_lock@GOTPAGE
Lloh12:
	ldr	x0, [x0, _smi_data_lock@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_5:
	mov	x0, x22
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SMI_DATA_BUF_SIZE,8,3      ; @MAX_SMI_DATA_BUF_SIZE
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_smi_data_lock,4,2              ; @smi_data_lock
	.comm	_smi_data_buf,8,3               ; @smi_data_buf
	.no_dead_strip	_smi_data_write
.subsections_via_symbols
