	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function upscale_image
_upscale_image:                         ## @upscale_image
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	testl	%edi, %edi
	je	LBB0_14
## %bb.1:
	movq	%rsi, %r12
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.2:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.3:
	cmpq	$0, (%r12)
	je	LBB0_14
## %bb.4:
	movl	8(%r12), %ecx
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.5:
	movl	12(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.6:
	imull	%edi, %ecx
	movl	%ecx, 8(%r15)
	imull	%edi, %eax
	movl	%eax, 12(%r15)
	imull	%ecx, %eax
	movl	%eax, %edi
	movl	$4, %esi
	callq	_calloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_14
## %bb.7:
	movq	%rax, %r10
	movl	8(%r12), %eax
	movl	12(%r12), %r8d
	shll	$16, %eax
	movl	8(%r15), %edi
	movl	12(%r15), %r9d
	cltd
	idivl	%edi
	movl	%eax, %r11d
	shll	$16, %r8d
	movl	%r8d, %eax
	cltd
	idivl	%r9d
	movl	$1, %r14d
	testl	%r9d, %r9d
	je	LBB0_14
## %bb.8:
	xorl	%r8d, %r8d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%r8d
	movl	%ecx, %edi
	cmpl	%r9d, %r8d
	jae	LBB0_14
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movl	$0, %ecx
	testl	%edi, %edi
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%r8d, %r13d
	imull	%eax, %r13d
	shrl	$16, %r13d
	movq	(%r12), %r9
	xorl	%ecx, %ecx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ecx, %esi
	shrl	$16, %esi
	movl	8(%r12), %edx
	imull	%r13d, %edx
	addl	%esi, %edx
	movl	(%r9,%rdx,4), %edx
	imull	%r8d, %edi
	addl	%ebx, %edi
	movl	%edx, (%r10,%rdi,4)
	incl	%ebx
	movl	8(%r15), %edi
	addl	%r11d, %ecx
	cmpl	%edi, %ebx
	jb	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	12(%r15), %r9d
	movl	%edi, %ecx
	jmp	LBB0_13
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_upscale_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function upscale_image
_upscale_image:                         ; @upscale_image
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x8, x0
	mov	w0, #0
	cbz	w8, LBB0_15
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_15
; %bb.2:
	mov	x19, x2
	cbz	x2, LBB0_15
; %bb.3:
	ldr	x9, [x20]
	cbz	x9, LBB0_14
; %bb.4:
	ldr	w9, [x20, #8]
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.5:
	ldr	w10, [x20, #12]
	cmp	w10, #1
	b.lt	LBB0_14
; %bb.6:
	mul	w9, w9, w8
	mul	w8, w10, w8
	stp	w9, w8, [x19, #8]
	mul	w0, w8, w9
	mov	w1, #4
	bl	_calloc
	str	x0, [x19]
	cbz	x0, LBB0_15
; %bb.7:
	ldr	w12, [x19, #12]
	cbz	w12, LBB0_16
; %bb.8:
	mov	w8, #0
	ldp	w9, w10, [x20, #8]
	lsl	w9, w9, #16
	ldr	w11, [x19, #8]
	sdiv	w9, w9, w11
	lsl	w10, w10, #16
	sdiv	w10, w10, w12
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	w8, w8, #1
	cmp	w8, w12
	b.hs	LBB0_16
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	cbz	w11, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w12, #0
	mov	w13, #0
	mul	w14, w8, w10
	lsr	w14, w14, #16
	ldr	x15, [x20]
LBB0_12:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w16, [x20, #8]
	mul	w16, w16, w14
	add	w16, w16, w12, lsr #16
	ldr	w16, [x15, w16, uxtw #2]
	madd	w11, w8, w11, w13
	str	w16, [x0, w11, uxtw #2]
	add	w13, w13, #1
	ldr	w11, [x19, #8]
	add	w12, w12, w9
	cmp	w13, w11
	b.lo	LBB0_12
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w12, [x19, #12]
	b	LBB0_9
LBB0_14:
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	w0, #1
	b	LBB0_15
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_upscale_image
.subsections_via_symbols
