	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_GenerateLookup               ## -- Begin function R_GenerateLookup
	.p2align	4, 0x90
_R_GenerateLookup:                      ## @R_GenerateLookup
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_textures@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rcx
	movq	(%rax,%rcx,8), %r14
	movq	_texturecomposite@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%rcx,8)
	movq	_texturecompositesize@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	$0, (%rax,%rcx,4)
	movq	_texturecolumnlump@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_texturecolumnofs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edi
	callq	_alloca
	movl	(%r14), %edx
	xorl	%ebx, %ebx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	cmpl	$0, 4(%r14)
	jle	LBB0_6
## %bb.1:
	movq	24(%r14), %r15
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-68(%rbp), %ebx                 ## 4-byte Reload
	incl	%ebx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	addq	$8, %r15
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	cmpl	4(%r14), %ebx
	jge	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	%ebx, -68(%rbp)                 ## 4-byte Spill
	movswl	(%r15), %edi
	movq	_PU_CACHE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_W_CacheLumpNum
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movslq	4(%r15), %rbx
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movl	8(%rax), %edi
	callq	_SHORT
	addl	%ebx, %eax
	testl	%ebx, %ebx
	movl	$0, %esi
	movq	%rbx, %r13
	cmovgl	%ebx, %esi
	movl	(%r14), %edx
	cmpl	%edx, %eax
	cmovgel	%edx, %eax
	cmpl	%eax, %esi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jge	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%esi, %r14d
	movl	%eax, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	shlq	$2, %r13
	negq	%r13
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	incl	(%r12,%r14,4)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movzwl	(%rax), %eax
	movw	%ax, (%r15,%r14,2)
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rax
	addq	%r13, %rax
	movl	(%rax,%r14,4), %edi
	callq	_LONG
	addl	$3, %eax
	movw	%ax, (%rbx,%r14,2)
	incq	%r14
	cmpq	%r14, -104(%rbp)                ## 8-byte Folded Reload
	jne	LBB0_4
	jmp	LBB0_5
LBB0_6:
	movl	(%r14), %eax
	testl	%eax, %eax
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	_texturecompositesize@GOTPCREL(%rip), %r12
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jle	LBB0_14
## %bb.7:
	xorl	%ebx, %ebx
	leaq	L_.str.1(%rip), %r13
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	%edx, %ecx
	movl	%ecx, (%rax,%r15,4)
	movl	(%r14), %eax
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_14
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rbx,4), %ecx
	testl	%ecx, %ecx
	je	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$2, %ecx
	jl	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movw	$-1, (%r8,%rbx,2)
	movq	(%r12), %rax
	movl	(%rax,%r15,4), %ecx
	movw	%cx, (%r9,%rbx,2)
	movl	16(%r14), %edx
	movl	$65536, %esi                    ## imm = 0x10000
	subl	%edx, %esi
	cmpl	%esi, %ecx
	jle	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_I_Error
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movl	16(%r14), %edx
	movq	(%r12), %rax
	movl	(%rax,%r15,4), %ecx
	jmp	LBB0_12
LBB0_14:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	8(%r14), %rsi
	leaq	L_.str(%rip), %rdi
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_textures,8,3                   ## @textures
	.comm	_texturecomposite,8,3           ## @texturecomposite
	.comm	_texturecompositesize,8,3       ## @texturecompositesize
	.comm	_texturecolumnlump,8,3          ## @texturecolumnlump
	.comm	_texturecolumnofs,8,3           ## @texturecolumnofs
	.comm	_PU_CACHE,4,2                   ## @PU_CACHE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"R_GenerateLookup: column without a patch (%s)\n"

L_.str.1:                               ## @.str.1
	.asciz	"R_GenerateLookup: texture %i is >64k"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_R_GenerateLookup               ; -- Begin function R_GenerateLookup
	.p2align	2
_R_GenerateLookup:                      ; @R_GenerateLookup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x8, _textures@GOTPAGE
Lloh1:
	ldr	x8, [x8, _textures@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sbfiz	x9, x0, #3, #32
	ldr	x22, [x8, x9]
Lloh3:
	adrp	x8, _texturecomposite@GOTPAGE
Lloh4:
	ldr	x8, [x8, _texturecomposite@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	xzr, [x8, x9]
Lloh6:
	adrp	x8, _texturecompositesize@GOTPAGE
Lloh7:
	ldr	x8, [x8, _texturecompositesize@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	str	wzr, [x8, w0, sxtw #2]
Lloh9:
	adrp	x8, _texturecolumnlump@GOTPAGE
Lloh10:
	ldr	x8, [x8, _texturecolumnlump@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	x8, [x8, x9]
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
Lloh12:
	adrp	x8, _texturecolumnofs@GOTPAGE
Lloh13:
	ldr	x8, [x8, _texturecolumnofs@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	x8, [x8, x9]
	str	x8, [sp, #16]                   ; 8-byte Folded Spill
	ldr	w0, [x22]
	bl	_alloca
	mov	x20, x0
	ldr	w2, [x22]
	mov	w1, #0
	bl	_memset
	ldr	w8, [x22, #4]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w26, #0
	ldr	x27, [x22, #24]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w26, w26, #1
	add	x27, x27, #8
	ldr	w8, [x22, #4]
	cmp	w26, w8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldrsh	w0, [x27]
Lloh15:
	adrp	x8, _PU_CACHE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PU_CACHE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_W_CacheLumpNum
	mov	x21, x0
	ldrsw	x19, [x27, #4]
	ldr	w0, [x0, #8]
	bl	_SHORT
	cmp	w19, #0
	csel	w8, w19, wzr, gt
	ldr	w9, [x22]
	add	w10, w0, w19
	cmp	w10, w9
	csel	w9, w10, w9, lt
	cmp	w8, w9
	b.ge	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	lsl	x10, x8, #2
	sub	x23, x10, x19, lsl #2
	lsl	x11, x8, #1
	ldr	x12, [sp, #16]                  ; 8-byte Folded Reload
	add	x19, x12, x11
	ldr	x12, [sp, #24]                  ; 8-byte Folded Reload
	add	x24, x12, x11
	add	x25, x20, x10
	sub	x28, x9, x8
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x25]
	add	w8, w8, #1
	str	w8, [x25], #4
	ldrh	w8, [x27]
	strh	w8, [x24], #2
	ldr	x8, [x21]
	ldr	w0, [x8, x23]
	bl	_LONG
	add	w8, w0, #3
	strh	w8, [x19], #2
	add	x23, x23, #4
	subs	x28, x28, #1
	b.ne	LBB0_5
	b	LBB0_2
LBB0_6:
	ldr	w8, [x22]
	cmp	w8, #1
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
Lloh18:
	adrp	x23, _texturecompositesize@GOTPAGE
Lloh19:
	ldr	x23, [x23, _texturecompositesize@GOTPAGEOFF]
	b.lt	LBB0_14
; %bb.7:
	mov	x26, #0
	sxtw	x27, w19
	mov	w28, #65535
	mov	w21, #65536
Lloh20:
	adrp	x24, l_.str.1@PAGE
Lloh21:
	add	x24, x24, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	w9, w10, w9
	str	w9, [x8, x27, lsl #2]
	ldr	w8, [x22]
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x26, x26, #1
	cmp	x26, w8, sxtw
	b.ge	LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x20, x26, lsl #2]
	cbz	w9, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	cmp	w9, #2
	b.lt	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	lsl	x9, x26, #1
	ldp	x11, x8, [sp, #16]              ; 16-byte Folded Reload
	strh	w28, [x8, x9]
	ldr	x8, [x23]
	ldr	w10, [x8, x27, lsl #2]
	strh	w10, [x11, x9]
	ldr	w9, [x22, #16]
	sub	w11, w21, w9
	cmp	w10, w11
	b.le	LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x24
	mov	x1, x19
	bl	_I_Error
	ldr	w9, [x22, #16]
	ldr	x8, [x23]
	ldr	w10, [x8, x27, lsl #2]
	b	LBB0_8
LBB0_14:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_15:
	ldr	x1, [x22, #8]
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_printf
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_textures,8,3                   ; @textures
	.comm	_texturecomposite,8,3           ; @texturecomposite
	.comm	_texturecompositesize,8,3       ; @texturecompositesize
	.comm	_texturecolumnlump,8,3          ; @texturecolumnlump
	.comm	_texturecolumnofs,8,3           ; @texturecolumnofs
	.comm	_PU_CACHE,4,2                   ; @PU_CACHE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"R_GenerateLookup: column without a patch (%s)\n"

l_.str.1:                               ; @.str.1
	.asciz	"R_GenerateLookup: texture %i is >64k"

.subsections_via_symbols
