	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageScaleNearestNeighbour   ## -- Begin function gdImageScaleNearestNeighbour
	.p2align	4, 0x90
_gdImageScaleNearestNeighbour:          ## @gdImageScaleNearestNeighbour
	.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
	movl	%edx, %ebx
	movq	%rdi, %r15
	movl	$1, %edi
	callq	_MAX
	movq	%rax, %r14
	movl	$1, %edi
	movl	%ebx, %esi
	callq	_MAX
	movq	%rax, %rbx
	cvtsi2ssq	32(%r15), %xmm0
	testq	%r14, %r14
	js	LBB0_1
## %bb.2:
	cvtsi2ss	%r14, %xmm1
	jmp	LBB0_3
LBB0_1:
	movq	%r14, %rax
	shrq	%rax
	movl	%r14d, %ecx
	andl	$1, %ecx
	orq	%rax, %rcx
	cvtsi2ss	%rcx, %xmm1
	addss	%xmm1, %xmm1
LBB0_3:
	divss	%xmm1, %xmm0
	cvtsi2ssq	24(%r15), %xmm2
	testq	%rbx, %rbx
	js	LBB0_4
## %bb.5:
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rbx, %xmm1
	jmp	LBB0_6
LBB0_4:
	movq	%rbx, %rax
	shrq	%rax
	movl	%ebx, %ecx
	andl	$1, %ecx
	orq	%rax, %rcx
	xorps	%xmm1, %xmm1
	cvtsi2ss	%rcx, %xmm1
	addss	%xmm1, %xmm1
LBB0_6:
	divss	%xmm1, %xmm2
	movss	%xmm2, -48(%rbp)                ## 4-byte Spill
	callq	_gd_ftofx
	movl	%eax, %r12d
	movss	-48(%rbp), %xmm0                ## 4-byte Reload
                                        ## xmm0 = mem[0],zero,zero,zero
	callq	_gd_ftofx
	xorl	%edx, %edx
	testq	%r14, %r14
	je	LBB0_17
## %bb.7:
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.8:
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_gdImageCreateTrueColor
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	xorl	%esi, %esi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rsi
	movl	%esi, %eax
	cmpq	%rax, -72(%rbp)                 ## 8-byte Folded Reload
	jbe	LBB0_17
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
                                        ##     Child Loop BB0_15 Depth 2
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, 16(%r15)
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_gd_itofx
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_gd_itofx
	movl	%eax, %r13d
	movl	%r12d, %edi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_gd_mulfx
	movl	%eax, %r12d
	movl	%r13d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gd_mulfx
	movl	%eax, %r13d
	movl	%r12d, %edi
	callq	_gd_fxtoi
	movq	%rax, %r12
	movl	%r13d, %edi
	callq	_gd_fxtoi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%r15), %rcx
	movq	(%rcx,%r12,8), %rcx
	movl	(%rcx,%rax,4), %eax
	movq	8(%rdx), %rcx
	movq	(%rcx,%rsi,8), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	movl	%ebx, %eax
	cmpq	%rax, %r14
	ja	LBB0_13
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_gd_itofx
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_gd_itofx
	movl	%eax, %r13d
	movl	%ebx, %edi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_gd_mulfx
	movl	%eax, %r14d
	movl	%r13d, %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_gd_mulfx
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_gd_fxtoi
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	_gd_fxtoi
	movq	(%r15), %rcx
	movq	(%rcx,%r14,8), %rcx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	(%rcx,%rax,4), %edi
	callq	_colorIndex2RGBA
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rcx
	movq	(%rcx,%rsi,8), %rcx
	movl	%eax, (%rcx,%r12,4)
	incq	%r12
	movl	%r12d, %eax
	cmpq	%rax, %r14
	ja	LBB0_15
	jmp	LBB0_16
LBB0_9:
	xorl	%edx, %edx
LBB0_17:
	movq	%rdx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gdImageScaleNearestNeighbour   ; -- Begin function gdImageScaleNearestNeighbour
	.p2align	2
_gdImageScaleNearestNeighbour:          ; @gdImageScaleNearestNeighbour
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-112]!            ; 16-byte Folded Spill
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x21, x2
	mov	x19, x0
	mov	w0, #1
	bl	_MAX
	mov	x20, x0
	mov	w0, #1
	mov	x1, x21
	bl	_MAX
	mov	x21, x0
	ldp	x9, x8, [x19, #24]
	scvtf	s0, x8
	ucvtf	s1, x20
	fdiv	s0, s0, s1
	scvtf	s1, x9
	ucvtf	s2, x0
	fdiv	s8, s1, s2
	bl	_gd_ftofx
	mov	x22, x0
	fmov	s0, s8
	bl	_gd_ftofx
	mov	x24, #0
	cbz	x20, LBB0_10
; %bb.1:
	cbz	x21, LBB0_10
; %bb.2:
	mov	x23, x0
	mov	x0, x20
	mov	x1, x21
	bl	_gdImageCreateTrueColor
	mov	x24, x0
	cbz	x0, LBB0_10
; %bb.3:
	mov	x25, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x25, x25, #1
	cmp	x21, w25, uxtw
	b.ls	LBB0_10
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, #0
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x25
	bl	_gd_itofx
	mov	x27, x0
	mov	x0, x26
	bl	_gd_itofx
	mov	x28, x0
	mov	x0, x27
	mov	x1, x23
	bl	_gd_mulfx
	mov	x27, x0
	mov	x0, x28
	mov	x1, x22
	bl	_gd_mulfx
	mov	x28, x0
	mov	x0, x27
	bl	_gd_fxtoi
	mov	x27, x0
	mov	x0, x28
	bl	_gd_fxtoi
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x27, lsl #3]
	ldr	w8, [x8, x0, lsl #2]
	ldr	x9, [x24, #8]
	ldr	x9, [x9, x25, lsl #3]
	str	w8, [x9, x26, lsl #2]
	add	x26, x26, #1
	cmp	x20, w26, uxtw
	b.hi	LBB0_7
	b	LBB0_4
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, #0
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x25
	bl	_gd_itofx
	mov	x27, x0
	mov	x0, x26
	bl	_gd_itofx
	mov	x28, x0
	mov	x0, x27
	mov	x1, x23
	bl	_gd_mulfx
	mov	x27, x0
	mov	x0, x28
	mov	x1, x22
	bl	_gd_mulfx
	mov	x28, x0
	mov	x0, x27
	bl	_gd_fxtoi
	mov	x27, x0
	mov	x0, x28
	bl	_gd_fxtoi
	ldr	x8, [x19]
	ldr	x8, [x8, x27, lsl #3]
	ldr	w0, [x8, x0, lsl #2]
	bl	_colorIndex2RGBA
	ldr	x8, [x24, #8]
	ldr	x8, [x8, x25, lsl #3]
	str	w0, [x8, x26, lsl #2]
	add	x26, x26, #1
	cmp	x20, w26, uxtw
	b.hi	LBB0_9
	b	LBB0_4
LBB0_10:
	mov	x0, x24
	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
	ldp	d9, d8, [sp], #112              ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
