	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepare_for_latency_optimized_write
_prepare_for_latency_optimized_write:   ## @prepare_for_latency_optimized_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
	movq	%rdi, %rbx
	movq	24(%rbp), %r15
	imull	$1000, (%rsi), %eax             ## imm = 0x3E8
	cmpl	%edx, %eax
	jg	LBB0_12
## %bb.1:
	imull	4(%rsi), %edx
	imull	$100000, 16(%rbp), %eax         ## imm = 0x186A0
	cmpl	%eax, %edx
	jge	LBB0_2
LBB0_12:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_disable_latency_optimized_write ## TAILCALL
LBB0_2:
	movl	%ecx, %r12d
	movq	_H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	imull	%ecx, %r8d
	movl	(%rbx), %eax
	cmpl	8(%rsi), %r8d
	jge	LBB0_7
## %bb.3:
	movl	%r9d, %r14d
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_calc_suggested_tls_payload_size
	movl	%eax, 4(%rbx)
	imull	%eax, %r14d
	movl	%r14d, 8(%rbx)
	jmp	LBB0_11
LBB0_7:
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	*%r15
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movl	$0, (%rbx)
LBB0_10:
	movl	$16384, 4(%rbx)                 ## imm = 0x4000
	movq	_SIZE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	*%r15
	testl	%eax, %eax
	jne	LBB0_12
## %bb.5:
	movl	$1, (%rbx)
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED,4,2 ## @H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED
	.comm	_SIZE_MAX,4,2                   ## @SIZE_MAX
	.no_dead_strip	_prepare_for_latency_optimized_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepare_for_latency_optimized_write
_prepare_for_latency_optimized_write:   ; @prepare_for_latency_optimized_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x7
	mov	x19, x0
	ldr	w8, [x1]
	mov	w9, #1000
	mul	w8, w8, w9
	cmp	w8, w2
	b.gt	LBB0_2
; %bb.1:
	ldr	w8, [x1, #4]
	mul	w8, w8, w2
	mov	w9, #34464
	movk	w9, #1, lsl #16
	mul	w9, w6, w9
	cmp	w8, w9
	b.ge	LBB0_3
LBB0_2:
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_disable_latency_optimized_write
LBB0_3:
	mov	x22, x3
Lloh0:
	adrp	x8, _H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #12]
	mul	w9, w4, w3
	ldr	w10, [x1, #8]
	ldr	w8, [x19]
	cmp	w9, w10
	b.ge	LBB0_6
; %bb.4:
	mov	x21, x5
	cbz	w8, LBB0_11
LBB0_5:
	mov	x0, x19
	mov	x1, x22
	bl	_calc_suggested_tls_payload_size
	mul	w8, w0, w21
	stp	w0, w8, [x19, #4]
	b	LBB0_10
LBB0_6:
	cbz	w8, LBB0_9
; %bb.7:
	mov	x0, x19
	mov	w1, #0
	blr	x20
	cbnz	w0, LBB0_2
; %bb.8:
	str	wzr, [x19]
LBB0_9:
	mov	w8, #16384
Lloh3:
	adrp	x9, _SIZE_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SIZE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #4]
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	w23, #1
	mov	x0, x19
	mov	w1, #1
	blr	x20
	cbnz	w0, LBB0_2
; %bb.12:
	str	w23, [x19]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED,4,2 ; @H2O_SOCKET_LATENCY_OPTIMIZATION_STATE_DETERMINED
	.comm	_SIZE_MAX,4,2                   ; @SIZE_MAX
	.no_dead_strip	_prepare_for_latency_optimized_write
.subsections_via_symbols
