	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LSAPI_FinalizeRespHeaders_r    ## -- Begin function LSAPI_FinalizeRespHeaders_r
	.p2align	4, 0x90
_LSAPI_FinalizeRespHeaders_r:           ## @LSAPI_FinalizeRespHeaders_r
	.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
	movl	$-1, %r14d
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movl	(%rbx), %ecx
	movq	_LSAPI_ST_RESP_HEADER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	xorl	%r14d, %r14d
	testl	%ecx, %edx
	je	LBB0_7
## %bb.3:
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, (%rbx)
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	subq	%rdx, %rcx
	jle	LBB0_4
## %bb.5:
	movq	56(%rbx), %rsi
	movq	%rdx, 8(%rsi)
	movq	%rcx, (%rsi)
	addl	24(%rbx), %ecx
	addq	$16, %rsi
	movq	%rsi, 56(%rbx)
	jmp	LBB0_6
LBB0_4:
	movl	24(%rbx), %ecx
LBB0_6:
	leaq	48(%rbx), %r15
	movl	52(%rbx), %edx
	leal	(%rdx,%rdx), %esi
	addl	$4, %esi
	movl	%esi, (%rax)
	leal	4(%rcx,%rdx,2), %edx
	movl	%edx, 24(%rbx)
	movq	_LSAPI_RESP_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_lsapi_buildPacketHeader
	movq	32(%rbx), %rax
	movq	%r15, 8(%rax)
	movq	%rax, 40(%rbx)
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LSAPI_ST_RESP_HEADER,4,2       ## @LSAPI_ST_RESP_HEADER
	.comm	_LSAPI_RESP_HEADER,4,2          ## @LSAPI_RESP_HEADER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LSAPI_FinalizeRespHeaders_r    ; -- Begin function LSAPI_FinalizeRespHeaders_r
	.p2align	2
_LSAPI_FinalizeRespHeaders_r:           ; @LSAPI_FinalizeRespHeaders_r
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	w9, [x19]
Lloh0:
	adrp	x10, _LSAPI_ST_RESP_HEADER@GOTPAGE
Lloh1:
	ldr	x10, [x10, _LSAPI_ST_RESP_HEADER@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.3:
	bic	w9, w9, w10
	str	w9, [x19]
	ldp	x9, x10, [x19, #8]
	subs	x9, x9, x10
	b.le	LBB0_7
; %bb.4:
	ldr	x11, [x19, #56]
	stp	x9, x10, [x11]
	ldr	w10, [x19, #24]
	add	w9, w10, w9
	add	x10, x11, #16
	str	x10, [x19, #56]
	b	LBB0_8
LBB0_5:
	mov	w0, #-1
	b	LBB0_9
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
	ldr	w9, [x19, #24]
LBB0_8:
	add	x20, x19, #48
	ldr	w10, [x19, #52]
	lsl	w10, w10, #1
	add	w10, w10, #4
	str	w10, [x8]
	add	w2, w9, w10
	str	w2, [x19, #24]
Lloh3:
	adrp	x8, _LSAPI_RESP_HEADER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LSAPI_RESP_HEADER@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_lsapi_buildPacketHeader
	mov	w0, #0
	ldr	x8, [x19, #32]
	str	x20, [x8, #8]
	str	x8, [x19, #40]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_LSAPI_ST_RESP_HEADER,4,2       ; @LSAPI_ST_RESP_HEADER
	.comm	_LSAPI_RESP_HEADER,4,2          ; @LSAPI_RESP_HEADER
.subsections_via_symbols
