	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ldns_hdr2buffer_wire
_ldns_hdr2buffer_wire:                  ## @ldns_hdr2buffer_wire
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	$12, %esi
	callq	_ldns_buffer_reserve
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_ldns_pkt_id
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_ldns_buffer_write_u16
	movq	%r15, %rdi
	callq	_ldns_pkt_qr
	movl	%eax, %ebx
	shll	$7, %ebx
	movq	%r15, %rdi
	callq	_ldns_pkt_get_opcode
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %r12d
	orl	%ebx, %r12d
	movq	%r15, %rdi
	callq	_ldns_pkt_aa
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,4), %r13d
	movq	%r15, %rdi
	callq	_ldns_pkt_tc
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax), %ebx
	orl	%r13d, %ebx
	orl	%r12d, %ebx
	movq	%r15, %rdi
	callq	_ldns_pkt_rd
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ldns_buffer_write_u8
	movq	%r15, %rdi
	callq	_ldns_pkt_ra
	movl	%eax, %r12d
	shll	$7, %r12d
	movq	%r15, %rdi
	callq	_ldns_pkt_ad
	shll	$5, %eax
	orl	%eax, %r12d
	movq	%r15, %rdi
	callq	_ldns_pkt_cd
	movl	%eax, %ebx
	shll	$4, %ebx
	movq	%r15, %rdi
	callq	_ldns_pkt_get_rcode
	orl	%eax, %ebx
	orl	%r12d, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ldns_buffer_write_u8
	movq	%r15, %rdi
	callq	_ldns_pkt_qdcount
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_ldns_buffer_write_u16
	movq	%r15, %rdi
	callq	_ldns_pkt_ancount
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_ldns_buffer_write_u16
	movq	%r15, %rdi
	callq	_ldns_pkt_nscount
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_ldns_buffer_write_u16
	movq	%r15, %rdi
	callq	_ldns_pkt_arcount
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_ldns_pkt_tsig
	cmpq	$1, %rax
	sbbl	$-1, %ebx
	movq	%r15, %rdi
	callq	_ldns_pkt_edns
	cmpq	$1, %rax
	sbbl	$-1, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ldns_buffer_write_u16
LBB0_2:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ldns_buffer_status             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ldns_hdr2buffer_wire
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ldns_hdr2buffer_wire
_ldns_hdr2buffer_wire:                  ; @ldns_hdr2buffer_wire
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w1, #12
	bl	_ldns_buffer_reserve
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_ldns_pkt_id
	mov	x1, x0
	mov	x0, x19
	bl	_ldns_buffer_write_u16
	mov	x0, x20
	bl	_ldns_pkt_qr
	mov	x21, x0
	mov	x0, x20
	bl	_ldns_pkt_get_opcode
	lsl	w8, w0, #3
	orr	w21, w8, w21, lsl #7
	mov	x0, x20
	bl	_ldns_pkt_aa
	orr	w21, w21, w0, lsl #2
	mov	x0, x20
	bl	_ldns_pkt_tc
	orr	w21, w21, w0, lsl #1
	mov	x0, x20
	bl	_ldns_pkt_rd
	orr	w1, w21, w0
	mov	x0, x19
	bl	_ldns_buffer_write_u8
	mov	x0, x20
	bl	_ldns_pkt_ra
	mov	x21, x0
	mov	x0, x20
	bl	_ldns_pkt_ad
	lsl	w8, w0, #5
	orr	w21, w8, w21, lsl #7
	mov	x0, x20
	bl	_ldns_pkt_cd
	orr	w21, w21, w0, lsl #4
	mov	x0, x20
	bl	_ldns_pkt_get_rcode
	orr	w1, w21, w0
	mov	x0, x19
	bl	_ldns_buffer_write_u8
	mov	x0, x20
	bl	_ldns_pkt_qdcount
	mov	x1, x0
	mov	x0, x19
	bl	_ldns_buffer_write_u16
	mov	x0, x20
	bl	_ldns_pkt_ancount
	mov	x1, x0
	mov	x0, x19
	bl	_ldns_buffer_write_u16
	mov	x0, x20
	bl	_ldns_pkt_nscount
	mov	x1, x0
	mov	x0, x19
	bl	_ldns_buffer_write_u16
	mov	x0, x20
	bl	_ldns_pkt_arcount
	mov	x21, x0
	mov	x0, x20
	bl	_ldns_pkt_tsig
	cmp	x0, #0
	cinc	w21, w21, ne
	mov	x0, x20
	bl	_ldns_pkt_edns
	cmp	x0, #0
	cinc	w1, w21, ne
	mov	x0, x19
	bl	_ldns_buffer_write_u16
LBB0_2:
	mov	x0, x19
	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
	b	_ldns_buffer_status
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ldns_hdr2buffer_wire
.subsections_via_symbols
