	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shutdown_ssl
_shutdown_ssl:                          ## @shutdown_ssl
	.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
	subq	$152, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	testq	%rsi, %rsi
	jne	LBB0_3
## %bb.1:
	cmpq	$0, 8(%r14)
	je	LBB0_4
## %bb.2:
	movq	$0, 8(%r14)
LBB0_3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_dispose_socket
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_21
## %bb.16:
	addq	$152, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	(%r14), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_9
## %bb.5:
	leaq	-168(%rbp), %r15
	leaq	-160(%rbp), %rsi
	movq	%r15, %rdi
	movl	$128, %edx
	callq	_ptls_buffer_init
	movq	(%r14), %rax
	movq	16(%rax), %rdi
	movq	_PTLS_ALERT_LEVEL_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PTLS_ALERT_CLOSE_NOTIFY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rsi
	callq	_ptls_send_alert
	testl	%eax, %eax
	jne	LBB0_3
## %bb.6:
	movl	-168(%rbp), %edx
	movl	-164(%rbp), %esi
	movq	%r14, %rdi
	callq	_write_ssl_bytes
	leaq	-168(%rbp), %rdi
	callq	_ptls_buffer_dispose
	movq	(%r14), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_3
## %bb.7:
	movq	%r14, %rdi
	callq	_h2o_socket_read_stop
	jmp	LBB0_8
LBB0_9:
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.10:
	xorl	%eax, %eax
	callq	_ERR_clear_error
	movq	(%r14), %rax
	movq	(%rax), %rdi
	callq	_SSL_shutdown
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.11:
	movl	%eax, %r15d
	movq	(%r14), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_17
## %bb.12:
	movq	%r14, %rdi
	callq	_h2o_socket_read_stop
	cmpl	$1, %r15d
	jne	LBB0_13
LBB0_8:
	movq	_dispose_socket@GOTPCREL(%rip), %rsi
LBB0_14:
	movq	%r14, %rdi
	callq	_flush_pending_ssl
	jmp	LBB0_15
LBB0_17:
	cmpl	$2, %r15d
	jne	LBB0_3
## %bb.18:
	movq	(%rax), %rdi
	movl	$2, %esi
	callq	_SSL_get_error
	movq	_SSL_ERROR_WANT_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	leaq	_shutdown_ssl(%rip), %rsi
	movq	%r14, %rdi
	addq	$152, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_h2o_socket_read_start          ## TAILCALL
LBB0_13:
	leaq	_shutdown_ssl(%rip), %rsi
	jmp	LBB0_14
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PTLS_ALERT_LEVEL_WARNING,4,2   ## @PTLS_ALERT_LEVEL_WARNING
	.comm	_PTLS_ALERT_CLOSE_NOTIFY,4,2    ## @PTLS_ALERT_CLOSE_NOTIFY
	.comm	_SSL_ERROR_WANT_READ,8,3        ## @SSL_ERROR_WANT_READ
	.no_dead_strip	_shutdown_ssl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shutdown_ssl
_shutdown_ssl:                          ; @shutdown_ssl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	cbnz	x1, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.2:
	str	xzr, [x19, #8]
LBB0_3:
	mov	x0, x19
	mov	x1, x20
	bl	_dispose_socket
LBB0_4:
	ldur	x8, [x29, #-40]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.5:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_6:
	ldr	x8, [x19]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_10
; %bb.7:
	mov	x0, sp
	add	x1, sp, #8
	mov	w2, #128
	bl	_ptls_buffer_init
	ldr	x8, [x19]
	ldr	x0, [x8, #16]
Lloh6:
	adrp	x8, _PTLS_ALERT_LEVEL_WARNING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PTLS_ALERT_LEVEL_WARNING@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _PTLS_ALERT_CLOSE_NOTIFY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PTLS_ALERT_CLOSE_NOTIFY@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x1, sp
	bl	_ptls_send_alert
	cbnz	w0, LBB0_3
; %bb.8:
	ldp	w2, w1, [sp]
	mov	x0, x19
	bl	_write_ssl_bytes
	mov	x0, sp
	bl	_ptls_buffer_dispose
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_3
; %bb.9:
	mov	x0, x19
	bl	_h2o_socket_read_stop
	b	LBB0_14
LBB0_10:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.11:
	bl	_ERR_clear_error
	ldr	x8, [x19]
	ldr	x0, [x8]
	bl	_SSL_shutdown
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.12:
	mov	x21, x0
	ldr	x8, [x19]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_16
; %bb.13:
	mov	x0, x19
	bl	_h2o_socket_read_stop
	cmp	w21, #1
	b.ne	LBB0_20
LBB0_14:
Lloh12:
	adrp	x1, _dispose_socket@GOTPAGE
Lloh13:
	ldr	x1, [x1, _dispose_socket@GOTPAGEOFF]
LBB0_15:
	mov	x0, x19
	bl	_flush_pending_ssl
	b	LBB0_4
LBB0_16:
	cmp	w21, #2
	b.ne	LBB0_3
; %bb.17:
	ldr	x0, [x8]
	mov	w1, #2
	bl	_SSL_get_error
Lloh14:
	adrp	x8, _SSL_ERROR_WANT_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SSL_ERROR_WANT_READ@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.18:
	ldur	x8, [x29, #-40]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.19:
Lloh20:
	adrp	x1, _shutdown_ssl@PAGE
Lloh21:
	add	x1, x1, _shutdown_ssl@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #192
	b	_h2o_socket_read_start
LBB0_20:
Lloh22:
	adrp	x1, _shutdown_ssl@PAGE
Lloh23:
	add	x1, x1, _shutdown_ssl@PAGEOFF
	b	LBB0_15
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PTLS_ALERT_LEVEL_WARNING,4,2   ; @PTLS_ALERT_LEVEL_WARNING
	.comm	_PTLS_ALERT_CLOSE_NOTIFY,4,2    ; @PTLS_ALERT_CLOSE_NOTIFY
	.comm	_SSL_ERROR_WANT_READ,8,3        ; @SSL_ERROR_WANT_READ
	.no_dead_strip	_shutdown_ssl
.subsections_via_symbols
