	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpl	$5, %edi
	jge	LBB0_4
## %bb.1:
	xorl	%r12d, %r12d
	movl	$0, -68(%rbp)                   ## 4-byte Folded Spill
	movl	$0, %edx
	cmpl	$4, %ebx
	je	LBB0_10
## %bb.2:
	cmpl	$2, %ebx
	jg	LBB0_8
## %bb.3:
	leaq	L_str(%rip), %rdi
	callq	_puts
	leaq	L_str.10(%rip), %rdi
	callq	_puts
	jmp	LBB0_32
LBB0_4:
	movq	32(%r15), %rdi
	callq	_atoi
	movl	%eax, %r12d
	movl	$0, -68(%rbp)                   ## 4-byte Folded Spill
	cmpl	$5, %ebx
	je	LBB0_5
## %bb.6:
	movq	40(%r15), %rdi
	callq	_atoi
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	cmpl	$7, %ebx
	jae	LBB0_9
LBB0_5:
	movl	%r12d, %edx
	jmp	LBB0_10
LBB0_8:
	xorl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	$1, %r13d
	movl	$0, -68(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	jmp	LBB0_22
LBB0_9:
	movq	48(%r15), %rdi
	callq	_atoi
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r12), %edx
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovgl	%eax, %ecx
	subl	%ecx, %r12d
LBB0_10:
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	24(%r15), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_18
## %bb.11:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_19
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_20
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_21
## %bb.14:
	leaq	-64(%rbp), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_strtol
	movl	%eax, %r13d
	movq	-64(%rbp), %rax
	cmpb	$0, (%rax)
	jne	LBB0_17
## %bb.15:
	testl	%r13d, %r13d
	jle	LBB0_17
## %bb.16:
	cmpl	$3, %r13d
	jl	LBB0_22
LBB0_17:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r15), %rdx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_32
LBB0_18:
	movl	$1, %r13d
	jmp	LBB0_22
LBB0_19:
	movl	$2, %r13d
	jmp	LBB0_22
LBB0_20:
	movl	$4, %r13d
	jmp	LBB0_22
LBB0_21:
	movl	$8, %r13d
LBB0_22:
	movq	8(%r15), %rdi
	leaq	L_.str.7(%rip), %r14
	movq	%r14, %rsi
	callq	_fopen
	movq	%rax, %rbx
	movq	%rax, -64(%rbp)
	movq	16(%r15), %rdi
	movq	%r14, %rsi
	callq	_fopen
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_31
## %bb.23:
	testq	%rbx, %rbx
	je	LBB0_31
## %bb.24:
	movl	$2, %ebx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpl	%eax, %r12d
	jg	LBB0_33
## %bb.25:
	leal	1(%rax), %r15d
	movl	$-1, %r14d
	movq	%r12, %rcx
	xorl	%r12d, %r12d
	movq	%rcx, %rax
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	%ecx, %ebx
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_28 Depth=1
	movl	%eax, %r14d
	movl	%ebx, %r12d
LBB0_27:                                ##   in Loop: Header=BB0_28 Depth=1
	incl	%ebx
	cmpl	%ebx, %r15d
	je	LBB0_35
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	leaq	-64(%rbp), %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	callq	_run_psnr
	cmpl	%r14d, %eax
	jg	LBB0_26
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	testl	%ebx, %ebx
	jns	LBB0_27
## %bb.30:                              ##   in Loop: Header=BB0_28 Depth=1
	cmpl	%r14d, %eax
	je	LBB0_26
	jmp	LBB0_27
LBB0_31:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_32:
	movl	$1, %ebx
LBB0_33:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_38
## %bb.34:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_35:
	testl	%r14d, %r14d
	movl	$2, %ebx
	js	LBB0_33
## %bb.36:
	xorl	%ebx, %ebx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpl	-88(%rbp), %eax                 ## 4-byte Folded Reload
	jle	LBB0_33
## %bb.37:
	movq	_F@GOTPCREL(%rip), %rcx
	movl	%r14d, %eax
	cltd
	idivl	(%rcx)
	leaq	L_.str.9(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_33
LBB0_38:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"u8"

L_.str.1:                               ## @.str.1
	.asciz	"s16"

L_.str.2:                               ## @.str.2
	.asciz	"f32"

L_.str.3:                               ## @.str.3
	.asciz	"f64"

	.comm	_stderr,4,2                     ## @stderr
L_.str.4:                               ## @.str.4
	.asciz	"Unsupported sample format: %s\nSupported: u8, s16, f32, f64\n"

L_.str.7:                               ## @.str.7
	.asciz	"rb"

L_.str.8:                               ## @.str.8
	.asciz	"Could not open input files.\n"

L_.str.9:                               ## @.str.9
	.asciz	"Best PSNR is %3d.%02d for shift %i\n"

	.comm	_F,4,2                          ## @F
L_str:                                  ## @str
	.asciz	"tiny_psnr <file1> <file2> [<elem size>|u8|s16|f32|f64 [<shift> [<skip bytes> [<shift search range>]]]]"

L_str.10:                               ## @str.10
	.asciz	"WAV headers are skipped automatically."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	cmp	w0, #5
	b.ge	LBB0_3
; %bb.1:
	cmp	w22, #4
	b.ne	LBB0_5
; %bb.2:
	mov	w19, #0
	mov	w20, #0
	mov	w25, #0
	b	LBB0_11
LBB0_3:
	ldr	x0, [x21, #32]
	bl	_atoi
	mov	x19, x0
	cmp	w22, #5
	b.ne	LBB0_7
; %bb.4:
	mov	w20, #0
	mov	x25, x19
	b	LBB0_11
LBB0_5:
	cmp	w22, #2
	b.gt	LBB0_9
; %bb.6:
Lloh3:
	adrp	x0, l_str@PAGE
Lloh4:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh5:
	adrp	x0, l_str.10@PAGE
Lloh6:
	add	x0, x0, l_str.10@PAGEOFF
	bl	_puts
	mov	w0, #1
	b	LBB0_39
LBB0_7:
	ldr	x0, [x21, #40]
	bl	_atoi
	mov	x20, x0
	cmp	w22, #7
	b.hs	LBB0_10
; %bb.8:
	mov	x25, x19
	b	LBB0_11
LBB0_9:
	mov	w25, #0
	mov	w20, #0
	mov	w19, #0
	b	LBB0_19
LBB0_10:
	ldr	x0, [x21, #48]
	bl	_atoi
	add	w25, w0, w19
	cmp	w0, #0
	csel	w8, w0, wzr, gt
	sub	w19, w19, w8
LBB0_11:
	ldr	x22, [x21, #24]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_strcmp
	cbz	w0, LBB0_19
; %bb.12:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_strcmp
	cbz	w0, LBB0_20
; %bb.13:
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_strcmp
	cbz	w0, LBB0_21
; %bb.14:
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	bl	_strcmp
	cbz	w0, LBB0_22
; %bb.15:
	add	x1, sp, #24
	mov	x0, x22
	mov	w2, #0
	bl	_strtol
	ldr	x8, [sp, #24]
	ldrb	w8, [x8]
	cbnz	w8, LBB0_18
; %bb.16:
	mov	x22, x0
	cmp	w0, #1
	b.lt	LBB0_18
; %bb.17:
	cmp	w22, #3
	b.lt	LBB0_23
LBB0_18:
Lloh15:
	adrp	x8, _stderr@GOTPAGE
Lloh16:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	x8, [x21, #24]
	str	x8, [sp]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_33
LBB0_19:
	mov	w22, #1
	b	LBB0_23
LBB0_20:
	mov	w22, #2
	b	LBB0_23
LBB0_21:
	mov	w22, #4
	b	LBB0_23
LBB0_22:
	mov	w22, #8
LBB0_23:
	ldr	x0, [x21, #8]
Lloh20:
	adrp	x24, l_.str.7@PAGE
Lloh21:
	add	x24, x24, l_.str.7@PAGEOFF
	mov	x1, x24
	bl	_fopen
	mov	x23, x0
	str	x0, [sp, #24]
	ldr	x0, [x21, #16]
	mov	x1, x24
	bl	_fopen
	str	x0, [sp, #32]
	cbz	x0, LBB0_32
; %bb.24:
	cbz	x23, LBB0_32
; %bb.25:
	cmp	w19, w25
	b.gt	LBB0_38
; %bb.26:
	mov	w23, #0
	add	w26, w25, #1
	mov	w24, #-1
	mov	x21, x19
	b	LBB0_29
LBB0_27:                                ;   in Loop: Header=BB0_29 Depth=1
	mov	x24, x0
	mov	x23, x21
LBB0_28:                                ;   in Loop: Header=BB0_29 Depth=1
	add	w21, w21, #1
	cmp	w26, w21
	b.eq	LBB0_34
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #24
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_run_psnr
	cmp	w0, w24
	b.gt	LBB0_27
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=1
	tbz	w21, #31, LBB0_28
; %bb.31:                               ;   in Loop: Header=BB0_29 Depth=1
	cmp	w0, w24
	b.eq	LBB0_27
	b	LBB0_28
LBB0_32:
Lloh22:
	adrp	x8, _stderr@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, l_.str.8@PAGE
Lloh26:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_33:
	bl	_fprintf
	mov	w0, #1
	b	LBB0_39
LBB0_34:
	tbnz	w24, #31, LBB0_38
; %bb.35:
	cmp	w25, w19
	b.le	LBB0_37
; %bb.36:
Lloh27:
	adrp	x8, _F@GOTPAGE
Lloh28:
	ldr	x8, [x8, _F@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	sdiv	w9, w24, w8
	msub	w8, w9, w8, w24
	stp	x8, x23, [sp, #8]
	str	x9, [sp]
Lloh30:
	adrp	x0, l_.str.9@PAGE
Lloh31:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_printf
LBB0_37:
	mov	w0, #0
	b	LBB0_39
LBB0_38:
	mov	w0, #2
LBB0_39:
	ldr	x8, [sp, #40]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_41
; %bb.40:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_41:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"u8"

l_.str.1:                               ; @.str.1
	.asciz	"s16"

l_.str.2:                               ; @.str.2
	.asciz	"f32"

l_.str.3:                               ; @.str.3
	.asciz	"f64"

	.comm	_stderr,4,2                     ; @stderr
l_.str.4:                               ; @.str.4
	.asciz	"Unsupported sample format: %s\nSupported: u8, s16, f32, f64\n"

l_.str.7:                               ; @.str.7
	.asciz	"rb"

l_.str.8:                               ; @.str.8
	.asciz	"Could not open input files.\n"

l_.str.9:                               ; @.str.9
	.asciz	"Best PSNR is %3d.%02d for shift %i\n"

	.comm	_F,4,2                          ; @F
l_str:                                  ; @str
	.asciz	"tiny_psnr <file1> <file2> [<elem size>|u8|s16|f32|f64 [<shift> [<skip bytes> [<shift search range>]]]]"

l_str.10:                               ; @str.10
	.asciz	"WAV headers are skipped automatically."

.subsections_via_symbols
