	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_veu_calc_scale
_sh_veu_calc_scale:                     ## @sh_veu_calc_scale
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	16(%rbp), %r11
	movl	$0, (%r9)
	movl	$0, (%r8)
	movl	$0, (%r11)
	cmpl	%edx, %esi
	jne	LBB0_3
## %bb.1:
	cmpl	%esi, %ecx
	je	LBB0_17
## %bb.2:
	movl	$1, (%r8)
	popq	%rbp
	retq
LBB0_3:
	movl	%edx, %r10d
	movl	%esi, %ecx
	shll	$12, %ecx
	cmpl	%esi, %edx
	jle	LBB0_12
## %bb.4:
	cmpq	$0, (%rdi)
	je	LBB0_12
## %bb.5:
	movl	%ecx, %eax
	cltd
	idivl	%r10d
                                        ## kill: def $eax killed $eax def $rax
	leal	4095(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	movl	%edx, %edi
	sarl	$12, %edi
	movl	%edi, (%r8)
	andl	$-4096, %edx                    ## imm = 0xF000
	subl	%edx, %eax
	andl	$-8, %eax
	movl	%eax, (%r9)
	cmpl	$512, %eax                      ## imm = 0x200
	je	LBB0_10
## %bb.6:
	cmpl	$1024, %eax                     ## imm = 0x400
	je	LBB0_9
## %bb.7:
	cmpl	$2048, %eax                     ## imm = 0x800
	jne	LBB0_11
## %bb.8:
	movl	$1, (%r11)
	popq	%rbp
	retq
LBB0_10:
	movl	$7, (%r11)
	popq	%rbp
	retq
LBB0_9:
	movl	$3, (%r11)
	popq	%rbp
	retq
LBB0_11:
	cmpl	$0, (%r11)
	jne	LBB0_17
LBB0_12:
	addl	$-4096, %ecx                    ## imm = 0xF000
	leal	1(%r10), %edi
	movl	%ecx, %eax
	cltd
	idivl	%edi
                                        ## kill: def $eax killed $eax def $rax
	leal	4095(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movl	%ecx, %edx
	sarl	$12, %edx
	movl	%edx, (%r8)
	andl	$-4096, %ecx                    ## imm = 0xF000
	subl	%ecx, %eax
	movl	%eax, (%r9)
	testb	$7, %al
	je	LBB0_17
## %bb.13:
	andl	$-8, %eax
	cmpl	%esi, %r10d
	jle	LBB0_15
## %bb.14:
	addl	$-8, %eax
	jmp	LBB0_16
LBB0_15:
	addl	$8, %eax
LBB0_16:
	movl	%eax, (%r9)
LBB0_17:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_sh_veu_calc_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_veu_calc_scale
_sh_veu_calc_scale:                     ; @sh_veu_calc_scale
	.cfi_startproc
; %bb.0:
	str	wzr, [x5]
	str	wzr, [x4]
	str	wzr, [x6]
	cmp	w1, w2
	b.ne	LBB0_3
; %bb.1:
	cmp	w3, w1
	b.eq	LBB0_17
; %bb.2:
	mov	w8, #1
	str	w8, [x4]
	ret
LBB0_3:
	lsl	w8, w1, #12
	cmp	w2, w1
	b.le	LBB0_12
; %bb.4:
	ldr	x9, [x0]
	cbz	x9, LBB0_12
; %bb.5:
	sdiv	w9, w8, w2
	add	w10, w9, #4095
	cmp	w9, #0
	csel	w10, w10, w9, lt
	asr	w11, w10, #12
	str	w11, [x4]
	and	w10, w10, #0xfffff000
	sub	w9, w9, w10
	and	w9, w9, #0xfffffff8
	str	w9, [x5]
	cmp	w9, #512
	b.eq	LBB0_9
; %bb.6:
	cmp	w9, #1024
	b.eq	LBB0_10
; %bb.7:
	cmp	w9, #2048
	b.ne	LBB0_11
; %bb.8:
	mov	w8, #1
	str	w8, [x6]
	ret
LBB0_9:
	mov	w8, #7
	str	w8, [x6]
	ret
LBB0_10:
	mov	w8, #3
	str	w8, [x6]
	ret
LBB0_11:
	ldr	w9, [x6]
	cbnz	w9, LBB0_17
LBB0_12:
	sub	w8, w8, #1, lsl #12             ; =4096
	add	w9, w2, #1
	sdiv	w8, w8, w9
	add	w9, w8, #4095
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w10, w9, #12
	str	w10, [x4]
	and	w9, w9, #0xfffff000
	sub	w8, w8, w9
	str	w8, [x5]
	tst	w8, #0x7
	b.eq	LBB0_17
; %bb.13:
	and	w8, w8, #0xfffffff8
	cmp	w2, w1
	b.le	LBB0_15
; %bb.14:
	sub	w8, w8, #8
	b	LBB0_16
LBB0_15:
	add	w8, w8, #8
LBB0_16:
	str	w8, [x5]
LBB0_17:
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_sh_veu_calc_scale
.subsections_via_symbols
