	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_tile_dimensions
_calc_tile_dimensions:                  ## @calc_tile_dimensions
	.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	%rdi, %r9
	movq	(%rsi), %r8
	movq	_IMAGE_CONVERT_IN@GOTPCREL(%rip), %rax
	movl	$1024, -44(%rbp)                ## 4-byte Folded Spill
                                        ## imm = 0x400
	movl	$1024, -48(%rbp)                ## 4-byte Folded Spill
                                        ## imm = 0x400
	cmpq	(%rax), %r8
	jne	LBB0_2
## %bb.1:
	movb	(%r9), %cl
	movb	4(%r9), %al
	movl	$1024, %edx                     ## imm = 0x400
	shll	%cl, %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	$1024, %edx                     ## imm = 0x400
	movl	%eax, %ecx
	shll	%cl, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
LBB0_2:
	cmpl	$0, 8(%r9)
	je	LBB0_14
## %bb.3:
	movq	24(%r9), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	8(%rsi)
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rax
	movq	_IMAGE_CONVERT_OUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r8
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	16(%r9), %rax
	movq	(%rax,%rbx,8), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	24(%rsi), %r13
	leaq	(%rax,%rax,8), %rcx
	leaq	(%rcx,%rcx,2), %r12
	addq	%rax, %r12
	movq	16(%rsi), %rcx
	movl	(%rcx), %esi
	movl	4(%r13,%r12), %r11d
	movl	8(%r13,%r12), %eax
	movl	%esi, %edx
	imull	%r11d, %edx
	sarl	$3, %edx
	movl	%edx, %edi
	imull	%eax, %edi
	movl	%edi, (%r13,%r12)
	imull	%eax, %esi
	sarl	$3, %esi
	cmpq	$0, 8(%rcx)
	cmovnel	%eax, %esi
	cmovnel	%r11d, %edx
	movl	%esi, 12(%r13,%r12)
	movl	%edx, 16(%r13,%r12)
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	(%rcx), %edi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edx
	movq	_IMAGE_CONVERT_IN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r8
	leaq	L_.str.2(%rip), %r8
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rcx, %r8
	movl	24(%r13,%r12), %r14d
	movl	20(%r13,%r12), %r10d
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	movq	%r9, %r15
	movq	%r9, %rcx
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	pushq	%r10
	pushq	%r14
	pushq	%r11
	pushq	%rax
	pushq	-88(%rbp)                       ## 8-byte Folded Reload
	callq	_dev_dbg
	addq	$48, %rsp
	movl	4(%r13,%r12), %r8d
	movl	8(%r13,%r12), %ecx
	testl	%ecx, %ecx
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	-48(%rbp), %ecx                 ## 4-byte Folded Reload
	ja	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%r8d, %r8d
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	-44(%rbp), %r8d                 ## 4-byte Folded Reload
	ja	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movl	8(%r15), %eax
	cmpq	%rax, %rbx
	jae	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %r9
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	(%rsi), %r8
	jmp	LBB0_4
LBB0_14:
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_12:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_IMAGE_CONVERT_IN@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.5(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IMAGE_CONVERT_IN,8,3           ## @IMAGE_CONVERT_IN
	.comm	_IMAGE_CONVERT_OUT,8,3          ## @IMAGE_CONVERT_OUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"task %u: ctx %p: %s@[%u,%u]: %ux%u@%u,%u\n"

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

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

L_.str.3:                               ## @.str.3
	.asciz	"invalid %s tile size: %ux%u\n"

L_.str.4:                               ## @.str.4
	.asciz	"input"

L_.str.5:                               ## @.str.5
	.asciz	"output"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_calc_tile_dimensions
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_tile_dimensions
_calc_tile_dimensions:                  ; @calc_tile_dimensions
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _IMAGE_CONVERT_IN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IMAGE_CONVERT_IN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	w23, #1024
	mov	w24, #1024
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldp	w9, w10, [x20]
	lsl	w24, w23, w9
	lsl	w23, w23, w10
LBB0_2:
	ldr	w9, [x20, #8]
	cbz	w9, LBB0_10
; %bb.3:
	mov	x26, #0
	ldr	x27, [x20, #24]
	ldr	x25, [x27, #8]
Lloh3:
	adrp	x22, l_.str.1@PAGE
Lloh4:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh5:
	adrp	x21, l_.str@PAGE
Lloh6:
	add	x21, x21, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
Lloh7:
	adrp	x9, _IMAGE_CONVERT_OUT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IMAGE_CONVERT_OUT@GOTPAGEOFF]
Lloh9:
	ldr	x10, [x9]
	mov	x9, x26
	cmp	x8, x10
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x20, #16]
	ldr	x9, [x9, x26, lsl #3]
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w10, [x19, #8]
	udiv	w5, w26, w10
	msub	w6, w5, w10, w26
	ldp	x11, x10, [x19, #16]
	mov	w12, #28
	madd	x28, x9, x12, x10
	ldr	w9, [x11]
	ldp	w10, w7, [x28, #4]
	mul	w12, w9, w10
	asr	w12, w12, #3
	mul	w13, w12, w7
	str	w13, [x28]
	ldr	x11, [x11, #8]
	mul	w9, w7, w9
	asr	w9, w9, #3
	cmp	x11, #0
	csel	w9, w9, w7, eq
	csel	w11, w12, w10, eq
	stp	w9, w11, [x28, #12]
	ldr	x9, [x25]
	ldr	w0, [x9]
	ldr	w2, [x27]
Lloh10:
	adrp	x9, _IMAGE_CONVERT_IN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IMAGE_CONVERT_IN@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh13:
	adrp	x8, l_.str.2@PAGE
Lloh14:
	add	x8, x8, l_.str.2@PAGEOFF
	csel	x4, x22, x8, eq
	ldp	w9, w8, [x28, #20]
	stp	w8, w9, [sp, #4]
	str	w10, [sp]
	mov	x1, x21
	mov	x3, x20
	bl	_dev_dbg
	ldp	w4, w3, [x28, #4]
	cbz	w3, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w3, w24
	ccmp	w4, #0, #4, ls
	ccmp	w4, w23, #2, ne
	b.hi	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	ldr	w8, [x20, #8]
	cmp	x26, x8
	b.hs	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19]
	b	LBB0_4
LBB0_10:
	mov	w0, #0
	b	LBB0_12
LBB0_11:
	ldr	x8, [x25]
	ldr	w0, [x8]
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _IMAGE_CONVERT_IN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _IMAGE_CONVERT_IN@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
Lloh18:
	adrp	x10, l_.str.5@PAGE
Lloh19:
	add	x10, x10, l_.str.5@PAGEOFF
Lloh20:
	adrp	x11, l_.str.4@PAGE
Lloh21:
	add	x11, x11, l_.str.4@PAGEOFF
	cmp	x8, x9
	csel	x2, x11, x10, eq
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IMAGE_CONVERT_IN,8,3           ; @IMAGE_CONVERT_IN
	.comm	_IMAGE_CONVERT_OUT,8,3          ; @IMAGE_CONVERT_OUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"task %u: ctx %p: %s@[%u,%u]: %ux%u@%u,%u\n"

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

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

l_.str.3:                               ; @.str.3
	.asciz	"invalid %s tile size: %ux%u\n"

l_.str.4:                               ; @.str.4
	.asciz	"input"

l_.str.5:                               ; @.str.5
	.asciz	"output"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_calc_tile_dimensions
.subsections_via_symbols
