	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Get16BitD3DFormat
_Get16BitD3DFormat:                     ## @Get16BitD3DFormat
	.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
	movl	%edi, %esi
	movq	_D3DFMT_R5G6B5@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_CreateDCA
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_CreateCompatibleBitmap
	testq	%rax, %rax
	je	LBB0_10
## %bb.2:
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$20, %edx
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, %r12
	movl	$4, 8(%rax)
	movq	_DIB_RGB_COLORS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, (%rsp)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%r12, %r9
	callq	_GetDIBits
	testq	%rax, %rax
	jle	LBB0_8
## %bb.4:
	movq	16(%r12), %rax
	movq	_BI_BITFIELDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.5:
	movl	24(%r12), %ecx
	movl	(%r13), %eax
	movl	%eax, (%rsp)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	movq	%r12, %r9
	callq	_GetDIBits
	testq	%rax, %rax
	jle	LBB0_8
## %bb.6:
	movq	(%r12), %rax
	cmpl	$992, 4(%rax)                   ## imm = 0x3E0
	jne	LBB0_8
## %bb.7:
	movq	_D3DFMT_X1R5G5B5@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_8:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_HeapFree
LBB0_9:
	movq	%r15, %rdi
	callq	_DeleteObject
LBB0_10:
	movq	%rbx, %rdi
	callq	_DeleteDC
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_D3DFMT_R5G6B5,4,2              ## @D3DFMT_R5G6B5
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_DIB_RGB_COLORS,4,2             ## @DIB_RGB_COLORS
	.comm	_BI_BITFIELDS,8,3               ## @BI_BITFIELDS
	.comm	_D3DFMT_X1R5G5B5,4,2            ## @D3DFMT_X1R5G5B5
	.no_dead_strip	_Get16BitD3DFormat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function Get16BitD3DFormat
_Get16BitD3DFormat:                     ; @Get16BitD3DFormat
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x1, x0
Lloh0:
	adrp	x8, _D3DFMT_R5G6B5@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3DFMT_R5G6B5@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	mov	x0, #0
	mov	x2, #0
	mov	x3, #0
	bl	_CreateDCA
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x0
	mov	w1, #1
	mov	w2, #1
	bl	_CreateCompatibleBitmap
	cbz	x0, LBB0_9
; %bb.2:
	mov	x21, x0
	bl	_GetProcessHeap
Lloh3:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w2, #20
	bl	_HeapAlloc
	cbz	x0, LBB0_8
; %bb.3:
	mov	x22, x0
	mov	w8, #4
	str	w8, [x0, #8]
Lloh6:
	adrp	x23, _DIB_RGB_COLORS@GOTPAGE
Lloh7:
	ldr	x23, [x23, _DIB_RGB_COLORS@GOTPAGEOFF]
	ldr	w6, [x23]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	mov	w3, #0
	mov	x4, #0
	mov	x5, x22
	bl	_GetDIBits
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.4:
	ldr	x8, [x22, #16]
Lloh8:
	adrp	x9, _BI_BITFIELDS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BI_BITFIELDS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	w3, [x22, #24]
	ldr	w6, [x23]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	mov	x4, #0
	mov	x5, x22
	bl	_GetDIBits
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.6:
	ldr	x8, [x22]
	ldr	w8, [x8, #4]
Lloh11:
	adrp	x9, _D3DFMT_X1R5G5B5@GOTPAGE
Lloh12:
	ldr	x9, [x9, _D3DFMT_X1R5G5B5@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, #992
	csel	w19, w9, w19, eq
LBB0_7:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x22
	bl	_HeapFree
LBB0_8:
	mov	x0, x21
	bl	_DeleteObject
LBB0_9:
	mov	x0, x20
	bl	_DeleteDC
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_D3DFMT_R5G6B5,4,2              ; @D3DFMT_R5G6B5
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_DIB_RGB_COLORS,4,2             ; @DIB_RGB_COLORS
	.comm	_BI_BITFIELDS,8,3               ; @BI_BITFIELDS
	.comm	_D3DFMT_X1R5G5B5,4,2            ; @D3DFMT_X1R5G5B5
	.no_dead_strip	_Get16BitD3DFormat
.subsections_via_symbols
