	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdi_load_texture
_gdi_load_texture:                      ## @gdi_load_texture
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.1:
	movq	%rsi, %rbx
	cmpl	$2048, (%rsi)                   ## imm = 0x800
	jg	LBB0_11
## %bb.4:
	cmpl	$2048, 4(%rbx)                  ## imm = 0x800
	jg	LBB0_11
## %bb.6:
	movl	%ecx, %r15d
	movl	$1, %edi
	movl	$32, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	%rax, %xmm0
	movq	%rax, %rsi
	shrq	$32, %rsi
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movdqu	%xmm0, (%r14)
	imull	%eax, %esi
	shll	$2, %esi
	movl	$1, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_calloc
	movq	%rax, 24(%r14)
	movl	%r15d, 16(%r14)
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movl	8(%rbx), %esi
	movl	(%r14), %edx
	imull	4(%r14), %edx
	shll	$2, %edx
	movq	%rax, %rdi
	callq	_memcpy
	jmp	LBB0_12
LBB0_10:
	movq	%r14, %rdi
	callq	_free
LBB0_11:
	xorl	%r14d, %r14d
LBB0_12:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_gdi_load_texture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdi_load_texture
_gdi_load_texture:                      ; @gdi_load_texture
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x1, LBB0_7
; %bb.1:
	mov	x20, x1
	ldr	w8, [x1]
	cmp	w8, #2048
	b.gt	LBB0_7
; %bb.2:
	ldr	w8, [x20, #4]
	cmp	w8, #2048
	b.gt	LBB0_7
; %bb.3:
	mov	x21, x3
	mov	w0, #1
	mov	w1, #32
	bl	_calloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.4:
	ldp	w8, w9, [x20]
	stp	w8, w9, [x19]
	stp	w8, w9, [x19, #8]
	mul	w8, w8, w9
	lsl	w1, w8, #2
	mov	w0, #1
	bl	_calloc
	str	x0, [x19, #24]
	str	w21, [x19, #16]
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w1, [x20, #8]
	ldp	w8, w9, [x19]
	mul	w8, w8, w9
	lsl	w2, w8, #2
	bl	_memcpy
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_free
LBB0_7:
	mov	x19, #0
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_gdi_load_texture
.subsections_via_symbols
