	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_decode_ssl_input               ## -- Begin function decode_ssl_input
	.p2align	4, 0x90
_decode_ssl_input:                      ## @decode_ssl_input
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	xorl	%edi, %edi
	cmpq	$0, 8(%r15)
	setne	%dil
	callq	_assert
	movq	8(%r15), %rax
	xorl	%edi, %edi
	cmpq	$0, 32(%rax)
	sete	%dil
	callq	_assert
	movq	8(%r15), %rcx
	cmpq	$0, 24(%rcx)
	je	LBB0_1
## %bb.6:
	movq	16(%rcx), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	je	LBB0_28
## %bb.7:
	movq	8(%rax), %rbx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_h2o_buffer_try_reserve
	movq	_h2o_socket_error_out_of_memory@GOTPCREL(%rip), %rcx
	testq	%rdx, %rdx
	je	LBB0_21
## %bb.8:
	addq	%rbx, %r12
	leaq	-56(%rbp), %rdi
	movq	%rdx, %rsi
	movq	%rax, %rdx
	callq	_ptls_buffer_init
	leaq	-64(%rbp), %r13
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rax
	subq	%rbx, %rax
	movq	%rax, -64(%rbp)
	movq	8(%r15), %rax
	movq	24(%rax), %rdi
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdx
	movq	%r13, %rcx
	callq	_ptls_receive
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-64(%rbp), %rax
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_9 Depth=1
	xorl	%eax, %eax
LBB0_12:                                ##   in Loop: Header=BB0_9 Depth=1
	addq	%rax, %rbx
	testl	%r14d, %r14d
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpq	%r12, %rbx
	jne	LBB0_9
LBB0_14:
	movq	8(%r15), %rdi
	movq	16(%rdi), %rax
	addq	$16, %rdi
	subl	%r12d, %ebx
	addl	(%rax), %ebx
	movl	%ebx, %esi
	callq	_h2o_buffer_consume
	cmpq	$0, -48(%rbp)
	movl	-56(%rbp), %esi
	je	LBB0_17
## %bb.15:
	movq	%r15, %rdi
	callq	_h2o_buffer_try_reserve
	testq	%rdx, %rdx
	movq	_h2o_socket_error_out_of_memory@GOTPCREL(%rip), %rcx
	je	LBB0_21
## %bb.16:
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %esi
	movq	%rdx, %rdi
	movl	%eax, %edx
	callq	_memcpy
	movl	-56(%rbp), %eax
	movq	(%r15), %rcx
	addl	%eax, (%rcx)
	leaq	-56(%rbp), %rdi
	callq	_ptls_buffer_dispose
	testl	%r14d, %r14d
	jne	LBB0_19
	jmp	LBB0_28
LBB0_1:
	leaq	-56(%rbp), %r13
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rcx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%rcx), %edi
	callq	_SSL_pending
	testq	%rax, %rax
	je	LBB0_28
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_h2o_buffer_try_reserve
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.22:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r12
	movq	%rdx, %rbx
	movl	$0, -56(%rbp)
	movq	8(%r15), %rax
	movq	%r13, (%rax)
	xorl	%eax, %eax
	callq	_ERR_clear_error
	movq	8(%r15), %rax
	movl	8(%rax), %edi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	callq	_SSL_read
	movq	8(%r15), %rcx
	movq	$0, (%rcx)
	cmpl	$0, -56(%rbp)
	jne	LBB0_29
## %bb.23:                              ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	je	LBB0_28
## %bb.24:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, %eax
	je	LBB0_25
## %bb.27:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rdx
	addl	%eax, (%rdx)
	jmp	LBB0_2
LBB0_17:
	movq	(%r15), %rax
	addl	%esi, (%rax)
	testl	%r14d, %r14d
	je	LBB0_28
LBB0_19:
	movq	_PTLS_ERROR_IN_PROGRESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_28
## %bb.20:
	movq	_h2o_socket_error_ssl_decode@GOTPCREL(%rip), %rcx
LBB0_21:
	movq	(%rcx), %r14
	jmp	LBB0_29
LBB0_5:
	movq	_h2o_socket_error_out_of_memory@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	jmp	LBB0_29
LBB0_25:
	movl	8(%rcx), %edi
	movl	$-1, %esi
	callq	_SSL_get_error
	movq	_SSL_ERROR_WANT_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_26
LBB0_28:
	xorl	%r14d, %r14d
LBB0_29:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	_h2o_socket_error_ssl_decode@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_h2o_socket_error_out_of_memory,8,3 ## @h2o_socket_error_out_of_memory
	.comm	_PTLS_ERROR_IN_PROGRESS,4,2     ## @PTLS_ERROR_IN_PROGRESS
	.comm	_h2o_socket_error_ssl_decode,8,3 ## @h2o_socket_error_ssl_decode
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ssl renegotiation not supported"

	.comm	_SSL_ERROR_WANT_READ,8,3        ## @SSL_ERROR_WANT_READ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_decode_ssl_input               ; -- Begin function decode_ssl_input
	.p2align	2
_decode_ssl_input:                      ; @decode_ssl_input
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	x8, [x0, #8]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #32]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19, #8]
	ldr	x9, [x8, #24]
	cbz	x9, LBB0_8
; %bb.1:
	ldr	x8, [x8, #16]
	ldr	x20, [x8]
	cbz	x20, LBB0_22
; %bb.2:
	ldr	x21, [x8, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_h2o_buffer_try_reserve
	cbz	x1, LBB0_16
; %bb.3:
	mov	x2, x0
	add	x22, x21, x20
	add	x0, sp, #16
	bl	_ptls_buffer_init
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x22, x21
	str	x8, [sp, #8]
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #24]
	add	x1, sp, #16
	add	x3, sp, #8
	mov	x2, x21
	bl	_ptls_receive
	ldr	x8, [sp, #8]
	cmp	w0, #0
	csel	x8, x8, xzr, eq
	add	x21, x21, x8
	ccmp	x21, x22, #4, eq
	b.ne	LBB0_4
; %bb.5:
	mov	x20, x0
	ldr	x0, [x19, #8]
	ldr	x8, [x0, #16]!
	ldr	w8, [x8]
	sub	w9, w21, w22
	add	w1, w9, w8
	bl	_h2o_buffer_consume
	ldr	x8, [sp, #24]
	ldr	w1, [sp, #16]
	cbz	x8, LBB0_17
; %bb.6:
	mov	x0, x19
	bl	_h2o_buffer_try_reserve
	cbz	x1, LBB0_16
; %bb.7:
	ldp	w2, w8, [sp, #16]
	mov	x0, x1
	mov	x1, x8
	bl	_memcpy
	ldr	w8, [sp, #16]
	ldr	x9, [x19]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
	add	x0, sp, #16
	bl	_ptls_buffer_dispose
	b	LBB0_18
LBB0_8:
	add	x23, sp, #16
Lloh0:
	adrp	x20, l_.str@PAGE
Lloh1:
	add	x20, x20, l_.str@PAGEOFF
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8, #16]
	ldr	x9, [x9]
	cbnz	x9, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x8, #8]
	bl	_SSL_pending
	cbz	x0, LBB0_19
LBB0_11:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	mov	w1, #4096
	bl	_h2o_buffer_try_reserve
	cbz	x1, LBB0_16
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x21, x0
	mov	x22, x1
	str	wzr, [sp, #16]
	ldr	x8, [x19, #8]
	str	x23, [x8]
	bl	_ERR_clear_error
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #8]
	mov	x1, x22
	mov	x2, x21
	bl	_SSL_read
	ldr	x8, [x19, #8]
	str	xzr, [x8]
	ldr	w9, [sp, #16]
	cbnz	w9, LBB0_22
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	cbz	w0, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
	cmn	w0, #1
	b.eq	LBB0_20
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x9, [x19]
	ldr	w10, [x9]
	add	w10, w10, w0
	str	w10, [x9]
	b	LBB0_9
LBB0_16:
Lloh2:
	adrp	x8, _h2o_socket_error_out_of_memory@GOTPAGE
Lloh3:
	ldr	x8, [x8, _h2o_socket_error_out_of_memory@GOTPAGEOFF]
Lloh4:
	ldr	x20, [x8]
	b	LBB0_22
LBB0_17:
	ldr	x8, [x19]
	ldr	w9, [x8]
	add	w9, w9, w1
	str	w9, [x8]
LBB0_18:
Lloh5:
	adrp	x8, _PTLS_ERROR_IN_PROGRESS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PTLS_ERROR_IN_PROGRESS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w20, #0
	ccmp	w20, w8, #4, ne
	b.ne	LBB0_21
LBB0_19:
	mov	x20, #0
	b	LBB0_22
LBB0_20:
	ldr	w0, [x8, #8]
	mov	w1, #-1
	bl	_SSL_get_error
Lloh8:
	adrp	x8, _SSL_ERROR_WANT_READ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SSL_ERROR_WANT_READ@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_19
LBB0_21:
Lloh11:
	adrp	x8, _h2o_socket_error_ssl_decode@GOTPAGE
Lloh12:
	ldr	x8, [x8, _h2o_socket_error_ssl_decode@GOTPAGEOFF]
Lloh13:
	ldr	x20, [x8]
LBB0_22:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_h2o_socket_error_out_of_memory,8,3 ; @h2o_socket_error_out_of_memory
	.comm	_PTLS_ERROR_IN_PROGRESS,4,2     ; @PTLS_ERROR_IN_PROGRESS
	.comm	_h2o_socket_error_ssl_decode,8,3 ; @h2o_socket_error_ssl_decode
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ssl renegotiation not supported"

	.comm	_SSL_ERROR_WANT_READ,8,3        ; @SSL_ERROR_WANT_READ
.subsections_via_symbols
