	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_close
_test_close:                            ## @test_close
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_test_closeed_by_peer@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_quic_ctx@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	-56(%rbp), %rax
	movq	%rax, (%rcx)
	movq	_client@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rax, %r14
	movl	$12345, %edi                    ## imm = 0x3039
	callq	_QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_quicly_close
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ok
	movq	(%r14), %rdi
	callq	_quicly_get_state
	movq	_QUICLY_STATE_CLOSING@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_ok
	movq	(%r14), %rdi
	callq	_quicly_get_first_timeout
	movq	_quic_now@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	movq	%rcx, %r15
	setle	%dil
	callq	_ok
	movq	$1, -48(%rbp)
	movq	(%r14), %rdi
	movq	%r14, %rbx
	leaq	-80(%rbp), %r14
	leaq	-48(%rbp), %rdx
	movq	%r14, %rsi
	callq	_quicly_send
	xorl	%edi, %edi
	cmpq	$1, -48(%rbp)
	sete	%dil
	callq	_assert
	movq	(%rbx), %rdi
	callq	_quicly_get_first_timeout
	movq	%rax, %r12
	movq	(%r15), %rax
	movq	%r15, %r13
	cmpq	%r12, %rax
	setl	%cl
	addq	$1000, %rax                     ## imm = 0x3E8
	cmpq	%rax, %r12
	setl	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_ok
	leaq	-68(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r14, %r15
	movl	$1, %edx
	callq	_decode_packets
	movq	_server@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movq	_fake_address@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	movq	%rbx, %rcx
	callq	_quicly_receive
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ok
	movq	_test_close_error_code@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	$12345, (%rax)                  ## imm = 0x3039
	sete	%dil
	callq	_ok
	movq	(%r14), %rdi
	callq	_quicly_get_state
	movq	_QUICLY_STATE_DRAINING@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_ok
	movq	(%r14), %rdi
	callq	_quicly_get_first_timeout
	movq	%rax, %rbx
	movq	(%r13), %rax
	cmpq	%rbx, %rax
	setl	%cl
	addq	$1000, %rax                     ## imm = 0x3E8
	cmpq	%rax, %rbx
	setl	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_ok
	movq	$1, -48(%rbp)
	movq	(%r14), %rdi
	movq	%r15, %r13
	movq	%r15, %rsi
	leaq	-48(%rbp), %r15
	movq	%r15, %rdx
	callq	_quicly_send
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ok
	xorl	%edi, %edi
	cmpq	$0, -48(%rbp)
	sete	%dil
	callq	_ok
	cmpq	%rbx, %r12
	cmovgq	%r12, %rbx
	movq	_quic_now@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	$1, -48(%rbp)
	movq	_client@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_quicly_send
	movq	_QUICLY_ERROR_FREE_CONNECTION@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	cmpl	(%r12), %eax
	sete	%dil
	callq	_ok
	movq	(%rbx), %rdi
	callq	_quicly_free
	movq	$1, -48(%rbp)
	movq	(%r14), %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_quicly_send
	xorl	%edi, %edi
	cmpl	(%r12), %eax
	sete	%dil
	callq	_ok
	movq	(%r14), %rdi
	callq	_quicly_free
	movq	$0, (%rbx)
	movq	$0, (%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	_quic_ctx@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_test_closeed_by_peer,4,2       ## @test_closeed_by_peer
	.comm	_quic_ctx,8,3                   ## @quic_ctx
	.comm	_client,8,3                     ## @client
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"good bye"

	.comm	_QUICLY_STATE_CLOSING,8,3       ## @QUICLY_STATE_CLOSING
	.comm	_quic_now,8,3                   ## @quic_now
	.comm	_server,8,3                     ## @server
	.comm	_fake_address,4,2               ## @fake_address
	.comm	_test_close_error_code,4,2      ## @test_close_error_code
	.comm	_QUICLY_STATE_DRAINING,8,3      ## @QUICLY_STATE_DRAINING
	.comm	_QUICLY_ERROR_FREE_CONNECTION,4,2 ## @QUICLY_ERROR_FREE_CONNECTION
	.no_dead_strip	_test_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_close
_test_close:                            ; @test_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x8, _test_closeed_by_peer@GOTPAGE
Lloh1:
	ldr	x8, [x8, _test_closeed_by_peer@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh3:
	adrp	x21, _quic_ctx@GOTPAGE
Lloh4:
	ldr	x21, [x21, _quic_ctx@GOTPAGEOFF]
	ldr	x22, [x21]
	add	x8, sp, #24
	str	x8, [x21]
Lloh5:
	adrp	x23, _client@GOTPAGE
Lloh6:
	ldr	x23, [x23, _client@GOTPAGEOFF]
	ldr	x19, [x23]
	mov	w20, #12345
	mov	w0, #12345
	bl	_QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE
	mov	x1, x0
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_quicly_close
	cmp	w0, #0
	cset	w0, eq
	bl	_ok
	ldr	x0, [x23]
	bl	_quicly_get_state
Lloh9:
	adrp	x8, _QUICLY_STATE_CLOSING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _QUICLY_STATE_CLOSING@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
	bl	_ok
	ldr	x0, [x23]
	bl	_quicly_get_first_timeout
Lloh12:
	adrp	x25, _quic_now@GOTPAGE
Lloh13:
	ldr	x25, [x25, _quic_now@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	cset	w0, le
	bl	_ok
	mov	w24, #1
	str	x24, [sp, #8]
	ldr	x0, [x23]
	add	x1, sp, #16
	add	x2, sp, #8
	bl	_quicly_send
	ldr	x8, [sp, #8]
	cmp	x8, #1
	cset	w0, eq
	bl	_assert
	ldr	x0, [x23]
	bl	_quicly_get_first_timeout
	mov	x19, x0
	ldr	x8, [x25]
	cmp	x8, x0
	add	x8, x8, #1000
	ccmp	x0, x8, #0, lt
	cset	w0, lt
	bl	_ok
	add	x0, sp, #4
	add	x1, sp, #16
	mov	w2, #1
	bl	_decode_packets
Lloh14:
	adrp	x26, _server@GOTPAGE
Lloh15:
	ldr	x26, [x26, _server@GOTPAGEOFF]
	ldr	x0, [x26]
Lloh16:
	adrp	x2, _fake_address@GOTPAGE
Lloh17:
	ldr	x2, [x2, _fake_address@GOTPAGEOFF]
	add	x3, sp, #4
	mov	x1, #0
	bl	_quicly_receive
	cmp	w0, #0
	cset	w0, eq
	bl	_ok
Lloh18:
	adrp	x8, _test_close_error_code@GOTPAGE
Lloh19:
	ldr	x8, [x8, _test_close_error_code@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, w20
	cset	w0, eq
	bl	_ok
	ldr	x0, [x26]
	bl	_quicly_get_state
Lloh21:
	adrp	x8, _QUICLY_STATE_DRAINING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _QUICLY_STATE_DRAINING@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, eq
	bl	_ok
	ldr	x0, [x26]
	bl	_quicly_get_first_timeout
	mov	x20, x0
	ldr	x8, [x25]
	cmp	x8, x0
	add	x8, x8, #1000
	ccmp	x0, x8, #0, lt
	cset	w0, lt
	bl	_ok
	str	x24, [sp, #8]
	ldr	x0, [x26]
	add	x1, sp, #16
	add	x2, sp, #8
	bl	_quicly_send
	cmp	w0, #0
	cset	w0, eq
	bl	_ok
	ldr	x8, [sp, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_ok
	cmp	x19, x20
	csel	x8, x19, x20, gt
	str	x8, [x25]
	str	x24, [sp, #8]
	ldr	x0, [x23]
	add	x1, sp, #16
	add	x2, sp, #8
	bl	_quicly_send
Lloh24:
	adrp	x19, _QUICLY_ERROR_FREE_CONNECTION@GOTPAGE
Lloh25:
	ldr	x19, [x19, _QUICLY_ERROR_FREE_CONNECTION@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w0, w8
	cset	w0, eq
	bl	_ok
	ldr	x0, [x23]
	bl	_quicly_free
	str	x24, [sp, #8]
	ldr	x0, [x26]
	add	x1, sp, #16
	add	x2, sp, #8
	bl	_quicly_send
	ldr	w8, [x19]
	cmp	w0, w8
	cset	w0, eq
	bl	_ok
	ldr	x0, [x26]
	bl	_quicly_free
	str	xzr, [x23]
	str	xzr, [x26]
	str	x22, [x21]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_test_closeed_by_peer,4,2       ; @test_closeed_by_peer
	.comm	_quic_ctx,8,3                   ; @quic_ctx
	.comm	_client,8,3                     ; @client
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"good bye"

	.comm	_QUICLY_STATE_CLOSING,8,3       ; @QUICLY_STATE_CLOSING
	.comm	_quic_now,8,3                   ; @quic_now
	.comm	_server,8,3                     ; @server
	.comm	_fake_address,4,2               ; @fake_address
	.comm	_test_close_error_code,4,2      ; @test_close_error_code
	.comm	_QUICLY_STATE_DRAINING,8,3      ; @QUICLY_STATE_DRAINING
	.comm	_QUICLY_ERROR_FREE_CONNECTION,4,2 ; @QUICLY_ERROR_FREE_CONNECTION
	.no_dead_strip	_test_close
.subsections_via_symbols
