	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function test_dwtf
_test_dwtf:                             ## @test_dwtf
	.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
	movss	%xmm0, -68(%rbp)                ## 4-byte Spill
	movl	%ecx, %ebx
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	$0, -48(%rbp)
	movq	_FF_DWT97@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rdi
	movq	%rdx, %rsi
	movl	%ebx, %edx
	callq	_ff_jpeg2000_dwt_init
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	leaq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	_ff_dwt_encode
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	leaq	-48(%rbp), %rdi
	movq	%r13, %rsi
	callq	_ff_dwt_decode
	testl	%eax, %eax
	js	LBB0_4
## %bb.6:
	movq	_MAX_W@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	imull	%eax, %eax
	testl	%eax, %eax
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	xorps	%xmm0, %xmm0
	je	LBB0_7
## %bb.8:
	movsd	%xmm0, -64(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movss	(%r13,%rbx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	subss	(%r12,%rbx,4), %xmm0
	callq	_FFABS
	ucomiss	-68(%rbp), %xmm0                ## 4-byte Folded Reload
	ja	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movss	(%r13,%rbx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	movss	(%r12,%rbx,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	subss	%xmm1, %xmm0
	mulss	%xmm0, %xmm0
	cvtss2sd	%xmm0, %xmm0
	movsd	-64(%rbp), %xmm2                ## 8-byte Reload
                                        ## xmm2 = mem[0],zero
	addsd	%xmm0, %xmm2
	movsd	%xmm2, -64(%rbp)                ## 8-byte Spill
	movss	%xmm1, (%r13,%rbx,4)
	incq	%rbx
	movl	(%r14), %eax
	imull	%eax, %eax
	cmpq	%rax, %rbx
	jb	LBB0_9
	jmp	LBB0_12
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %eax
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movsd	%xmm0, -64(%rbp)                ## 8-byte Spill
LBB0_12:
	leaq	-48(%rbp), %rdi
	callq	_ff_dwt_destroy
	movl	(%r15), %edx
	movl	4(%r15), %ecx
	movl	8(%r15), %r8d
	movl	12(%r15), %r9d
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%r9d, %esi
	subl	%r8d, %esi
	imull	%eax, %esi
	xorps	%xmm1, %xmm1
	cvtsi2sd	%esi, %xmm1
	movsd	-64(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	divsd	%xmm1, %xmm0
	leaq	L_.str.3(%rip), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_printf
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_10:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movss	(%r13,%rbx,4), %xmm0            ## xmm0 = mem[0],zero,zero,zero
	cvtss2sd	%xmm0, %xmm0
	movss	(%r12,%rbx,4), %xmm1            ## xmm1 = mem[0],zero,zero,zero
	cvtss2sd	%xmm1, %xmm1
	movl	(%r15), %r8d
	movl	4(%r15), %r9d
	movl	8(%r15), %r10d
	movl	12(%r15), %r11d
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movb	$2, %al
	pushq	%r11
	pushq	%r10
	callq	_fprintf
	addq	$16, %rsp
	movl	$2, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_FF_DWT97,4,2                   ## @FF_DWT97
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ff_jpeg2000_dwt_init failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"ff_dwt_encode failed\n"

	.comm	_MAX_W,4,2                      ## @MAX_W
L_.str.2:                               ## @.str.2
	.asciz	"missmatch at %d (%f != %f) decomp:%d border %d %d %d %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"9/7f, decomp:%2d border %3d %3d %3d %3d err2:%20.3f\n"

	.no_dead_strip	_test_dwtf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function test_dwtf
_test_dwtf:                             ; @test_dwtf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	d9, d8, [sp, #80]               ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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 b8, -88
	.cfi_offset b9, -96
	fmov	s8, s0
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	str	wzr, [sp, #72]
Lloh0:
	adrp	x8, _FF_DWT97@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FF_DWT97@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x0, sp, #72
	mov	x1, x2
	mov	x2, x19
	bl	_ff_jpeg2000_dwt_init
	tbnz	w0, #31, LBB0_8
; %bb.1:
	add	x0, sp, #72
	mov	x1, x22
	bl	_ff_dwt_encode
	tbnz	w0, #31, LBB0_7
; %bb.2:
	add	x0, sp, #72
	mov	x1, x22
	bl	_ff_dwt_decode
	tbnz	w0, #31, LBB0_7
; %bb.3:
Lloh3:
	adrp	x24, _MAX_W@GOTPAGE
Lloh4:
	ldr	x24, [x24, _MAX_W@GOTPAGEOFF]
	ldr	w8, [x24]
	mul	w8, w8, w8
	cbz	w8, LBB0_11
; %bb.4:
	mov	x23, #0
	movi	d9, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x25, x23, #2
	ldr	s0, [x22, x25]
	ldr	s1, [x21, x25]
	fsub	s0, s0, s1
	bl	_FFABS
	fcmp	s0, s8
	b.gt	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	s0, [x22, x25]
	ldr	s1, [x21, x25]
	fsub	s0, s0, s1
	fmul	s0, s0, s0
	fcvt	d0, s0
	fadd	d9, d9, d0
	str	s1, [x22, x25]
	add	x23, x23, #1
	ldr	w8, [x24]
	mul	w8, w8, w8
	cmp	x23, x8
	b.lo	LBB0_5
	b	LBB0_12
LBB0_7:
Lloh5:
	adrp	x8, _stderr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh10:
	adrp	x8, _stderr@GOTPAGE
Lloh11:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
LBB0_9:
	bl	_fprintf
	mov	w0, #1
LBB0_10:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #80]               ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_11:
	movi	d9, #0000000000000000
LBB0_12:
	add	x0, sp, #72
	bl	_ff_dwt_destroy
	ldp	w2, w3, [x20]
	ldp	w4, w5, [x20, #8]
	sub	w8, w3, w2
	sub	w9, w5, w4
	mul	w8, w9, w8
	scvtf	d0, w8
	fdiv	d0, d9, d0
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_printf
	mov	w0, #0
	b	LBB0_10
LBB0_13:
Lloh17:
	adrp	x8, _stderr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	s0, [x22, x25]
	ldr	s1, [x21, x25]
	fcvt	d0, s0
	fcvt	d1, s1
	ldp	w8, w9, [x20]
	ldp	w10, w11, [x20, #8]
	stp	x10, x11, [sp, #48]
	stp	x8, x9, [sp, #32]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	str	x19, [sp, #24]
	stp	d0, d1, [sp, #8]
	str	x23, [sp]
	bl	_fprintf
	mov	w0, #2
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_FF_DWT97,4,2                   ; @FF_DWT97
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ff_jpeg2000_dwt_init failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"ff_dwt_encode failed\n"

	.comm	_MAX_W,4,2                      ; @MAX_W
l_.str.2:                               ; @.str.2
	.asciz	"missmatch at %d (%f != %f) decomp:%d border %d %d %d %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"9/7f, decomp:%2d border %3d %3d %3d %3d err2:%20.3f\n"

	.no_dead_strip	_test_dwtf
.subsections_via_symbols
