	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtmp_server_handshake
_rtmp_server_handshake:                 ## @rtmp_server_handshake
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RTMP_HANDSHAKE_PACKET_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	$0, -72(%rbp)
	movl	(%r12), %edi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_ffurl_read_complete
	testl	%eax, %eax
	jle	LBB0_1
## %bb.3:
	cmpl	$3, (%r14)
	jne	LBB0_4
## %bb.5:
	movl	(%r12), %edi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_ffurl_write
	testq	%rax, %rax
	jle	LBB0_6
## %bb.7:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rcx
	movq	_RTMP_HANDSHAKE_PACKET_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	leaq	-80(%rbp), %rsi
	leaq	-104(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rcx, %r13
	callq	_rtmp_receive_hs_packet
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_22
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_2
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_2
LBB0_6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_2:
	movq	%r15, %rdi
	callq	_av_log
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r15d
LBB0_23:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.24:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	_RTMP_HANDSHAKE_PACKET_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	cmpl	$9, %r8d
	jl	LBB0_12
## %bb.10:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	32(%rax), %r15
	movl	$8, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_av_get_random_seed
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_AV_WB32
	movl	(%r13), %r8d
	addq	$16, %r15
	addl	$4, %ebx
	cmpl	%ebx, %r8d
	jg	LBB0_11
LBB0_12:
	movq	%r12, %rdi
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	xorl	%edx, %edx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_rtmp_send_hs_packet
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_22
LBB0_14:
	movq	-80(%rbp), %rsi
	movq	_RTMP_HANDSHAKE_PACKET_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r8d
	movq	%r12, %rdi
	xorl	%edx, %edx
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	callq	_rtmp_send_hs_packet
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_22
LBB0_16:
	movl	(%rbx), %r8d
	leaq	-72(%rbp), %rsi
	leaq	-104(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r14, %rcx
	callq	_rtmp_receive_hs_packet
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r15d
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.6(%rip), %rdx
	jmp	LBB0_22
LBB0_18:
	cmpq	%r13, -72(%rbp)
	je	LBB0_20
## %bb.19:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.7(%rip), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_log
LBB0_20:
	addq	$32, %r14
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	addq	$32, %rsi
	movl	(%rbx), %edx
	addl	$-8, %edx
	movq	%r14, %rdi
	callq	_memcmp
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.8(%rip), %rdx
LBB0_22:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_log
	jmp	LBB0_23
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RTMP_HANDSHAKE_PACKET_SIZE,4,2 ## @RTMP_HANDSHAKE_PACKET_SIZE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to read handshake\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"RTMP protocol version mismatch\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to write answer - RTMP S0\n"

L_.str.3:                               ## @.str.3
	.asciz	"RTMP Handshake C1 Error\n"

L_.str.4:                               ## @.str.4
	.asciz	"RTMP Handshake S1 Error\n"

L_.str.5:                               ## @.str.5
	.asciz	"RTMP Handshake S2 Error\n"

L_.str.6:                               ## @.str.6
	.asciz	"RTMP Handshake C2 Error\n"

	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.7:                               ## @.str.7
	.asciz	"Erroneous C2 Message epoch does not match up with C1 epoch\n"

L_.str.8:                               ## @.str.8
	.asciz	"Erroneous C2 Message random does not match up\n"

	.no_dead_strip	_rtmp_server_handshake
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtmp_server_handshake
_rtmp_server_handshake:                 ; @rtmp_server_handshake
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
	mov	x21, 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, #-88]
Lloh3:
	adrp	x26, _RTMP_HANDSHAKE_PACKET_SIZE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _RTMP_HANDSHAKE_PACKET_SIZE@GOTPAGEOFF]
	ldr	w8, [x26]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x20, x9, x12
	mov	sp, x20
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x23, x9, x12
	mov	sp, x23
	mov	x9, x8
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x22, x8, x12
	mov	sp, x22
	stur	xzr, [x29, #-112]
	ldr	w0, [x1]
	mov	x1, x20
	mov	w2, #1
	bl	_ffurl_read_complete
	cmp	w0, #0
	b.le	LBB0_5
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #3
	b.ne	LBB0_6
; %bb.2:
	ldr	w0, [x21]
	mov	x1, x20
	mov	w2, #1
	bl	_ffurl_write
	cmp	x0, #0
	b.le	LBB0_7
; %bb.3:
	ldr	w4, [x26]
	sub	x1, x29, #96
	sub	x2, x29, #104
	mov	x0, x21
	mov	x3, x23
	bl	_rtmp_receive_hs_packet
	cbz	w0, LBB0_11
; %bb.4:
	mov	x25, x0
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str.3@PAGE
Lloh15:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_5:
Lloh16:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh21:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str.1@PAGE
Lloh25:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh26:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_av_log
Lloh31:
	adrp	x8, _EIO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x25, x0
LBB0_9:
	ldur	x8, [x29, #-88]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.10:
	mov	x0, x25
	sub	sp, x29, #80
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldur	x24, [x29, #-96]
	ldr	w4, [x26]
	cmp	w4, #9
	b.lt	LBB0_14
; %bb.12:
	add	x25, x22, #32
	mov	w27, #8
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	bl	_av_get_random_seed
	mov	x1, x0
	mov	x0, x25
	bl	_AV_WB32
	ldr	w4, [x26]
	add	x25, x25, #16
	add	w27, w27, #4
	cmp	w4, w27
	b.gt	LBB0_13
LBB0_14:
	mov	x0, x21
	mov	x1, x24
	mov	w2, #0
	mov	x3, x22
	bl	_rtmp_send_hs_packet
	cbz	w0, LBB0_16
; %bb.15:
	mov	x25, x0
Lloh37:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh38:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
Lloh40:
	adrp	x2, l_.str.4@PAGE
Lloh41:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_20
LBB0_16:
	ldur	x1, [x29, #-96]
	ldr	w4, [x26]
	mov	x0, x21
	mov	w2, #0
	mov	x3, x23
	bl	_rtmp_send_hs_packet
	cbz	w0, LBB0_18
; %bb.17:
	mov	x25, x0
Lloh42:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh43:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
Lloh45:
	adrp	x2, l_.str.5@PAGE
Lloh46:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_20
LBB0_18:
	ldr	w4, [x26]
	sub	x1, x29, #112
	sub	x2, x29, #104
	mov	x0, x21
	mov	x3, x20
	bl	_rtmp_receive_hs_packet
	cbz	w0, LBB0_21
; %bb.19:
	mov	x25, x0
Lloh47:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
Lloh50:
	adrp	x2, l_.str.6@PAGE
Lloh51:
	add	x2, x2, l_.str.6@PAGEOFF
LBB0_20:
	mov	x0, x19
	bl	_av_log
	b	LBB0_9
LBB0_21:
	ldur	x8, [x29, #-112]
Lloh52:
	adrp	x21, _AV_LOG_WARNING@GOTPAGE
Lloh53:
	ldr	x21, [x21, _AV_LOG_WARNING@GOTPAGEOFF]
	cmp	x8, x24
	b.eq	LBB0_23
; %bb.22:
	ldr	w1, [x21]
Lloh54:
	adrp	x2, l_.str.7@PAGE
Lloh55:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_23:
	add	x0, x20, #32
	add	x1, x22, #32
	ldr	w8, [x26]
	sub	w2, w8, #8
	bl	_memcmp
	cbz	x0, LBB0_25
; %bb.24:
	ldr	w1, [x21]
Lloh56:
	adrp	x2, l_.str.8@PAGE
Lloh57:
	add	x2, x2, l_.str.8@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_25:
	mov	w25, #0
	b	LBB0_9
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_RTMP_HANDSHAKE_PACKET_SIZE,4,2 ; @RTMP_HANDSHAKE_PACKET_SIZE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to read handshake\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"RTMP protocol version mismatch\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to write answer - RTMP S0\n"

l_.str.3:                               ; @.str.3
	.asciz	"RTMP Handshake C1 Error\n"

l_.str.4:                               ; @.str.4
	.asciz	"RTMP Handshake S1 Error\n"

l_.str.5:                               ; @.str.5
	.asciz	"RTMP Handshake S2 Error\n"

l_.str.6:                               ; @.str.6
	.asciz	"RTMP Handshake C2 Error\n"

	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.7:                               ; @.str.7
	.asciz	"Erroneous C2 Message epoch does not match up with C1 epoch\n"

l_.str.8:                               ; @.str.8
	.asciz	"Erroneous C2 Message random does not match up\n"

	.no_dead_strip	_rtmp_server_handshake
.subsections_via_symbols
