	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AllocLMBlock                   ## -- Begin function AllocLMBlock
	.p2align	4, 0x90
_AllocLMBlock:                          ## @AllocLMBlock
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edi killed $edi def $rdi
	movq	_LIGHTMAP_HEIGHT@GOTPCREL(%rip), %r8
	movl	(%r8), %r10d
	movq	_LIGHTMAP_WIDTH@GOTPCREL(%rip), %r9
	movl	(%r9), %r11d
	cmpl	%edi, %r11d
	jge	LBB0_2
## %bb.1:
	movl	%r10d, %eax
	jmp	LBB0_11
LBB0_2:
	movq	_allocated@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	%edi, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, (%rdx)
	movl	%r13d, (%rcx)
	movl	(%r9), %r11d
	movl	%r13d, %r10d
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	1(%r14), %rax
	movl	%r11d, %ebx
	subl	%edi, %ebx
	movslq	%ebx, %rbx
	addq	$4, %r12
	cmpq	%rbx, %r14
	movq	%rax, %r14
	jge	LBB0_10
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	$0, %eax
	movl	$0, %r13d
	testl	%edi, %edi
	jle	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12,%rax,4), %ebx
	cmpl	%r10d, %ebx
	jge	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	cmpl	%r13d, %ebx
	cmovgl	%ebx, %r13d
	incq	%rax
	cmpq	%rax, %r15
	jne	LBB0_5
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%edi, %eax
	je	LBB0_8
	jmp	LBB0_9
LBB0_10:
	movl	(%r8), %eax
LBB0_11:
	addl	%esi, %r10d
	cmpl	%eax, %r10d
	jle	LBB0_13
## %bb.12:
	movq	_qfalse@GOTPCREL(%rip), %r8
	jmp	LBB0_20
LBB0_13:
	movq	_qtrue@GOTPCREL(%rip), %r8
	testl	%edi, %edi
	jle	LBB0_20
## %bb.14:
	movq	_allocated@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leal	-1(%rdi), %ecx
	movl	%edi, %esi
	andl	$3, %esi
	xorl	%ebx, %ebx
	cmpl	$3, %ecx
	jb	LBB0_17
## %bb.15:
	andl	$-4, %edi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rdx), %rcx
	addq	%rbx, %rcx
	movl	%r10d, (%rax,%rcx,4)
	movslq	(%rdx), %rcx
	addq	%rbx, %rcx
	movl	%r10d, 4(%rax,%rcx,4)
	movslq	(%rdx), %rcx
	addq	%rbx, %rcx
	movl	%r10d, 8(%rax,%rcx,4)
	movslq	(%rdx), %rcx
	addq	%rbx, %rcx
	movl	%r10d, 12(%rax,%rcx,4)
	addq	$4, %rbx
	cmpl	%ebx, %edi
	jne	LBB0_16
LBB0_17:
	testl	%esi, %esi
	je	LBB0_20
## %bb.18:
	movslq	%ebx, %rdi
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rdx), %rcx
	addq	%rdi, %rcx
	movl	%r10d, (%rax,%rcx,4)
	incq	%rdi
	decl	%esi
	jne	LBB0_19
LBB0_20:
	movl	(%r8), %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LIGHTMAP_HEIGHT,4,2            ## @LIGHTMAP_HEIGHT
	.comm	_LIGHTMAP_WIDTH,4,2             ## @LIGHTMAP_WIDTH
	.comm	_allocated,8,3                  ## @allocated
	.comm	_qfalse,4,2                     ## @qfalse
	.comm	_qtrue,4,2                      ## @qtrue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AllocLMBlock                   ; -- Begin function AllocLMBlock
	.p2align	2
_AllocLMBlock:                          ; @AllocLMBlock
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x9, _LIGHTMAP_HEIGHT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LIGHTMAP_HEIGHT@GOTPAGEOFF]
	ldr	w8, [x9]
Lloh2:
	adrp	x10, _LIGHTMAP_WIDTH@GOTPAGE
Lloh3:
	ldr	x10, [x10, _LIGHTMAP_WIDTH@GOTPAGEOFF]
	ldr	w11, [x10]
	cmp	w11, w0
	b.ge	LBB0_2
; %bb.1:
	mov	x9, x8
	b	LBB0_12
LBB0_2:
	mov	x13, #0
Lloh4:
	adrp	x12, _allocated@GOTPAGE
Lloh5:
	ldr	x12, [x12, _allocated@GOTPAGEOFF]
Lloh6:
	ldr	x12, [x12]
	mov	w14, w0
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	w13, [x2]
	str	w15, [x3]
	ldr	w11, [x10]
	mov	x8, x15
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	w15, w11, w0
	cmp	x13, w15, sxtw
	add	x13, x13, #1
	add	x12, x12, #4
	b.ge	LBB0_11
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x16, #0
	mov	w15, #0
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w17, [x12, x16, lsl #2]
	cmp	w17, w8
	b.ge	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	cmp	w17, w15
	csel	w15, w17, w15, gt
	add	x16, x16, #1
	cmp	x14, x16
	b.ne	LBB0_7
	b	LBB0_3
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w16, #0
	mov	w15, #0
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w16, w0
	b.eq	LBB0_3
	b	LBB0_4
LBB0_11:
	ldr	w9, [x9]
LBB0_12:
	add	w8, w8, w1
	cmp	w8, w9
	b.le	LBB0_14
; %bb.13:
Lloh7:
	adrp	x9, _qfalse@GOTPAGE
Lloh8:
	ldr	x9, [x9, _qfalse@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x9]
	ret
LBB0_14:
	cmp	w0, #1
	b.lt	LBB0_18
; %bb.15:
	mov	x10, #0
Lloh10:
	adrp	x9, _allocated@GOTPAGE
Lloh11:
	ldr	x9, [x9, _allocated@GOTPAGEOFF]
Lloh12:
	ldr	x11, [x9]
	mov	w12, w0
Lloh13:
	adrp	x9, _qtrue@GOTPAGE
Lloh14:
	ldr	x9, [x9, _qtrue@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x13, [x2]
	add	x13, x10, x13
	str	w8, [x11, x13, lsl #2]
	add	x10, x10, #1
	cmp	w12, w10
	b.ne	LBB0_16
; %bb.17:
	ldr	w0, [x9]
	ret
LBB0_18:
Lloh15:
	adrp	x9, _qtrue@GOTPAGE
Lloh16:
	ldr	x9, [x9, _qtrue@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x9]
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_LIGHTMAP_HEIGHT,4,2            ; @LIGHTMAP_HEIGHT
	.comm	_LIGHTMAP_WIDTH,4,2             ; @LIGHTMAP_WIDTH
	.comm	_allocated,8,3                  ; @allocated
	.comm	_qfalse,4,2                     ; @qfalse
	.comm	_qtrue,4,2                      ; @qtrue
.subsections_via_symbols
