	.file	"extr_r_main.c_R_InitTextureMapping.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	R_InitTextureMapping
	.type	R_InitTextureMapping, @function
R_InitTextureMapping:
.LFB0:
	.cfi_startproc
	endbr64
	mov	edx, DWORD PTR FINEANGLES[rip]
	mov	ecx, DWORD PTR FIELDOFVIEW[rip]
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	edi, DWORD PTR centerxfrac[rip]
	test	edx, edx
	lea	eax, 3[rdx]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmovns	eax, edx
	sar	eax, 2
	mov	edx, eax
	mov	eax, ecx
	shr	eax, 31
	add	eax, ecx
	sar	eax
	add	eax, edx
	mov	rdx, QWORD PTR finetangent[rip]
	cdqe
	mov	esi, DWORD PTR [rdx+rax*4]
	call	FixedDiv@PLT
	mov	r9d, DWORD PTR FINEANGLES[rip]
	mov	ebx, eax
	cmp	r9d, 1
	jle	.L2
	xor	ebp, ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	neg	eax
	add	eax, eax
	cmp	edi, eax
	jge	.L5
	mov	eax, DWORD PTR viewwidth[rip]
	add	eax, 1
.L4:
	mov	rsi, QWORD PTR viewangletox[rip]
	add	rbp, 1
	mov	DWORD PTR [rsi+r12], eax
	mov	r9d, DWORD PTR FINEANGLES[rip]
	mov	eax, r9d
	shr	eax, 31
	add	eax, r9d
	sar	eax
	cmp	eax, ebp
	jle	.L27
.L7:
	mov	rax, QWORD PTR finetangent[rip]
	lea	r12, 0[0+rbp*4]
	mov	edi, DWORD PTR [rax+rbp*4]
	mov	eax, DWORD PTR FRACUNIT[rip]
	lea	edx, [rax+rax]
	cmp	edi, edx
	jle	.L3
.L6:
	mov	eax, -1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, ebx
	call	FixedMul@PLT
	mov	ecx, DWORD PTR centerxfrac[rip]
	sub	ecx, eax
	mov	eax, DWORD PTR FRACUNIT[rip]
	add	eax, ecx
	mov	ecx, DWORD PTR FRACBITS[rip]
	sub	eax, 1
	sar	eax, cl
	mov	edx, eax
	cmp	eax, -1
	jl	.L6
	mov	eax, DWORD PTR viewwidth[rip]
	add	eax, 1
	cmp	eax, edx
	cmovg	eax, edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L27:
	mov	r10d, DWORD PTR viewwidth[rip]
	test	r10d, r10d
	js	.L8
.L16:
	mov	ebp, DWORD PTR [rsi]
	mov	ecx, DWORD PTR ANGLETOFINESHIFT[rip]
	xor	r8d, r8d
	mov	r11, QWORD PTR xtoviewangle[rip]
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, r8d
	mov	eax, 1
	xor	edx, edx
	cmp	ebp, r8d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edx, eax
	add	rax, 1
	cmp	DWORD PTR -4[rsi+rax*4], edi
	jg	.L10
	sal	edx, cl
	movsx	rdx, edx
.L11:
	sub	rdx, QWORD PTR ANG90[rip]
	mov	QWORD PTR [r11+r8*8], rdx
	add	r8, 1
	cmp	r10d, r8d
	jge	.L9
.L8:
	xor	ebp, ebp
	cmp	r9d, 1
	jg	.L12
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	mov	ecx, DWORD PTR viewwidth[rip]
	lea	esi, 1[rcx]
	cmp	edx, esi
	jne	.L14
	mov	DWORD PTR [rax], ecx
.L14:
	mov	edx, DWORD PTR FINEANGLES[rip]
	add	rbp, 1
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	sar	eax
	cmp	eax, ebp
	jle	.L15
.L12:
	mov	rax, QWORD PTR finetangent[rip]
	mov	esi, ebx
	lea	r12, 0[0+rbp*4]
	mov	edi, DWORD PTR [rax+rbp*4]
	call	FixedMul@PLT
	mov	rax, QWORD PTR viewangletox[rip]
	add	rax, r12
	mov	edx, DWORD PTR [rax]
	cmp	edx, -1
	jne	.L13
	mov	DWORD PTR [rax], 0
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	mov	rax, QWORD PTR xtoviewangle[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR clipangle[rip], rax
	ret
.L2:
	.cfi_restore_state
	mov	r10d, DWORD PTR viewwidth[rip]
	test	r10d, r10d
	js	.L15
	mov	rsi, QWORD PTR viewangletox[rip]
	jmp	.L16
	.cfi_endproc
.LFE0:
	.size	R_InitTextureMapping, .-R_InitTextureMapping
	.comm	xtoviewangle,8,8
	.comm	viewwidth,4,4
	.comm	viewangletox,8,8
	.comm	finetangent,8,8
	.comm	clipangle,8,8
	.comm	centerxfrac,4,4
	.comm	centerx,4,4
	.comm	FRACUNIT,4,4
	.comm	FRACBITS,4,4
	.comm	FINEANGLES,4,4
	.comm	FIELDOFVIEW,4,4
	.comm	ANGLETOFINESHIFT,4,4
	.comm	ANG90,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_r_main.c_R_InitTextureMapping.c"
	.text
	.align	2
	.global	R_InitTextureMapping
	.syntax unified
	.arm
	.fpu softvfp
	.type	R_InitTextureMapping, %function
R_InitTextureMapping:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r5, .L30
	ldr	r3, .L30+4
	ldr	r2, [r5]
	ldr	r3, [r3]
	cmp	r2, #0
	add	r1, r2, #3
	movge	r1, r2
	ldr	r6, .L30+8
	add	r3, r3, r3, lsr #31
	ldr	r0, [r6]
	asr	r2, r3, #1
	ldr	r3, .L30+12
	add	r2, r2, r1, asr #2
	ldr	r1, [r0, r2, lsl #2]
	sub	sp, sp, #20
	ldr	r0, [r3]
	bl	FixedDiv
	ldr	lr, [r5]
	mov	r9, r0
	cmp	lr, #1
	ble	.L2
	mov	r4, #0
	ldr	fp, .L30+16
	ldr	r8, .L30+20
	ldr	r7, .L30+24
	ldr	r3, .L30+12
	b	.L7
.L3:
	cmp	r0, r1, lsl #1
	bge	.L5
	ldr	r0, [r8]
	add	r0, r0, #1
.L4:
	ldr	r1, [r7]
	add	r4, r4, #1
	str	r0, [r1, r10]
	ldr	lr, [r5]
	add	r0, lr, lr, lsr #31
	cmp	r4, r0, asr #1
	bge	.L29
.L7:
	ldr	r1, [r6]
	ldr	ip, [fp]
	ldr	r0, [r1, r4, lsl #2]
	lsl	r10, r4, #2
	cmp	r0, ip, lsl #1
	rsb	r1, ip, ip, lsl #31
	ble	.L3
.L6:
	mvn	r0, #0
	b	.L4
.L5:
	mov	r1, r9
	bl	FixedMul
	ldr	r3, .L30+12
	ldr	ip, [fp]
	ldr	r1, [r3]
	ldr	r2, .L30+28
	sub	r1, r1, r0
	add	r1, r1, ip
	ldr	ip, [r2]
	sub	r0, r1, #1
	asr	r1, r0, ip
	cmn	r1, #1
	blt	.L6
	ldr	r0, [r8]
	add	r0, r0, #1
	cmp	r0, r1
	movge	r0, r1
	b	.L4
.L29:
	ldr	r10, [r8]
	cmp	r10, #0
	ldrlt	r3, .L30+32
	strlt	r3, [sp, #4]
	blt	.L8
.L17:
	ldr	r3, .L30+32
	str	r9, [sp, #8]
	mov	r2, r3
	str	r3, [sp, #4]
	ldr	r3, .L30+36
	ldr	r4, [r2]
	ldr	r3, [r3]
	ldr	r2, [r1]
	str	lr, [sp, #12]
	mov	r0, #0
	mov	r9, r3
	mov	lr, r2
	ldr	fp, .L30+40
	sub	r4, r4, #4
.L9:
	cmp	lr, r0
	movle	r3, #0
	ble	.L12
	mov	r2, r1
	mov	r3, #0
.L10:
	ldr	ip, [r2, #4]!
	add	r3, r3, #1
	cmp	ip, r0
	bgt	.L10
	lsl	r3, r3, r9
.L12:
	ldr	r2, [fp]
	add	r0, r0, #1
	sub	r3, r3, r2
	cmp	r10, r0
	str	r3, [r4, #4]!
	bge	.L9
	ldr	r9, [sp, #8]
	ldr	lr, [sp, #12]
.L8:
	cmp	lr, #1
	movgt	r4, #0
	movgt	r10, r4
	ble	.L16
.L13:
	ldr	r3, [r6]
	mov	r1, r9
	ldr	r0, [r3, r4, lsl #2]
	bl	FixedMul
	ldr	r2, [r7]
	lsl	ip, r4, #2
	ldr	r3, [r2, r4, lsl #2]
	cmn	r3, #1
	streq	r10, [r2, r4, lsl #2]
	beq	.L15
	ldr	r1, [r8]
	add	r0, r1, #1
	cmp	r3, r0
	streq	r1, [r2, ip]
.L15:
	ldr	r3, [r5]
	add	r4, r4, #1
	add	r3, r3, r3, lsr #31
	cmp	r4, r3, asr #1
	blt	.L13
.L16:
	ldr	r3, [sp, #4]
	ldr	r2, [r3]
	ldr	r3, .L30+44
	ldr	r2, [r2]
	str	r2, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r8, .L30+20
	ldr	r10, [r8]
	cmp	r10, #0
	ldrlt	r3, .L30+32
	strlt	r3, [sp, #4]
	blt	.L16
	ldr	r7, .L30+24
	ldr	r1, [r7]
	b	.L17
.L31:
	.align	2
.L30:
	.word	FINEANGLES
	.word	FIELDOFVIEW
	.word	finetangent
	.word	centerxfrac
	.word	FRACUNIT
	.word	viewwidth
	.word	viewangletox
	.word	FRACBITS
	.word	xtoviewangle
	.word	ANGLETOFINESHIFT
	.word	ANG90
	.word	clipangle
	.size	R_InitTextureMapping, .-R_InitTextureMapping
	.comm	xtoviewangle,4,4
	.comm	viewwidth,4,4
	.comm	viewangletox,4,4
	.comm	finetangent,4,4
	.comm	clipangle,4,4
	.comm	centerxfrac,4,4
	.comm	centerx,4,4
	.comm	FRACUNIT,4,4
	.comm	FRACBITS,4,4
	.comm	FINEANGLES,4,4
	.comm	FIELDOFVIEW,4,4
	.comm	ANGLETOFINESHIFT,4,4
	.comm	ANG90,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
