	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_x509_write_sig         ## -- Begin function mbedtls_x509_write_sig
	.p2align	4, 0x90
_mbedtls_x509_write_sig:                ## @mbedtls_x509_write_sig
	.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	%rdi, %r13
	movq	(%rdi), %rdi
	movq	%rdi, %rax
	subq	%rsi, %rax
	jb	LBB0_2
## %bb.1:
	movq	%r9, %rbx
	cmpq	%r9, %rax
	jb	LBB0_2
## %bb.3:
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	subq	%rbx, %rdi
	movq	%rdi, (%r13)
	movq	%r8, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	(%r13), %rax
	movq	%rax, %rcx
	subq	%r12, %rcx
	testq	%rcx, %rcx
	jle	LBB0_2
## %bb.4:
	leaq	-1(%rax), %rcx
	movq	%rcx, (%r13)
	movb	$0, -1(%rax)
	incq	%rbx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_mbedtls_asn1_write_len
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	_MBEDTLS_ASN1_BIT_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_mbedtls_asn1_write_tag
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	xorl	%r8d, %r8d
	callq	_mbedtls_asn1_write_algorithm_identifier
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	jmp	LBB0_5
LBB0_2:
	movq	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL,4,2 ## @MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
	.comm	_MBEDTLS_ASN1_BIT_STRING,4,2    ## @MBEDTLS_ASN1_BIT_STRING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_x509_write_sig         ; -- Begin function mbedtls_x509_write_sig
	.p2align	2
_mbedtls_x509_write_sig:                ; @mbedtls_x509_write_sig
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0]
	subs	x9, x8, x1
	b.lo	LBB0_4
; %bb.1:
	mov	x23, x5
	cmp	x9, x5
	b.lo	LBB0_4
; %bb.2:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	sub	x0, x8, x23
	str	x0, [x22]
	mov	x1, x4
	mov	x2, x23
	bl	_memcpy
	ldr	x8, [x22]
	sub	x9, x8, x21
	cmp	x9, #0
	b.le	LBB0_4
; %bb.3:
	sub	x9, x8, #1
	str	x9, [x22]
	sturb	wzr, [x8, #-1]
	add	x23, x23, #1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_mbedtls_asn1_write_len
	mov	x1, x0
	mov	x0, x23
	bl	_MBEDTLS_ASN1_CHK_ADD
Lloh0:
	adrp	x8, _MBEDTLS_ASN1_BIT_STRING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MBEDTLS_ASN1_BIT_STRING@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x21
	bl	_mbedtls_asn1_write_tag
	mov	x1, x0
	mov	x0, x23
	bl	_MBEDTLS_ASN1_CHK_ADD
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x19
	mov	w4, #0
	bl	_mbedtls_asn1_write_algorithm_identifier
	mov	x1, x0
	mov	x0, x23
	bl	_MBEDTLS_ASN1_CHK_ADD
	b	LBB0_5
LBB0_4:
Lloh3:
	adrp	x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL,4,2 ; @MBEDTLS_ERR_ASN1_BUF_TOO_SMALL
	.comm	_MBEDTLS_ASN1_BIT_STRING,4,2    ; @MBEDTLS_ASN1_BIT_STRING
.subsections_via_symbols
