	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_bitsring
_encode_bitsring:                       ## @encode_bitsring
	.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	(%rdi), %r15
	movq	$0, -96(%rbp)
	movq	%rsi, %rax
	subq	%r15, %rax
	cmpq	$1, %rax
	jle	LBB0_33
## %bb.1:
	cmpb	$120, (%r15)
	jne	LBB0_33
## %bb.2:
	movq	%rcx, %r14
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	incq	%r15
	movsbl	(%r15), %edi
	callq	_isxdigit
	testl	%eax, %eax
	je	LBB0_33
## %bb.3:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	cmpq	%r13, %r15
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jae	LBB0_20
## %bb.4:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r12
	incq	%r12
	cmpq	%rdx, %r12
	jae	LBB0_20
## %bb.5:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movsbl	(%r15), %edi
	movl	$1, %r14d
	cmpl	$47, %edi
	je	LBB0_18
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$93, %edi
	je	LBB0_21
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rbx
	movslq	%edi, %r12
	testl	%eax, %eax
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	callq	_isdigit
	testl	%eax, %eax
	je	LBB0_33
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %r12
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	callq	_isxdigit
	testl	%eax, %eax
	je	LBB0_33
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	cmpl	$253, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jge	LBB0_33
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	shll	$4, %ecx
	movq	_digitvalue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addl	(%rax,%r12,4), %ecx
	addl	$4, %esi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	$4, %eax
	xorl	%r14d, %r14d
	cmpl	$8, %eax
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %r12
	jmp	LBB0_18
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rax
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	cmpb	$48, %r12b
	movq	%rbx, %r12
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jne	LBB0_18
	jmp	LBB0_33
LBB0_17:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %r12
	movb	%cl, (%rbx)
	incq	%r12
	xorl	%r14d, %r14d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r15
	cmpq	%r13, %r15
	jae	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%r14d, %eax
	cmpq	%rdx, %r12
	jb	LBB0_6
LBB0_20:
	movq	_EMSGSIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_34
LBB0_21:
	testl	%eax, %eax
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_25
## %bb.22:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_33
## %bb.23:
	leaq	-96(%rbp), %rsi
	movl	$10, %edx
	callq	_strtol
	movq	-96(%rbp), %rcx
	cmpb	$93, (%rcx)
	jne	LBB0_33
## %bb.24:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_26
LBB0_25:
	xorl	%eax, %eax
LBB0_26:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_28
## %bb.27:
	movl	%ebx, %ecx
	shlb	$4, %cl
	movb	%cl, (%r12)
	incq	%r12
LBB0_28:
	incq	%r15
	cmpq	%r13, %r15
	jae	LBB0_20
## %bb.29:
	cmpq	%rdx, %r12
	jae	LBB0_20
## %bb.30:
	testl	%eax, %eax
	jle	LBB0_36
## %bb.31:
	leal	3(%rax), %ecx
	andl	$-4, %ecx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmpl	%edx, %ecx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_33
## %bb.32:
	movl	%eax, %ecx
	subl	%edx, %ecx
	addb	$8, %cl
                                        ## kill: def $cl killed $cl killed $ecx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	shll	%cl, %edx
	testb	%dl, %dl
	je	LBB0_37
LBB0_33:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_34:
	movl	(%rax), %eax
LBB0_35:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax def $rax
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
LBB0_37:
	movq	_DNS_LABELTYPE_BITSTRING@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movq	(%rdx), %rdx
	movb	%cl, (%rdx)
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rcx
	movb	%al, (%rcx)
	movq	%r15, (%rsi)
	movq	%r12, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_35
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_digitvalue,8,3                 ## @digitvalue
	.comm	_EMSGSIZE,4,2                   ## @EMSGSIZE
	.comm	_DNS_LABELTYPE_BITSTRING,1,0    ## @DNS_LABELTYPE_BITSTRING
	.no_dead_strip	_encode_bitsring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_bitsring
_encode_bitsring:                       ; @encode_bitsring
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x27, [x0]
	str	xzr, [sp, #8]
	sub	x8, x1, x27
	cmp	x8, #1
	b.le	LBB0_31
; %bb.1:
	ldrb	w8, [x27], #1
	cmp	w8, #120
	b.ne	LBB0_31
; %bb.2:
	mov	x22, x4
	mov	x19, x3
	mov	x21, x2
	mov	x23, x1
	mov	x20, x0
	ldrsb	w0, [x27]
	bl	_isxdigit
	cbz	w0, LBB0_31
; %bb.3:
	ldr	x8, [x19]
	add	x26, x8, #1
	cmp	x27, x23
	ccmp	x26, x22, #2, lo
	b.lo	LBB0_5
LBB0_4:
Lloh0:
	adrp	x8, _EMSGSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EMSGSIZE@GOTPAGEOFF]
	b	LBB0_32
LBB0_5:
	str	xzr, [sp]                       ; 8-byte Folded Spill
	mov	w28, #0
	mov	x24, #0
	mov	w8, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldrsb	w9, [x27]
	cmp	w9, #47
	b.eq	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, #93
	b.eq	LBB0_20
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	sxtw	x25, w9
	mov	x0, x25
	cbz	w8, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_isdigit
	cbz	w0, LBB0_31
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	cbz	x24, LBB0_18
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w8, #1
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x27, x27, #1
	cmp	x27, x23
	b.hs	LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	x26, x22
	b.lo	LBB0_6
	b	LBB0_4
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	bl	_isxdigit
	cbz	w0, LBB0_31
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	cmp	w8, #253
	b.ge	LBB0_31
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
Lloh2:
	adrp	x8, _digitvalue@GOTPAGE
Lloh3:
	ldr	x8, [x8, _digitvalue@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	w8, [x8, x25, lsl #2]
	ldr	w9, [sp]                        ; 4-byte Folded Reload
	add	w9, w8, w9, lsl #4
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	add	w8, w8, #4
	add	w28, w28, #4
	cmp	w28, #8
	stp	w9, w8, [sp]                    ; 8-byte Folded Spill
	mov	w8, #0
	b.ne	LBB0_12
; %bb.17:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w28, #0
	strb	w9, [x26], #1
	b	LBB0_12
LBB0_18:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w25, #48
	b.eq	LBB0_31
; %bb.19:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	w8, #1
	mov	x24, x27
	b	LBB0_12
LBB0_20:
	cbz	w8, LBB0_24
; %bb.21:
	cbz	x24, LBB0_31
; %bb.22:
	add	x1, sp, #8
	mov	x0, x24
	mov	w2, #10
	bl	_strtol
	ldr	x9, [sp, #8]
	ldrb	w9, [x9]
	cmp	w9, #93
	b.ne	LBB0_31
; %bb.23:
	mov	x8, x0
LBB0_24:
	ldr	w9, [sp]                        ; 4-byte Folded Reload
	cbz	w28, LBB0_26
; %bb.25:
	lsl	w9, w9, #4
	strb	w9, [x26], #1
LBB0_26:
	add	x9, x27, #1
	cmp	x9, x23
	b.hs	LBB0_4
; %bb.27:
	cmp	x26, x22
	b.hs	LBB0_4
; %bb.28:
	cmp	w8, #1
	b.lt	LBB0_34
; %bb.29:
	add	w10, w8, #3
	and	w10, w10, #0xfffffffc
	ldr	w11, [sp, #4]                   ; 4-byte Folded Reload
	cmp	w10, w11
	b.ne	LBB0_31
; %bb.30:
	sub	w10, w8, w11
	add	w10, w10, #8
	ldr	w11, [sp]                       ; 4-byte Folded Reload
	lsl	w10, w11, w10
	tst	w10, #0xff
	b.eq	LBB0_35
LBB0_31:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_32:
	ldr	w0, [x8]
LBB0_33:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_34:
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
LBB0_35:
	mov	w0, #0
Lloh7:
	adrp	x10, _DNS_LABELTYPE_BITSTRING@GOTPAGE
Lloh8:
	ldr	x10, [x10, _DNS_LABELTYPE_BITSTRING@GOTPAGEOFF]
	ldrb	w10, [x10]
	ldr	x11, [x21]
	strb	w10, [x11]
	ldr	x10, [x19]
	strb	w8, [x10]
	str	x9, [x20]
	str	x26, [x19]
	b	LBB0_33
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_digitvalue,8,3                 ; @digitvalue
	.comm	_EMSGSIZE,4,2                   ; @EMSGSIZE
	.comm	_DNS_LABELTYPE_BITSTRING,1,0    ; @DNS_LABELTYPE_BITSTRING
	.no_dead_strip	_encode_bitsring
.subsections_via_symbols
