	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msg_constructor_add            ## -- Begin function msg_constructor_add
	.p2align	4, 0x90
_msg_constructor_add:                   ## @msg_constructor_add
	.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	%r8, %r14
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r12
	movl	%esi, -44(%rbp)
	movl	%esi, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	leal	(%rbx,%r13), %r15d
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_add_force_confirm
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_msg_is_dup
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	4(%r14), %r8d
	movl	8(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$1, %edi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_vkprintf
	movq	%r12, %rdi
	callq	_rwm_free
	jmp	LBB0_11
LBB0_2:
	movq	%r12, %rbx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_add_received
	movl	(%r14), %edi
	leaq	-44(%rbp), %rsi
	callq	_tree_lookup_value_udp_msg_constructor
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%rax), %r13
	jmp	LBB0_5
LBB0_4:
	leal	(,%r12,4), %r15d
	leal	24(,%r12,4), %edi
	callq	_malloc
	movq	%rax, %r13
	movl	-44(%rbp), %eax
	movl	%eax, (%r13)
	movl	%r12d, 4(%r13)
	movl	%r12d, 8(%r13)
	movq	16(%r13), %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movl	(%r14), %r15d
	xorl	%eax, %eax
	callq	_lrand48
	movl	%r15d, %edi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_tree_insert_udp_msg_constructor
	movl	%eax, (%r14)
LBB0_5:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%r13), %rax
	movslq	%ecx, %rcx
	movl	(%rbx), %edx
	movl	%edx, (%rax,%rcx,4)
	movl	8(%r13), %ecx
	decl	%ecx
	movl	%ecx, 8(%r13)
	movl	-44(%rbp), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_vkprintf
	cmpl	$0, 8(%r13)
	jne	LBB0_11
## %bb.6:
	movq	16(%r13), %r15
	cmpl	$2, 4(%r13)
	jl	LBB0_10
## %bb.7:
	movl	4(%r15), %edi
	callq	_assert
	movq	16(%r13), %rsi
	addq	$4, %rsi
	movq	%r15, %rdi
	callq	_rwm_union
	cmpl	$3, 4(%r13)
	jl	LBB0_10
## %bb.8:
	movl	$2, %ebx
	movl	$8, %r12d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_assert
	movq	16(%r13), %rsi
	addq	%r12, %rsi
	movq	%r15, %rdi
	callq	_rwm_union
	incq	%rbx
	movslq	4(%r13), %rax
	addq	$4, %r12
	cmpq	%rax, %rbx
	jl	LBB0_9
LBB0_10:
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_udp_msg_create
	movq	%rax, %r15
	movl	(%r14), %edi
	movq	%r13, %rsi
	callq	_tree_delete_udp_msg_constructor
	movl	%eax, (%r14)
	movq	%r13, %rdi
	callq	_free
LBB0_11:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"msg_is_dup: duplicate message %d. S->send_num = %d, S->max_confirmed = %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"packet_id = %d. %d parts left\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_msg_constructor_add            ; -- Begin function msg_constructor_add
	.p2align	2
_msg_constructor_add:                   ; @msg_constructor_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x4
	mov	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	str	w1, [sp, #12]
	mvn	w8, w1
	lsr	w0, w8, #31
	bl	_assert
	add	w24, w20, w22
	mov	x0, x19
	mov	x1, x24
	bl	_add_force_confirm
	mov	x0, x19
	mov	x1, x24
	bl	_msg_is_dup
	cbz	x0, LBB0_2
; %bb.1:
	ldp	w8, w3, [x19, #4]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x20
	bl	_vkprintf
	mov	x0, x21
	bl	_rwm_free
	mov	x21, #0
	b	LBB0_12
LBB0_2:
	mov	x0, x19
	mov	x1, x24
	bl	_add_received
	ldr	w0, [x19]
	add	x1, sp, #12
	bl	_tree_lookup_value_udp_msg_constructor
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x20, [x0]
	b	LBB0_5
LBB0_4:
	lsl	w24, w23, #2
	add	w0, w24, #24
	bl	_malloc
	mov	x20, x0
	ldr	w8, [sp, #12]
	stp	w8, w23, [x0]
	str	w23, [x0, #8]
	ldr	x0, [x0, #16]
	mov	w1, #0
	mov	x2, x24
	bl	_memset
	ldr	w23, [x19]
	bl	_lrand48
	mov	x2, x0
	mov	x0, x23
	mov	x1, x20
	bl	_tree_insert_udp_msg_constructor
	str	w0, [x19]
LBB0_5:
	ldr	x8, [x20, #16]
	ldr	w9, [x21]
	str	w9, [x8, w22, sxtw #2]
	ldr	w8, [x20, #8]
	sub	w3, w8, #1
	str	w3, [x20, #8]
	ldr	w2, [sp, #12]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_7
; %bb.6:
	mov	x21, #0
	b	LBB0_12
LBB0_7:
	ldr	x21, [x20, #16]
	ldr	w8, [x20, #4]
	cmp	w8, #2
	b.lt	LBB0_11
; %bb.8:
	ldr	w0, [x21, #4]
	bl	_assert
	ldr	x8, [x20, #16]
	add	x1, x8, #4
	mov	x0, x21
	bl	_rwm_union
	ldr	w8, [x20, #4]
	cmp	w8, #3
	b.lt	LBB0_11
; %bb.9:
	mov	w22, #2
	mov	w23, #8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldr	w0, [x8, x22, lsl #2]
	bl	_assert
	ldr	x8, [x20, #16]
	add	x1, x8, x23
	mov	x0, x21
	bl	_rwm_union
	add	x22, x22, #1
	ldrsw	x8, [x20, #4]
	add	x23, x23, #4
	cmp	x22, x8
	b.lt	LBB0_10
LBB0_11:
	ldr	w1, [sp, #12]
	mov	x0, x21
	mov	x2, x19
	bl	_udp_msg_create
	mov	x21, x0
	ldr	w0, [x19]
	mov	x1, x20
	bl	_tree_delete_udp_msg_constructor
	str	w0, [x19]
	mov	x0, x20
	bl	_free
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"msg_is_dup: duplicate message %d. S->send_num = %d, S->max_confirmed = %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"packet_id = %d. %d parts left\n"

.subsections_via_symbols
