	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_pk_write_pubkey_der    ## -- Begin function mbedtls_pk_write_pubkey_der
	.p2align	4, 0x90
_mbedtls_pk_write_pubkey_der:           ## @mbedtls_pk_write_pubkey_der
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	addq	%rsi, %rdx
	movq	%rdx, -32(%rbp)
	leaq	-32(%rbp), %rdi
	movq	%r14, %rdx
	callq	_mbedtls_pk_write_pubkey
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	-32(%rbp), %rax
	movq	%rax, %rcx
	subq	%rbx, %rcx
	testq	%rcx, %rcx
	jle	LBB0_1
## %bb.2:
	leaq	-1(%rax), %rcx
	movq	%rcx, -32(%rbp)
	movb	$0, -1(%rax)
	leaq	-32(%rbp), %r15
	movl	$1, %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mbedtls_asn1_write_len
	movl	$1, %edi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	_MBEDTLS_ASN1_BIT_STRING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mbedtls_asn1_write_tag
	movl	$1, %edi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	%r14, %rdi
	callq	_mbedtls_pk_get_type
	leaq	-40(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%rax, %rdi
	callq	_mbedtls_oid_get_oid_by_pk_alg
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	-40(%rbp), %rdx
	movq	-48(%rbp), %rcx
	leaq	-32(%rbp), %r14
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%r8d, %r8d
	callq	_mbedtls_asn1_write_algorithm_identifier
	movl	$1, %edi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movl	$1, %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mbedtls_asn1_write_len
	movl	$1, %edi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movq	_MBEDTLS_ASN1_CONSTRUCTED@GOTPCREL(%rip), %rax
	movq	_MBEDTLS_ASN1_SEQUENCE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mbedtls_asn1_write_tag
	movl	$1, %edi
	movl	%eax, %esi
	callq	_MBEDTLS_ASN1_CHK_ADD
	movl	$1, %eax
	jmp	LBB0_4
LBB0_1:
	movq	_MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	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
	.comm	_MBEDTLS_ASN1_CONSTRUCTED,4,2   ## @MBEDTLS_ASN1_CONSTRUCTED
	.comm	_MBEDTLS_ASN1_SEQUENCE,4,2      ## @MBEDTLS_ASN1_SEQUENCE
	.comm	_MBEDTLS_PK_ECKEY,8,3           ## @MBEDTLS_PK_ECKEY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mbedtls_pk_write_pubkey_der    ; -- Begin function mbedtls_pk_write_pubkey_der
	.p2align	2
_mbedtls_pk_write_pubkey_der:           ; @mbedtls_pk_write_pubkey_der
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x1
	mov	x20, x0
	add	x8, x1, x2
	str	x8, [sp, #24]
	add	x0, sp, #24
	mov	x2, x20
	bl	_mbedtls_pk_write_pubkey
	mov	x1, x0
	mov	x0, #0
	bl	_MBEDTLS_ASN1_CHK_ADD
	ldr	x8, [sp, #24]
	sub	x9, x8, x19
	cmp	x9, #0
	b.le	LBB0_3
; %bb.1:
	sub	x9, x8, #1
	str	x9, [sp, #24]
	sturb	wzr, [x8, #-1]
	add	x0, sp, #24
	mov	x1, x19
	mov	w2, #1
	bl	_mbedtls_asn1_write_len
	mov	x1, x0
	mov	w0, #1
	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]
	add	x0, sp, #24
	mov	x1, x19
	bl	_mbedtls_asn1_write_tag
	mov	x1, x0
	mov	w0, #1
	bl	_MBEDTLS_ASN1_CHK_ADD
	mov	x0, x20
	bl	_mbedtls_pk_get_type
	add	x1, sp, #8
	add	x2, sp, #16
	bl	_mbedtls_oid_get_oid_by_pk_alg
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.2:
	ldp	x2, x3, [sp, #8]
	add	x0, sp, #24
	mov	x1, x19
	mov	x4, #0
	bl	_mbedtls_asn1_write_algorithm_identifier
	mov	x1, x0
	mov	w20, #1
	mov	w0, #1
	bl	_MBEDTLS_ASN1_CHK_ADD
	add	x0, sp, #24
	mov	x1, x19
	mov	w2, #1
	bl	_mbedtls_asn1_write_len
	mov	x1, x0
	mov	w0, #1
	bl	_MBEDTLS_ASN1_CHK_ADD
Lloh3:
	adrp	x8, _MBEDTLS_ASN1_CONSTRUCTED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MBEDTLS_ASN1_CONSTRUCTED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _MBEDTLS_ASN1_SEQUENCE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MBEDTLS_ASN1_SEQUENCE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w9, w8
	add	x0, sp, #24
	mov	x1, x19
	bl	_mbedtls_asn1_write_tag
	mov	x1, x0
	mov	w0, #1
	bl	_MBEDTLS_ASN1_CHK_ADD
	b	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MBEDTLS_ERR_ASN1_BUF_TOO_SMALL@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.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
	.comm	_MBEDTLS_ASN1_CONSTRUCTED,4,2   ; @MBEDTLS_ASN1_CONSTRUCTED
	.comm	_MBEDTLS_ASN1_SEQUENCE,4,2      ; @MBEDTLS_ASN1_SEQUENCE
	.comm	_MBEDTLS_PK_ECKEY,8,3           ; @MBEDTLS_PK_ECKEY
.subsections_via_symbols
