	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rds_message_add_extension      ## -- Begin function rds_message_add_extension
	.p2align	4, 0x90
_rds_message_add_extension:             ## @rds_message_add_extension
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	(%rdi), %r15
	movb	(%r15), %bl
	movq	_RDS_EXTHDR_NONE@GOTPCREL(%rip), %r14
	xorl	%eax, %eax
	cmpb	(%r14), %bl
	jne	LBB0_5
## %bb.1:
	movq	___RDS_EXTHDR_MAX@GOTPCREL(%rip), %rdi
	cmpl	%esi, (%rdi)
	jbe	LBB0_5
## %bb.2:
	movq	_rds_exthdr_size@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movl	%esi, %ebx
	cmpl	%ecx, (%rdi,%rbx,4)
	jne	LBB0_5
## %bb.3:
	leal	4(%rcx), %edi
	movq	_RDS_HEADER_EXT_SPACE@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %edi
	jae	LBB0_5
## %bb.4:
	movl	%ecx, %ebx
	leaq	1(%r15), %rdi
	movb	%sil, (%r15)
	movq	%rdx, %rsi
	movl	%ecx, %edx
	callq	_memcpy
	movb	(%r14), %al
	movb	%al, 1(%r15,%rbx)
	movl	$1, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RDS_EXTHDR_NONE,1,0            ## @RDS_EXTHDR_NONE
	.comm	___RDS_EXTHDR_MAX,4,2           ## @__RDS_EXTHDR_MAX
	.comm	_rds_exthdr_size,8,3            ## @rds_exthdr_size
	.comm	_RDS_HEADER_EXT_SPACE,4,2       ## @RDS_HEADER_EXT_SPACE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rds_message_add_extension      ; -- Begin function rds_message_add_extension
	.p2align	2
_rds_message_add_extension:             ; @rds_message_add_extension
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x19, [x0]
	ldrb	w8, [x19]
Lloh0:
	adrp	x20, _RDS_EXTHDR_NONE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _RDS_EXTHDR_NONE@GOTPAGEOFF]
	ldrb	w9, [x20]
Lloh2:
	adrp	x10, ___RDS_EXTHDR_MAX@GOTPAGE
Lloh3:
	ldr	x10, [x10, ___RDS_EXTHDR_MAX@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w10, w1, #0, eq
	b.ls	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _rds_exthdr_size@GOTPAGE
Lloh6:
	ldr	x8, [x8, _rds_exthdr_size@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	w8, [x8, w1, uxtw #2]
	add	w9, w3, #4
Lloh8:
	adrp	x10, _RDS_HEADER_EXT_SPACE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _RDS_HEADER_EXT_SPACE@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w8, w3
	ccmp	w9, w10, #2, eq
	b.lo	LBB0_3
LBB0_2:
	mov	w0, #0
	b	LBB0_4
LBB0_3:
	mov	w21, w3
	strb	w1, [x19], #1
	mov	x0, x19
	mov	x1, x2
	mov	x2, x3
	bl	_memcpy
	ldrb	w8, [x20]
	strb	w8, [x19, x21]
	mov	w0, #1
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_RDS_EXTHDR_NONE,1,0            ; @RDS_EXTHDR_NONE
	.comm	___RDS_EXTHDR_MAX,4,2           ; @__RDS_EXTHDR_MAX
	.comm	_rds_exthdr_size,8,3            ; @rds_exthdr_size
	.comm	_RDS_HEADER_EXT_SPACE,4,2       ; @RDS_HEADER_EXT_SPACE
.subsections_via_symbols
