	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ldns_sign_public               ## -- Begin function ldns_sign_public
	.p2align	4, 0x90
_ldns_sign_public:                      ## @ldns_sign_public
	.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
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_ldns_rr_list_rr_count
	xorl	%ebx, %ebx
	testq	%r15, %r15
	je	LBB0_24
## %bb.2:
	testq	%rax, %rax
	jle	LBB0_24
## %bb.3:
	xorl	%eax, %eax
	callq	_ldns_rr_list_new
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_ldns_rr_list_clone
	testq	%rax, %rax
	je	LBB0_19
## %bb.4:
	movq	%rax, %r12
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_ldns_rr_list_rr_count
	testq	%rax, %rax
	jle	LBB0_7
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ldns_rr_list_rr
	movl	%eax, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ldns_rr_list_rr
	movl	%eax, %edi
	callq	_ldns_rr_ttl
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ldns_rr_set_ttl
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ldns_rr_list_rr
	movl	%eax, %edi
	callq	_ldns_rr2canonical
	incq	%rbx
	movq	%r12, %rdi
	callq	_ldns_rr_list_rr_count
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_7:
	movq	%r12, %rdi
	callq	_ldns_rr_list_sort
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_ldns_key_list_key_count
	testq	%rax, %rax
	je	LBB0_20
## %bb.8:
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_ldns_buffer_free
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	movq	%r14, %rdi
	callq	_ldns_key_list_key_count
	cmpq	%rax, %rbx
	jae	LBB0_20
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ldns_key_list_key
	movq	%rax, %rdi
	callq	_ldns_key_use
	testl	%eax, %eax
	je	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_LDNS_MAX_PACKETLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ldns_buffer_new
	testq	%rax, %rax
	je	LBB0_23
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rax, %r13
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ldns_key_list_key
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_ldns_key_flags
	movq	_LDNS_KEY_ZONE_KEY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ldns_create_empty_rrsig
	movq	%rax, %r14
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_ldns_rrsig2buffer_wire
	movq	_LDNS_STATUS_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ldns_rr_list2buffer_wire
	movq	_LDNS_STATUS_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ldns_sign_public_buffer
	testq	%rax, %rax
	je	LBB0_22
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ldns_rr_rrsig_set_sig
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_ldns_rr_list_push_rr
	jmp	LBB0_9
LBB0_19:
	xorl	%ebx, %ebx
LBB0_24:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	%r12, %rdi
	callq	_ldns_rr_list_deep_free
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_24
LBB0_21:
	movq	%r13, %rdi
	callq	_ldns_buffer_free
LBB0_22:
	movq	%r12, %rdi
	callq	_ldns_rr_list_deep_free
	movq	%r14, %rdi
	callq	_ldns_rr_free
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ldns_rr_list_deep_free
	xorl	%ebx, %ebx
	jmp	LBB0_24
LBB0_23:
	movq	%r12, %rdi
	callq	_ldns_rr_list_free
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ldns_rr_list_free
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_ldns_rdf_free
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_LDNS_MAX_PACKETLEN,4,2         ## @LDNS_MAX_PACKETLEN
	.comm	_LDNS_KEY_ZONE_KEY,4,2          ## @LDNS_KEY_ZONE_KEY
	.comm	_LDNS_STATUS_OK,8,3             ## @LDNS_STATUS_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ldns_sign_public               ; -- Begin function ldns_sign_public
	.p2align	2
_ldns_sign_public:                      ; @ldns_sign_public
	.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
	cbz	x0, LBB0_22
; %bb.1:
	mov	x20, x1
	mov	x22, x0
	bl	_ldns_rr_list_rr_count
	mov	x19, #0
	cbz	x20, LBB0_23
; %bb.2:
	cmp	x0, #1
	b.lt	LBB0_23
; %bb.3:
	bl	_ldns_rr_list_new
	mov	x19, x0
	mov	x0, x22
	bl	_ldns_rr_list_clone
	cbz	x0, LBB0_22
; %bb.4:
	mov	x21, x0
	bl	_ldns_rr_list_rr_count
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x23, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x23
	bl	_ldns_rr_list_rr
	mov	x24, x0
	mov	x0, x22
	mov	x1, #0
	bl	_ldns_rr_list_rr
	bl	_ldns_rr_ttl
	mov	x1, x0
	mov	x0, x24
	bl	_ldns_rr_set_ttl
	mov	x0, x21
	mov	x1, x23
	bl	_ldns_rr_list_rr
	bl	_ldns_rr2canonical
	add	x23, x23, #1
	mov	x0, x21
	bl	_ldns_rr_list_rr_count
	cmp	x23, x0
	b.lt	LBB0_6
LBB0_7:
	mov	x0, x21
	bl	_ldns_rr_list_sort
	mov	x0, x20
	bl	_ldns_key_list_key_count
	cbz	x0, LBB0_18
; %bb.8:
	mov	x22, #0
Lloh0:
	adrp	x26, _LDNS_MAX_PACKETLEN@GOTPAGE
Lloh1:
	ldr	x26, [x26, _LDNS_MAX_PACKETLEN@GOTPAGEOFF]
Lloh2:
	adrp	x27, _LDNS_KEY_ZONE_KEY@GOTPAGE
Lloh3:
	ldr	x27, [x27, _LDNS_KEY_ZONE_KEY@GOTPAGEOFF]
Lloh4:
	adrp	x28, _LDNS_STATUS_OK@GOTPAGE
Lloh5:
	ldr	x28, [x28, _LDNS_STATUS_OK@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	bl	_ldns_buffer_free
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x22, x22, #1
	mov	x0, x20
	bl	_ldns_key_list_key_count
	cmp	x22, x0
	b.hs	LBB0_18
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_ldns_key_list_key
	bl	_ldns_key_use
	cbz	w0, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w0, [x26]
	bl	_ldns_buffer_new
	cbz	x0, LBB0_21
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x23, x0
	mov	x0, x20
	mov	x1, x22
	bl	_ldns_key_list_key
	mov	x25, x0
	bl	_ldns_key_flags
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x21
	mov	x1, x25
	bl	_ldns_create_empty_rrsig
	mov	x24, x0
	mov	x0, x23
	mov	x1, x24
	bl	_ldns_rrsig2buffer_wire
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_ldns_rr_list2buffer_wire
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x23
	mov	x1, x25
	bl	_ldns_sign_public_buffer
	cbz	x0, LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x1, x0
	mov	x0, x24
	bl	_ldns_rr_rrsig_set_sig
	mov	x0, x19
	mov	x1, x24
	bl	_ldns_rr_list_push_rr
	b	LBB0_9
LBB0_18:
	mov	x0, x21
	bl	_ldns_rr_list_deep_free
	b	LBB0_23
LBB0_19:
	mov	x0, x23
	bl	_ldns_buffer_free
LBB0_20:
	mov	x0, x21
	bl	_ldns_rr_list_deep_free
	mov	x0, x24
	bl	_ldns_rr_free
	mov	x0, x19
	bl	_ldns_rr_list_deep_free
	b	LBB0_22
LBB0_21:
	mov	x0, x21
	bl	_ldns_rr_list_free
	mov	x0, x19
	bl	_ldns_rr_list_free
	mov	x0, #0
	bl	_ldns_rdf_free
LBB0_22:
	mov	x19, #0
LBB0_23:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_LDNS_MAX_PACKETLEN,4,2         ; @LDNS_MAX_PACKETLEN
	.comm	_LDNS_KEY_ZONE_KEY,4,2          ; @LDNS_KEY_ZONE_KEY
	.comm	_LDNS_STATUS_OK,8,3             ; @LDNS_STATUS_OK
.subsections_via_symbols
