	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bs_copy_box                    ## -- Begin function bs_copy_box
	.p2align	4, 0x90
_bs_copy_box:                           ## @bs_copy_box
	.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
	movl	%ecx, %r13d
	testl	%ecx, %ecx
	jle	LBB0_17
## %bb.1:
	movl	%r8d, %r12d
	testl	%r8d, %r8d
	jle	LBB0_17
## %bb.2:
	movl	%esi, %ecx
	movq	%rdi, %r15
	movl	%r13d, %ebx
	addl	%esi, %ebx
	js	LBB0_18
## %bb.3:
	movl	%edx, %r14d
	movl	%r12d, %eax
	addl	%edx, %eax
	js	LBB0_18
## %bb.4:
	movq	_g_width1@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	cmpl	%ecx, %edi
	jle	LBB0_18
## %bb.5:
	movq	_g_height1@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	%r14d, %edx
	jle	LBB0_18
## %bb.6:
	movl	%r14d, %esi
	orl	%ecx, %esi
	js	LBB0_13
## %bb.7:
	cmpl	%edi, %ebx
	jg	LBB0_13
## %bb.8:
	cmpl	%edx, %eax
	jg	LBB0_13
## %bb.9:
	movslq	%r9d, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	addq	-48(%rbp), %r15                 ## 8-byte Folded Reload
	incl	%r14d
	decl	%r12d
	movl	%ebx, %ecx
	je	LBB0_17
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %ebx
	movl	%ecx, %edi
	movl	%r14d, %esi
	callq	_get_bs_ptr
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_g_Bpp@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	imull	%r13d, %edx
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_bs_copy_mem
	jmp	LBB0_12
LBB0_18:
	imull	%r13d, %r12d
	movq	_g_Bpp@GOTPCREL(%rip), %rax
	imull	(%rax), %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_13:
	movl	%r12d, %edx
	imull	%r13d, %edx
	movq	_g_Bpp@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	callq	_memset
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, %esi
	cmovnsl	%r13d, %ebx
	movl	$0, %edi
	cmovgl	%esi, %edi
	leal	(%rbx,%rdi), %eax
	movq	_g_width1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	movq	%rdi, %r13
	subl	%edi, %edx
	cmpl	%ecx, %eax
	cmovlel	%ebx, %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	_g_Bpp@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%esi, %ecx
	imull	%esi, %eax
	negl	%eax
	sarl	$31, %ecx
	andl	%eax, %ecx
	movslq	%ecx, %rbx
	addq	%r15, %rbx
	movslq	-56(%rbp), %r15                 ## 4-byte Folded Reload
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	addq	%r15, %rbx
	incl	%r14d
	decl	%r12d
	je	LBB0_17
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	movl	%r14d, %esi
	callq	_get_bs_ptr
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_g_Bpp@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	imull	-48(%rbp), %edx                 ## 4-byte Folded Reload
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_bs_copy_mem
	jmp	LBB0_16
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_width1,4,2                   ## @g_width1
	.comm	_g_height1,4,2                  ## @g_height1
	.comm	_g_Bpp,4,2                      ## @g_Bpp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bs_copy_box                    ; -- Begin function bs_copy_box
	.p2align	2
_bs_copy_box:                           ; @bs_copy_box
	.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
	cmp	w3, #1
	b.lt	LBB0_17
; %bb.1:
	mov	x19, x4
	cmp	w4, #1
	b.lt	LBB0_17
; %bb.2:
	mov	x23, x3
	mov	x22, x1
	mov	x21, x0
	adds	w26, w3, w1
	b.mi	LBB0_12
; %bb.3:
	mov	x20, x2
	adds	w8, w19, w2
	b.mi	LBB0_12
; %bb.4:
Lloh0:
	adrp	x27, _g_width1@GOTPAGE
Lloh1:
	ldr	x27, [x27, _g_width1@GOTPAGEOFF]
	ldr	w9, [x27]
	cmp	w9, w22
	b.le	LBB0_12
; %bb.5:
Lloh2:
	adrp	x10, _g_height1@GOTPAGE
Lloh3:
	ldr	x10, [x10, _g_height1@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	cmp	w10, w20
	b.le	LBB0_12
; %bb.6:
	mov	x24, x5
	orr	w11, w20, w22
	tbnz	w11, #31, LBB0_13
; %bb.7:
	cmp	w26, w9
	ccmp	w8, w10, #0, le
	b.gt	LBB0_13
; %bb.8:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x24, w24
Lloh5:
	adrp	x25, _g_Bpp@GOTPAGE
Lloh6:
	ldr	x25, [x25, _g_Bpp@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x21, x21, x24
	add	w20, w20, #1
	subs	w19, w19, #1
	b.eq	LBB0_17
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x20
	bl	_get_bs_ptr
	cbz	x0, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x1, x0
	ldr	w8, [x25]
	mul	w2, w8, w23
	mov	x0, x21
	bl	_bs_copy_mem
	b	LBB0_9
LBB0_12:
Lloh7:
	adrp	x8, _g_Bpp@GOTPAGE
Lloh8:
	ldr	x8, [x8, _g_Bpp@GOTPAGEOFF]
	mul	w9, w19, w23
Lloh9:
	ldr	w8, [x8]
	mul	w2, w9, w8
	mov	x0, x21
	mov	w1, #0
	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
	b	_memset
LBB0_13:
	mul	w8, w19, w23
Lloh10:
	adrp	x25, _g_Bpp@GOTPAGE
Lloh11:
	ldr	x25, [x25, _g_Bpp@GOTPAGEOFF]
	ldr	w9, [x25]
	mul	w2, w8, w9
	mov	x0, x21
	mov	w1, #0
	bl	_memset
	cmp	w22, #0
	csel	w8, w26, w23, lt
	csel	w23, w22, wzr, gt
	ldr	w9, [x27]
	sub	w10, w9, w23
	add	w11, w8, w23
	cmp	w11, w9
	csel	w26, w10, w8, gt
	ldr	w8, [x25]
	mneg	w8, w8, w22
	and	w8, w8, w22, asr #31
	add	x21, x21, w8, sxtw
	sxtw	x22, w24
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x21, x21, x22
	add	w20, w20, #1
	subs	w19, w19, #1
	b.eq	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x20
	bl	_get_bs_ptr
	cbz	x0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x1, x0
	ldr	w8, [x25]
	mul	w2, w8, w26
	mov	x0, x21
	bl	_bs_copy_mem
	b	LBB0_14
LBB0_17:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_g_width1,4,2                   ; @g_width1
	.comm	_g_height1,4,2                  ; @g_height1
	.comm	_g_Bpp,4,2                      ; @g_Bpp
.subsections_via_symbols
