	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_sign
_do_sign:                               ## @do_sign
	.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
	movq	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_EVP_MD_CTX_create
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rax, %r12
	leaq	-56(%rbp), %rsi
	movq	%rax, %rdi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movq	%rbx, %r8
	callq	_EVP_DigestSignInit
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	callq	_EVP_PKEY_id
	movq	_EVP_PKEY_RSA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.4:
	movq	-56(%rbp), %rdi
	movq	_RSA_PKCS1_PSS_PADDING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_EVP_PKEY_CTX_set_rsa_padding
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.5:
	movq	-56(%rbp), %rdi
	movl	$-1, %esi
	callq	_EVP_PKEY_CTX_set_rsa_pss_saltlen
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.6:
	movq	-56(%rbp), %rbx
	xorl	%eax, %eax
	callq	_EVP_sha256
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_EVP_PKEY_CTX_set_rsa_mgf1_md
	cmpl	$1, %eax
	jne	LBB0_2
LBB0_7:
	movq	%r15, %rsi
	shrq	$32, %rsi
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r15d, %edx
	callq	_EVP_DigestSignUpdate
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.8:
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_EVP_DigestSignFinal
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.9:
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ptls_buffer_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movslq	(%r14), %rsi
	shlq	$2, %rsi
	addq	8(%r14), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	callq	_EVP_DigestSignFinal
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.11:
	movl	-48(%rbp), %eax
	addl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_2:
	movq	_PTLS_ERROR_LIBRARY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_12:
	movq	%r12, %rdi
	callq	_EVP_MD_CTX_destroy
	jmp	LBB0_13
LBB0_14:
	movq	_PTLS_ERROR_NO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ## @PTLS_ERROR_NO_MEMORY
	.comm	_PTLS_ERROR_LIBRARY,4,2         ## @PTLS_ERROR_LIBRARY
	.comm	_EVP_PKEY_RSA,8,3               ## @EVP_PKEY_RSA
	.comm	_RSA_PKCS1_PSS_PADDING,4,2      ## @RSA_PKCS1_PSS_PADDING
	.no_dead_strip	_do_sign
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_sign
_do_sign:                               ; @do_sign
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x23, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	bl	_EVP_MD_CTX_create
	cbz	x0, LBB0_13
; %bb.1:
	mov	x19, x0
	add	x1, sp, #8
	mov	x2, x23
	mov	x3, #0
	mov	x4, x22
	bl	_EVP_DigestSignInit
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.2:
	mov	x0, x22
	bl	_EVP_PKEY_id
Lloh0:
	adrp	x8, _EVP_PKEY_RSA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EVP_PKEY_RSA@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:
	ldr	x0, [sp, #8]
Lloh3:
	adrp	x8, _RSA_PKCS1_PSS_PADDING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RSA_PKCS1_PSS_PADDING@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_EVP_PKEY_CTX_set_rsa_padding
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.4:
	ldr	x0, [sp, #8]
	mov	w1, #-1
	bl	_EVP_PKEY_CTX_set_rsa_pss_saltlen
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.5:
	ldr	x22, [sp, #8]
	bl	_EVP_sha256
	mov	x1, x0
	mov	x0, x22
	bl	_EVP_PKEY_CTX_set_rsa_mgf1_md
	cmp	w0, #1
	b.ne	LBB0_11
LBB0_6:
	lsr	x1, x21, #32
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x2, x21
	bl	_EVP_DigestSignUpdate
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.7:
	mov	x2, sp
	mov	x0, x19
	mov	x1, #0
	bl	_EVP_DigestSignFinal
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.8:
	ldr	x1, [sp]
	mov	x0, x20
	bl	_ptls_buffer_reserve
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.9:
	ldr	x8, [x20, #8]
	ldrsw	x9, [x20]
	add	x1, x8, x9, lsl #2
	mov	x2, sp
	mov	x0, x19
	bl	_EVP_DigestSignFinal
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.10:
	mov	w21, #0
	ldr	w8, [sp]
	ldr	w9, [x20]
	add	w8, w9, w8
	str	w8, [x20]
	b	LBB0_12
LBB0_11:
Lloh6:
	adrp	x8, _PTLS_ERROR_LIBRARY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PTLS_ERROR_LIBRARY@GOTPAGEOFF]
Lloh8:
	ldr	w21, [x8]
LBB0_12:
	mov	x0, x19
	bl	_EVP_MD_CTX_destroy
	b	LBB0_14
LBB0_13:
Lloh9:
	adrp	x8, _PTLS_ERROR_NO_MEMORY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PTLS_ERROR_NO_MEMORY@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PTLS_ERROR_NO_MEMORY,4,2       ; @PTLS_ERROR_NO_MEMORY
	.comm	_PTLS_ERROR_LIBRARY,4,2         ; @PTLS_ERROR_LIBRARY
	.comm	_EVP_PKEY_RSA,8,3               ; @EVP_PKEY_RSA
	.comm	_RSA_PKCS1_PSS_PADDING,4,2      ; @RSA_PKCS1_PSS_PADDING
	.no_dead_strip	_do_sign
.subsections_via_symbols
