	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_h_scale_registers
_calculate_h_scale_registers:           ## @calculate_h_scale_registers
	.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	%rbx
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%edx, %r10d
	movq	_MASK_29@GOTPCREL(%rip), %r11
	movl	(%r11), %ebx
	notl	%ebx
	andl	(%r8), %ebx
	movl	%ebx, (%r8)
	movl	$1, %edi
	cmpl	%edx, %esi
	jle	LBB0_4
## %bb.3:
	movl	%esi, %eax
	cltd
	idivl	%r10d
	movl	%eax, %edi
LBB0_4:
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.5:
	orl	(%r11), %ebx
	movl	%ebx, (%r8)
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%esi, %eax
	cltd
	idivl	%edi
	incl	%edi
	cmpl	$383, %eax                      ## imm = 0x17F
	jg	LBB0_6
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%esi, %eax
	cltd
	idivl	%edi
	incl	%edi
	cmpl	$767, %eax                      ## imm = 0x2FF
	jg	LBB0_7
LBB0_8:
	decl	%edi
	cmpl	$64, %edi
	movl	$64, %ebx
	cmovll	%edi, %ebx
	movq	_hps_h_coeff_tab@GOTPCREL(%rip), %rax
	movq	(%rax), %r11
	movslq	%ebx, %r8
	movl	-8(%r11,%r8,8), %r14d
	cmpl	%r10d, %esi
	jne	LBB0_10
## %bb.9:
	movl	$1024, %eax                     ## imm = 0x400
	cmpl	$1, %ebx
	je	LBB0_11
LBB0_10:
	shll	$10, %esi
	imull	%ebx, %r10d
	movl	%esi, %eax
	cltd
	idivl	%r10d
	addl	%ebx, %eax
LBB0_11:
	decq	%r8
	xorl	%r15d, %r15d
	cmpl	$1024, %eax                     ## imm = 0x400
	sete	%r15b
	xorl	%r10d, %r10d
	movl	$131072, %edi                   ## imm = 0x20000
	movl	$0, %esi
	cmpl	$1, %ebx
	je	LBB0_15
## %bb.12:
	movslq	4(%r11,%r8,8), %rbx
	movq	_h_attenuation@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	$-134217728, %esi               ## imm = 0xF8000000
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx), %rdx
	addl	$134217728, %esi                ## imm = 0x8000000
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	addq	$8, %rcx
	cmpq	%rbx, %rdx
	jl	LBB0_13
LBB0_15:
	movq	24(%rbp), %rbx
	movq	16(%rbp), %r11
	shll	$31, %r15d
	cmpl	$1024, %eax                     ## imm = 0x400
	je	LBB0_19
## %bb.16:
	movl	$16777216, %r10d                ## imm = 0x1000000
	cmpl	$1536, %eax                     ## imm = 0x600
	jl	LBB0_19
## %bb.17:
	movl	$285212672, %r10d               ## imm = 0x11000000
	cmpl	$1664, %eax                     ## imm = 0x680
	jb	LBB0_19
## %bb.18:
	cmpl	$1792, %eax                     ## imm = 0x700
	movl	$570425344, %ecx                ## imm = 0x22000000
	movl	$855638016, %r10d               ## imm = 0x33000000
	cmovbl	%ecx, %r10d
LBB0_19:
	movq	_MASK_W0@GOTPCREL(%rip), %rcx
	movq	_MASK_B2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	andl	(%r9), %edx
	orl	%r10d, %edx
	movl	%edx, (%r9)
	movq	_MASK_W1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	(%rbx), %ecx
	andl	$-61441, %ecx                   ## imm = 0xFFFF0FFF
	shll	$12, %eax
	orl	%eax, %r15d
	orl	%ecx, %r15d
	movl	%r15d, (%rbx)
	shll	$18, %r8d
	orl	%r14d, %r8d
	shll	$8, %r14d
	orl	%r8d, %r14d
	orl	%esi, %r14d
	orl	%edi, %r14d
	orl	%r14d, (%r11)
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MASK_29,4,2                    ## @MASK_29
	.comm	_hps_h_coeff_tab,8,3            ## @hps_h_coeff_tab
	.comm	_h_attenuation,8,3              ## @h_attenuation
	.comm	_MASK_W0,4,2                    ## @MASK_W0
	.comm	_MASK_B2,4,2                    ## @MASK_B2
	.comm	_MASK_W1,4,2                    ## @MASK_W1
	.no_dead_strip	_calculate_h_scale_registers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_h_scale_registers
_calculate_h_scale_registers:           ; @calculate_h_scale_registers
	.cfi_startproc
; %bb.0:
	cbz	w2, LBB0_3
; %bb.1:
Lloh0:
	adrp	x9, _MASK_29@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MASK_29@GOTPAGEOFF]
	ldr	w8, [x9]
	ldr	w10, [x4]
	bic	w10, w10, w8
	str	w10, [x4]
	cmp	w1, w2
	b.le	LBB0_4
; %bb.2:
	sdiv	w8, w1, w2
	cbnz	w3, LBB0_5
	b	LBB0_7
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_4:
	mov	w8, #1
	cbz	w3, LBB0_7
LBB0_5:
	ldr	w9, [x9]
	orr	w9, w9, w10
	str	w9, [x4]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sdiv	w9, w1, w8
	add	w8, w8, #1
	cmp	w9, #383
	b.gt	LBB0_6
	b	LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sdiv	w9, w1, w8
	add	w8, w8, #1
	cmp	w9, #767
	b.gt	LBB0_7
LBB0_8:
	sub	w8, w8, #1
	mov	w9, #64
Lloh5:
	adrp	x10, _hps_h_coeff_tab@GOTPAGE
Lloh6:
	ldr	x10, [x10, _hps_h_coeff_tab@GOTPAGEOFF]
	cmp	w8, #64
	csel	w13, w8, w9, lt
Lloh7:
	ldr	x12, [x10]
	sxtw	x8, w13
	sub	x8, x8, #1
	lsl	x10, x8, #3
	cmp	w1, w2
	b.ne	LBB0_11
; %bb.9:
	cmp	w13, #1
	b.ne	LBB0_11
; %bb.10:
	mov	w9, #1024
	b	LBB0_12
LBB0_11:
	lsl	w9, w1, #10
	mul	w11, w13, w2
	sdiv	w9, w9, w11
	add	w9, w9, w13
LBB0_12:
	ldr	w10, [x12, x10]
	cmp	w9, #1024
	cset	w11, eq
	lsl	w11, w11, #31
	cmp	w13, #1
	b.ne	LBB0_14
; %bb.13:
	mov	w12, #0
	mov	w13, #131072
	b	LBB0_17
LBB0_14:
	add	x12, x12, x8, lsl #3
	ldrsw	x13, [x12, #4]
Lloh8:
	adrp	x12, _h_attenuation@GOTPAGE
Lloh9:
	ldr	x12, [x12, _h_attenuation@GOTPAGEOFF]
Lloh10:
	ldr	x14, [x12]
	mov	w12, #-134217728
	mov	w15, #134217728
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x16, [x14], #8
	add	w12, w12, w15
	cmp	x16, #0
	ccmp	x16, x13, #0, ne
	b.lt	LBB0_15
; %bb.16:
	mov	w13, #0
LBB0_17:
	mov	w0, #0
	mov	w14, #16777216
	mov	w15, #855638016
	mov	w16, #570425344
	cmp	w9, #1792
	csel	w15, w16, w15, lo
	mov	w16, #285212672
	cmp	w9, #1664
	csel	w15, w16, w15, lo
	cmp	w9, #1536
	csel	w14, w14, w15, lt
	cmp	w9, #1024
	csel	w14, wzr, w14, eq
Lloh11:
	adrp	x15, _MASK_W0@GOTPAGE
Lloh12:
	ldr	x15, [x15, _MASK_W0@GOTPAGEOFF]
Lloh13:
	ldr	w15, [x15]
Lloh14:
	adrp	x16, _MASK_B2@GOTPAGE
Lloh15:
	ldr	x16, [x16, _MASK_B2@GOTPAGEOFF]
Lloh16:
	ldr	w16, [x16]
	orr	w15, w16, w15
	ldr	w16, [x5]
	and	w15, w16, w15
	orr	w14, w15, w14
	str	w14, [x5]
Lloh17:
	adrp	x14, _MASK_W1@GOTPAGE
Lloh18:
	ldr	x14, [x14, _MASK_W1@GOTPAGEOFF]
Lloh19:
	ldr	w14, [x14]
	ldr	w15, [x7]
	bic	w14, w15, w14
	and	w14, w14, #0xffff0fff
	orr	w9, w11, w9, lsl #12
	orr	w9, w9, w14
	str	w9, [x7]
	ldr	w9, [x6]
	orr	w8, w10, w8, lsl #18
	orr	w8, w8, w10, lsl #8
	orr	w8, w8, w12
	orr	w8, w8, w13
	orr	w8, w8, w9
	str	w8, [x6]
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MASK_29,4,2                    ; @MASK_29
	.comm	_hps_h_coeff_tab,8,3            ; @hps_h_coeff_tab
	.comm	_h_attenuation,8,3              ; @h_attenuation
	.comm	_MASK_W0,4,2                    ; @MASK_W0
	.comm	_MASK_B2,4,2                    ; @MASK_B2
	.comm	_MASK_W1,4,2                    ; @MASK_W1
	.no_dead_strip	_calculate_h_scale_registers
.subsections_via_symbols
