	.file	"extr_hash_algs.c_fsverity_get_hash_alg.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Unknown hash algorithm number: %u"
	.align 8
.LC1:
	.string	"Missing crypto API support for hash algorithm \"%s\""
	.align 8
.LC2:
	.string	"Error allocating hash algorithm \"%s\": %ld"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%s using implementation \"%s\"\n"
	.text
	.p2align 4
	.globl	fsverity_get_hash_alg
	.type	fsverity_get_hash_alg, @function
fsverity_get_hash_alg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rdi, QWORD PTR fsverity_hash_algs[rip]
	call	ARRAY_SIZE@PLT
	cmp	eax, r13d
	jbe	.L2
	mov	r12d, r13d
	sal	r12, 5
	add	r12, QWORD PTR fsverity_hash_algs[rip]
	mov	eax, DWORD PTR [r12]
	test	eax, eax
	jne	.L3
.L2:
	mov	rdi, rbp
	mov	edx, r13d
	lea	rsi, .LC0[rip]
	call	fsverity_warn@PLT
	mov	edi, DWORD PTR EINVAL[rip]
	neg	edi
.L12:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	ERR_PTR@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	edi, DWORD PTR 24[r12]
	call	READ_ONCE@PLT
	xor	edi, edi
	test	rax, rax
	setne	dil
	call	likely@PLT
	test	rax, rax
	je	.L14
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	edi, DWORD PTR [r12]
	xor	edx, edx
	xor	esi, esi
	call	crypto_alloc_ahash@PLT
	mov	rdi, rax
	mov	r13, rax
	call	IS_ERR@PLT
	test	rax, rax
	je	.L5
	mov	rdi, r13
	call	PTR_ERR@PLT
	add	eax, DWORD PTR ENOENT[rip]
	je	.L15
	mov	rdi, r13
	call	PTR_ERR@PLT
	mov	edx, DWORD PTR [r12]
	mov	rdi, rbp
	lea	rsi, .LC2[rip]
	mov	ecx, eax
	call	fsverity_err@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r13
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	ERR_CAST@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	ebp, DWORD PTR EINVAL[rip]
	mov	rbx, QWORD PTR 8[r12]
	mov	rdi, r13
	call	crypto_ahash_digestsize@PLT
	xor	edi, edi
	neg	ebp
	cmp	rbx, rax
	setne	dil
	call	WARN_ON@PLT
	test	rax, rax
	je	.L16
.L7:
	mov	rdi, r13
	call	crypto_free_ahash@PLT
	mov	edi, ebp
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rbx, QWORD PTR 16[r12]
	mov	rdi, r13
	call	crypto_ahash_blocksize@PLT
	xor	edi, edi
	cmp	rbx, rax
	setne	dil
	call	WARN_ON@PLT
	test	rax, rax
	jne	.L7
	mov	rdi, r13
	call	crypto_ahash_driver_name@PLT
	mov	esi, DWORD PTR [r12]
	lea	rdi, .LC3[rip]
	mov	edx, eax
	call	pr_info@PLT
	xor	esi, esi
	lea	rdi, 24[r12]
	mov	rdx, r13
	call	cmpxchg@PLT
	test	rax, rax
	je	.L1
	mov	rdi, r13
	call	crypto_free_ahash@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edx, DWORD PTR [r12]
	mov	rdi, rbp
	lea	rsi, .LC1[rip]
	call	fsverity_warn@PLT
	mov	edi, DWORD PTR ENOPKG[rip]
	neg	edi
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	fsverity_get_hash_alg, .-fsverity_get_hash_alg
	.comm	fsverity_hash_algs,8,8
	.comm	ENOPKG,4,4
	.comm	ENOENT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_hash_algs.c_fsverity_get_hash_alg.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unknown hash algorithm number: %u\000"
	.align	2
.LC1:
	.ascii	"Missing crypto API support for hash algorithm \"%s\""
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"Error allocating hash algorithm \"%s\": %ld\000"
	.align	2
.LC3:
	.ascii	"%s using implementation \"%s\"\012\000"
	.text
	.align	2
	.global	fsverity_get_hash_alg
	.syntax unified
	.arm
	.fpu softvfp
	.type	fsverity_get_hash_alg, %function
fsverity_get_hash_alg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r5, .L16
	mov	r6, r0
	ldr	r0, [r5]
	mov	r4, r1
	bl	ARRAY_SIZE
	cmp	r0, r4
	bls	.L2
	ldr	r5, [r5]
	ldr	r3, [r5, r4, lsl #4]
	add	r7, r5, r4, lsl #4
	cmp	r3, #0
	bne	.L3
.L2:
	mov	r2, r4
	mov	r0, r6
	ldr	r1, .L16+4
	bl	fsverity_warn
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L16+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	ERR_PTR
.L3:
	ldr	r0, [r7, #12]
	bl	READ_ONCE
	subs	r0, r0, #0
	movne	r0, #1
	bl	likely
	subs	r2, r0, #0
	beq	.L13
.L1:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	mov	r1, r2
	ldr	r0, [r5, r4, lsl #4]
	bl	crypto_alloc_ahash
	mov	r8, r0
	bl	IS_ERR
	cmp	r0, #0
	beq	.L5
	mov	r0, r8
	bl	PTR_ERR
	ldr	r3, .L16+12
	ldr	r3, [r3]
	cmn	r0, r3
	beq	.L14
	mov	r0, r8
	ldr	r4, [r5, r4, lsl #4]
	bl	PTR_ERR
	mov	r2, r4
	mov	r3, r0
	ldr	r1, .L16+16
	mov	r0, r6
	bl	fsverity_err
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	ERR_CAST
.L5:
	ldr	r3, .L16+8
	mov	r0, r8
	ldr	r6, [r3]
	ldr	r9, [r7, #4]
	bl	crypto_ahash_digestsize
	subs	r0, r9, r0
	movne	r0, #1
	bl	WARN_ON
	cmp	r0, #0
	rsb	r6, r6, #0
	beq	.L15
.L7:
	mov	r0, r8
	bl	crypto_free_ahash
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	ERR_PTR
.L15:
	mov	r0, r8
	ldr	r9, [r7, #8]
	bl	crypto_ahash_blocksize
	subs	r0, r9, r0
	movne	r0, #1
	bl	WARN_ON
	subs	r9, r0, #0
	bne	.L7
	mov	r0, r8
	ldr	r4, [r5, r4, lsl #4]
	bl	crypto_ahash_driver_name
	mov	r1, r4
	mov	r2, r0
	ldr	r0, .L16+20
	bl	pr_info
	mov	r2, r8
	mov	r1, r9
	add	r0, r7, #12
	bl	cmpxchg
	cmp	r0, #0
	beq	.L1
	mov	r0, r8
	bl	crypto_free_ahash
	b	.L1
.L14:
	mov	r0, r6
	ldr	r2, [r5, r4, lsl #4]
	ldr	r1, .L16+24
	bl	fsverity_warn
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L16+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	ERR_PTR
.L17:
	.align	2
.L16:
	.word	fsverity_hash_algs
	.word	.LC0
	.word	EINVAL
	.word	ENOENT
	.word	.LC2
	.word	.LC3
	.word	.LC1
	.word	ENOPKG
	.size	fsverity_get_hash_alg, .-fsverity_get_hash_alg
	.comm	fsverity_hash_algs,4,4
	.comm	ENOPKG,4,4
	.comm	ENOENT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
