	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_genwqe_setup_sgl               ## -- Begin function genwqe_setup_sgl
	.p2align	4, 0x90
_genwqe_setup_sgl:                      ## @genwqe_setup_sgl
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -136(%rbp)                ## 8-byte Spill
	movq	64(%rsi), %rbx
	cmpl	$0, 16(%rsi)
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	(%rsi), %r15
	movq	8(%rsi), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movl	$128, %eax
	movq	_SG_CHAINED@GOTPCREL(%rip), %r14
	xorl	%ecx, %ecx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rsi, -112(%rbp)                ## 8-byte Spill
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_6 Depth 3
	movq	24(%r12), %rdi
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	addq	%rax, %rdi
	callq	_cpu_to_be64
	movq	%rax, 16(%rbx)
	movl	$128, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%rbx)
	movl	(%r14), %edi
	callq	_cpu_to_be32
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, (%rbx)
	movl	$1, %ecx
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_6 Depth 3
	movq	%r15, -128(%rbp)                ## 8-byte Spill
	movslq	-44(%rbp), %r15                 ## 4-byte Folded Reload
	leal	1(%r15), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpq	$7, %rcx
	ja	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=3
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	subq	%rbx, %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_min
	movl	%eax, %r13d
	testq	%r15, %r15
	je	LBB0_8
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=3
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	16(%r12), %eax
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=3
	cmpq	$0, 48(%r12)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=3
	movq	40(%r12), %rbx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=3
	movq	-136(%rbp), %rax                ## 8-byte Reload
	addq	(%rax,%r15,8), %rbx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=3
	cmpq	$0, 56(%r12)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=3
	addq	32(%r12), %rbx
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=3
	movl	%r13d, %r12d
	subq	%r12, -80(%rbp)                 ## 8-byte Folded Spill
	cmpq	%rbx, %r14
	jne	LBB0_24
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=3
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	8(%rbx), %rdi
	callq	_be32_to_cpu
	addl	%eax, %r13d
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%rbx)
	incq	%r15
	addq	%r12, %r14
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leal	1(%rcx), %eax
	movl	$0, %ebx
	movq	-112(%rbp), %r12                ## 8-byte Reload
	cmpl	16(%r12), %ecx
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_6
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	%rbx, %rdi
	callq	_cpu_to_be64
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rcx,2), %r14
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	leaq	(%r15,%r14,8), %rcx
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movq	%rax, 16(%r15,%r14,8)
	movl	%r13d, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%r15,%r14,8)
	movq	_SG_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be32
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%r15,%r14,8)
	addq	%rbx, %r12
	incq	%rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, %eax
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	$0, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	-112(%rbp), %r12                ## 8-byte Reload
	cmpl	%edx, 16(%r12)
	jne	LBB0_5
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-120(%rbp), %rax                ## 8-byte Reload
	subq	$-128, %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	addq	$192, %rbx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	16(%r12), %edx
	movq	_SG_CHAINED@GOTPCREL(%rip), %r14
	movq	-128(%rbp), %r15                ## 8-byte Reload
	jl	LBB0_4
	jmp	LBB0_17
LBB0_16:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_1:
	xorl	%ecx, %ecx
LBB0_17:
	leaq	-192(%rbx), %r15
	cmpl	$1, %ecx
	cmovneq	%rbx, %r15
	movl	$7, %eax
	cmovnel	%ecx, %eax
	testl	%eax, %eax
	jle	LBB0_18
## %bb.19:
	movl	%eax, %r14d
	movl	%r14d, %eax
	andl	$-2, %eax
	movq	%r15, %rcx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	40(%rcx), %rdx
	movq	%rdx, 16(%rcx)
	movups	24(%rcx), %xmm0
	movups	%xmm0, (%rcx)
	movups	48(%rcx), %xmm0
	movups	%xmm0, 24(%rcx)
	movq	64(%rcx), %rdx
	movq	%rdx, 40(%rcx)
	addq	$48, %rcx
	addq	$-2, %rax
	jne	LBB0_20
## %bb.21:
	testb	$1, %r14b
	je	LBB0_23
## %bb.22:
	movq	40(%rcx), %rax
	movq	%rax, 16(%rcx)
	movups	24(%rcx), %xmm0
	movups	%xmm0, (%rcx)
	jmp	LBB0_23
LBB0_18:
	xorl	%r14d, %r14d
LBB0_23:
	xorl	%edi, %edi
	callq	_cpu_to_be64
	leaq	(%r14,%r14,2), %rbx
	movq	%rax, 16(%r15,%rbx,8)
	xorl	%edi, %edi
	callq	_cpu_to_be32
	movq	%rax, 8(%r15,%rbx,8)
	movq	_SG_END_LIST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be32
	movq	%rax, (%r15,%rbx,8)
	xorl	%eax, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SG_CHAINED,4,2                 ## @SG_CHAINED
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_SG_DATA,4,2                    ## @SG_DATA
	.comm	_SG_END_LIST,4,2                ## @SG_END_LIST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_genwqe_setup_sgl               ; -- Begin function genwqe_setup_sgl
	.p2align	2
_genwqe_setup_sgl:                      ; @genwqe_setup_sgl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	str	x2, [sp, #32]                   ; 8-byte Folded Spill
	ldr	x26, [x1, #64]
	ldr	w8, [x1, #16]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.1:
	mov	x20, x1
	mov	x25, #0
	mov	x28, #0
	mov	w19, #0
	ldp	x22, x24, [x1]
Lloh0:
	adrp	x21, _SG_CHAINED@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SG_CHAINED@GOTPAGEOFF]
	mov	w9, #128
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
                                        ;       Child Loop BB0_4 Depth 3
	ldr	x8, [x20, #24]
	str	x9, [sp]                        ; 8-byte Folded Spill
	add	x0, x8, x9
	bl	_cpu_to_be64
	str	x0, [x26, #16]
	mov	w0, #128
	bl	_cpu_to_be32
	str	x0, [x26, #8]
	ldr	w0, [x21]
	bl	_cpu_to_be32
	str	x0, [x26]
	mov	w10, #1
	mov	x8, x19
	mov	x21, x22
	str	x26, [sp, #40]                  ; 8-byte Folded Spill
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_4 Depth 3
	stp	x22, x28, [sp, #8]              ; 16-byte Folded Spill
	mov	x27, #0
	sub	x11, x27, w8, sxtw
	ldr	x9, [sp, #32]                   ; 8-byte Folded Reload
	add	x9, x9, w8, sxtw #3
	stp	x9, x11, [sp, #48]              ; 16-byte Folded Spill
	str	x24, [sp, #24]                  ; 8-byte Folded Spill
	mov	x23, x24
	mov	w19, w8
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ;     Parent Loop BB0_3 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	cmp	x10, #7
	b.hi	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=3
	mov	x24, x10
Lloh2:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	sub	x1, x8, x23
	mov	x0, x21
	bl	_min
	mov	x22, x0
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	cmp	x8, x27
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=3
	ldr	x8, [x20, #56]
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=3
	ldr	x8, [x20, #32]
	b	LBB0_12
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=3
	ldr	w8, [x20, #16]
	sub	w8, w8, #1
	add	w9, w19, w27
	cmp	w9, w8
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=3
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=3
	ldr	x23, [x20, #40]
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=3
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	ldr	x8, [x8, x27, lsl #3]
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=3
	add	x23, x8, x23
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=3
	mov	w26, w22
	sub	x21, x21, x26
	cmp	x28, x23
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=3
	ldr	x0, [x25, #8]
	bl	_be32_to_cpu
	add	w0, w0, w22
	bl	_cpu_to_be32
	mov	x23, #0
	str	x0, [x25, #8]
	ldr	w8, [x20, #16]
	add	x28, x28, x26
	add	x27, x27, #1
	add	w9, w19, w27
	cmp	w9, w8
	mov	x10, x24
	b.ne	LBB0_4
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=2
	mov	x0, x23
	bl	_cpu_to_be64
	ldr	x26, [sp, #40]                  ; 8-byte Folded Reload
	mov	w8, #24
	madd	x25, x24, x8, x26
	str	x0, [x25, #16]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [x25, #8]
Lloh5:
	adrp	x8, _SG_DATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SG_DATA@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_cpu_to_be32
	mov	x10, x24
	mov	x24, #0
	str	x0, [x25]
	add	x28, x23, w22, uxtw
	add	x10, x10, #1
	add	w8, w19, w27
	add	w8, w8, #1
	ldr	w9, [x20, #16]
	sub	w9, w19, w9
	add	w9, w9, w27
	mov	x22, x21
	cmn	w9, #1
	b.ne	LBB0_3
	b	LBB0_19
LBB0_16:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	x9, x22, [sp]                   ; 16-byte Folded Reload
	add	x9, x9, #128
	ldr	x26, [sp, #40]                  ; 8-byte Folded Reload
	add	x26, x26, #192
	ldr	w8, [x20, #16]
	cmp	w19, w8
Lloh8:
	adrp	x21, _SG_CHAINED@GOTPAGE
Lloh9:
	ldr	x21, [x21, _SG_CHAINED@GOTPAGEOFF]
	ldp	x28, x24, [sp, #16]             ; 16-byte Folded Reload
	b.lt	LBB0_2
	b	LBB0_19
LBB0_17:
	ldr	x26, [sp, #40]                  ; 8-byte Folded Reload
	b	LBB0_19
LBB0_18:
	mov	w10, #0
LBB0_19:
	mov	x8, #-192
	mov	w9, #7
	cmp	w10, #1
	csel	w20, w9, w10, eq
	csel	x8, x8, xzr, eq
	add	x19, x26, x8
	cmp	w20, #1
	b.lt	LBB0_22
; %bb.20:
	mov	x8, x20
	mov	x9, x19
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldur	q0, [x9, #24]
	str	q0, [x9]
	ldr	x10, [x9, #40]
	str	x10, [x9, #16]
	add	x9, x9, #24
	subs	x8, x8, #1
	b.ne	LBB0_21
	b	LBB0_23
LBB0_22:
	mov	x20, #0
LBB0_23:
	mov	x0, #0
	bl	_cpu_to_be64
	mov	w8, #24
	madd	x19, x20, x8, x19
	str	x0, [x19, #16]
	mov	w0, #0
	bl	_cpu_to_be32
	str	x0, [x19, #8]
Lloh10:
	adrp	x8, _SG_END_LIST@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SG_END_LIST@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_cpu_to_be32
	str	x0, [x19]
	mov	w0, #0
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_SG_CHAINED,4,2                 ; @SG_CHAINED
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_SG_DATA,4,2                    ; @SG_DATA
	.comm	_SG_END_LIST,4,2                ; @SG_END_LIST
.subsections_via_symbols
