	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qat_uclo_wr_uimage_page
_qat_uclo_wr_uimage_page:               ## @qat_uclo_wr_uimage_page
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r13
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	12(%rsi), %edi
	callq	_ICP_QAT_CTX_MODE
	movq	_ICP_QAT_UCLO_MAX_CTX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	movl	$255, %eax
	movl	$85, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rax
	cmpb	$0, (%rax)
	je	LBB0_17
## %bb.1:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	8(%rax), %rbx
	xorl	%r14d, %r14d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	callq	_qat_hal_set_live_ctx
	movl	(%rbx), %edx
	movl	4(%rbx), %ecx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_qat_hal_set_pc
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movzbl	(%rax), %eax
	cmpq	%rax, %r14
	jae	LBB0_17
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_12 Depth 2
	movzbl	%r14b, %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_16
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	movq	%r14, %r15
	shlq	$4, %r15
	movl	(%rax,%r15), %edx
	testq	%rdx, %rdx
	je	LBB0_16
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	movq	8(%rax,%r15), %rax
	shlq	$3, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testl	%ecx, (%rax,%r12)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	addq	$24, %r12
	cmpq	%r12, %rdx
	jne	LBB0_5
	jmp	LBB0_16
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rax,%r12), %rax
	movq	(%rax), %rsi
	cmpl	$0, (%rsi)
	je	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movzbl	%r14b, %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	callq	_qat_uclo_wr_uimage_raw_page
	movq	_ICP_QAT_UCLO_MAX_CTX@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r8d, %r8d
	jle	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	movq	8(%rax,%r15), %rdx
	movq	16(%rdx,%r12), %rbx
	movq	8(%rdx,%r12), %rdx
	movq	%rbx, (%rdx)
	cmpl	$1, %r8d
	je	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r8d, %esi
	decq	%r8
	movl	$1, %edx
	cmpl	$2, %esi
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r8, %r9
	andq	$-2, %r9
	movl	$1, %edx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%r10d, %r10d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r13), %rdi
	movq	8(%rdi,%r15), %rdi
	btl	%edx, %esi
	movq	%rbx, %rax
	cmovaeq	%r10, %rax
	movq	8(%rdi,%r12), %rdi
	movq	%rax, (%rdi,%rdx,8)
	movq	(%r13), %rax
	movq	8(%rax,%r15), %rax
	leaq	1(%rdx), %rdi
	btl	%edi, %esi
	movq	%rbx, %rcx
	cmovaeq	%r10, %rcx
	movq	8(%rax,%r12), %rax
	movq	%rcx, 8(%rax,%rdx,8)
	addq	$2, %rdx
	cmpq	%r9, %rdi
	jne	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	testb	$1, %r8b
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	movq	8(%rax,%r15), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	btl	%edx, %ecx
	movl	$0, %ecx
	cmovaeq	%rcx, %rbx
	movq	8(%rax,%r12), %rax
	movq	%rbx, (%rax,%rdx,8)
	jmp	LBB0_15
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ICP_QAT_UCLO_MAX_CTX,4,2       ## @ICP_QAT_UCLO_MAX_CTX
	.no_dead_strip	_qat_uclo_wr_uimage_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qat_uclo_wr_uimage_page
_qat_uclo_wr_uimage_page:               ; @qat_uclo_wr_uimage_page
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
	ldr	w0, [x1, #12]
	bl	_ICP_QAT_CTX_MODE
Lloh0:
	adrp	x24, _ICP_QAT_UCLO_MAX_CTX@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ICP_QAT_UCLO_MAX_CTX@GOTPAGEOFF]
	ldr	w8, [x24]
	mov	w9, #85
	mov	w10, #255
	cmp	w0, w8
	csel	w25, w10, w9, eq
	ldr	x8, [x20]
	ldrb	w8, [x8]
	cbz	w8, LBB0_14
; %bb.1:
	mov	x26, #0
	add	x21, x19, #8
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x19]
	mov	x0, x20
	mov	x1, x22
	bl	_qat_hal_set_live_ctx
	ldp	w2, w3, [x19]
	mov	x0, x20
	mov	x1, x22
	bl	_qat_hal_set_pc
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	ldr	x8, [x20]
	ldrb	w8, [x8]
	cmp	x26, x8
	b.hs	LBB0_14
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_13 Depth 2
	and	w0, w26, #0xff
	mov	x1, x21
	bl	_test_bit
	cbz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x23]
	lsl	x8, x26, #4
	ldr	w10, [x9, x8]
	cbz	w10, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, #0
	ldr	w8, [x19]
	add	x9, x9, x26, lsl #4
	ldr	x9, [x9, #8]
	add	x10, x10, x10, lsl #1
	lsl	x10, x10, #3
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x9, x27]
	tst	w11, w8
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	add	x27, x27, #24
	cmp	x10, x27
	b.ne	LBB0_7
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x9, x27
	ldr	x8, [x8, #16]
	ldr	x1, [x8]
	ldr	w8, [x1]
	cbz	w8, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	and	w22, w26, #0xff
	mov	x0, x20
	mov	x2, x22
	bl	_qat_uclo_wr_uimage_raw_page
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x23]
	add	x9, x9, x26, lsl #4
	ldr	x9, [x9, #8]
	add	x10, x9, x27
	ldp	x10, x9, [x10, #8]
	str	x9, [x10]
	cmp	w8, #1
	b.eq	LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	w10, #1
LBB0_13:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x11, [x23]
	add	x11, x11, x26, lsl #4
	ldr	x11, [x11, #8]
	lsr	w12, w25, w10
	tst	w12, #0x1
	csel	x12, xzr, x9, eq
	add	x11, x11, x27
	ldr	x11, [x11, #8]
	str	x12, [x11, x10, lsl #3]
	add	x10, x10, #1
	cmp	x8, x10
	b.ne	LBB0_13
	b	LBB0_2
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ICP_QAT_UCLO_MAX_CTX,4,2       ; @ICP_QAT_UCLO_MAX_CTX
	.no_dead_strip	_qat_uclo_wr_uimage_page
.subsections_via_symbols
