input
stringlengths 64
79.4k
| output
stringlengths 182
199k
| filename
stringlengths 33
210
|
|---|---|---|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int byte ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
int MAX_MAP_LEAFS ;
int /*<<< orphan*/ _printf (char*,...) ;
int leafbytes ;
int leaflongs ;
int /*<<< orphan*/ memcpy (int*,int*,int) ;
int portalclusters ;
int* visBytes ;
void CalcPHS (void)
{
int i, j, k, l, index;
int bitbyte;
long *dest, *src;
byte *scan;
int count;
byte uncompressed[MAX_MAP_LEAFS/8];
_printf ("Building PHS...\n");
count = 0;
for (i=0 ; i<portalclusters ; i++)
{
scan = visBytes + i*leafbytes;
memcpy (uncompressed, scan, leafbytes);
for (j=0 ; j<leafbytes ; j++)
{
bitbyte = scan[j];
if (!bitbyte)
continue;
for (k=0 ; k<8 ; k++)
{
if (! (bitbyte & (1<<k)) )
continue;
// OR this pvs row into the phs
index = ((j<<3)+k);
if (index >= portalclusters)
Error ("Bad bit in PVS"); // pad bits should be 0
src = (long *)(visBytes + index*leafbytes);
dest = (long *)uncompressed;
for (l=0 ; l<leaflongs ; l++)
((long *)uncompressed)[l] |= src[l];
}
}
for (j=0 ; j<portalclusters ; j++)
if (uncompressed[j>>3] & (1<<(j&7)) )
count++;
// FIXME: copy it off
}
_printf ("Average clusters hearable: %i\n", count/portalclusters);
}
|
.text
.file "extr_vis.c_CalcPHS.c"
.globl CalcPHS // -- Begin function CalcPHS
.p2align 2
.type CalcPHS,@function
CalcPHS: // @CalcPHS
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub sp, sp, #80
adrp x8, MAX_MAP_LEAFS
ldr w8, [x8, :lo12:MAX_MAP_LEAFS]
mov w9, #8 // =0x8
sdiv w8, w8, w9
mov w8, w8
// kill: def $x8 killed $w8
mov x9, sp
stur x9, [x29, #-64]
lsl x9, x8, #2
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x9, x9, x10
mov sp, x9
stur x9, [x29, #-80] // 8-byte Folded Spill
stur x8, [x29, #-72]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
stur wzr, [x29, #-52]
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_3 Depth 2
// Child Loop BB0_7 Depth 3
// Child Loop BB0_13 Depth 4
// Child Loop BB0_21 Depth 2
ldur w8, [x29, #-4]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_28
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-80] // 8-byte Folded Reload
adrp x8, visBytes
ldr x9, [x8, :lo12:visBytes]
ldur w10, [x29, #-4]
adrp x8, leafbytes
ldr w11, [x8, :lo12:leafbytes]
mul w10, w10, w11
add x9, x9, w10, sxtw #2
stur x9, [x29, #-48]
ldur x1, [x29, #-48]
ldr w2, [x8, :lo12:leafbytes]
bl memcpy
stur wzr, [x29, #-8]
b .LBB0_3
.LBB0_3: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_7 Depth 3
// Child Loop BB0_13 Depth 4
ldur w8, [x29, #-8]
adrp x9, leafbytes
ldr w9, [x9, :lo12:leafbytes]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_20
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-48]
ldursw x9, [x29, #-8]
ldr w8, [x8, x9, lsl #2]
stur w8, [x29, #-24]
ldur w8, [x29, #-24]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_6: // in Loop: Header=BB0_3 Depth=2
stur wzr, [x29, #-12]
b .LBB0_7
.LBB0_7: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_3 Depth=2
// => This Loop Header: Depth=3
// Child Loop BB0_13 Depth 4
ldur w8, [x29, #-12]
subs w8, w8, #8
cset w8, ge
tbnz w8, #0, .LBB0_18
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=3
ldur w8, [x29, #-24]
ldur w10, [x29, #-12]
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=3
b .LBB0_17
.LBB0_10: // in Loop: Header=BB0_7 Depth=3
ldur w9, [x29, #-8]
ldur w8, [x29, #-12]
add w8, w8, w9, lsl #3
stur w8, [x29, #-20]
ldur w8, [x29, #-20]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_7 Depth=3
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl Error
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_7 Depth=3
ldur x8, [x29, #-80] // 8-byte Folded Reload
adrp x9, visBytes
ldr x9, [x9, :lo12:visBytes]
ldur w10, [x29, #-20]
adrp x11, leafbytes
ldr w11, [x11, :lo12:leafbytes]
mul w10, w10, w11
add x9, x9, w10, sxtw #2
stur x9, [x29, #-40]
stur x8, [x29, #-32]
stur wzr, [x29, #-16]
b .LBB0_13
.LBB0_13: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_3 Depth=2
// Parent Loop BB0_7 Depth=3
// => This Inner Loop Header: Depth=4
ldur w8, [x29, #-16]
adrp x9, leaflongs
ldr w9, [x9, :lo12:leaflongs]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_16
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_13 Depth=4
ldur x8, [x29, #-80] // 8-byte Folded Reload
ldur x9, [x29, #-40]
ldursw x10, [x29, #-16]
ldr x10, [x9, x10, lsl #3]
ldursw x9, [x29, #-16]
add x9, x8, x9, lsl #3
ldr x8, [x9]
orr x8, x8, x10
str x8, [x9]
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_13 Depth=4
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_13
.LBB0_16: // in Loop: Header=BB0_7 Depth=3
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_7 Depth=3
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_7
.LBB0_18: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_3 Depth=2
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_3
.LBB0_20: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-8]
b .LBB0_21
.LBB0_21: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-8]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_26
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_21 Depth=2
ldur x8, [x29, #-80] // 8-byte Folded Reload
ldur w9, [x29, #-8]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-8]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_24
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_21 Depth=2
ldur w8, [x29, #-52]
add w8, w8, #1
stur w8, [x29, #-52]
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_21 Depth=2
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_21 Depth=2
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_21
.LBB0_26: // in Loop: Header=BB0_1 Depth=1
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_1
.LBB0_28:
ldur w8, [x29, #-52]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
sdiv w1, w8, w9
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
ldur x8, [x29, #-64]
mov sp, x8
mov sp, x29
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size CalcPHS, .Lfunc_end0-CalcPHS
.cfi_endproc
// -- End function
.type MAX_MAP_LEAFS,@object // @MAX_MAP_LEAFS
.bss
.globl MAX_MAP_LEAFS
.p2align 2, 0x0
MAX_MAP_LEAFS:
.word 0 // 0x0
.size MAX_MAP_LEAFS, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Building PHS...\n"
.size .L.str, 17
.type portalclusters,@object // @portalclusters
.bss
.globl portalclusters
.p2align 2, 0x0
portalclusters:
.word 0 // 0x0
.size portalclusters, 4
.type visBytes,@object // @visBytes
.globl visBytes
.p2align 3, 0x0
visBytes:
.xword 0
.size visBytes, 8
.type leafbytes,@object // @leafbytes
.globl leafbytes
.p2align 2, 0x0
leafbytes:
.word 0 // 0x0
.size leafbytes, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "Bad bit in PVS"
.size .L.str.1, 15
.type leaflongs,@object // @leaflongs
.bss
.globl leaflongs
.p2align 2, 0x0
leaflongs:
.word 0 // 0x0
.size leaflongs, 4
.type .L.str.2,@object // @.str.2
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.2:
.asciz "Average clusters hearable: %i\n"
.size .L.str.2, 31
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym _printf
.addrsig_sym memcpy
.addrsig_sym Error
.addrsig_sym MAX_MAP_LEAFS
.addrsig_sym portalclusters
.addrsig_sym visBytes
.addrsig_sym leafbytes
.addrsig_sym leaflongs
|
../AnghaBench/Quake-III-Arena/q3map/extr_vis.c_CalcPHS.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_4__ {int /*<<< orphan*/ * winding; } ;
typedef TYPE_1__ portal_t ;
typedef int /*<<< orphan*/ FILE ;
/* Variables and functions */
int /*<<< orphan*/ FreeWinding (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ OutputWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int PortalVisibleSides (TYPE_1__*) ;
int /*<<< orphan*/ * ReverseWinding (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ c_glfaces ;
void OutputPortal (portal_t *p, FILE *glview)
{
winding_t *w;
int sides;
sides = PortalVisibleSides (p);
if (!sides)
return;
c_glfaces++;
w = p->winding;
if (sides == 2) // back side
w = ReverseWinding (w);
OutputWinding (w, glview);
if (sides == 2)
FreeWinding(w);
}
|
.text
.file "extr_glfile.c_OutputPortal.c"
.globl OutputPortal // -- Begin function OutputPortal
.p2align 2
.type OutputPortal,@function
OutputPortal: // @OutputPortal
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
str x1, [sp, #16]
ldur x0, [x29, #-8]
bl PortalVisibleSides
str w0, [sp, #4]
ldr w8, [sp, #4]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_6
.LBB0_2:
adrp x9, c_glfaces
ldr w8, [x9, :lo12:c_glfaces]
add w8, w8, #1
str w8, [x9, :lo12:c_glfaces]
ldur x8, [x29, #-8]
ldr x8, [x8]
str x8, [sp, #8]
ldr w8, [sp, #4]
subs w8, w8, #2
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldr x0, [sp, #8]
bl ReverseWinding
str x0, [sp, #8]
b .LBB0_4
.LBB0_4:
ldr x0, [sp, #8]
ldr x1, [sp, #16]
bl OutputWinding
ldr w8, [sp, #4]
subs w8, w8, #2
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
ldr x0, [sp, #8]
bl FreeWinding
b .LBB0_6
.LBB0_6:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size OutputPortal, .Lfunc_end0-OutputPortal
.cfi_endproc
// -- End function
.type c_glfaces,@object // @c_glfaces
.bss
.globl c_glfaces
.p2align 2, 0x0
c_glfaces:
.word 0 // 0x0
.size c_glfaces, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym PortalVisibleSides
.addrsig_sym ReverseWinding
.addrsig_sym OutputWinding
.addrsig_sym FreeWinding
.addrsig_sym c_glfaces
|
../AnghaBench/Quake-III-Arena/q3map/extr_glfile.c_OutputPortal.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {struct TYPE_3__* next; } ;
typedef TYPE_1__ bspbrush_t ;
/* Variables and functions */
int CountBrushList (bspbrush_t *brushes)
{
int c;
c = 0;
for ( ; brushes ; brushes = brushes->next)
c++;
return c;
}
|
.text
.file "extr_brush.c_CountBrushList.c"
.globl CountBrushList // -- Begin function CountBrushList
.p2align 2
.type CountBrushList,@function
CountBrushList: // @CountBrushList
.cfi_startproc
// %bb.0:
sub sp, sp, #16
.cfi_def_cfa_offset 16
str x0, [sp, #8]
str wzr, [sp, #4]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
ldr x8, [x8]
str x8, [sp, #8]
b .LBB0_1
.LBB0_4:
ldr w0, [sp, #4]
add sp, sp, #16
.cfi_def_cfa_offset 0
ret
.Lfunc_end0:
.size CountBrushList, .Lfunc_end0-CountBrushList
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_CountBrushList.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_3__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int leaf; } ;
typedef TYPE_1__ vportal_t ;
typedef int byte ;
struct TYPE_5__ {int merged; } ;
/* Variables and functions */
int CountBits (int*,int) ;
TYPE_3__* leafs ;
int numportals ;
int portalclusters ;
TYPE_1__* portals ;
int LeafVectorFromPortalVector (byte *portalbits, byte *leafbits)
{
int i, j, leafnum;
vportal_t *p;
int c_leafs;
for (i=0 ; i<numportals*2 ; i++)
{
if (portalbits[i>>3] & (1<<(i&7)) )
{
p = portals+i;
leafbits[p->leaf>>3] |= (1<<(p->leaf&7));
}
}
for (j = 0; j < portalclusters; j++)
{
leafnum = j;
while (leafs[leafnum].merged >= 0)
leafnum = leafs[leafnum].merged;
//if the merged leaf is visible then the original leaf is visible
if (leafbits[leafnum>>3] & (1<<(leafnum&7)))
{
leafbits[j>>3] |= (1<<(j&7));
}
}
c_leafs = CountBits (leafbits, portalclusters);
return c_leafs;
}
|
.text
.file "extr_vis.c_LeafVectorFromPortalVector.c"
.globl LeafVectorFromPortalVector // -- Begin function LeafVectorFromPortalVector
.p2align 2
.type LeafVectorFromPortalVector,@function
LeafVectorFromPortalVector: // @LeafVectorFromPortalVector
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur wzr, [x29, #-20]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-20]
adrp x9, numportals
ldr w9, [x9, :lo12:numportals]
subs w8, w8, w9, lsl #1
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldur w9, [x29, #-20]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-20]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
adrp x8, portals
ldr x8, [x8, :lo12:portals]
ldursw x9, [x29, #-20]
add x8, x8, x9, lsl #2
str x8, [sp, #8]
ldr x8, [sp, #8]
ldr w8, [x8]
and w9, w8, #0x7
mov w8, #1 // =0x1
lsl w10, w8, w9
ldur x8, [x29, #-16]
ldr x9, [sp, #8]
ldr w9, [x9]
asr w9, w9, #3
add x9, x8, w9, sxtw #2
ldr w8, [x9]
orr w8, w8, w10
str w8, [x9]
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_1
.LBB0_6:
str wzr, [sp, #24]
b .LBB0_7
.LBB0_7: // =>This Loop Header: Depth=1
// Child Loop BB0_9 Depth 2
ldr w8, [sp, #24]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_15
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
ldr w8, [sp, #24]
str w8, [sp, #20]
b .LBB0_9
.LBB0_9: // Parent Loop BB0_7 Depth=1
// => This Inner Loop Header: Depth=2
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldrsw x9, [sp, #20]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=2
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldrsw x9, [sp, #20]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #20]
b .LBB0_9
.LBB0_11: // in Loop: Header=BB0_7 Depth=1
ldur x8, [x29, #-16]
ldr w9, [sp, #20]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldr w9, [sp, #20]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_7 Depth=1
ldr w8, [sp, #24]
and w9, w8, #0x7
mov w8, #1 // =0x1
lsl w10, w8, w9
ldur x8, [x29, #-16]
ldr w9, [sp, #24]
asr w9, w9, #3
add x9, x8, w9, sxtw #2
ldr w8, [x9]
orr w8, w8, w10
str w8, [x9]
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_7 Depth=1
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_7 Depth=1
ldr w8, [sp, #24]
add w8, w8, #1
str w8, [sp, #24]
b .LBB0_7
.LBB0_15:
ldur x0, [x29, #-16]
adrp x8, portalclusters
ldr w1, [x8, :lo12:portalclusters]
bl CountBits
str w0, [sp, #4]
ldr w0, [sp, #4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size LeafVectorFromPortalVector, .Lfunc_end0-LeafVectorFromPortalVector
.cfi_endproc
// -- End function
.type numportals,@object // @numportals
.bss
.globl numportals
.p2align 2, 0x0
numportals:
.word 0 // 0x0
.size numportals, 4
.type portals,@object // @portals
.globl portals
.p2align 3, 0x0
portals:
.xword 0
.size portals, 8
.type portalclusters,@object // @portalclusters
.globl portalclusters
.p2align 2, 0x0
portalclusters:
.word 0 // 0x0
.size portalclusters, 4
.type leafs,@object // @leafs
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym CountBits
.addrsig_sym numportals
.addrsig_sym portals
.addrsig_sym portalclusters
.addrsig_sym leafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_vis.c_LeafVectorFromPortalVector.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int leaf; scalar_t__ portalflood; scalar_t__ removed; } ;
typedef TYPE_1__ vportal_t ;
struct TYPE_6__ {int numportals; TYPE_1__** portals; } ;
typedef TYPE_2__ leaf_t ;
typedef int byte ;
/* Variables and functions */
int MAX_PORTALS ;
TYPE_2__* leafs ;
int portallongs ;
TYPE_1__* portals ;
void RecursiveLeafBitFlow (int leafnum, byte *mightsee, byte *cansee)
{
vportal_t *p;
leaf_t *leaf;
int i, j;
long more;
int pnum;
byte newmight[MAX_PORTALS/8];
leaf = &leafs[leafnum];
// check all portals for flowing into other leafs
for (i=0 ; i<leaf->numportals ; i++)
{
p = leaf->portals[i];
if (p->removed)
continue;
pnum = p - portals;
// if some previous portal can't see it, skip
if (! (mightsee[pnum>>3] & (1<<(pnum&7)) ) )
continue;
// if this portal can see some portals we mightsee, recurse
more = 0;
for (j=0 ; j<portallongs ; j++)
{
((long *)newmight)[j] = ((long *)mightsee)[j]
& ((long *)p->portalflood)[j];
more |= ((long *)newmight)[j] & ~((long *)cansee)[j];
}
if (!more)
continue; // can't see anything new
cansee[pnum>>3] |= (1<<(pnum&7));
RecursiveLeafBitFlow (p->leaf, newmight, cansee);
}
}
|
.text
.file "extr_visflow.c_RecursiveLeafBitFlow.c"
.globl RecursiveLeafBitFlow // -- Begin function RecursiveLeafBitFlow
.p2align 2
.type RecursiveLeafBitFlow,@function
RecursiveLeafBitFlow: // @RecursiveLeafBitFlow
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub sp, sp, #96
stur w0, [x29, #-4]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
adrp x8, MAX_PORTALS
ldr w8, [x8, :lo12:MAX_PORTALS]
mov w9, #8 // =0x8
sdiv w8, w8, w9
mov w8, w8
// kill: def $x8 killed $w8
mov x9, sp
stur x9, [x29, #-72]
lsl x9, x8, #2
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x9, x9, x10
mov sp, x9
stur x9, [x29, #-88] // 8-byte Folded Spill
stur x8, [x29, #-80]
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #4
stur x8, [x29, #-40]
stur wzr, [x29, #-44]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_7 Depth 2
ldur w8, [x29, #-44]
ldur x9, [x29, #-40]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_14
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-40]
ldr x8, [x8, #8]
ldursw x9, [x29, #-44]
ldr x8, [x8, x9, lsl #3]
stur x8, [x29, #-32]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-32]
adrp x9, portals
ldr x9, [x9, :lo12:portals]
subs x8, x8, x9
mov x9, #24 // =0x18
sdiv x8, x8, x9
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-60]
ldur x8, [x29, #-16]
ldur w9, [x29, #-60]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-60]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
stur xzr, [x29, #-56]
stur wzr, [x29, #-48]
b .LBB0_7
.LBB0_7: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-48]
adrp x9, portallongs
ldr w9, [x9, :lo12:portallongs]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_10
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=2
ldur x8, [x29, #-88] // 8-byte Folded Reload
ldur x9, [x29, #-16]
ldursw x10, [x29, #-48]
ldr x9, [x9, x10, lsl #3]
ldur x10, [x29, #-32]
ldr x10, [x10, #8]
ldursw x11, [x29, #-48]
ldr x10, [x10, x11, lsl #3]
and x9, x9, x10
ldursw x10, [x29, #-48]
str x9, [x8, x10, lsl #3]
ldursw x9, [x29, #-48]
ldr x8, [x8, x9, lsl #3]
ldur x9, [x29, #-24]
ldursw x10, [x29, #-48]
ldr x9, [x9, x10, lsl #3]
bic x9, x8, x9
ldur x8, [x29, #-56]
orr x8, x8, x9
stur x8, [x29, #-56]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=2
ldur w8, [x29, #-48]
add w8, w8, #1
stur w8, [x29, #-48]
b .LBB0_7
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-56]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-88] // 8-byte Folded Reload
ldur w8, [x29, #-60]
and w9, w8, #0x7
mov w8, #1 // =0x1
lsl w10, w8, w9
ldur x8, [x29, #-24]
ldur w9, [x29, #-60]
asr w9, w9, #3
add x9, x8, w9, sxtw #2
ldr w8, [x9]
orr w8, w8, w10
str w8, [x9]
ldur x8, [x29, #-32]
ldr w0, [x8]
ldur x2, [x29, #-24]
bl RecursiveLeafBitFlow
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-44]
add w8, w8, #1
stur w8, [x29, #-44]
b .LBB0_1
.LBB0_14:
ldur x8, [x29, #-72]
mov sp, x8
mov sp, x29
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size RecursiveLeafBitFlow, .Lfunc_end0-RecursiveLeafBitFlow
.cfi_endproc
// -- End function
.type MAX_PORTALS,@object // @MAX_PORTALS
.bss
.globl MAX_PORTALS
.p2align 2, 0x0
MAX_PORTALS:
.word 0 // 0x0
.size MAX_PORTALS, 4
.type leafs,@object // @leafs
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.type portals,@object // @portals
.globl portals
.p2align 3, 0x0
portals:
.xword 0
.size portals, 8
.type portallongs,@object // @portallongs
.globl portallongs
.p2align 2, 0x0
portallongs:
.word 0 // 0x0
.size portallongs, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym RecursiveLeafBitFlow
.addrsig_sym MAX_PORTALS
.addrsig_sym leafs
.addrsig_sym portals
.addrsig_sym portallongs
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_RecursiveLeafBitFlow.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_17__ TYPE_5__ ;
typedef struct TYPE_16__ TYPE_4__ ;
typedef struct TYPE_15__ TYPE_3__ ;
typedef struct TYPE_14__ TYPE_2__ ;
typedef struct TYPE_13__ TYPE_1__ ;
/* Type definitions */
struct TYPE_14__ {int numpoints; int /*<<< orphan*/ * points; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_15__ {int width; TYPE_1__* verts; } ;
typedef TYPE_3__ mesh_t ;
struct TYPE_16__ {int numFacets; int /*<<< orphan*/ * facets; TYPE_3__* detailMesh; } ;
typedef TYPE_4__ lsurfaceTest_t ;
struct TYPE_17__ {int lightmapNum; int lightmapHeight; int lightmapWidth; scalar_t__ surfaceType; int lightmapY; int lightmapX; int /*<<< orphan*/ * lightmapVecs; int /*<<< orphan*/ lightmapOrigin; } ;
typedef TYPE_5__ dsurface_t ;
struct TYPE_13__ {int /*<<< orphan*/ normal; int /*<<< orphan*/ xyz; } ;
/* Variables and functions */
int LIGHTMAP_HEIGHT ;
float LIGHTMAP_PIXELSHIFT ;
int LIGHTMAP_WIDTH ;
scalar_t__ MST_PATCH ;
scalar_t__ VL_ChopWindingWithFacet (TYPE_2__*,int /*<<< orphan*/ *) ;
float VL_WindingAreaOutsideSolid (TYPE_2__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float WindingArea (TYPE_2__*) ;
int /*<<< orphan*/ _printf (char*) ;
TYPE_5__* drawSurfaces ;
float* lightmappixelarea ;
TYPE_4__** lsurfaceTest ;
int /*<<< orphan*/ memcpy (TYPE_2__*,TYPE_2__*,int) ;
scalar_t__ nostitching ;
int numDrawSurfaces ;
void VL_CalcVisibleLightmapPixelArea(void)
{
int i, j, x, y, k;
dsurface_t *ds;
lsurfaceTest_t *test;
mesh_t *mesh;
winding_t w, tmpw;
float area;
_printf("calculating visible lightmap pixel area...\n");
for ( i = 0 ; i < numDrawSurfaces ; i++ )
{
test = lsurfaceTest[ i ];
if (!test)
continue;
ds = &drawSurfaces[ i ];
if ( ds->lightmapNum < 0 )
continue;
for (y = 0; y < ds->lightmapHeight; y++)
{
for (x = 0; x < ds->lightmapWidth; x++)
{
if (ds->surfaceType == MST_PATCH)
{
if (y == ds->lightmapHeight-1)
continue;
if (x == ds->lightmapWidth-1)
continue;
mesh = lsurfaceTest[i]->detailMesh;
VectorCopy( mesh->verts[y*mesh->width+x].xyz, w.points[0]);
VectorCopy( mesh->verts[(y+1)*mesh->width+x].xyz, w.points[1]);
VectorCopy( mesh->verts[(y+1)*mesh->width+x+1].xyz, w.points[2]);
VectorCopy( mesh->verts[y*mesh->width+x+1].xyz, w.points[3]);
w.numpoints = 4;
if (nostitching)
area = WindingArea(&w);
else
area = VL_WindingAreaOutsideSolid(&w, mesh->verts[y*mesh->width+x].normal);
}
else
{
VectorMA(ds->lightmapOrigin, (float) x - LIGHTMAP_PIXELSHIFT, ds->lightmapVecs[0], w.points[0]);
VectorMA(w.points[0], (float) y - LIGHTMAP_PIXELSHIFT, ds->lightmapVecs[1], w.points[0]);
VectorMA(ds->lightmapOrigin, (float) x - LIGHTMAP_PIXELSHIFT, ds->lightmapVecs[0], w.points[3]);
VectorMA(w.points[3], (float) y - LIGHTMAP_PIXELSHIFT + 1, ds->lightmapVecs[1], w.points[3]);
VectorMA(ds->lightmapOrigin, (float) x - LIGHTMAP_PIXELSHIFT + 1, ds->lightmapVecs[0], w.points[2]);
VectorMA(w.points[2], (float) y - LIGHTMAP_PIXELSHIFT + 1, ds->lightmapVecs[1], w.points[2]);
VectorMA(ds->lightmapOrigin, (float) x - LIGHTMAP_PIXELSHIFT + 1, ds->lightmapVecs[0], w.points[1]);
VectorMA(w.points[1], (float) y - LIGHTMAP_PIXELSHIFT, ds->lightmapVecs[1], w.points[1]);
w.numpoints = 4;
area = 0;
for (j = 0; j < test->numFacets; j++)
{
memcpy(&tmpw, &w, sizeof(winding_t));
area += VL_ChopWindingWithFacet(&tmpw, &test->facets[j]);
}
}
k = ( ds->lightmapNum * LIGHTMAP_HEIGHT + ds->lightmapY + y)
* LIGHTMAP_WIDTH + ds->lightmapX + x;
lightmappixelarea[k] = area;
}
}
}
}
|
.text
.file "extr_lightv.c_VL_CalcVisibleLightmapPixelArea.c"
.globl VL_CalcVisibleLightmapPixelArea // -- Begin function VL_CalcVisibleLightmapPixelArea
.p2align 2
.type VL_CalcVisibleLightmapPixelArea,@function
VL_CalcVisibleLightmapPixelArea: // @VL_CalcVisibleLightmapPixelArea
.cfi_startproc
// %bb.0:
sub sp, sp, #128
.cfi_def_cfa_offset 128
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
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_7 Depth 2
// Child Loop BB0_9 Depth 3
// Child Loop BB0_20 Depth 4
ldur w8, [x29, #-4]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_30
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, lsurfaceTest
ldr x8, [x8, :lo12:lsurfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
stur x8, [x29, #-40]
ldur x8, [x29, #-40]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_29
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldursw x9, [x29, #-4]
mov x10, #48 // =0x30
mul x9, x9, x10
add x8, x8, x9
stur x8, [x29, #-32]
ldur x8, [x29, #-32]
ldr w8, [x8]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
b .LBB0_29
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-16]
b .LBB0_7
.LBB0_7: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_9 Depth 3
// Child Loop BB0_20 Depth 4
ldur w8, [x29, #-16]
ldur x9, [x29, #-32]
ldr w9, [x9, #4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_28
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=2
stur wzr, [x29, #-12]
b .LBB0_9
.LBB0_9: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_7 Depth=2
// => This Loop Header: Depth=3
// Child Loop BB0_20 Depth 4
ldur w8, [x29, #-12]
ldur x9, [x29, #-32]
ldr w9, [x9, #8]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_26
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=3
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
adrp x9, MST_PATCH
ldr x9, [x9, :lo12:MST_PATCH]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_19
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_9 Depth=3
ldur w8, [x29, #-16]
ldur x9, [x29, #-32]
ldr w9, [x9, #4]
subs w9, w9, #1
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_9 Depth=3
b .LBB0_25
.LBB0_13: // in Loop: Header=BB0_9 Depth=3
ldur w8, [x29, #-12]
ldur x9, [x29, #-32]
ldr w9, [x9, #8]
subs w9, w9, #1
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_9 Depth=3
b .LBB0_25
.LBB0_15: // in Loop: Header=BB0_9 Depth=3
adrp x8, lsurfaceTest
ldr x8, [x8, :lo12:lsurfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
ldr x8, [x8, #16]
stur x8, [x29, #-48]
ldur x8, [x29, #-48]
ldr x8, [x8, #8]
ldur w9, [x29, #-16]
ldur x10, [x29, #-48]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-12]
add w9, w9, w10
add x8, x8, w9, sxtw #3
ldr w0, [x8, #4]
ldr x8, [sp, #56]
ldr w1, [x8]
bl VectorCopy
ldur x8, [x29, #-48]
ldr x8, [x8, #8]
ldur w9, [x29, #-16]
add w9, w9, #1
ldur x10, [x29, #-48]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-12]
add w9, w9, w10
add x8, x8, w9, sxtw #3
ldr w0, [x8, #4]
ldr x8, [sp, #56]
ldr w1, [x8, #4]
bl VectorCopy
ldur x8, [x29, #-48]
ldr x8, [x8, #8]
ldur w9, [x29, #-16]
add w9, w9, #1
ldur x10, [x29, #-48]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-12]
add w9, w9, w10
add w9, w9, #1
add x8, x8, w9, sxtw #3
ldr w0, [x8, #4]
ldr x8, [sp, #56]
ldr w1, [x8, #8]
bl VectorCopy
ldur x8, [x29, #-48]
ldr x8, [x8, #8]
ldur w9, [x29, #-16]
ldur x10, [x29, #-48]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-12]
add w9, w9, w10
add w9, w9, #1
add x8, x8, w9, sxtw #3
ldr w0, [x8, #4]
ldr x8, [sp, #56]
ldr w1, [x8, #12]
bl VectorCopy
mov w8, #4 // =0x4
str w8, [sp, #48]
adrp x8, nostitching
ldr x8, [x8, :lo12:nostitching]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_9 Depth=3
add x0, sp, #48
bl WindingArea
str s0, [sp, #28]
b .LBB0_18
.LBB0_17: // in Loop: Header=BB0_9 Depth=3
ldur x8, [x29, #-48]
ldr x8, [x8, #8]
ldur w9, [x29, #-16]
ldur x10, [x29, #-48]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-12]
add w10, w9, w10
// implicit-def: $x9
mov w9, w10
sxtw x9, w9
lsl x9, x9, #3
ldr w1, [x8, x9]
add x0, sp, #48
bl VL_WindingAreaOutsideSolid
str s0, [sp, #28]
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_9 Depth=3
b .LBB0_24
.LBB0_19: // in Loop: Header=BB0_9 Depth=3
ldur x8, [x29, #-32]
ldr w0, [x8, #40]
ldur s0, [x29, #-12]
scvtf s0, s0
adrp x8, LIGHTMAP_PIXELSHIFT
str x8, [sp, #16] // 8-byte Folded Spill
ldr s1, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8]
ldr x8, [sp, #56]
ldr w2, [x8]
bl VectorMA
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #56]
ldr w0, [x9]
ldur s0, [x29, #-16]
scvtf s0, s0
ldr s1, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8, #4]
ldr x8, [sp, #56]
ldr w2, [x8]
bl VectorMA
ldr x8, [sp, #16] // 8-byte Folded Reload
ldur x9, [x29, #-32]
ldr w0, [x9, #40]
ldur s0, [x29, #-12]
scvtf s0, s0
ldr s1, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8]
ldr x8, [sp, #56]
ldr w2, [x8, #12]
bl VectorMA
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #56]
ldr w0, [x9, #12]
ldur s0, [x29, #-16]
scvtf s0, s0
ldr s1, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s1
fmov s1, #1.00000000
str s1, [sp, #12] // 4-byte Folded Spill
fadd s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8, #4]
ldr x8, [sp, #56]
ldr w2, [x8, #12]
bl VectorMA
ldr s1, [sp, #12] // 4-byte Folded Reload
ldr x8, [sp, #16] // 8-byte Folded Reload
ldur x9, [x29, #-32]
ldr w0, [x9, #40]
ldur s0, [x29, #-12]
scvtf s0, s0
ldr s2, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s2
fadd s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8]
ldr x8, [sp, #56]
ldr w2, [x8, #8]
bl VectorMA
ldr s1, [sp, #12] // 4-byte Folded Reload
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #56]
ldr w0, [x9, #8]
ldur s0, [x29, #-16]
scvtf s0, s0
ldr s2, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s2
fadd s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8, #4]
ldr x8, [sp, #56]
ldr w2, [x8, #8]
bl VectorMA
ldr s1, [sp, #12] // 4-byte Folded Reload
ldr x8, [sp, #16] // 8-byte Folded Reload
ldur x9, [x29, #-32]
ldr w0, [x9, #40]
ldur s0, [x29, #-12]
scvtf s0, s0
ldr s2, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s2
fadd s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8]
ldr x8, [sp, #56]
ldr w2, [x8, #4]
bl VectorMA
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #56]
ldr w0, [x9, #4]
ldur s0, [x29, #-16]
scvtf s0, s0
ldr s1, [x8, :lo12:LIGHTMAP_PIXELSHIFT]
fsub s0, s0, s1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
ldr w1, [x8, #4]
ldr x8, [sp, #56]
ldr w2, [x8, #4]
bl VectorMA
mov w8, #4 // =0x4
str w8, [sp, #48]
movi d0, #0000000000000000
str s0, [sp, #28]
stur wzr, [x29, #-8]
b .LBB0_20
.LBB0_20: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_7 Depth=2
// Parent Loop BB0_9 Depth=3
// => This Inner Loop Header: Depth=4
ldur w8, [x29, #-8]
ldur x9, [x29, #-40]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_23
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_20 Depth=4
add x0, sp, #32
str x0, [sp] // 8-byte Folded Spill
add x1, sp, #48
mov w2, #16 // =0x10
bl memcpy
ldr x0, [sp] // 8-byte Folded Reload
ldur x8, [x29, #-40]
ldr x8, [x8, #8]
ldursw x9, [x29, #-8]
add x1, x8, x9, lsl #2
bl VL_ChopWindingWithFacet
scvtf s1, x0
ldr s0, [sp, #28]
fadd s0, s0, s1
str s0, [sp, #28]
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_20 Depth=4
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_20
.LBB0_23: // in Loop: Header=BB0_9 Depth=3
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_9 Depth=3
ldur x8, [x29, #-32]
ldr w8, [x8]
adrp x9, LIGHTMAP_HEIGHT
ldr w9, [x9, :lo12:LIGHTMAP_HEIGHT]
mul w8, w8, w9
ldur x9, [x29, #-32]
ldr w9, [x9, #24]
add w8, w8, w9
ldur w9, [x29, #-16]
add w8, w8, w9
adrp x9, LIGHTMAP_WIDTH
ldr w9, [x9, :lo12:LIGHTMAP_WIDTH]
mul w8, w8, w9
ldur x9, [x29, #-32]
ldr w9, [x9, #28]
add w8, w8, w9
ldur w9, [x29, #-12]
add w8, w8, w9
stur w8, [x29, #-20]
ldr s0, [sp, #28]
adrp x8, lightmappixelarea
ldr x8, [x8, :lo12:lightmappixelarea]
ldursw x9, [x29, #-20]
str s0, [x8, x9, lsl #2]
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_9 Depth=3
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_26: // in Loop: Header=BB0_7 Depth=2
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_7 Depth=2
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_7
.LBB0_28: // in Loop: Header=BB0_1 Depth=1
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_1
.LBB0_30:
.cfi_def_cfa wsp, 128
ldp x29, x30, [sp, #112] // 16-byte Folded Reload
add sp, sp, #128
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_CalcVisibleLightmapPixelArea, .Lfunc_end0-VL_CalcVisibleLightmapPixelArea
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "calculating visible lightmap pixel area...\n"
.size .L.str, 44
.type numDrawSurfaces,@object // @numDrawSurfaces
.bss
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type lsurfaceTest,@object // @lsurfaceTest
.globl lsurfaceTest
.p2align 3, 0x0
lsurfaceTest:
.xword 0
.size lsurfaceTest, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type MST_PATCH,@object // @MST_PATCH
.globl MST_PATCH
.p2align 3, 0x0
MST_PATCH:
.xword 0 // 0x0
.size MST_PATCH, 8
.type nostitching,@object // @nostitching
.globl nostitching
.p2align 3, 0x0
nostitching:
.xword 0 // 0x0
.size nostitching, 8
.type LIGHTMAP_PIXELSHIFT,@object // @LIGHTMAP_PIXELSHIFT
.globl LIGHTMAP_PIXELSHIFT
.p2align 2, 0x0
LIGHTMAP_PIXELSHIFT:
.word 0x00000000 // float 0
.size LIGHTMAP_PIXELSHIFT, 4
.type LIGHTMAP_HEIGHT,@object // @LIGHTMAP_HEIGHT
.globl LIGHTMAP_HEIGHT
.p2align 2, 0x0
LIGHTMAP_HEIGHT:
.word 0 // 0x0
.size LIGHTMAP_HEIGHT, 4
.type LIGHTMAP_WIDTH,@object // @LIGHTMAP_WIDTH
.globl LIGHTMAP_WIDTH
.p2align 2, 0x0
LIGHTMAP_WIDTH:
.word 0 // 0x0
.size LIGHTMAP_WIDTH, 4
.type lightmappixelarea,@object // @lightmappixelarea
.globl lightmappixelarea
.p2align 3, 0x0
lightmappixelarea:
.xword 0
.size lightmappixelarea, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym _printf
.addrsig_sym VectorCopy
.addrsig_sym WindingArea
.addrsig_sym VL_WindingAreaOutsideSolid
.addrsig_sym VectorMA
.addrsig_sym memcpy
.addrsig_sym VL_ChopWindingWithFacet
.addrsig_sym numDrawSurfaces
.addrsig_sym lsurfaceTest
.addrsig_sym drawSurfaces
.addrsig_sym MST_PATCH
.addrsig_sym nostitching
.addrsig_sym LIGHTMAP_PIXELSHIFT
.addrsig_sym LIGHTMAP_HEIGHT
.addrsig_sym LIGHTMAP_WIDTH
.addrsig_sym lightmappixelarea
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_CalcVisibleLightmapPixelArea.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ * normal; } ;
typedef TYPE_2__ plane_t ;
struct TYPE_9__ {size_t planenum; struct TYPE_9__** children; TYPE_4__* brushlist; } ;
typedef TYPE_3__ node_t ;
struct TYPE_10__ {TYPE_1__* original; struct TYPE_10__* next; } ;
typedef TYPE_4__ bspbrush_t ;
struct TYPE_7__ {int /*<<< orphan*/ brushnum; } ;
/* Variables and functions */
size_t PLANENUM_LEAF ;
int /*<<< orphan*/ _printf (char*,...) ;
TYPE_2__* mapplanes ;
void PrintTree_r (node_t *node, int depth)
{
int i;
plane_t *plane;
bspbrush_t *bb;
for (i=0 ; i<depth ; i++)
_printf (" ");
if (node->planenum == PLANENUM_LEAF)
{
if (!node->brushlist)
_printf ("NULL\n");
else
{
for (bb=node->brushlist ; bb ; bb=bb->next)
_printf ("%i ", bb->original->brushnum);
_printf ("\n");
}
return;
}
plane = &mapplanes[node->planenum];
_printf ("#%i (%5.2f %5.2f %5.2f):%5.2f\n", node->planenum,
plane->normal[0], plane->normal[1], plane->normal[2],
plane->dist);
PrintTree_r (node->children[0], depth+1);
PrintTree_r (node->children[1], depth+1);
}
|
.text
.file "extr_tree.c_PrintTree_r.c"
.globl PrintTree_r // -- Begin function PrintTree_r
.p2align 2
.type PrintTree_r,@function
PrintTree_r: // @PrintTree_r
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
stur w1, [x29, #-12]
str wzr, [sp, #16]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #16]
ldur w9, [x29, #-12]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b .LBB0_1
.LBB0_4:
ldur x8, [x29, #-8]
ldr x8, [x8]
adrp x9, PLANENUM_LEAF
ldr x9, [x9, :lo12:PLANENUM_LEAF]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_5
.LBB0_5:
ldur x8, [x29, #-8]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
b .LBB0_12
.LBB0_7:
ldur x8, [x29, #-8]
ldr x8, [x8, #16]
str x8, [sp]
b .LBB0_8
.LBB0_8: // =>This Inner Loop Header: Depth=1
ldr x8, [sp]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_11
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_8 Depth=1
ldr x8, [sp]
ldr x8, [x8]
ldr w1, [x8]
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_8 Depth=1
ldr x8, [sp]
ldr x8, [x8, #8]
str x8, [sp]
b .LBB0_8
.LBB0_11:
adrp x0, .L.str.3
add x0, x0, :lo12:.L.str.3
bl _printf
b .LBB0_12
.LBB0_12:
b .LBB0_14
.LBB0_13:
adrp x8, mapplanes
ldr x8, [x8, :lo12:mapplanes]
ldur x9, [x29, #-8]
ldr x9, [x9]
add x8, x8, x9, lsl #4
str x8, [sp, #8]
ldur x8, [x29, #-8]
ldr x1, [x8]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr w2, [x8]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr w3, [x8, #4]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr w4, [x8, #8]
ldr x8, [sp, #8]
ldr w5, [x8]
adrp x0, .L.str.4
add x0, x0, :lo12:.L.str.4
bl _printf
ldur x8, [x29, #-8]
ldr x8, [x8, #8]
ldr x0, [x8]
ldur w8, [x29, #-12]
add w1, w8, #1
bl PrintTree_r
ldur x8, [x29, #-8]
ldr x8, [x8, #8]
ldr x0, [x8, #8]
ldur w8, [x29, #-12]
add w1, w8, #1
bl PrintTree_r
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size PrintTree_r, .Lfunc_end0-PrintTree_r
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz " "
.size .L.str, 3
.type PLANENUM_LEAF,@object // @PLANENUM_LEAF
.bss
.globl PLANENUM_LEAF
.p2align 3, 0x0
PLANENUM_LEAF:
.xword 0 // 0x0
.size PLANENUM_LEAF, 8
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "NULL\n"
.size .L.str.1, 6
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "%i "
.size .L.str.2, 4
.type .L.str.3,@object // @.str.3
.L.str.3:
.asciz "\n"
.size .L.str.3, 2
.type mapplanes,@object // @mapplanes
.bss
.globl mapplanes
.p2align 3, 0x0
mapplanes:
.xword 0
.size mapplanes, 8
.type .L.str.4,@object // @.str.4
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.4:
.asciz "#%i (%5.2f %5.2f %5.2f):%5.2f\n"
.size .L.str.4, 31
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym PrintTree_r
.addrsig_sym _printf
.addrsig_sym PLANENUM_LEAF
.addrsig_sym mapplanes
|
../AnghaBench/Quake-III-Arena/q3map/extr_tree.c_PrintTree_r.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_7__ {int numpoints; float** points; } ;
typedef TYPE_1__ winding_t ;
typedef float vec_t ;
typedef float* vec3_t ;
struct TYPE_8__ {int* normal; float dist; } ;
typedef TYPE_2__ plane_t ;
/* Variables and functions */
float DotProduct (float*,int*) ;
int MAX_POINTS_ON_FIXED_WINDING ;
size_t SIDE_BACK ;
int SIDE_CROSS ;
size_t SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VectorCopy (float*,float*) ;
int /*<<< orphan*/ _printf (char*) ;
int /*<<< orphan*/ memcpy (TYPE_1__*,TYPE_1__*,int) ;
int VL_ChopWinding (winding_t *in, plane_t *split, float epsilon)
{
vec_t dists[128];
int sides[128];
int counts[3];
vec_t dot;
int i, j;
vec_t *p1, *p2;
vec3_t mid;
winding_t out;
winding_t *neww;
counts[0] = counts[1] = counts[2] = 0;
// determine sides for each point
for (i=0 ; i<in->numpoints ; i++)
{
dot = DotProduct (in->points[i], split->normal);
dot -= split->dist;
dists[i] = dot;
if (dot > epsilon)
sides[i] = SIDE_FRONT;
else if (dot < -epsilon)
sides[i] = SIDE_BACK;
else
{
sides[i] = SIDE_ON;
}
counts[sides[i]]++;
}
if (!counts[SIDE_BACK])
{
if (!counts[SIDE_FRONT])
return SIDE_ON;
else
return SIDE_FRONT;
}
if (!counts[SIDE_FRONT])
{
return SIDE_BACK;
}
sides[i] = sides[0];
dists[i] = dists[0];
neww = &out;
neww->numpoints = 0;
for (i=0 ; i<in->numpoints ; i++)
{
p1 = in->points[i];
if (neww->numpoints >= MAX_POINTS_ON_FIXED_WINDING)
{
_printf("WARNING: VL_ChopWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n");
return SIDE_FRONT; // can't chop -- fall back to original
}
if (sides[i] == SIDE_ON)
{
VectorCopy (p1, neww->points[neww->numpoints]);
neww->numpoints++;
continue;
}
if (sides[i] == SIDE_FRONT)
{
VectorCopy (p1, neww->points[neww->numpoints]);
neww->numpoints++;
}
if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
continue;
if (neww->numpoints >= MAX_POINTS_ON_FIXED_WINDING)
{
_printf("WARNING: VL_ChopWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n");
return SIDE_FRONT; // can't chop -- fall back to original
}
// generate a split point
p2 = in->points[(i+1)%in->numpoints];
dot = dists[i] / (dists[i]-dists[i+1]);
for (j=0 ; j<3 ; j++)
{ // avoid round off error when possible
if (split->normal[j] == 1)
mid[j] = split->dist;
else if (split->normal[j] == -1)
mid[j] = -split->dist;
else
mid[j] = p1[j] + dot*(p2[j]-p1[j]);
}
VectorCopy (mid, neww->points[neww->numpoints]);
neww->numpoints++;
}
memcpy(in, &out, sizeof(winding_t));
return SIDE_CROSS;
}
|
.text
.file "extr_lightv.c_VL_ChopWinding.c"
.globl VL_ChopWinding // -- Begin function VL_ChopWinding
.p2align 2
.type VL_ChopWinding,@function
VL_ChopWinding: // @VL_ChopWinding
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x28, [sp, #16] // 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1136
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur s0, [x29, #-28]
str wzr, [sp, #80]
str wzr, [sp, #76]
str wzr, [sp, #72]
str wzr, [sp, #64]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #64]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_10
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #64]
ldr x0, [x8, x9, lsl #3]
ldur x8, [x29, #-24]
ldr x1, [x8]
bl DotProduct
str s0, [sp, #68]
ldur x8, [x29, #-24]
ldr s1, [x8, #8]
ldr s0, [sp, #68]
fsub s0, s0, s1
str s0, [sp, #68]
ldr s0, [sp, #68]
ldrsw x9, [sp, #64]
add x8, sp, #596
str s0, [x8, x9, lsl #2]
ldr s0, [sp, #68]
ldur s1, [x29, #-28]
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
ldrsw x10, [sp, #64]
add x9, sp, #84
// kill: def $w8 killed $w8 killed $x8
str w8, [x9, x10, lsl #2]
b .LBB0_8
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldr s0, [sp, #68]
ldur s1, [x29, #-28]
fneg s1, s1
fcmp s0, s1
cset w8, pl
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_BACK
ldr x8, [x8, :lo12:SIDE_BACK]
ldrsw x10, [sp, #64]
add x9, sp, #84
// kill: def $w8 killed $w8 killed $x8
str w8, [x9, x10, lsl #2]
b .LBB0_7
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_ON
ldr w8, [x8, :lo12:SIDE_ON]
ldrsw x10, [sp, #64]
add x9, sp, #84
str w8, [x9, x10, lsl #2]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldrsw x9, [sp, #64]
add x8, sp, #84
ldrsw x9, [x8, x9, lsl #2]
add x8, sp, #72
add x9, x8, x9, lsl #2
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #64]
add w8, w8, #1
str w8, [sp, #64]
b .LBB0_1
.LBB0_10:
adrp x8, SIDE_BACK
ldr x9, [x8, :lo12:SIDE_BACK]
add x8, sp, #72
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_14
b .LBB0_11
.LBB0_11:
adrp x8, SIDE_FRONT
ldr x9, [x8, :lo12:SIDE_FRONT]
add x8, sp, #72
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12:
adrp x8, SIDE_ON
ldr w8, [x8, :lo12:SIDE_ON]
stur w8, [x29, #-4]
b .LBB0_42
.LBB0_13:
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_42
.LBB0_14:
adrp x8, SIDE_FRONT
ldr x9, [x8, :lo12:SIDE_FRONT]
add x8, sp, #72
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15:
adrp x8, SIDE_BACK
ldr x8, [x8, :lo12:SIDE_BACK]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_42
.LBB0_16:
add x9, sp, #84
ldr w8, [sp, #84]
ldrsw x10, [sp, #64]
str w8, [x9, x10, lsl #2]
add x8, sp, #596
ldr s0, [sp, #596]
ldrsw x9, [sp, #64]
str s0, [x8, x9, lsl #2]
add x8, sp, #16
str x8, [sp, #8]
ldr x8, [sp, #8]
str wzr, [x8]
str wzr, [sp, #64]
b .LBB0_17
.LBB0_17: // =>This Loop Header: Depth=1
// Child Loop BB0_30 Depth 2
ldr w8, [sp, #64]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_41
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #64]
ldr x8, [x8, x9, lsl #3]
str x8, [sp, #48]
ldr x8, [sp, #8]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_42
.LBB0_20: // in Loop: Header=BB0_17 Depth=1
ldrsw x9, [sp, #64]
add x8, sp, #84
ldr w8, [x8, x9, lsl #2]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #48]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp, #8]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_40
.LBB0_22: // in Loop: Header=BB0_17 Depth=1
ldrsw x9, [sp, #64]
add x8, sp, #84
ldrsw x8, [x8, x9, lsl #2]
adrp x9, SIDE_FRONT
ldr x9, [x9, :lo12:SIDE_FRONT]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_24
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #48]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp, #8]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #64]
add w9, w8, #1
add x8, sp, #84
ldr w8, [x8, w9, sxtw #2]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_26
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #64]
add w8, w8, #1
add x9, sp, #84
ldr w8, [x9, w8, sxtw #2]
ldrsw x10, [sp, #64]
ldr w9, [x9, x10, lsl #2]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_27
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_17 Depth=1
b .LBB0_40
.LBB0_27: // in Loop: Header=BB0_17 Depth=1
ldr x8, [sp, #8]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_29
b .LBB0_28
.LBB0_28:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_42
.LBB0_29: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldr w9, [sp, #64]
add w9, w9, #1
ldur x10, [x29, #-16]
ldr w11, [x10]
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr x8, [x8, w9, sxtw #3]
str x8, [sp, #40]
ldrsw x9, [sp, #64]
add x8, sp, #596
ldr s0, [x8, x9, lsl #2]
ldrsw x9, [sp, #64]
ldr s1, [x8, x9, lsl #2]
ldr w9, [sp, #64]
add w9, w9, #1
ldr s2, [x8, w9, sxtw #2]
fsub s1, s1, s2
fdiv s0, s0, s1
str s0, [sp, #68]
str wzr, [sp, #60]
b .LBB0_30
.LBB0_30: // Parent Loop BB0_17 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #60]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_39
b .LBB0_31
.LBB0_31: // in Loop: Header=BB0_30 Depth=2
ldur x8, [x29, #-24]
ldr x8, [x8]
ldrsw x9, [sp, #60]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_33
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_30 Depth=2
ldur x8, [x29, #-24]
ldr s0, [x8, #8]
ldr x8, [sp, #32]
ldrsw x9, [sp, #60]
str s0, [x8, x9, lsl #2]
b .LBB0_37
.LBB0_33: // in Loop: Header=BB0_30 Depth=2
ldur x8, [x29, #-24]
ldr x8, [x8]
ldrsw x9, [sp, #60]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_35
b .LBB0_34
.LBB0_34: // in Loop: Header=BB0_30 Depth=2
ldur x8, [x29, #-24]
ldr s0, [x8, #8]
fneg s0, s0
ldr x8, [sp, #32]
ldrsw x9, [sp, #60]
str s0, [x8, x9, lsl #2]
b .LBB0_36
.LBB0_35: // in Loop: Header=BB0_30 Depth=2
ldr x8, [sp, #48]
ldrsw x9, [sp, #60]
ldr s2, [x8, x9, lsl #2]
ldr s0, [sp, #68]
ldr x8, [sp, #40]
ldrsw x9, [sp, #60]
ldr s1, [x8, x9, lsl #2]
ldr x8, [sp, #48]
ldrsw x9, [sp, #60]
ldr s3, [x8, x9, lsl #2]
fsub s1, s1, s3
fmadd s0, s0, s1, s2
ldr x8, [sp, #32]
ldrsw x9, [sp, #60]
str s0, [x8, x9, lsl #2]
b .LBB0_36
.LBB0_36: // in Loop: Header=BB0_30 Depth=2
b .LBB0_37
.LBB0_37: // in Loop: Header=BB0_30 Depth=2
b .LBB0_38
.LBB0_38: // in Loop: Header=BB0_30 Depth=2
ldr w8, [sp, #60]
add w8, w8, #1
str w8, [sp, #60]
b .LBB0_30
.LBB0_39: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #32]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp, #8]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_40
.LBB0_40: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #64]
add w8, w8, #1
str w8, [sp, #64]
b .LBB0_17
.LBB0_41:
ldur x0, [x29, #-16]
add x1, sp, #16
mov w2, #16 // =0x10
bl memcpy
adrp x8, SIDE_CROSS
ldr w8, [x8, :lo12:SIDE_CROSS]
stur w8, [x29, #-4]
b .LBB0_42
.LBB0_42:
ldur w0, [x29, #-4]
add sp, sp, #1136
.cfi_def_cfa wsp, 32
ldr x28, [sp, #16] // 8-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_ChopWinding, .Lfunc_end0-VL_ChopWinding
.cfi_endproc
// -- End function
.type SIDE_FRONT,@object // @SIDE_FRONT
.bss
.globl SIDE_FRONT
.p2align 3, 0x0
SIDE_FRONT:
.xword 0 // 0x0
.size SIDE_FRONT, 8
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 3, 0x0
SIDE_BACK:
.xword 0 // 0x0
.size SIDE_BACK, 8
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type MAX_POINTS_ON_FIXED_WINDING,@object // @MAX_POINTS_ON_FIXED_WINDING
.globl MAX_POINTS_ON_FIXED_WINDING
.p2align 2, 0x0
MAX_POINTS_ON_FIXED_WINDING:
.word 0 // 0x0
.size MAX_POINTS_ON_FIXED_WINDING, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "WARNING: VL_ChopWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n"
.size .L.str, 67
.type SIDE_CROSS,@object // @SIDE_CROSS
.bss
.globl SIDE_CROSS
.p2align 2, 0x0
SIDE_CROSS:
.word 0 // 0x0
.size SIDE_CROSS, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym DotProduct
.addrsig_sym _printf
.addrsig_sym VectorCopy
.addrsig_sym memcpy
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym MAX_POINTS_ON_FIXED_WINDING
.addrsig_sym SIDE_CROSS
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_ChopWinding.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_15__ TYPE_6__ ;
typedef struct TYPE_14__ TYPE_5__ ;
typedef struct TYPE_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_11__ {int width; int height; TYPE_1__* verts; } ;
struct TYPE_12__ {TYPE_2__ mesh; struct TYPE_12__* next; } ;
typedef TYPE_3__ parseMesh_t ;
struct TYPE_13__ {TYPE_6__* brushes; TYPE_3__* patches; } ;
typedef TYPE_4__ entity_t ;
struct TYPE_14__ {int /*<<< orphan*/ firstBrush; int /*<<< orphan*/ firstSurface; int /*<<< orphan*/ maxs; int /*<<< orphan*/ mins; } ;
typedef TYPE_5__ dmodel_t ;
struct TYPE_15__ {int /*<<< orphan*/ maxs; int /*<<< orphan*/ mins; int /*<<< orphan*/ numsides; struct TYPE_15__* next; } ;
typedef TYPE_6__ bspbrush_t ;
struct TYPE_10__ {int /*<<< orphan*/ xyz; } ;
/* Variables and functions */
int /*<<< orphan*/ AddPointToBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ClearBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ EmitBrushes (TYPE_6__*) ;
int /*<<< orphan*/ Error (char*) ;
size_t MAX_MAP_MODELS ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_5__* dmodels ;
TYPE_4__* entities ;
size_t entity_num ;
int /*<<< orphan*/ numDrawSurfaces ;
int /*<<< orphan*/ numbrushes ;
size_t nummodels ;
void BeginModel( void ) {
dmodel_t *mod;
bspbrush_t *b;
entity_t *e;
vec3_t mins, maxs;
parseMesh_t *p;
int i;
if ( nummodels == MAX_MAP_MODELS ) {
Error( "MAX_MAP_MODELS" );
}
mod = &dmodels[nummodels];
//
// bound the brushes
//
e = &entities[entity_num];
ClearBounds (mins, maxs);
for ( b = e->brushes ; b ; b = b->next ) {
if ( !b->numsides ) {
continue; // not a real brush (origin brush, etc)
}
AddPointToBounds (b->mins, mins, maxs);
AddPointToBounds (b->maxs, mins, maxs);
}
for ( p = e->patches ; p ; p = p->next ) {
for ( i = 0 ; i < p->mesh.width * p->mesh.height ; i++ ) {
AddPointToBounds( p->mesh.verts[i].xyz, mins, maxs );
}
}
VectorCopy (mins, mod->mins);
VectorCopy (maxs, mod->maxs);
mod->firstSurface = numDrawSurfaces;
mod->firstBrush = numbrushes;
EmitBrushes( e->brushes );
}
|
.text
.file "extr_writebsp.c_BeginModel.c"
.globl BeginModel // -- Begin function BeginModel
.p2align 2
.type BeginModel,@function
BeginModel: // @BeginModel
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
adrp x8, nummodels
ldr x8, [x8, :lo12:nummodels]
adrp x9, MAX_MAP_MODELS
ldr x9, [x9, :lo12:MAX_MAP_MODELS]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_2
.LBB0_2:
adrp x8, dmodels
ldr x8, [x8, :lo12:dmodels]
adrp x9, nummodels
ldr x9, [x9, :lo12:nummodels]
add x8, x8, x9, lsl #4
stur x8, [x29, #-8]
adrp x8, entities
ldr x8, [x8, :lo12:entities]
adrp x9, entity_num
ldr x9, [x9, :lo12:entity_num]
add x8, x8, x9, lsl #4
str x8, [sp, #24]
ldr w0, [sp, #20]
ldr w1, [sp, #16]
bl ClearBounds
ldr x8, [sp, #24]
ldr x8, [x8]
stur x8, [x29, #-16]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldur x8, [x29, #-16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-16]
ldr w8, [x8, #8]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=1
b .LBB0_7
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-16]
ldr w0, [x8, #4]
ldr w1, [sp, #20]
ldr w2, [sp, #16]
bl AddPointToBounds
ldur x8, [x29, #-16]
ldr w0, [x8]
ldr w1, [sp, #20]
ldr w2, [sp, #16]
bl AddPointToBounds
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #16]
stur x8, [x29, #-16]
b .LBB0_3
.LBB0_8:
ldr x8, [sp, #24]
ldr x8, [x8, #8]
str x8, [sp, #8]
b .LBB0_9
.LBB0_9: // =>This Loop Header: Depth=1
// Child Loop BB0_11 Depth 2
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_16
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=1
str wzr, [sp, #4]
b .LBB0_11
.LBB0_11: // Parent Loop BB0_9 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #4]
ldr x9, [sp, #8]
ldr w9, [x9]
ldr x10, [sp, #8]
ldr w10, [x10, #4]
mul w9, w9, w10
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_14
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_11 Depth=2
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldrsw x9, [sp, #4]
ldr w0, [x8, x9, lsl #2]
ldr w1, [sp, #20]
ldr w2, [sp, #16]
bl AddPointToBounds
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_11 Depth=2
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b .LBB0_11
.LBB0_14: // in Loop: Header=BB0_9 Depth=1
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_9 Depth=1
ldr x8, [sp, #8]
ldr x8, [x8, #16]
str x8, [sp, #8]
b .LBB0_9
.LBB0_16:
ldr w0, [sp, #20]
ldur x8, [x29, #-8]
ldr w1, [x8, #12]
bl VectorCopy
ldr w0, [sp, #16]
ldur x8, [x29, #-8]
ldr w1, [x8, #8]
bl VectorCopy
adrp x8, numDrawSurfaces
ldr w8, [x8, :lo12:numDrawSurfaces]
ldur x9, [x29, #-8]
str w8, [x9, #4]
adrp x8, numbrushes
ldr w8, [x8, :lo12:numbrushes]
ldur x9, [x29, #-8]
str w8, [x9]
ldr x8, [sp, #24]
ldr x0, [x8]
bl EmitBrushes
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size BeginModel, .Lfunc_end0-BeginModel
.cfi_endproc
// -- End function
.type nummodels,@object // @nummodels
.bss
.globl nummodels
.p2align 3, 0x0
nummodels:
.xword 0 // 0x0
.size nummodels, 8
.type MAX_MAP_MODELS,@object // @MAX_MAP_MODELS
.globl MAX_MAP_MODELS
.p2align 3, 0x0
MAX_MAP_MODELS:
.xword 0 // 0x0
.size MAX_MAP_MODELS, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "MAX_MAP_MODELS"
.size .L.str, 15
.type dmodels,@object // @dmodels
.bss
.globl dmodels
.p2align 3, 0x0
dmodels:
.xword 0
.size dmodels, 8
.type entities,@object // @entities
.globl entities
.p2align 3, 0x0
entities:
.xword 0
.size entities, 8
.type entity_num,@object // @entity_num
.globl entity_num
.p2align 3, 0x0
entity_num:
.xword 0 // 0x0
.size entity_num, 8
.type numDrawSurfaces,@object // @numDrawSurfaces
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type numbrushes,@object // @numbrushes
.globl numbrushes
.p2align 2, 0x0
numbrushes:
.word 0 // 0x0
.size numbrushes, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
.addrsig_sym ClearBounds
.addrsig_sym AddPointToBounds
.addrsig_sym VectorCopy
.addrsig_sym EmitBrushes
.addrsig_sym nummodels
.addrsig_sym MAX_MAP_MODELS
.addrsig_sym dmodels
.addrsig_sym entities
.addrsig_sym entity_num
.addrsig_sym numDrawSurfaces
.addrsig_sym numbrushes
|
../AnghaBench/Quake-III-Arena/q3map/extr_writebsp.c_BeginModel.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {struct TYPE_4__* verts; } ;
typedef TYPE_1__ mesh_t ;
/* Variables and functions */
int /*<<< orphan*/ free (TYPE_1__*) ;
void FreeMesh( mesh_t *m ) {
free( m->verts );
free( m );
}
|
.text
.file "extr_mesh.c_FreeMesh.c"
.globl FreeMesh // -- Begin function FreeMesh
.p2align 2
.type FreeMesh,@function
FreeMesh: // @FreeMesh
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
str x0, [sp, #8]
ldr x8, [sp, #8]
ldr x0, [x8]
bl free
ldr x0, [sp, #8]
bl free
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FreeMesh, .Lfunc_end0-FreeMesh
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym free
|
../AnghaBench/Quake-III-Arena/q3map/extr_mesh.c_FreeMesh.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_3__ ;
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {TYPE_3__* next; } ;
struct TYPE_6__ {TYPE_1__ pstack_head; } ;
typedef TYPE_2__ threaddata_t ;
struct TYPE_7__ {int /*<<< orphan*/ * leaf; struct TYPE_7__* next; } ;
typedef TYPE_3__ pstack_t ;
typedef int /*<<< orphan*/ leaf_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
void CheckStack (leaf_t *leaf, threaddata_t *thread)
{
pstack_t *p, *p2;
for (p=thread->pstack_head.next ; p ; p=p->next)
{
// _printf ("=");
if (p->leaf == leaf)
Error ("CheckStack: leaf recursion");
for (p2=thread->pstack_head.next ; p2 != p ; p2=p2->next)
if (p2->leaf == p->leaf)
Error ("CheckStack: late leaf recursion");
}
// _printf ("\n");
}
|
.text
.file "extr_visflow.c_CheckStack.c"
.globl CheckStack // -- Begin function CheckStack
.p2align 2
.type CheckStack,@function
CheckStack: // @CheckStack
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
str x1, [sp, #16]
ldr x8, [sp, #16]
ldr x8, [x8]
str x8, [sp, #8]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_5 Depth 2
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
ldr x8, [x8]
ldur x9, [x29, #-8]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #16]
ldr x8, [x8]
str x8, [sp]
b .LBB0_5
.LBB0_5: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldr x8, [sp]
ldr x9, [sp, #8]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp]
ldr x8, [x8]
ldr x9, [sp, #8]
ldr x9, [x9]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=2
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl Error
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_5 Depth=2
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp]
ldr x8, [x8, #8]
str x8, [sp]
b .LBB0_5
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
ldr x8, [x8, #8]
str x8, [sp, #8]
b .LBB0_1
.LBB0_12:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size CheckStack, .Lfunc_end0-CheckStack
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "CheckStack: leaf recursion"
.size .L.str, 27
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "CheckStack: late leaf recursion"
.size .L.str.1, 32
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_CheckStack.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_20__ TYPE_4__ ;
typedef struct TYPE_19__ TYPE_3__ ;
typedef struct TYPE_18__ TYPE_2__ ;
typedef struct TYPE_17__ TYPE_1__ ;
/* Type definitions */
struct TYPE_18__ {int numpoints; int /*<<< orphan*/ points; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_17__ {int numpoints; int /*<<< orphan*/ points; } ;
struct TYPE_19__ {float photons; float* emitColor; TYPE_4__* si; int /*<<< orphan*/ * color; int /*<<< orphan*/ origin; int /*<<< orphan*/ type; int /*<<< orphan*/ twosided; int /*<<< orphan*/ * normal; int /*<<< orphan*/ * plane; TYPE_1__ w; } ;
typedef TYPE_3__ vsound_t ;
typedef float* vec3_t ;
struct TYPE_20__ {float value; float* color; int contents; int backsplashFraction; int /*<<< orphan*/ backsplashDistance; } ;
typedef TYPE_4__ shaderInfo_t ;
typedef scalar_t__ qboolean ;
/* Variables and functions */
int CONTENTS_FOG ;
int /*<<< orphan*/ ClipWindingEpsilon (TYPE_2__*,float*,float,int /*<<< orphan*/ ,TYPE_2__**,TYPE_2__**) ;
int /*<<< orphan*/ DotProduct (int /*<<< orphan*/ ,float*) ;
int /*<<< orphan*/ FreeWinding (TYPE_2__*) ;
int /*<<< orphan*/ LIGHT_POINTFAKESURFACE ;
int /*<<< orphan*/ LIGHT_POINTRADIAL ;
int /*<<< orphan*/ ON_EPSILON ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorClear (float*) ;
int /*<<< orphan*/ VectorCopy (float*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,int /*<<< orphan*/ ,float*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (float*,float,float*) ;
float WindingArea (TYPE_2__*) ;
int /*<<< orphan*/ WindingBounds (TYPE_2__*,float*,float*) ;
int /*<<< orphan*/ WindingCenter (TYPE_2__*,int /*<<< orphan*/ ) ;
float lightAreaScale ;
float lightFormFactorValueScale ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ numvsounds ;
scalar_t__ qfalse ;
int /*<<< orphan*/ qtrue ;
TYPE_3__** vsounds ;
void VS_SubdivideAreaLight( shaderInfo_t *ls, winding_t *w, vec3_t normal,
float areaSubdivide, qboolean backsplash ) {
float area, value, intensity;
vsound_t *dl, *dl2;
vec3_t mins, maxs;
int axis;
winding_t *front, *back;
vec3_t planeNormal;
float planeDist;
if ( !w ) {
return;
}
WindingBounds( w, mins, maxs );
// check for subdivision
for ( axis = 0 ; axis < 3 ; axis++ ) {
if ( maxs[axis] - mins[axis] > areaSubdivide ) {
VectorClear( planeNormal );
planeNormal[axis] = 1;
planeDist = ( maxs[axis] + mins[axis] ) * 0.5;
ClipWindingEpsilon ( w, planeNormal, planeDist, ON_EPSILON, &front, &back );
VS_SubdivideAreaLight( ls, front, normal, areaSubdivide, qfalse );
VS_SubdivideAreaLight( ls, back, normal, areaSubdivide, qfalse );
FreeWinding( w );
return;
}
}
// create a light from this
area = WindingArea (w);
if ( area <= 0 || area > 20000000 ) {
return;
}
dl = malloc(sizeof(*dl));
memset (dl, 0, sizeof(*dl));
dl->type = LIGHT_POINTFAKESURFACE;
WindingCenter( w, dl->origin );
memcpy(dl->w.points, w->points, sizeof(vec3_t) * w->numpoints);
dl->w.numpoints = w->numpoints;
VectorCopy ( normal, dl->normal);
VectorCopy ( normal, dl->plane);
dl->plane[3] = DotProduct( dl->origin, normal );
value = ls->value;
intensity = value * area * lightAreaScale;
VectorAdd( dl->origin, dl->normal, dl->origin );
VectorCopy( ls->color, dl->color );
dl->photons = intensity;
// emitColor is irrespective of the area
VectorScale( ls->color, value*lightFormFactorValueScale*lightAreaScale, dl->emitColor );
//
VectorCopy(dl->emitColor, dl->color);
dl->si = ls;
if ( ls->contents & CONTENTS_FOG ) {
dl->twosided = qtrue;
}
vsounds[numvsounds++] = dl;
// optionally create a point backsplash light
if ( backsplash && ls->backsplashFraction > 0 ) {
dl2 = malloc(sizeof(*dl));
memset (dl2, 0, sizeof(*dl2));
dl2->type = LIGHT_POINTRADIAL;
VectorMA( dl->origin, ls->backsplashDistance, normal, dl2->origin );
VectorCopy( ls->color, dl2->color );
dl2->photons = dl->photons * ls->backsplashFraction;
dl2->si = ls;
vsounds[numvsounds++] = dl2;
}
}
|
.text
.file "extr_soundv.c_VS_SubdivideAreaLight.c"
.globl VS_SubdivideAreaLight // -- Begin function VS_SubdivideAreaLight
.p2align 2
.type VS_SubdivideAreaLight,@function
VS_SubdivideAreaLight: // @VS_SubdivideAreaLight
.cfi_startproc
// %bb.0:
sub sp, sp, #176
.cfi_def_cfa_offset 176
stp x29, x30, [sp, #160] // 16-byte Folded Spill
add x29, sp, #160
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
stur s0, [x29, #-28]
stur x3, [x29, #-40]
ldur x8, [x29, #-16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_16
.LBB0_2:
ldur x0, [x29, #-16]
ldr x1, [sp, #80]
ldr x2, [sp, #72]
bl WindingBounds
str wzr, [sp, #68]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #68]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldr x8, [sp, #72]
ldrsw x9, [sp, #68]
ldr s0, [x8, x9, lsl #2]
ldr x8, [sp, #80]
ldrsw x9, [sp, #68]
ldr s1, [x8, x9, lsl #2]
fsub s0, s0, s1
ldur s1, [x29, #-28]
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
ldr x0, [sp, #40]
bl VectorClear
ldr x8, [sp, #40]
ldrsw x9, [sp, #68]
fmov s0, #1.00000000
str s0, [x8, x9, lsl #2]
ldr x8, [sp, #72]
ldrsw x9, [sp, #68]
ldr s0, [x8, x9, lsl #2]
ldr x8, [sp, #80]
ldrsw x9, [sp, #68]
ldr s1, [x8, x9, lsl #2]
fadd s0, s0, s1
fcvt d0, s0
fmov d1, #0.50000000
fmul d0, d0, d1
fcvt s0, d0
str s0, [sp, #36]
ldur x0, [x29, #-16]
ldr x1, [sp, #40]
ldr s0, [sp, #36]
adrp x8, ON_EPSILON
ldr w2, [x8, :lo12:ON_EPSILON]
add x3, sp, #56
add x4, sp, #48
bl ClipWindingEpsilon
ldur x0, [x29, #-8]
ldr x1, [sp, #56]
ldur x2, [x29, #-24]
ldur s0, [x29, #-28]
adrp x8, qfalse
str x8, [sp, #24] // 8-byte Folded Spill
ldr x3, [x8, :lo12:qfalse]
bl VS_SubdivideAreaLight
ldr x8, [sp, #24] // 8-byte Folded Reload
ldur x0, [x29, #-8]
ldr x1, [sp, #48]
ldur x2, [x29, #-24]
ldur s0, [x29, #-28]
ldr x3, [x8, :lo12:qfalse]
bl VS_SubdivideAreaLight
ldur x0, [x29, #-16]
bl FreeWinding
b .LBB0_16
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #68]
add w8, w8, #1
str w8, [sp, #68]
b .LBB0_3
.LBB0_8:
ldur x0, [x29, #-16]
bl WindingArea
stur s0, [x29, #-44]
ldur s0, [x29, #-44]
fcmp s0, #0.0
cset w8, ls
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9:
ldur s0, [x29, #-44]
mov w8, #38528 // =0x9680
movk w8, #19352, lsl #16
fmov s1, w8
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10:
b .LBB0_16
.LBB0_11:
mov w0, #72 // =0x48
str w0, [sp, #12] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #12] // 4-byte Folded Reload
stur x0, [x29, #-64]
ldur x0, [x29, #-64]
mov w1, wzr
bl memset
adrp x8, LIGHT_POINTFAKESURFACE
ldr w8, [x8, :lo12:LIGHT_POINTFAKESURFACE]
ldur x9, [x29, #-64]
str w8, [x9, #36]
ldur x0, [x29, #-16]
ldur x8, [x29, #-64]
ldr w1, [x8, #32]
bl WindingCenter
ldur x8, [x29, #-64]
ldr w0, [x8, #68]
ldur x8, [x29, #-16]
ldr w1, [x8, #4]
ldur x8, [x29, #-16]
ldrsw x9, [x8]
mov x8, #8 // =0x8
mul x8, x8, x9
mov w2, w8
bl memcpy
ldur x8, [x29, #-16]
ldr w8, [x8]
ldur x9, [x29, #-64]
str w8, [x9, #64]
ldur x0, [x29, #-24]
ldur x8, [x29, #-64]
ldr x1, [x8, #48]
bl VectorCopy
ldur x0, [x29, #-24]
ldur x8, [x29, #-64]
ldr x1, [x8, #56]
bl VectorCopy
ldur x8, [x29, #-64]
ldr w0, [x8, #32]
ldur x1, [x29, #-24]
bl DotProduct
ldur x8, [x29, #-64]
ldr x8, [x8, #56]
str w0, [x8, #12]
ldur x8, [x29, #-8]
ldr s0, [x8]
stur s0, [x29, #-48]
ldur s0, [x29, #-48]
ldur s1, [x29, #-44]
fmul s0, s0, s1
adrp x8, lightAreaScale
str x8, [sp, #16] // 8-byte Folded Spill
ldr s1, [x8, :lo12:lightAreaScale]
fmul s0, s0, s1
stur s0, [x29, #-52]
ldur x8, [x29, #-64]
ldr w0, [x8, #32]
ldur x8, [x29, #-64]
ldr x1, [x8, #48]
ldur x8, [x29, #-64]
ldr w2, [x8, #32]
bl VectorAdd
ldur x8, [x29, #-8]
ldr x0, [x8, #8]
ldur x8, [x29, #-64]
ldr x1, [x8, #24]
bl VectorCopy
ldr x8, [sp, #16] // 8-byte Folded Reload
ldur s0, [x29, #-52]
ldur x9, [x29, #-64]
str s0, [x9]
ldur x9, [x29, #-8]
ldr x0, [x9, #8]
ldur s0, [x29, #-48]
adrp x9, lightFormFactorValueScale
ldr s1, [x9, :lo12:lightFormFactorValueScale]
fmul s0, s0, s1
ldr s1, [x8, :lo12:lightAreaScale]
fmul s0, s0, s1
ldur x8, [x29, #-64]
ldr x1, [x8, #8]
bl VectorScale
ldur x8, [x29, #-64]
ldr x0, [x8, #8]
ldur x8, [x29, #-64]
ldr x1, [x8, #24]
bl VectorCopy
ldur x8, [x29, #-8]
ldur x9, [x29, #-64]
str x8, [x9, #16]
ldur x8, [x29, #-8]
ldr w8, [x8, #16]
adrp x9, CONTENTS_FOG
ldr w9, [x9, :lo12:CONTENTS_FOG]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
ldur x9, [x29, #-64]
str w8, [x9, #40]
b .LBB0_13
.LBB0_13:
ldur x8, [x29, #-64]
adrp x9, vsounds
ldr x9, [x9, :lo12:vsounds]
adrp x12, numvsounds
ldrsw x10, [x12, :lo12:numvsounds]
mov w11, w10
add w11, w11, #1
str w11, [x12, :lo12:numvsounds]
str x8, [x9, x10, lsl #3]
ldur x8, [x29, #-40]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_16
b .LBB0_14
.LBB0_14:
ldur x8, [x29, #-8]
ldr w8, [x8, #20]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15:
mov w0, #72 // =0x48
str w0, [sp, #8] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #8] // 4-byte Folded Reload
stur x0, [x29, #-72]
ldur x0, [x29, #-72]
mov w1, wzr
bl memset
adrp x8, LIGHT_POINTRADIAL
ldr w8, [x8, :lo12:LIGHT_POINTRADIAL]
ldur x9, [x29, #-72]
str w8, [x9, #36]
ldur x8, [x29, #-64]
ldr w0, [x8, #32]
ldur x8, [x29, #-8]
ldr w1, [x8, #24]
ldur x2, [x29, #-24]
ldur x8, [x29, #-72]
ldr w3, [x8, #32]
bl VectorMA
ldur x8, [x29, #-8]
ldr x0, [x8, #8]
ldur x8, [x29, #-72]
ldr x1, [x8, #24]
bl VectorCopy
ldur x8, [x29, #-64]
ldr s0, [x8]
ldur x8, [x29, #-8]
ldr s1, [x8, #20]
scvtf s1, s1
fmul s0, s0, s1
ldur x8, [x29, #-72]
str s0, [x8]
ldur x8, [x29, #-8]
ldur x9, [x29, #-72]
str x8, [x9, #16]
ldur x8, [x29, #-72]
adrp x9, vsounds
ldr x9, [x9, :lo12:vsounds]
adrp x12, numvsounds
ldrsw x10, [x12, :lo12:numvsounds]
mov w11, w10
add w11, w11, #1
str w11, [x12, :lo12:numvsounds]
str x8, [x9, x10, lsl #3]
b .LBB0_16
.LBB0_16:
.cfi_def_cfa wsp, 176
ldp x29, x30, [sp, #160] // 16-byte Folded Reload
add sp, sp, #176
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_SubdivideAreaLight, .Lfunc_end0-VS_SubdivideAreaLight
.cfi_endproc
// -- End function
.type ON_EPSILON,@object // @ON_EPSILON
.bss
.globl ON_EPSILON
.p2align 2, 0x0
ON_EPSILON:
.word 0 // 0x0
.size ON_EPSILON, 4
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 3, 0x0
qfalse:
.xword 0 // 0x0
.size qfalse, 8
.type LIGHT_POINTFAKESURFACE,@object // @LIGHT_POINTFAKESURFACE
.globl LIGHT_POINTFAKESURFACE
.p2align 2, 0x0
LIGHT_POINTFAKESURFACE:
.word 0 // 0x0
.size LIGHT_POINTFAKESURFACE, 4
.type lightAreaScale,@object // @lightAreaScale
.globl lightAreaScale
.p2align 2, 0x0
lightAreaScale:
.word 0x00000000 // float 0
.size lightAreaScale, 4
.type lightFormFactorValueScale,@object // @lightFormFactorValueScale
.globl lightFormFactorValueScale
.p2align 2, 0x0
lightFormFactorValueScale:
.word 0x00000000 // float 0
.size lightFormFactorValueScale, 4
.type CONTENTS_FOG,@object // @CONTENTS_FOG
.globl CONTENTS_FOG
.p2align 2, 0x0
CONTENTS_FOG:
.word 0 // 0x0
.size CONTENTS_FOG, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type vsounds,@object // @vsounds
.globl vsounds
.p2align 3, 0x0
vsounds:
.xword 0
.size vsounds, 8
.type numvsounds,@object // @numvsounds
.globl numvsounds
.p2align 2, 0x0
numvsounds:
.word 0 // 0x0
.size numvsounds, 4
.type LIGHT_POINTRADIAL,@object // @LIGHT_POINTRADIAL
.globl LIGHT_POINTRADIAL
.p2align 2, 0x0
LIGHT_POINTRADIAL:
.word 0 // 0x0
.size LIGHT_POINTRADIAL, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_SubdivideAreaLight
.addrsig_sym WindingBounds
.addrsig_sym VectorClear
.addrsig_sym ClipWindingEpsilon
.addrsig_sym FreeWinding
.addrsig_sym WindingArea
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym WindingCenter
.addrsig_sym memcpy
.addrsig_sym VectorCopy
.addrsig_sym DotProduct
.addrsig_sym VectorAdd
.addrsig_sym VectorScale
.addrsig_sym VectorMA
.addrsig_sym ON_EPSILON
.addrsig_sym qfalse
.addrsig_sym LIGHT_POINTFAKESURFACE
.addrsig_sym lightAreaScale
.addrsig_sym lightFormFactorValueScale
.addrsig_sym CONTENTS_FOG
.addrsig_sym qtrue
.addrsig_sym vsounds
.addrsig_sym numvsounds
.addrsig_sym LIGHT_POINTRADIAL
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_SubdivideAreaLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int width; int height; void* verts; } ;
typedef TYPE_1__ mesh_t ;
struct TYPE_6__ {int patchWidth; int patchHeight; int /*<<< orphan*/ verts; } ;
typedef TYPE_2__ mapDrawSurface_t ;
/* Variables and functions */
void* malloc (int) ;
int /*<<< orphan*/ memcpy (void*,int /*<<< orphan*/ ,int) ;
mesh_t *DrawSurfToMesh( mapDrawSurface_t *ds ) {
mesh_t *m;
m = malloc( sizeof( *m ) );
m->width = ds->patchWidth;
m->height = ds->patchHeight;
m->verts = malloc( sizeof(m->verts[0]) * m->width * m->height );
memcpy( m->verts, ds->verts, sizeof(m->verts[0]) * m->width * m->height );
return m;
}
|
.text
.file "extr_fog.c_DrawSurfToMesh.c"
.globl DrawSurfToMesh // -- Begin function DrawSurfToMesh
.p2align 2
.type DrawSurfToMesh,@function
DrawSurfToMesh: // @DrawSurfToMesh
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
mov w0, #16 // =0x10
bl malloc
str x0, [sp, #16]
ldur x8, [x29, #-8]
ldr w8, [x8]
ldr x9, [sp, #16]
str w8, [x9]
ldur x8, [x29, #-8]
ldr w8, [x8, #4]
ldr x9, [sp, #16]
str w8, [x9, #4]
ldr x8, [sp, #16]
ldrsw x9, [x8]
mov x8, #1 // =0x1
str x8, [sp, #8] // 8-byte Folded Spill
mul x8, x8, x9
ldr x9, [sp, #16]
ldrsw x9, [x9, #4]
mul x8, x8, x9
mov w0, w8
bl malloc
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x9, [sp, #16]
str x0, [x9, #8]
ldr x9, [sp, #16]
ldr x0, [x9, #8]
ldur x9, [x29, #-8]
ldr w1, [x9, #8]
ldr x9, [sp, #16]
ldrsw x9, [x9]
mul x8, x8, x9
ldr x9, [sp, #16]
ldrsw x9, [x9, #4]
mul x8, x8, x9
mov w2, w8
bl memcpy
ldr x0, [sp, #16]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size DrawSurfToMesh, .Lfunc_end0-DrawSurfToMesh
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym memcpy
|
../AnghaBench/Quake-III-Arena/q3map/extr_fog.c_DrawSurfToMesh.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int numSurfaces; int firstSurface; } ;
typedef TYPE_1__ lleaf_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
int MAX_MAP_LEAFFACES ;
int* clustersurfaces ;
TYPE_1__* leafs ;
int numclustersurfaces ;
int portalclusters ;
void VS_LinkSurfaceIntoCluster(int cluster, int surfaceNum)
{
lleaf_t *leaf;
int i;
leaf = &leafs[cluster];
for (i = 0; i < leaf->numSurfaces; i++)
{
if (clustersurfaces[leaf->firstSurface + i] == surfaceNum)
return;
}
for (i = numclustersurfaces; i > leaf->firstSurface + leaf->numSurfaces; i--)
clustersurfaces[i] = clustersurfaces[i-1];
for (i = 0; i < portalclusters; i++)
{
if (i == cluster)
continue;
if (leafs[i].firstSurface >= leaf->firstSurface + leaf->numSurfaces)
leafs[i].firstSurface++;
}
clustersurfaces[leaf->firstSurface + leaf->numSurfaces] = surfaceNum;
leaf->numSurfaces++;
numclustersurfaces++;
if (numclustersurfaces >= MAX_MAP_LEAFFACES)
Error("MAX_MAP_LEAFFACES");
}
|
.text
.file "extr_soundv.c_VS_LinkSurfaceIntoCluster.c"
.globl VS_LinkSurfaceIntoCluster // -- Begin function VS_LinkSurfaceIntoCluster
.p2align 2
.type VS_LinkSurfaceIntoCluster,@function
VS_LinkSurfaceIntoCluster: // @VS_LinkSurfaceIntoCluster
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur w0, [x29, #-4]
stur w1, [x29, #-8]
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #3
str x8, [sp, #16]
str wzr, [sp, #12]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, clustersurfaces
ldr x8, [x8, :lo12:clustersurfaces]
ldr x9, [sp, #16]
ldr w9, [x9, #4]
ldr w10, [sp, #12]
add w9, w9, w10
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-8]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
b .LBB0_20
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_1
.LBB0_6:
adrp x8, numclustersurfaces
ldr w8, [x8, :lo12:numclustersurfaces]
str w8, [sp, #12]
b .LBB0_7
.LBB0_7: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldr w9, [x9, #4]
ldr x10, [sp, #16]
ldr w10, [x10]
add w9, w9, w10
subs w8, w8, w9
cset w8, le
tbnz w8, #0, .LBB0_10
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
adrp x9, clustersurfaces
ldr x8, [x9, :lo12:clustersurfaces]
ldr w10, [sp, #12]
subs w10, w10, #1
ldr w8, [x8, w10, sxtw #2]
ldr x9, [x9, :lo12:clustersurfaces]
ldrsw x10, [sp, #12]
str w8, [x9, x10, lsl #2]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=1
ldr w8, [sp, #12]
subs w8, w8, #1
str w8, [sp, #12]
b .LBB0_7
.LBB0_10:
str wzr, [sp, #12]
b .LBB0_11
.LBB0_11: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_18
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #12]
ldur w9, [x29, #-4]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_11 Depth=1
b .LBB0_17
.LBB0_14: // in Loop: Header=BB0_11 Depth=1
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldrsw x9, [sp, #12]
add x8, x8, x9, lsl #3
ldr w8, [x8, #4]
ldr x9, [sp, #16]
ldr w9, [x9, #4]
ldr x10, [sp, #16]
ldr w10, [x10]
add w9, w9, w10
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_11 Depth=1
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldrsw x9, [sp, #12]
add x9, x8, x9, lsl #3
ldr w8, [x9, #4]
add w8, w8, #1
str w8, [x9, #4]
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_11 Depth=1
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_11
.LBB0_18:
ldur w8, [x29, #-8]
adrp x9, clustersurfaces
ldr x9, [x9, :lo12:clustersurfaces]
ldr x10, [sp, #16]
ldr w10, [x10, #4]
ldr x11, [sp, #16]
ldr w11, [x11]
add w10, w10, w11
str w8, [x9, w10, sxtw #2]
ldr x9, [sp, #16]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
adrp x8, numclustersurfaces
ldr w9, [x8, :lo12:numclustersurfaces]
add w9, w9, #1
str w9, [x8, :lo12:numclustersurfaces]
ldr w8, [x8, :lo12:numclustersurfaces]
adrp x9, MAX_MAP_LEAFFACES
ldr w9, [x9, :lo12:MAX_MAP_LEAFFACES]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_20
.LBB0_20:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_LinkSurfaceIntoCluster, .Lfunc_end0-VS_LinkSurfaceIntoCluster
.cfi_endproc
// -- End function
.type leafs,@object // @leafs
.bss
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.type clustersurfaces,@object // @clustersurfaces
.globl clustersurfaces
.p2align 3, 0x0
clustersurfaces:
.xword 0
.size clustersurfaces, 8
.type numclustersurfaces,@object // @numclustersurfaces
.globl numclustersurfaces
.p2align 2, 0x0
numclustersurfaces:
.word 0 // 0x0
.size numclustersurfaces, 4
.type portalclusters,@object // @portalclusters
.globl portalclusters
.p2align 2, 0x0
portalclusters:
.word 0 // 0x0
.size portalclusters, 4
.type MAX_MAP_LEAFFACES,@object // @MAX_MAP_LEAFFACES
.globl MAX_MAP_LEAFFACES
.p2align 2, 0x0
MAX_MAP_LEAFFACES:
.word 0 // 0x0
.size MAX_MAP_LEAFFACES, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "MAX_MAP_LEAFFACES"
.size .L.str, 18
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
.addrsig_sym leafs
.addrsig_sym clustersurfaces
.addrsig_sym numclustersurfaces
.addrsig_sym portalclusters
.addrsig_sym MAX_MAP_LEAFFACES
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_LinkSurfaceIntoCluster.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ tnode_t ;
/* Variables and functions */
int /*<<< orphan*/ InitSurfacesForTesting () ;
int MAX_TNODES ;
int /*<<< orphan*/ MakeTnode (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * malloc (int) ;
int /*<<< orphan*/ * tnode_p ;
int /*<<< orphan*/ * tnodes ;
void InitTrace( void ) {
// 32 byte align the structs
tnodes = malloc( (MAX_TNODES+1) * sizeof(tnode_t));
tnodes = (tnode_t *)(((int)tnodes + 31)&~31);
tnode_p = tnodes;
MakeTnode (0);
InitSurfacesForTesting();
}
|
.text
.file "extr_light_trace.c_InitTrace.c"
.globl InitTrace // -- Begin function InitTrace
.p2align 2
.type InitTrace,@function
InitTrace: // @InitTrace
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, MAX_TNODES
ldr w8, [x8, :lo12:MAX_TNODES]
add w9, w8, #1
// implicit-def: $x8
mov w8, w9
sxtw x8, w8
lsl x8, x8, #2
mov w0, w8
bl malloc
adrp x8, tnodes
str x0, [x8, :lo12:tnodes]
ldr x9, [x8, :lo12:tnodes]
// kill: def $w9 killed $w9 killed $x9
add w9, w9, #31
and w10, w9, #0xffffffe0
// implicit-def: $x9
mov w9, w10
sxtw x9, w9
str x9, [x8, :lo12:tnodes]
ldr x8, [x8, :lo12:tnodes]
adrp x9, tnode_p
str x8, [x9, :lo12:tnode_p]
mov w0, wzr
bl MakeTnode
bl InitSurfacesForTesting
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size InitTrace, .Lfunc_end0-InitTrace
.cfi_endproc
// -- End function
.type MAX_TNODES,@object // @MAX_TNODES
.bss
.globl MAX_TNODES
.p2align 2, 0x0
MAX_TNODES:
.word 0 // 0x0
.size MAX_TNODES, 4
.type tnodes,@object // @tnodes
.globl tnodes
.p2align 3, 0x0
tnodes:
.xword 0
.size tnodes, 8
.type tnode_p,@object // @tnode_p
.globl tnode_p
.p2align 3, 0x0
tnode_p:
.xword 0
.size tnode_p, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym MakeTnode
.addrsig_sym InitSurfacesForTesting
.addrsig_sym MAX_TNODES
.addrsig_sym tnodes
.addrsig_sym tnode_p
|
../AnghaBench/Quake-III-Arena/q3map/extr_light_trace.c_InitTrace.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_6__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
typedef int /*<<< orphan*/ vlight_t ;
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_10__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_11__ {int cluster; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VL_FloodAreaSpotLight (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int VL_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_6__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
void VL_R_SubdivideAreaSpotLight(vlight_t *light, int nodenum, winding_t *w)
{
int leafnum, res;
dnode_t *node;
dplane_t *plane;
winding_t back;
plane_t split;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VL_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
memcpy(&back, w, sizeof(winding_t));
VL_R_SubdivideAreaSpotLight(light, node->children[1], &back);
nodenum = node->children[0];
}
else
{
VL_R_SubdivideAreaSpotLight(light, node->children[1], &back);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
if (dleafs[leafnum].cluster != -1)
{
VL_FloodAreaSpotLight(light, w, leafnum);
}
}
|
.text
.file "extr_lightv.c_VL_R_SubdivideAreaSpotLight.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_R_SubdivideAreaSpotLight
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_R_SubdivideAreaSpotLight
.p2align 2
.type VL_R_SubdivideAreaSpotLight,@function
VL_R_SubdivideAreaSpotLight: // @VL_R_SubdivideAreaSpotLight
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur x2, [x29, #-24]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-12]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-12]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w0, [x8, #4]
add x8, sp, #20
str x8, [sp, #8] // 8-byte Folded Spill
ldr w1, [sp, #24]
bl VectorCopy
ldr x2, [sp, #8] // 8-byte Folded Reload
ldr x8, [sp, #32]
ldr w8, [x8]
str w8, [sp, #20]
ldur x0, [x29, #-24]
add x1, sp, #28
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VL_SplitWinding
stur w0, [x29, #-32]
ldur w8, [x29, #-32]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_11
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-12]
b .LBB0_10
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-24]
add x0, sp, #28
str x0, [sp] // 8-byte Folded Spill
mov w2, #4 // =0x4
bl memcpy
ldr x2, [sp] // 8-byte Folded Reload
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
bl VL_R_SubdivideAreaSpotLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
add x2, sp, #28
bl VL_R_SubdivideAreaSpotLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_12:
ldur w9, [x29, #-12]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-28]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-28]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur x0, [x29, #-8]
ldur x1, [x29, #-24]
ldur w2, [x29, #-28]
bl VL_FloodAreaSpotLight
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_R_SubdivideAreaSpotLight, .Lfunc_end0-VL_R_SubdivideAreaSpotLight
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VL_R_SubdivideAreaSpotLight
.addrsig_sym VectorCopy
.addrsig_sym VL_SplitWinding
.addrsig_sym memcpy
.addrsig_sym VL_FloodAreaSpotLight
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_R_SubdivideAreaSpotLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {int numpoints; int** points; } ;
typedef TYPE_1__ winding_t ;
typedef int vec_t ;
typedef int* vec3_t ;
typedef int /*<<< orphan*/ pstack_t ;
struct TYPE_9__ {int* normal; int dist; } ;
typedef TYPE_2__ plane_t ;
/* Variables and functions */
TYPE_1__* AllocStackWinding (int /*<<< orphan*/ *) ;
int DotProduct (int*,int*) ;
int /*<<< orphan*/ FreeStackWinding (TYPE_1__*,int /*<<< orphan*/ *) ;
int MAX_POINTS_ON_FIXED_WINDING ;
int ON_EPSILON ;
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VectorCopy (int*,int*) ;
winding_t *VisChopWinding (winding_t *in, pstack_t *stack, plane_t *split)
{
vec_t dists[128];
int sides[128];
int counts[3];
vec_t dot;
int i, j;
vec_t *p1, *p2;
vec3_t mid;
winding_t *neww;
counts[0] = counts[1] = counts[2] = 0;
// determine sides for each point
for (i=0 ; i<in->numpoints ; i++)
{
dot = DotProduct (in->points[i], split->normal);
dot -= split->dist;
dists[i] = dot;
if (dot > ON_EPSILON)
sides[i] = SIDE_FRONT;
else if (dot < -ON_EPSILON)
sides[i] = SIDE_BACK;
else
{
sides[i] = SIDE_ON;
}
counts[sides[i]]++;
}
if (!counts[1])
return in; // completely on front side
if (!counts[0])
{
FreeStackWinding (in, stack);
return NULL;
}
sides[i] = sides[0];
dists[i] = dists[0];
neww = AllocStackWinding (stack);
neww->numpoints = 0;
for (i=0 ; i<in->numpoints ; i++)
{
p1 = in->points[i];
if (neww->numpoints == MAX_POINTS_ON_FIXED_WINDING)
{
FreeStackWinding (neww, stack);
return in; // can't chop -- fall back to original
}
if (sides[i] == SIDE_ON)
{
VectorCopy (p1, neww->points[neww->numpoints]);
neww->numpoints++;
continue;
}
if (sides[i] == SIDE_FRONT)
{
VectorCopy (p1, neww->points[neww->numpoints]);
neww->numpoints++;
}
if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
continue;
if (neww->numpoints == MAX_POINTS_ON_FIXED_WINDING)
{
FreeStackWinding (neww, stack);
return in; // can't chop -- fall back to original
}
// generate a split point
p2 = in->points[(i+1)%in->numpoints];
dot = dists[i] / (dists[i]-dists[i+1]);
for (j=0 ; j<3 ; j++)
{ // avoid round off error when possible
if (split->normal[j] == 1)
mid[j] = split->dist;
else if (split->normal[j] == -1)
mid[j] = -split->dist;
else
mid[j] = p1[j] + dot*(p2[j]-p1[j]);
}
VectorCopy (mid, neww->points[neww->numpoints]);
neww->numpoints++;
}
// free the original winding
FreeStackWinding (in, stack);
return neww;
}
|
.text
.file "extr_visflow.c_VisChopWinding.c"
.globl VisChopWinding // -- Begin function VisChopWinding
.p2align 2
.type VisChopWinding,@function
VisChopWinding: // @VisChopWinding
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x28, [sp, #16] // 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1120
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
str wzr, [sp, #60]
str wzr, [sp, #56]
str wzr, [sp, #52]
str wzr, [sp, #44]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #44]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_10
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #44]
ldr x0, [x8, x9, lsl #3]
ldur x8, [x29, #-32]
ldr x1, [x8]
bl DotProduct
str w0, [sp, #48]
ldur x8, [x29, #-32]
ldr w9, [x8, #8]
ldr w8, [sp, #48]
subs w8, w8, w9
str w8, [sp, #48]
ldr w8, [sp, #48]
ldrsw x10, [sp, #44]
add x9, sp, #576
str w8, [x9, x10, lsl #2]
ldr w8, [sp, #48]
adrp x9, ON_EPSILON
ldr w9, [x9, :lo12:ON_EPSILON]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_FRONT
ldr w8, [x8, :lo12:SIDE_FRONT]
ldrsw x10, [sp, #44]
add x9, sp, #64
str w8, [x9, x10, lsl #2]
b .LBB0_8
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #48]
adrp x9, ON_EPSILON
ldr w10, [x9, :lo12:ON_EPSILON]
mov w9, wzr
subs w9, w9, w10
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_BACK
ldr w8, [x8, :lo12:SIDE_BACK]
ldrsw x10, [sp, #44]
add x9, sp, #64
str w8, [x9, x10, lsl #2]
b .LBB0_7
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_ON
ldr w8, [x8, :lo12:SIDE_ON]
ldrsw x10, [sp, #44]
add x9, sp, #64
str w8, [x9, x10, lsl #2]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldrsw x9, [sp, #44]
add x8, sp, #64
ldrsw x9, [x8, x9, lsl #2]
add x8, sp, #52
add x9, x8, x9, lsl #2
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #44]
add w8, w8, #1
str w8, [sp, #44]
b .LBB0_1
.LBB0_10:
ldr w8, [sp, #56]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11:
ldur x8, [x29, #-16]
stur x8, [x29, #-8]
b .LBB0_40
.LBB0_12:
ldr w8, [sp, #52]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur x0, [x29, #-16]
ldur x1, [x29, #-24]
bl FreeStackWinding
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_40
.LBB0_14:
add x9, sp, #64
ldr w8, [sp, #64]
ldrsw x10, [sp, #44]
str w8, [x9, x10, lsl #2]
add x9, sp, #576
ldr w8, [sp, #576]
ldrsw x10, [sp, #44]
str w8, [x9, x10, lsl #2]
ldur x0, [x29, #-24]
bl AllocStackWinding
str x0, [sp, #8]
ldr x8, [sp, #8]
str wzr, [x8]
str wzr, [sp, #44]
b .LBB0_15
.LBB0_15: // =>This Loop Header: Depth=1
// Child Loop BB0_28 Depth 2
ldr w8, [sp, #44]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_39
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_15 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #44]
ldr x8, [x8, x9, lsl #3]
str x8, [sp, #32]
ldr x8, [sp, #8]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_18
b .LBB0_17
.LBB0_17:
ldr x0, [sp, #8]
ldur x1, [x29, #-24]
bl FreeStackWinding
ldur x8, [x29, #-16]
stur x8, [x29, #-8]
b .LBB0_40
.LBB0_18: // in Loop: Header=BB0_15 Depth=1
ldrsw x9, [sp, #44]
add x8, sp, #64
ldr w8, [x8, x9, lsl #2]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_15 Depth=1
ldr x0, [sp, #32]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp, #8]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_38
.LBB0_20: // in Loop: Header=BB0_15 Depth=1
ldrsw x9, [sp, #44]
add x8, sp, #64
ldr w8, [x8, x9, lsl #2]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_15 Depth=1
ldr x0, [sp, #32]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp, #8]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_15 Depth=1
ldr w8, [sp, #44]
add w9, w8, #1
add x8, sp, #64
ldr w8, [x8, w9, sxtw #2]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_24
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_15 Depth=1
ldr w8, [sp, #44]
add w8, w8, #1
add x9, sp, #64
ldr w8, [x9, w8, sxtw #2]
ldrsw x10, [sp, #44]
ldr w9, [x9, x10, lsl #2]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_25
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_15 Depth=1
b .LBB0_38
.LBB0_25: // in Loop: Header=BB0_15 Depth=1
ldr x8, [sp, #8]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_27
b .LBB0_26
.LBB0_26:
ldr x0, [sp, #8]
ldur x1, [x29, #-24]
bl FreeStackWinding
ldur x8, [x29, #-16]
stur x8, [x29, #-8]
b .LBB0_40
.LBB0_27: // in Loop: Header=BB0_15 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldr w9, [sp, #44]
add w9, w9, #1
ldur x10, [x29, #-16]
ldr w11, [x10]
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr x8, [x8, w9, sxtw #3]
str x8, [sp, #24]
ldrsw x8, [sp, #44]
add x10, sp, #576
ldr w8, [x10, x8, lsl #2]
ldrsw x9, [sp, #44]
ldr w9, [x10, x9, lsl #2]
ldr w11, [sp, #44]
add w11, w11, #1
ldr w10, [x10, w11, sxtw #2]
subs w9, w9, w10
sdiv w8, w8, w9
str w8, [sp, #48]
str wzr, [sp, #40]
b .LBB0_28
.LBB0_28: // Parent Loop BB0_15 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #40]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_37
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_28 Depth=2
ldur x8, [x29, #-32]
ldr x8, [x8]
ldrsw x9, [sp, #40]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_31
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_28 Depth=2
ldur x8, [x29, #-32]
ldr w8, [x8, #8]
ldr x9, [sp, #16]
ldrsw x10, [sp, #40]
str w8, [x9, x10, lsl #2]
b .LBB0_35
.LBB0_31: // in Loop: Header=BB0_28 Depth=2
ldur x8, [x29, #-32]
ldr x8, [x8]
ldrsw x9, [sp, #40]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_33
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_28 Depth=2
ldur x8, [x29, #-32]
ldr w9, [x8, #8]
mov w8, wzr
subs w8, w8, w9
ldr x9, [sp, #16]
ldrsw x10, [sp, #40]
str w8, [x9, x10, lsl #2]
b .LBB0_34
.LBB0_33: // in Loop: Header=BB0_28 Depth=2
ldr x8, [sp, #32]
ldrsw x9, [sp, #40]
ldr w8, [x8, x9, lsl #2]
ldr w9, [sp, #48]
ldr x10, [sp, #24]
ldrsw x11, [sp, #40]
ldr w10, [x10, x11, lsl #2]
ldr x11, [sp, #32]
ldrsw x12, [sp, #40]
ldr w11, [x11, x12, lsl #2]
subs w10, w10, w11
mul w9, w9, w10
add w8, w8, w9
ldr x9, [sp, #16]
ldrsw x10, [sp, #40]
str w8, [x9, x10, lsl #2]
b .LBB0_34
.LBB0_34: // in Loop: Header=BB0_28 Depth=2
b .LBB0_35
.LBB0_35: // in Loop: Header=BB0_28 Depth=2
b .LBB0_36
.LBB0_36: // in Loop: Header=BB0_28 Depth=2
ldr w8, [sp, #40]
add w8, w8, #1
str w8, [sp, #40]
b .LBB0_28
.LBB0_37: // in Loop: Header=BB0_15 Depth=1
ldr x0, [sp, #16]
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp, #8]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_38
.LBB0_38: // in Loop: Header=BB0_15 Depth=1
ldr w8, [sp, #44]
add w8, w8, #1
str w8, [sp, #44]
b .LBB0_15
.LBB0_39:
ldur x0, [x29, #-16]
ldur x1, [x29, #-24]
bl FreeStackWinding
ldr x8, [sp, #8]
stur x8, [x29, #-8]
b .LBB0_40
.LBB0_40:
ldur x0, [x29, #-8]
add sp, sp, #1120
.cfi_def_cfa wsp, 32
ldr x28, [sp, #16] // 8-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VisChopWinding, .Lfunc_end0-VisChopWinding
.cfi_endproc
// -- End function
.type ON_EPSILON,@object // @ON_EPSILON
.bss
.globl ON_EPSILON
.p2align 2, 0x0
ON_EPSILON:
.word 0 // 0x0
.size ON_EPSILON, 4
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type MAX_POINTS_ON_FIXED_WINDING,@object // @MAX_POINTS_ON_FIXED_WINDING
.globl MAX_POINTS_ON_FIXED_WINDING
.p2align 2, 0x0
MAX_POINTS_ON_FIXED_WINDING:
.word 0 // 0x0
.size MAX_POINTS_ON_FIXED_WINDING, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym DotProduct
.addrsig_sym FreeStackWinding
.addrsig_sym AllocStackWinding
.addrsig_sym VectorCopy
.addrsig_sym ON_EPSILON
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym MAX_POINTS_ON_FIXED_WINDING
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_VisChopWinding.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int numSurfaces; int firstSurface; } ;
typedef TYPE_1__ lleaf_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
int MAX_MAP_LEAFFACES ;
int* clustersurfaces ;
TYPE_1__* leafs ;
int numclustersurfaces ;
int portalclusters ;
void VL_LinkSurfaceIntoCluster(int cluster, int surfaceNum)
{
lleaf_t *leaf;
int i;
leaf = &leafs[cluster];
for (i = 0; i < leaf->numSurfaces; i++)
{
if (clustersurfaces[leaf->firstSurface + i] == surfaceNum)
return;
}
for (i = numclustersurfaces; i > leaf->firstSurface + leaf->numSurfaces; i--)
clustersurfaces[i] = clustersurfaces[i-1];
for (i = 0; i < portalclusters; i++)
{
if (i == cluster)
continue;
if (leafs[i].firstSurface >= leaf->firstSurface + leaf->numSurfaces)
leafs[i].firstSurface++;
}
clustersurfaces[leaf->firstSurface + leaf->numSurfaces] = surfaceNum;
leaf->numSurfaces++;
numclustersurfaces++;
if (numclustersurfaces >= MAX_MAP_LEAFFACES)
Error("MAX_MAP_LEAFFACES");
}
|
.text
.file "extr_lightv.c_VL_LinkSurfaceIntoCluster.c"
.globl VL_LinkSurfaceIntoCluster // -- Begin function VL_LinkSurfaceIntoCluster
.p2align 2
.type VL_LinkSurfaceIntoCluster,@function
VL_LinkSurfaceIntoCluster: // @VL_LinkSurfaceIntoCluster
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur w0, [x29, #-4]
stur w1, [x29, #-8]
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #3
str x8, [sp, #16]
str wzr, [sp, #12]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, clustersurfaces
ldr x8, [x8, :lo12:clustersurfaces]
ldr x9, [sp, #16]
ldr w9, [x9, #4]
ldr w10, [sp, #12]
add w9, w9, w10
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-8]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
b .LBB0_20
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_1
.LBB0_6:
adrp x8, numclustersurfaces
ldr w8, [x8, :lo12:numclustersurfaces]
str w8, [sp, #12]
b .LBB0_7
.LBB0_7: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldr w9, [x9, #4]
ldr x10, [sp, #16]
ldr w10, [x10]
add w9, w9, w10
subs w8, w8, w9
cset w8, le
tbnz w8, #0, .LBB0_10
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
adrp x9, clustersurfaces
ldr x8, [x9, :lo12:clustersurfaces]
ldr w10, [sp, #12]
subs w10, w10, #1
ldr w8, [x8, w10, sxtw #2]
ldr x9, [x9, :lo12:clustersurfaces]
ldrsw x10, [sp, #12]
str w8, [x9, x10, lsl #2]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=1
ldr w8, [sp, #12]
subs w8, w8, #1
str w8, [sp, #12]
b .LBB0_7
.LBB0_10:
str wzr, [sp, #12]
b .LBB0_11
.LBB0_11: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_18
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #12]
ldur w9, [x29, #-4]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_11 Depth=1
b .LBB0_17
.LBB0_14: // in Loop: Header=BB0_11 Depth=1
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldrsw x9, [sp, #12]
add x8, x8, x9, lsl #3
ldr w8, [x8, #4]
ldr x9, [sp, #16]
ldr w9, [x9, #4]
ldr x10, [sp, #16]
ldr w10, [x10]
add w9, w9, w10
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_11 Depth=1
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldrsw x9, [sp, #12]
add x9, x8, x9, lsl #3
ldr w8, [x9, #4]
add w8, w8, #1
str w8, [x9, #4]
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_11 Depth=1
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_11
.LBB0_18:
ldur w8, [x29, #-8]
adrp x9, clustersurfaces
ldr x9, [x9, :lo12:clustersurfaces]
ldr x10, [sp, #16]
ldr w10, [x10, #4]
ldr x11, [sp, #16]
ldr w11, [x11]
add w10, w10, w11
str w8, [x9, w10, sxtw #2]
ldr x9, [sp, #16]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
adrp x8, numclustersurfaces
ldr w9, [x8, :lo12:numclustersurfaces]
add w9, w9, #1
str w9, [x8, :lo12:numclustersurfaces]
ldr w8, [x8, :lo12:numclustersurfaces]
adrp x9, MAX_MAP_LEAFFACES
ldr w9, [x9, :lo12:MAX_MAP_LEAFFACES]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_20
.LBB0_20:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_LinkSurfaceIntoCluster, .Lfunc_end0-VL_LinkSurfaceIntoCluster
.cfi_endproc
// -- End function
.type leafs,@object // @leafs
.bss
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.type clustersurfaces,@object // @clustersurfaces
.globl clustersurfaces
.p2align 3, 0x0
clustersurfaces:
.xword 0
.size clustersurfaces, 8
.type numclustersurfaces,@object // @numclustersurfaces
.globl numclustersurfaces
.p2align 2, 0x0
numclustersurfaces:
.word 0 // 0x0
.size numclustersurfaces, 4
.type portalclusters,@object // @portalclusters
.globl portalclusters
.p2align 2, 0x0
portalclusters:
.word 0 // 0x0
.size portalclusters, 4
.type MAX_MAP_LEAFFACES,@object // @MAX_MAP_LEAFFACES
.globl MAX_MAP_LEAFFACES
.p2align 2, 0x0
MAX_MAP_LEAFFACES:
.word 0 // 0x0
.size MAX_MAP_LEAFFACES, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "MAX_MAP_LEAFFACES"
.size .L.str, 18
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
.addrsig_sym leafs
.addrsig_sym clustersurfaces
.addrsig_sym numclustersurfaces
.addrsig_sym portalclusters
.addrsig_sym MAX_MAP_LEAFFACES
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_LinkSurfaceIntoCluster.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_2__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
struct TYPE_9__ {struct TYPE_9__** children; int /*<<< orphan*/ planenum; void* areaportal; void* opaque; TYPE_2__* brushlist; } ;
typedef TYPE_1__ node_t ;
struct TYPE_10__ {int contents; scalar_t__ opaque; int /*<<< orphan*/ detail; struct TYPE_10__* next; } ;
typedef TYPE_2__ bspbrush_t ;
/* Variables and functions */
int CONTENTS_AREAPORTAL ;
int /*<<< orphan*/ FreeBrush (TYPE_2__*) ;
int /*<<< orphan*/ PLANENUM_LEAF ;
int /*<<< orphan*/ SplitBrush (TYPE_2__*,int /*<<< orphan*/ ,TYPE_2__**,TYPE_2__**) ;
void* qfalse ;
void* qtrue ;
int FilterBrushIntoTree_r( bspbrush_t *b, node_t *node ) {
bspbrush_t *front, *back;
int c;
if ( !b ) {
return 0;
}
// add it to the leaf list
if ( node->planenum == PLANENUM_LEAF ) {
b->next = node->brushlist;
node->brushlist = b;
// classify the leaf by the structural brush
if ( !b->detail ) {
if ( b->opaque ) {
node->opaque = qtrue;
node->areaportal = qfalse;
} else if ( b->contents & CONTENTS_AREAPORTAL ) {
if ( !node->opaque ) {
node->areaportal = qtrue;
}
}
}
return 1;
}
// split it by the node plane
SplitBrush ( b, node->planenum, &front, &back );
FreeBrush( b );
c = 0;
c += FilterBrushIntoTree_r( front, node->children[0] );
c += FilterBrushIntoTree_r( back, node->children[1] );
return c;
}
|
.text
.file "extr_brush.c_FilterBrushIntoTree_r.c"
.globl FilterBrushIntoTree_r // -- Begin function FilterBrushIntoTree_r
.p2align 2
.type FilterBrushIntoTree_r,@function
FilterBrushIntoTree_r: // @FilterBrushIntoTree_r
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-16]
str x1, [sp, #24]
ldur x8, [x29, #-16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
stur wzr, [x29, #-4]
b .LBB0_14
.LBB0_2:
ldr x8, [sp, #24]
ldr w8, [x8, #8]
adrp x9, PLANENUM_LEAF
ldr w9, [x9, :lo12:PLANENUM_LEAF]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_3
.LBB0_3:
ldr x8, [sp, #24]
ldr x8, [x8, #32]
ldur x9, [x29, #-16]
str x8, [x9, #24]
ldur x8, [x29, #-16]
ldr x9, [sp, #24]
str x8, [x9, #32]
ldur x8, [x29, #-16]
ldr w8, [x8, #16]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_12
b .LBB0_4
.LBB0_4:
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldr x9, [sp, #24]
str x8, [x9, #24]
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
ldr x9, [sp, #24]
str x8, [x9, #16]
b .LBB0_11
.LBB0_6:
ldur x8, [x29, #-16]
ldr w8, [x8]
adrp x9, CONTENTS_AREAPORTAL
ldr w9, [x9, :lo12:CONTENTS_AREAPORTAL]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_7
.LBB0_7:
ldr x8, [sp, #24]
ldr x8, [x8, #24]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldr x9, [sp, #24]
str x8, [x9, #16]
b .LBB0_9
.LBB0_9:
b .LBB0_10
.LBB0_10:
b .LBB0_11
.LBB0_11:
b .LBB0_12
.LBB0_12:
mov w8, #1 // =0x1
stur w8, [x29, #-4]
b .LBB0_14
.LBB0_13:
ldur x0, [x29, #-16]
ldr x8, [sp, #24]
ldr w1, [x8, #8]
add x2, sp, #16
add x3, sp, #8
bl SplitBrush
ldur x0, [x29, #-16]
bl FreeBrush
str wzr, [sp, #4]
ldr x0, [sp, #16]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr x1, [x8]
bl FilterBrushIntoTree_r
ldr w8, [sp, #4]
add w8, w8, w0
str w8, [sp, #4]
ldr x0, [sp, #8]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr x1, [x8, #8]
bl FilterBrushIntoTree_r
ldr w8, [sp, #4]
add w8, w8, w0
str w8, [sp, #4]
ldr w8, [sp, #4]
stur w8, [x29, #-4]
b .LBB0_14
.LBB0_14:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FilterBrushIntoTree_r, .Lfunc_end0-FilterBrushIntoTree_r
.cfi_endproc
// -- End function
.type PLANENUM_LEAF,@object // @PLANENUM_LEAF
.bss
.globl PLANENUM_LEAF
.p2align 2, 0x0
PLANENUM_LEAF:
.word 0 // 0x0
.size PLANENUM_LEAF, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0
.size qtrue, 8
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 3, 0x0
qfalse:
.xword 0
.size qfalse, 8
.type CONTENTS_AREAPORTAL,@object // @CONTENTS_AREAPORTAL
.globl CONTENTS_AREAPORTAL
.p2align 2, 0x0
CONTENTS_AREAPORTAL:
.word 0 // 0x0
.size CONTENTS_AREAPORTAL, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym FilterBrushIntoTree_r
.addrsig_sym SplitBrush
.addrsig_sym FreeBrush
.addrsig_sym PLANENUM_LEAF
.addrsig_sym qtrue
.addrsig_sym qfalse
.addrsig_sym CONTENTS_AREAPORTAL
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_FilterBrushIntoTree_r.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {int numpoints; int /*<<< orphan*/ * p; } ;
typedef TYPE_2__ winding_t ;
typedef scalar_t__ vec_t ;
struct TYPE_9__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_3__ plane_t ;
struct TYPE_10__ {int numsides; TYPE_1__* sides; } ;
typedef TYPE_4__ bspbrush_t ;
struct TYPE_7__ {TYPE_2__* winding; } ;
/* Variables and functions */
scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int PSIDE_BACK ;
int PSIDE_FRONT ;
int BrushMostlyOnSide (bspbrush_t *brush, plane_t *plane)
{
int i, j;
winding_t *w;
vec_t d, max;
int side;
max = 0;
side = PSIDE_FRONT;
for (i=0 ; i<brush->numsides ; i++)
{
w = brush->sides[i].winding;
if (!w)
continue;
for (j=0 ; j<w->numpoints ; j++)
{
d = DotProduct (w->p[j], plane->normal) - plane->dist;
if (d > max)
{
max = d;
side = PSIDE_FRONT;
}
if (-d > max)
{
max = -d;
side = PSIDE_BACK;
}
}
}
return side;
}
|
.text
.file "extr_brush.c_BrushMostlyOnSide.c"
.globl BrushMostlyOnSide // -- Begin function BrushMostlyOnSide
.p2align 2
.type BrushMostlyOnSide,@function
BrushMostlyOnSide: // @BrushMostlyOnSide
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
str xzr, [sp, #16]
adrp x8, PSIDE_FRONT
ldr w8, [x8, :lo12:PSIDE_FRONT]
str w8, [sp, #12]
stur wzr, [x29, #-20]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_5 Depth 2
ldur w8, [x29, #-20]
ldur x9, [x29, #-8]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_14
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldr x8, [x8, #8]
ldursw x9, [x29, #-20]
ldr x8, [x8, x9, lsl #3]
str x8, [sp, #32]
ldr x8, [sp, #32]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-24]
b .LBB0_5
.LBB0_5: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-24]
ldr x9, [sp, #32]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_12
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp, #32]
ldr x8, [x8, #8]
ldursw x9, [x29, #-24]
ldr w0, [x8, x9, lsl #2]
ldur x8, [x29, #-16]
ldr w1, [x8, #8]
bl DotProduct
ldur x8, [x29, #-16]
ldr x8, [x8]
subs x8, x0, x8
str x8, [sp, #24]
ldr x8, [sp, #24]
ldr x9, [sp, #16]
subs x8, x8, x9
cset w8, le
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp, #24]
str x8, [sp, #16]
adrp x8, PSIDE_FRONT
ldr w8, [x8, :lo12:PSIDE_FRONT]
str w8, [sp, #12]
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_5 Depth=2
ldr x9, [sp, #24]
mov x8, xzr
subs x8, x8, x9
ldr x9, [sp, #16]
subs x8, x8, x9
cset w8, le
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_5 Depth=2
ldr x9, [sp, #24]
mov x8, xzr
subs x8, x8, x9
str x8, [sp, #16]
adrp x8, PSIDE_BACK
ldr w8, [x8, :lo12:PSIDE_BACK]
str w8, [sp, #12]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_5 Depth=2
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_5 Depth=2
ldur w8, [x29, #-24]
add w8, w8, #1
stur w8, [x29, #-24]
b .LBB0_5
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_1
.LBB0_14:
ldr w0, [sp, #12]
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size BrushMostlyOnSide, .Lfunc_end0-BrushMostlyOnSide
.cfi_endproc
// -- End function
.type PSIDE_FRONT,@object // @PSIDE_FRONT
.bss
.globl PSIDE_FRONT
.p2align 2, 0x0
PSIDE_FRONT:
.word 0 // 0x0
.size PSIDE_FRONT, 4
.type PSIDE_BACK,@object // @PSIDE_BACK
.globl PSIDE_BACK
.p2align 2, 0x0
PSIDE_BACK:
.word 0 // 0x0
.size PSIDE_BACK, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym DotProduct
.addrsig_sym PSIDE_FRONT
.addrsig_sym PSIDE_BACK
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_BrushMostlyOnSide.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {double* xyz; double* st; double* lightmap; int* color; } ;
typedef TYPE_1__ drawVert_t ;
/* Variables and functions */
void LerpDrawVert( drawVert_t *a, drawVert_t *b, drawVert_t *out ) {
out->xyz[0] = 0.5 * (a->xyz[0] + b->xyz[0]);
out->xyz[1] = 0.5 * (a->xyz[1] + b->xyz[1]);
out->xyz[2] = 0.5 * (a->xyz[2] + b->xyz[2]);
out->st[0] = 0.5 * (a->st[0] + b->st[0]);
out->st[1] = 0.5 * (a->st[1] + b->st[1]);
out->lightmap[0] = 0.5 * (a->lightmap[0] + b->lightmap[0]);
out->lightmap[1] = 0.5 * (a->lightmap[1] + b->lightmap[1]);
out->color[0] = (a->color[0] + b->color[0]) >> 1;
out->color[1] = (a->color[1] + b->color[1]) >> 1;
out->color[2] = (a->color[2] + b->color[2]) >> 1;
out->color[3] = (a->color[3] + b->color[3]) >> 1;
}
|
.text
.file "extr_mesh.c_LerpDrawVert.c"
.globl LerpDrawVert // -- Begin function LerpDrawVert
.p2align 2
.type LerpDrawVert,@function
LerpDrawVert: // @LerpDrawVert
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
str x0, [sp, #24]
str x1, [sp, #16]
str x2, [sp, #8]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr d0, [x8]
ldr x8, [sp, #16]
ldr x8, [x8]
ldr d1, [x8]
fadd d1, d0, d1
fmov d0, #0.50000000
fmul d1, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8]
str d1, [x8]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr d1, [x8, #8]
ldr x8, [sp, #16]
ldr x8, [x8]
ldr d2, [x8, #8]
fadd d1, d1, d2
fmul d1, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8]
str d1, [x8, #8]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr d1, [x8, #16]
ldr x8, [sp, #16]
ldr x8, [x8]
ldr d2, [x8, #16]
fadd d1, d1, d2
fmul d1, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8]
str d1, [x8, #16]
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldr d1, [x8]
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldr d2, [x8]
fadd d1, d1, d2
fmul d1, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8, #8]
str d1, [x8]
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldr d1, [x8, #8]
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldr d2, [x8, #8]
fadd d1, d1, d2
fmul d1, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8, #8]
str d1, [x8, #8]
ldr x8, [sp, #24]
ldr x8, [x8, #16]
ldr d1, [x8]
ldr x8, [sp, #16]
ldr x8, [x8, #16]
ldr d2, [x8]
fadd d1, d1, d2
fmul d1, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8, #16]
str d1, [x8]
ldr x8, [sp, #24]
ldr x8, [x8, #16]
ldr d1, [x8, #8]
ldr x8, [sp, #16]
ldr x8, [x8, #16]
ldr d2, [x8, #8]
fadd d1, d1, d2
fmul d0, d0, d1
ldr x8, [sp, #8]
ldr x8, [x8, #16]
str d0, [x8, #8]
ldr x8, [sp, #24]
ldr x8, [x8, #24]
ldr w8, [x8]
ldr x9, [sp, #16]
ldr x9, [x9, #24]
ldr w9, [x9]
add w8, w8, w9
asr w8, w8, #1
ldr x9, [sp, #8]
ldr x9, [x9, #24]
str w8, [x9]
ldr x8, [sp, #24]
ldr x8, [x8, #24]
ldr w8, [x8, #4]
ldr x9, [sp, #16]
ldr x9, [x9, #24]
ldr w9, [x9, #4]
add w8, w8, w9
asr w8, w8, #1
ldr x9, [sp, #8]
ldr x9, [x9, #24]
str w8, [x9, #4]
ldr x8, [sp, #24]
ldr x8, [x8, #24]
ldr w8, [x8, #8]
ldr x9, [sp, #16]
ldr x9, [x9, #24]
ldr w9, [x9, #8]
add w8, w8, w9
asr w8, w8, #1
ldr x9, [sp, #8]
ldr x9, [x9, #24]
str w8, [x9, #8]
ldr x8, [sp, #24]
ldr x8, [x8, #24]
ldr w8, [x8, #12]
ldr x9, [sp, #16]
ldr x9, [x9, #24]
ldr w9, [x9, #12]
add w8, w8, w9
asr w8, w8, #1
ldr x9, [sp, #8]
ldr x9, [x9, #24]
str w8, [x9, #12]
add sp, sp, #32
.cfi_def_cfa_offset 0
ret
.Lfunc_end0:
.size LerpDrawVert, .Lfunc_end0-LerpDrawVert
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
|
../AnghaBench/Quake-III-Arena/q3map/extr_mesh.c_LerpDrawVert.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_6__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
typedef int /*<<< orphan*/ vsound_t ;
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_10__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_11__ {int cluster; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VS_FloodDirectedLight (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int VS_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_6__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
void VS_R_SubdivideDirectedAreaLight(vsound_t *light, int nodenum, winding_t *w)
{
int leafnum, res;
dnode_t *node;
dplane_t *plane;
winding_t back;
plane_t split;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VS_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
memcpy(&back, w, sizeof(winding_t));
VS_R_SubdivideDirectedAreaLight(light, node->children[1], &back);
nodenum = node->children[0];
}
else
{
VS_R_SubdivideDirectedAreaLight(light, node->children[1], &back);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
if (dleafs[leafnum].cluster != -1)
{
VS_FloodDirectedLight(light, w, leafnum);
}
}
|
.text
.file "extr_soundv.c_VS_R_SubdivideDirectedAreaLight.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_R_SubdivideDirectedAreaLight
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VS_R_SubdivideDirectedAreaLight
.p2align 2
.type VS_R_SubdivideDirectedAreaLight,@function
VS_R_SubdivideDirectedAreaLight: // @VS_R_SubdivideDirectedAreaLight
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur x2, [x29, #-24]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-12]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-12]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w0, [x8, #4]
add x8, sp, #20
str x8, [sp, #8] // 8-byte Folded Spill
ldr w1, [sp, #24]
bl VectorCopy
ldr x2, [sp, #8] // 8-byte Folded Reload
ldr x8, [sp, #32]
ldr w8, [x8]
str w8, [sp, #20]
ldur x0, [x29, #-24]
add x1, sp, #28
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VS_SplitWinding
stur w0, [x29, #-32]
ldur w8, [x29, #-32]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_11
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-12]
b .LBB0_10
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-24]
add x0, sp, #28
str x0, [sp] // 8-byte Folded Spill
mov w2, #4 // =0x4
bl memcpy
ldr x2, [sp] // 8-byte Folded Reload
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
bl VS_R_SubdivideDirectedAreaLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
add x2, sp, #28
bl VS_R_SubdivideDirectedAreaLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_12:
ldur w9, [x29, #-12]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-28]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-28]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur x0, [x29, #-8]
ldur x1, [x29, #-24]
ldur w2, [x29, #-28]
bl VS_FloodDirectedLight
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_R_SubdivideDirectedAreaLight, .Lfunc_end0-VS_R_SubdivideDirectedAreaLight
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_R_SubdivideDirectedAreaLight
.addrsig_sym VectorCopy
.addrsig_sym VS_SplitWinding
.addrsig_sym memcpy
.addrsig_sym VS_FloodDirectedLight
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_R_SubdivideDirectedAreaLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_16__ TYPE_5__ ;
typedef struct TYPE_15__ TYPE_4__ ;
typedef struct TYPE_14__ TYPE_3__ ;
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
struct TYPE_12__ {int numpoints; int /*<<< orphan*/ points; } ;
typedef TYPE_1__ winding_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_13__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ plane_t ;
struct TYPE_14__ {int numSides; int firstSide; } ;
typedef TYPE_3__ dbrush_t ;
struct TYPE_16__ {size_t planeNum; } ;
struct TYPE_15__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int VL_SplitWinding (TYPE_1__*,TYPE_1__*,TYPE_2__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorInverse (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ _printf (char*,int) ;
TYPE_5__* dbrushsides ;
TYPE_4__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int VL_ChopWindingWithBrush(winding_t *w, dbrush_t *brush, winding_t *outwindings, int maxout)
{
int i, res, numout;
winding_t front, back;
plane_t plane;
numout = 0;
memcpy(front.points, w->points, w->numpoints * sizeof(vec3_t));
front.numpoints = w->numpoints;
for (i = 0; i < brush->numSides; i++)
{
VectorCopy(dplanes[ dbrushsides[ brush->firstSide + i ].planeNum ].normal, plane.normal);
VectorInverse(plane.normal);
plane.dist = -dplanes[ dbrushsides[ brush->firstSide + i ].planeNum ].dist;
res = VL_SplitWinding(&front, &back, &plane, 0.1);
if (res == SIDE_BACK || res == SIDE_ON)
{
memcpy(outwindings[0].points, w->points, w->numpoints * sizeof(vec3_t));
outwindings[0].numpoints = w->numpoints;
return 1; //did not intersect
}
if (res != SIDE_FRONT)
{
if (numout >= maxout)
{
_printf("WARNING: VL_ChopWindingWithBrush: more than %d windings\n", maxout);
return 0;
}
memcpy(outwindings[numout].points, back.points, back.numpoints * sizeof(vec3_t));
outwindings[numout].numpoints = back.numpoints;
numout++;
}
}
return numout;
}
|
.text
.file "extr_lightv.c_VL_ChopWindingWithBrush.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_ChopWindingWithBrush
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_ChopWindingWithBrush
.p2align 2
.type VL_ChopWindingWithBrush,@function
VL_ChopWindingWithBrush: // @VL_ChopWindingWithBrush
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
stur w3, [x29, #-36]
str wzr, [sp, #48]
ldr w0, [sp, #44]
ldur x8, [x29, #-16]
ldr w1, [x8, #4]
ldur x8, [x29, #-16]
ldrsw x8, [x8]
lsl x8, x8, #2
mov w2, w8
bl memcpy
ldur x8, [x29, #-16]
ldr w8, [x8]
str w8, [sp, #40]
stur wzr, [x29, #-40]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-40]
ldur x9, [x29, #-24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_11
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dplanes
str x8, [sp] // 8-byte Folded Spill
ldr x8, [x8, :lo12:dplanes]
adrp x9, dbrushsides
str x9, [sp, #8] // 8-byte Folded Spill
ldr x9, [x9, :lo12:dbrushsides]
ldur x10, [x29, #-24]
ldr w10, [x10, #4]
ldur w11, [x29, #-40]
add w10, w10, w11
ldr x9, [x9, w10, sxtw #3]
add x8, x8, x9, lsl #3
ldr w0, [x8, #4]
add x8, sp, #24
str x8, [sp, #16] // 8-byte Folded Spill
ldr w1, [sp, #28]
bl VectorCopy
ldr w0, [sp, #28]
bl VectorInverse
ldr x8, [sp] // 8-byte Folded Reload
ldr x9, [sp, #8] // 8-byte Folded Reload
ldr x2, [sp, #16] // 8-byte Folded Reload
ldr x8, [x8, :lo12:dplanes]
ldr x9, [x9, :lo12:dbrushsides]
ldur x10, [x29, #-24]
ldr w10, [x10, #4]
ldur w11, [x29, #-40]
add w10, w10, w11
ldr x9, [x9, w10, sxtw #3]
lsl x9, x9, #3
ldr w9, [x8, x9]
mov w8, wzr
subs w8, w8, w9
str w8, [sp, #24]
add x0, sp, #40
add x1, sp, #32
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VL_SplitWinding
stur w0, [x29, #-44]
ldur w8, [x29, #-44]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-44]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
ldur x8, [x29, #-32]
ldr w0, [x8, #4]
ldur x8, [x29, #-16]
ldr w1, [x8, #4]
ldur x8, [x29, #-16]
ldrsw x8, [x8]
lsl x8, x8, #2
mov w2, w8
bl memcpy
ldur x8, [x29, #-16]
ldr w8, [x8]
ldur x9, [x29, #-32]
str w8, [x9]
mov w8, #1 // =0x1
stur w8, [x29, #-4]
b .LBB0_12
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-44]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_9
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #48]
ldur w9, [x29, #-36]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
ldur w1, [x29, #-36]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
stur wzr, [x29, #-4]
b .LBB0_12
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-32]
ldrsw x9, [sp, #48]
add x8, x8, x9, lsl #3
ldr w0, [x8, #4]
ldr w1, [sp, #36]
ldrsw x8, [sp, #32]
lsl x8, x8, #2
mov w2, w8
bl memcpy
ldr w8, [sp, #32]
ldur x9, [x29, #-32]
ldrsw x10, [sp, #48]
lsl x10, x10, #3
str w8, [x9, x10]
ldr w8, [sp, #48]
add w8, w8, #1
str w8, [sp, #48]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-40]
add w8, w8, #1
stur w8, [x29, #-40]
b .LBB0_1
.LBB0_11:
ldr w8, [sp, #48]
stur w8, [x29, #-4]
b .LBB0_12
.LBB0_12:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_ChopWindingWithBrush, .Lfunc_end0-VL_ChopWindingWithBrush
.cfi_endproc
// -- End function
.type dplanes,@object // @dplanes
.bss
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type dbrushsides,@object // @dbrushsides
.globl dbrushsides
.p2align 3, 0x0
dbrushsides:
.xword 0
.size dbrushsides, 8
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "WARNING: VL_ChopWindingWithBrush: more than %d windings\n"
.size .L.str, 57
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym memcpy
.addrsig_sym VectorCopy
.addrsig_sym VectorInverse
.addrsig_sym VL_SplitWinding
.addrsig_sym _printf
.addrsig_sym dplanes
.addrsig_sym dbrushsides
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym SIDE_FRONT
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_ChopWindingWithBrush.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ * vec3_t ;
/* Variables and functions */
int /*<<< orphan*/ _printf (char*,...) ;
void PrintCtrl( vec3_t ctrl[9] ) {
int i, j;
for ( i = 0 ; i < 3 ; i++ ) {
for ( j = 0 ; j < 3 ; j++ ) {
_printf("(%5.2f %5.2f %5.2f) ", ctrl[i*3+j][0], ctrl[i*3+j][1], ctrl[i*3+j][2] );
}
_printf("\n");
}
}
|
.text
.file "extr_patch.c_PrintCtrl.c"
.globl PrintCtrl // -- Begin function PrintCtrl
.p2align 2
.type PrintCtrl,@function
PrintCtrl: // @PrintCtrl
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
str x0, [sp, #8]
str wzr, [sp, #4]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_3 Depth 2
ldr w8, [sp, #4]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
str wzr, [sp]
b .LBB0_3
.LBB0_3: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #8]
ldr w9, [sp, #4]
mov w10, #3 // =0x3
mul w9, w9, w10
ldr w11, [sp]
add w9, w9, w11
ldr x8, [x8, w9, sxtw #3]
ldr w1, [x8]
ldr x8, [sp, #8]
ldr w9, [sp, #4]
mul w9, w9, w10
ldr w11, [sp]
add w9, w9, w11
ldr x8, [x8, w9, sxtw #3]
ldr w2, [x8, #4]
ldr x8, [sp, #8]
ldr w9, [sp, #4]
mul w9, w9, w10
ldr w10, [sp]
add w9, w9, w10
ldr x8, [x8, w9, sxtw #3]
ldr w3, [x8, #8]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=2
ldr w8, [sp]
add w8, w8, #1
str w8, [sp]
b .LBB0_3
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b .LBB0_1
.LBB0_8:
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size PrintCtrl, .Lfunc_end0-PrintCtrl
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "(%5.2f %5.2f %5.2f) "
.size .L.str, 21
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "\n"
.size .L.str.1, 2
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym _printf
|
../AnghaBench/Quake-III-Arena/q3map/extr_patch.c_PrintCtrl.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int /*<<< orphan*/ headnode; } ;
typedef TYPE_1__ tree_t ;
/* Variables and functions */
int /*<<< orphan*/ MakeHeadnodePortals (TYPE_1__*) ;
int /*<<< orphan*/ MakeTreePortals_r (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ c_tinyportals ;
int /*<<< orphan*/ qprintf (char*,...) ;
void MakeTreePortals (tree_t *tree)
{
qprintf( "----- MakeTreePortals -----\n");
MakeHeadnodePortals (tree);
MakeTreePortals_r (tree->headnode);
qprintf("%6d tiny portals\n", c_tinyportals);
}
|
.text
.file "extr_portals.c_MakeTreePortals.c"
.globl MakeTreePortals // -- Begin function MakeTreePortals
.p2align 2
.type MakeTreePortals,@function
MakeTreePortals: // @MakeTreePortals
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
str x0, [sp, #8]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl qprintf
ldr x0, [sp, #8]
bl MakeHeadnodePortals
ldr x8, [sp, #8]
ldr w0, [x8]
bl MakeTreePortals_r
adrp x8, c_tinyportals
ldr w1, [x8, :lo12:c_tinyportals]
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl qprintf
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size MakeTreePortals, .Lfunc_end0-MakeTreePortals
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "----- MakeTreePortals -----\n"
.size .L.str, 29
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "%6d tiny portals\n"
.size .L.str.1, 18
.type c_tinyportals,@object // @c_tinyportals
.bss
.globl c_tinyportals
.p2align 2, 0x0
c_tinyportals:
.word 0 // 0x0
.size c_tinyportals, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym qprintf
.addrsig_sym MakeHeadnodePortals
.addrsig_sym MakeTreePortals_r
.addrsig_sym c_tinyportals
|
../AnghaBench/Quake-III-Arena/q3map/extr_portals.c_MakeTreePortals.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_23__ TYPE_5__ ;
typedef struct TYPE_22__ TYPE_4__ ;
typedef struct TYPE_21__ TYPE_3__ ;
typedef struct TYPE_20__ TYPE_2__ ;
typedef struct TYPE_19__ TYPE_1__ ;
/* Type definitions */
struct TYPE_19__ {int numpoints; int /*<<< orphan*/ * points; } ;
typedef TYPE_1__ winding_t ;
struct TYPE_20__ {size_t leaf; int* portalflood; float radius; TYPE_1__* winding; int /*<<< orphan*/ origin; scalar_t__ removed; TYPE_4__* passages; int /*<<< orphan*/ status; } ;
typedef TYPE_2__ vportal_t ;
struct TYPE_21__ {float dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_3__ plane_t ;
struct TYPE_22__ {int* cansee; struct TYPE_22__* next; } ;
typedef TYPE_4__ passage_t ;
struct TYPE_23__ {int numportals; TYPE_2__** portals; } ;
typedef TYPE_5__ leaf_t ;
/* Variables and functions */
int AddSeperators (TYPE_1__*,TYPE_1__*,int /*<<< orphan*/ ,TYPE_3__*,int) ;
float DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int MAX_SEPERATORS ;
float ON_EPSILON ;
TYPE_1__* PassageChopWinding (TYPE_1__*,TYPE_1__*,TYPE_3__*) ;
int /*<<< orphan*/ _printf (char*,int) ;
TYPE_5__* leafs ;
scalar_t__ malloc (scalar_t__) ;
int /*<<< orphan*/ memcpy (TYPE_1__*,TYPE_1__*,int) ;
int /*<<< orphan*/ memset (TYPE_4__*,int /*<<< orphan*/ ,scalar_t__) ;
int numportals ;
scalar_t__ portalbytes ;
TYPE_2__* portals ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
TYPE_2__** sorted_portals ;
int /*<<< orphan*/ stat_done ;
void CreatePassages(int portalnum)
{
int i, j, k, n, numseperators, numsee;
float d;
vportal_t *portal, *p, *target;
leaf_t *leaf;
passage_t *passage, *lastpassage;
plane_t seperators[MAX_SEPERATORS*2];
winding_t *w;
winding_t in, out, *res;
#ifdef MREDEBUG
_printf("\r%6d", portalnum);
#endif
portal = sorted_portals[portalnum];
if (portal->removed)
{
portal->status = stat_done;
return;
}
lastpassage = NULL;
leaf = &leafs[portal->leaf];
for (i = 0; i < leaf->numportals; i++)
{
target = leaf->portals[i];
if (target->removed)
continue;
passage = (passage_t *) malloc(sizeof(passage_t) + portalbytes);
memset(passage, 0, sizeof(passage_t) + portalbytes);
numseperators = AddSeperators(portal->winding, target->winding, qfalse, seperators, MAX_SEPERATORS*2);
numseperators += AddSeperators(target->winding, portal->winding, qtrue, &seperators[numseperators], MAX_SEPERATORS*2-numseperators);
passage->next = NULL;
if (lastpassage)
lastpassage->next = passage;
else
portal->passages = passage;
lastpassage = passage;
numsee = 0;
//create the passage->cansee
for (j = 0; j < numportals * 2; j++)
{
p = &portals[j];
if (p->removed)
continue;
if ( ! (target->portalflood[j >> 3] & (1<<(j&7)) ) )
continue;
if ( ! (portal->portalflood[j >> 3] & (1<<(j&7)) ) )
continue;
for (k = 0; k < numseperators; k++)
{
//
d = DotProduct (p->origin, seperators[k].normal) - seperators[k].dist;
//if completely at the back of the seperator plane
if (d < -p->radius + ON_EPSILON)
break;
w = p->winding;
for (n = 0; n < w->numpoints; n++)
{
d = DotProduct (w->points[n], seperators[k].normal) - seperators[k].dist;
//if at the front of the seperator
if (d > ON_EPSILON)
break;
}
//if no points are at the front of the seperator
if (n >= w->numpoints)
break;
}
if (k < numseperators)
continue;
memcpy(&in, p->winding, sizeof(winding_t));
for (k = 0; k < numseperators; k++)
{
res = PassageChopWinding(&in, &out, &seperators[k]);
if (res == &out)
memcpy(&in, &out, sizeof(winding_t));
if (res == NULL)
break;
}
if (k < numseperators)
continue;
passage->cansee[j >> 3] |= (1<<(j&7));
numsee++;
}
}
}
|
.text
.file "extr_visflow.c_CreatePassages.c"
.globl CreatePassages // -- Begin function CreatePassages
.p2align 2
.type CreatePassages,@function
CreatePassages: // @CreatePassages
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub sp, sp, #192
stur w0, [x29, #-4]
adrp x8, MAX_SEPERATORS
ldr w8, [x8, :lo12:MAX_SEPERATORS]
lsl w8, w8, #1
mov w8, w8
// kill: def $x8 killed $w8
mov x9, sp
stur x9, [x29, #-88]
lsl x9, x8, #3
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x9, x9, x10
mov sp, x9
stur x9, [x29, #-160] // 8-byte Folded Spill
stur x8, [x29, #-96]
adrp x8, sorted_portals
ldr x8, [x8, :lo12:sorted_portals]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
stur x8, [x29, #-40]
ldur x8, [x29, #-40]
ldr x8, [x8, #40]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, stat_done
ldr w8, [x8, :lo12:stat_done]
ldur x9, [x29, #-40]
str w8, [x9, #56]
mov w8, #1 // =0x1
stur w8, [x29, #-148]
b .LBB0_48
.LBB0_2:
// kill: def $x8 killed $xzr
stur xzr, [x29, #-80]
adrp x8, leafs
ldr x8, [x8, :lo12:leafs]
ldur x9, [x29, #-40]
ldr x9, [x9]
add x8, x8, x9, lsl #4
stur x8, [x29, #-64]
stur wzr, [x29, #-8]
b .LBB0_3
.LBB0_3: // =>This Loop Header: Depth=1
// Child Loop BB0_10 Depth 2
// Child Loop BB0_18 Depth 3
// Child Loop BB0_22 Depth 4
// Child Loop BB0_34 Depth 3
ldur w8, [x29, #-8]
ldur x9, [x29, #-64]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_47
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-64]
ldr x8, [x8, #8]
ldursw x9, [x29, #-8]
ldr x8, [x8, x9, lsl #3]
stur x8, [x29, #-56]
ldur x8, [x29, #-56]
ldr x8, [x8, #40]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=1
b .LBB0_46
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
adrp x8, portalbytes
stur x8, [x29, #-176] // 8-byte Folded Spill
ldr x8, [x8, :lo12:portalbytes]
add x0, x8, #16
bl malloc
ldur x8, [x29, #-176] // 8-byte Folded Reload
stur x0, [x29, #-72]
ldur x0, [x29, #-72]
ldr x8, [x8, :lo12:portalbytes]
add x2, x8, #16
mov w1, wzr
bl memset
ldur x3, [x29, #-160] // 8-byte Folded Reload
ldur x8, [x29, #-40]
ldr x0, [x8, #24]
ldur x8, [x29, #-56]
ldr x1, [x8, #24]
adrp x8, qfalse
ldr w2, [x8, :lo12:qfalse]
adrp x8, MAX_SEPERATORS
stur x8, [x29, #-168] // 8-byte Folded Spill
ldr w8, [x8, :lo12:MAX_SEPERATORS]
lsl w4, w8, #1
bl AddSeperators
ldur x9, [x29, #-160] // 8-byte Folded Reload
ldur x8, [x29, #-168] // 8-byte Folded Reload
stur w0, [x29, #-24]
ldur x10, [x29, #-56]
ldr x0, [x10, #24]
ldur x10, [x29, #-40]
ldr x1, [x10, #24]
adrp x10, qtrue
ldr w2, [x10, :lo12:qtrue]
ldursw x10, [x29, #-24]
add x3, x9, x10, lsl #3
ldr w8, [x8, :lo12:MAX_SEPERATORS]
lsl w8, w8, #1
ldur w9, [x29, #-24]
subs w4, w8, w9
bl AddSeperators
ldur w8, [x29, #-24]
add w8, w8, w0
stur w8, [x29, #-24]
ldur x8, [x29, #-72]
// kill: def $x9 killed $xzr
str xzr, [x8, #8]
ldur x8, [x29, #-80]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-72]
ldur x9, [x29, #-80]
str x8, [x9, #8]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-72]
ldur x9, [x29, #-40]
str x8, [x9, #48]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-72]
stur x8, [x29, #-80]
stur wzr, [x29, #-28]
stur wzr, [x29, #-12]
b .LBB0_10
.LBB0_10: // Parent Loop BB0_3 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_18 Depth 3
// Child Loop BB0_22 Depth 4
// Child Loop BB0_34 Depth 3
ldur w8, [x29, #-12]
adrp x9, numportals
ldr w9, [x9, :lo12:numportals]
subs w8, w8, w9, lsl #1
cset w8, ge
tbnz w8, #0, .LBB0_45
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_10 Depth=2
adrp x8, portals
ldr x8, [x8, :lo12:portals]
ldursw x9, [x29, #-12]
add x8, x8, x9, lsl #6
stur x8, [x29, #-48]
ldur x8, [x29, #-48]
ldr x8, [x8, #40]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_10 Depth=2
b .LBB0_44
.LBB0_13: // in Loop: Header=BB0_10 Depth=2
ldur x8, [x29, #-56]
ldr x8, [x8, #8]
ldur w9, [x29, #-12]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-12]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_10 Depth=2
b .LBB0_44
.LBB0_15: // in Loop: Header=BB0_10 Depth=2
ldur x8, [x29, #-40]
ldr x8, [x8, #8]
ldur w9, [x29, #-12]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldur w9, [x29, #-12]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_10 Depth=2
b .LBB0_44
.LBB0_17: // in Loop: Header=BB0_10 Depth=2
stur wzr, [x29, #-16]
b .LBB0_18
.LBB0_18: // Parent Loop BB0_3 Depth=1
// Parent Loop BB0_10 Depth=2
// => This Loop Header: Depth=3
// Child Loop BB0_22 Depth 4
ldur w8, [x29, #-16]
ldur w9, [x29, #-24]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_31
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_18 Depth=3
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldur x9, [x29, #-48]
ldr w0, [x9, #32]
ldursw x9, [x29, #-16]
add x8, x8, x9, lsl #3
ldr w1, [x8, #4]
bl DotProduct
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldursw x9, [x29, #-16]
lsl x9, x9, #3
ldr s1, [x8, x9]
fsub s0, s0, s1
stur s0, [x29, #-32]
ldur s0, [x29, #-32]
ldur x8, [x29, #-48]
ldr s1, [x8, #16]
fneg s1, s1
adrp x8, ON_EPSILON
ldr s2, [x8, :lo12:ON_EPSILON]
fadd s1, s1, s2
fcmp s0, s1
cset w8, pl
tbnz w8, #0, .LBB0_21
b .LBB0_20
.LBB0_20: // in Loop: Header=BB0_10 Depth=2
b .LBB0_31
.LBB0_21: // in Loop: Header=BB0_18 Depth=3
ldur x8, [x29, #-48]
ldr x8, [x8, #24]
stur x8, [x29, #-104]
stur wzr, [x29, #-20]
b .LBB0_22
.LBB0_22: // Parent Loop BB0_3 Depth=1
// Parent Loop BB0_10 Depth=2
// Parent Loop BB0_18 Depth=3
// => This Inner Loop Header: Depth=4
ldur w8, [x29, #-20]
ldur x9, [x29, #-104]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_27
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_22 Depth=4
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldur x9, [x29, #-104]
ldr x9, [x9, #8]
ldursw x10, [x29, #-20]
ldr w0, [x9, x10, lsl #2]
ldursw x9, [x29, #-16]
add x8, x8, x9, lsl #3
ldr w1, [x8, #4]
bl DotProduct
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldursw x9, [x29, #-16]
lsl x9, x9, #3
ldr s1, [x8, x9]
fsub s0, s0, s1
stur s0, [x29, #-32]
ldur s0, [x29, #-32]
adrp x8, ON_EPSILON
ldr s1, [x8, :lo12:ON_EPSILON]
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_25
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_18 Depth=3
b .LBB0_27
.LBB0_25: // in Loop: Header=BB0_22 Depth=4
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_22 Depth=4
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_22
.LBB0_27: // in Loop: Header=BB0_18 Depth=3
ldur w8, [x29, #-20]
ldur x9, [x29, #-104]
ldr w9, [x9]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_29
b .LBB0_28
.LBB0_28: // in Loop: Header=BB0_10 Depth=2
b .LBB0_31
.LBB0_29: // in Loop: Header=BB0_18 Depth=3
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_18 Depth=3
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_18
.LBB0_31: // in Loop: Header=BB0_10 Depth=2
ldur w8, [x29, #-16]
ldur w9, [x29, #-24]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_33
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_10 Depth=2
b .LBB0_44
.LBB0_33: // in Loop: Header=BB0_10 Depth=2
ldur x8, [x29, #-48]
ldr x1, [x8, #24]
sub x0, x29, #120
mov w2, #16 // =0x10
bl memcpy
stur wzr, [x29, #-16]
b .LBB0_34
.LBB0_34: // Parent Loop BB0_3 Depth=1
// Parent Loop BB0_10 Depth=2
// => This Inner Loop Header: Depth=3
ldur w8, [x29, #-16]
ldur w9, [x29, #-24]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_41
b .LBB0_35
.LBB0_35: // in Loop: Header=BB0_34 Depth=3
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldursw x9, [x29, #-16]
add x2, x8, x9, lsl #3
sub x0, x29, #120
sub x1, x29, #136
stur x1, [x29, #-184] // 8-byte Folded Spill
bl PassageChopWinding
ldur x9, [x29, #-184] // 8-byte Folded Reload
stur x0, [x29, #-144]
ldur x8, [x29, #-144]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_37
b .LBB0_36
.LBB0_36: // in Loop: Header=BB0_34 Depth=3
sub x0, x29, #120
sub x1, x29, #136
mov w2, #16 // =0x10
bl memcpy
b .LBB0_37
.LBB0_37: // in Loop: Header=BB0_34 Depth=3
ldur x8, [x29, #-144]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_39
b .LBB0_38
.LBB0_38: // in Loop: Header=BB0_10 Depth=2
b .LBB0_41
.LBB0_39: // in Loop: Header=BB0_34 Depth=3
b .LBB0_40
.LBB0_40: // in Loop: Header=BB0_34 Depth=3
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_34
.LBB0_41: // in Loop: Header=BB0_10 Depth=2
ldur w8, [x29, #-16]
ldur w9, [x29, #-24]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_43
b .LBB0_42
.LBB0_42: // in Loop: Header=BB0_10 Depth=2
b .LBB0_44
.LBB0_43: // in Loop: Header=BB0_10 Depth=2
ldur w8, [x29, #-12]
and w9, w8, #0x7
mov w8, #1 // =0x1
lsl w10, w8, w9
ldur x8, [x29, #-72]
ldr x8, [x8]
ldur w9, [x29, #-12]
asr w9, w9, #3
add x9, x8, w9, sxtw #2
ldr w8, [x9]
orr w8, w8, w10
str w8, [x9]
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b .LBB0_44
.LBB0_44: // in Loop: Header=BB0_10 Depth=2
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_10
.LBB0_45: // in Loop: Header=BB0_3 Depth=1
b .LBB0_46
.LBB0_46: // in Loop: Header=BB0_3 Depth=1
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_3
.LBB0_47:
stur wzr, [x29, #-148]
b .LBB0_48
.LBB0_48:
ldur x8, [x29, #-88]
mov sp, x8
// %bb.49:
mov sp, x29
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
// %bb.50:
.Lfunc_end0:
.size CreatePassages, .Lfunc_end0-CreatePassages
.cfi_endproc
// -- End function
.type MAX_SEPERATORS,@object // @MAX_SEPERATORS
.bss
.globl MAX_SEPERATORS
.p2align 2, 0x0
MAX_SEPERATORS:
.word 0 // 0x0
.size MAX_SEPERATORS, 4
.type sorted_portals,@object // @sorted_portals
.globl sorted_portals
.p2align 3, 0x0
sorted_portals:
.xword 0
.size sorted_portals, 8
.type stat_done,@object // @stat_done
.globl stat_done
.p2align 2, 0x0
stat_done:
.word 0 // 0x0
.size stat_done, 4
.type leafs,@object // @leafs
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.type portalbytes,@object // @portalbytes
.globl portalbytes
.p2align 3, 0x0
portalbytes:
.xword 0 // 0x0
.size portalbytes, 8
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type numportals,@object // @numportals
.globl numportals
.p2align 2, 0x0
numportals:
.word 0 // 0x0
.size numportals, 4
.type portals,@object // @portals
.globl portals
.p2align 3, 0x0
portals:
.xword 0
.size portals, 8
.type ON_EPSILON,@object // @ON_EPSILON
.globl ON_EPSILON
.p2align 2, 0x0
ON_EPSILON:
.word 0x00000000 // float 0
.size ON_EPSILON, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym AddSeperators
.addrsig_sym DotProduct
.addrsig_sym memcpy
.addrsig_sym PassageChopWinding
.addrsig_sym MAX_SEPERATORS
.addrsig_sym sorted_portals
.addrsig_sym stat_done
.addrsig_sym leafs
.addrsig_sym portalbytes
.addrsig_sym qfalse
.addrsig_sym qtrue
.addrsig_sym numportals
.addrsig_sym portals
.addrsig_sym ON_EPSILON
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_CreatePassages.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int* vec3_t ;
struct TYPE_7__ {int type; int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_8__ {int* mins; float* maxs; } ;
typedef TYPE_2__ node_t ;
struct TYPE_9__ {size_t planenum; scalar_t__ hint; scalar_t__ priority; int /*<<< orphan*/ w; void* checked; struct TYPE_9__* next; } ;
typedef TYPE_3__ bspface_t ;
/* Variables and functions */
int BLOCK_SIZE ;
int FindFloatPlane (int*,float) ;
int SIDE_BACK ;
int SIDE_CROSS ;
int SIDE_FRONT ;
int /*<<< orphan*/ VectorClear (int*) ;
int WindingOnPlaneSide (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int floor (int) ;
void* hintsplit ;
TYPE_1__* mapplanes ;
void* qfalse ;
void* qtrue ;
int SelectSplitPlaneNum( node_t *node, bspface_t *list ) {
bspface_t *split;
bspface_t *check;
bspface_t *bestSplit;
int splits, facing, front, back;
int side;
plane_t *plane;
int value, bestValue;
int i;
vec3_t normal;
float dist;
int planenum;
hintsplit = qfalse;
// if it is crossing a 1k block boundary, force a split
for ( i = 0 ; i < 2 ; i++ ) {
dist = BLOCK_SIZE * ( floor( node->mins[i] / BLOCK_SIZE ) + 1 );
if ( node->maxs[i] > dist ) {
VectorClear( normal );
normal[i] = 1;
planenum = FindFloatPlane( normal, dist );
return planenum;
}
}
// pick one of the face planes
bestValue = -99999;
bestSplit = list;
for ( split = list ; split ; split = split->next ) {
split->checked = qfalse;
}
for ( split = list ; split ; split = split->next ) {
if ( split->checked ) {
continue;
}
plane = &mapplanes[ split->planenum ];
splits = 0;
facing = 0;
front = 0;
back = 0;
for ( check = list ; check ; check = check->next ) {
if ( check->planenum == split->planenum ) {
facing++;
check->checked = qtrue; // won't need to test this plane again
continue;
}
side = WindingOnPlaneSide( check->w, plane->normal, plane->dist );
if ( side == SIDE_CROSS ) {
splits++;
} else if ( side == SIDE_FRONT ) {
front++;
} else if ( side == SIDE_BACK ) {
back++;
}
}
value = 5*facing - 5*splits; // - abs(front-back);
if ( plane->type < 3 ) {
value+=5; // axial is better
}
value += split->priority; // prioritize hints higher
if ( value > bestValue ) {
bestValue = value;
bestSplit = split;
}
}
if ( bestValue == -99999 ) {
return -1;
}
if (bestSplit->hint)
hintsplit = qtrue;
return bestSplit->planenum;
}
|
.text
.file "extr_facebsp.c_SelectSplitPlaneNum.c"
.globl SelectSplitPlaneNum // -- Begin function SelectSplitPlaneNum
.p2align 2
.type SelectSplitPlaneNum,@function
SelectSplitPlaneNum: // @SelectSplitPlaneNum
.cfi_startproc
// %bb.0:
sub sp, sp, #144
.cfi_def_cfa_offset 144
stp x29, x30, [sp, #128] // 16-byte Folded Spill
add x29, sp, #128
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur x1, [x29, #-24]
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
adrp x9, hintsplit
str x8, [x9, :lo12:hintsplit]
str wzr, [sp, #36]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #36]
subs w8, w8, #2
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x9, BLOCK_SIZE
ldr w8, [x9, :lo12:BLOCK_SIZE]
str w8, [sp, #12] // 4-byte Folded Spill
ldur x8, [x29, #-16]
ldr x8, [x8]
ldrsw x10, [sp, #36]
ldr w8, [x8, x10, lsl #2]
ldr w9, [x9, :lo12:BLOCK_SIZE]
sdiv w0, w8, w9
bl floor
ldr w8, [sp, #12] // 4-byte Folded Reload
add w9, w0, #1
mul w8, w8, w9
scvtf s0, w8
str s0, [sp, #20]
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #36]
ldr s0, [x8, x9, lsl #2]
ldr s1, [sp, #20]
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldr x0, [sp, #24]
bl VectorClear
ldr x9, [sp, #24]
ldrsw x10, [sp, #36]
mov w8, #1 // =0x1
str w8, [x9, x10, lsl #2]
ldr x0, [sp, #24]
ldr s0, [sp, #20]
bl FindFloatPlane
str w0, [sp, #16]
ldr w8, [sp, #16]
stur w8, [x29, #-4]
b .LBB0_39
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #36]
add w8, w8, #1
str w8, [sp, #36]
b .LBB0_1
.LBB0_6:
mov w8, #31073 // =0x7961
movk w8, #65534, lsl #16
str w8, [sp, #40]
ldur x8, [x29, #-24]
stur x8, [x29, #-48]
ldur x8, [x29, #-24]
stur x8, [x29, #-32]
b .LBB0_7
.LBB0_7: // =>This Inner Loop Header: Depth=1
ldur x8, [x29, #-32]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
ldur x9, [x29, #-32]
str x8, [x9, #32]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #40]
stur x8, [x29, #-32]
b .LBB0_7
.LBB0_10:
ldur x8, [x29, #-24]
stur x8, [x29, #-32]
b .LBB0_11
.LBB0_11: // =>This Loop Header: Depth=1
// Child Loop BB0_15 Depth 2
ldur x8, [x29, #-32]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_34
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_11 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_11 Depth=1
b .LBB0_33
.LBB0_14: // in Loop: Header=BB0_11 Depth=1
adrp x8, mapplanes
ldr x8, [x8, :lo12:mapplanes]
ldur x9, [x29, #-32]
ldr x9, [x9]
mov x10, #12 // =0xc
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #48]
stur wzr, [x29, #-52]
stur wzr, [x29, #-56]
stur wzr, [x29, #-60]
str wzr, [sp, #64]
ldur x8, [x29, #-24]
stur x8, [x29, #-40]
b .LBB0_15
.LBB0_15: // Parent Loop BB0_11 Depth=1
// => This Inner Loop Header: Depth=2
ldur x8, [x29, #-40]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_28
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_15 Depth=2
ldur x8, [x29, #-40]
ldr x8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_18
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_15 Depth=2
ldur w8, [x29, #-56]
add w8, w8, #1
stur w8, [x29, #-56]
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldur x9, [x29, #-40]
str x8, [x9, #32]
b .LBB0_27
.LBB0_18: // in Loop: Header=BB0_15 Depth=2
ldur x8, [x29, #-40]
ldr w0, [x8, #24]
ldr x8, [sp, #48]
ldr w1, [x8, #8]
ldr x8, [sp, #48]
ldr w2, [x8, #4]
bl WindingOnPlaneSide
str w0, [sp, #60]
ldr w8, [sp, #60]
adrp x9, SIDE_CROSS
ldr w9, [x9, :lo12:SIDE_CROSS]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_15 Depth=2
ldur w8, [x29, #-52]
add w8, w8, #1
stur w8, [x29, #-52]
b .LBB0_26
.LBB0_20: // in Loop: Header=BB0_15 Depth=2
ldr w8, [sp, #60]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_15 Depth=2
ldur w8, [x29, #-60]
add w8, w8, #1
stur w8, [x29, #-60]
b .LBB0_25
.LBB0_22: // in Loop: Header=BB0_15 Depth=2
ldr w8, [sp, #60]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_24
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_15 Depth=2
ldr w8, [sp, #64]
add w8, w8, #1
str w8, [sp, #64]
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_15 Depth=2
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_15 Depth=2
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_15 Depth=2
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_15 Depth=2
ldur x8, [x29, #-40]
ldr x8, [x8, #40]
stur x8, [x29, #-40]
b .LBB0_15
.LBB0_28: // in Loop: Header=BB0_11 Depth=1
ldur w8, [x29, #-56]
mov w9, #5 // =0x5
mul w8, w9, w8
ldur w10, [x29, #-52]
mul w9, w9, w10
subs w8, w8, w9
str w8, [sp, #44]
ldr x8, [sp, #48]
ldr w8, [x8]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_30
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #44]
add w8, w8, #5
str w8, [sp, #44]
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_11 Depth=1
ldur x8, [x29, #-32]
ldr x9, [x8, #16]
ldrsw x8, [sp, #44]
add x8, x8, x9
// kill: def $w8 killed $w8 killed $x8
str w8, [sp, #44]
ldr w8, [sp, #44]
ldr w9, [sp, #40]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, .LBB0_32
b .LBB0_31
.LBB0_31: // in Loop: Header=BB0_11 Depth=1
ldr w8, [sp, #44]
str w8, [sp, #40]
ldur x8, [x29, #-32]
stur x8, [x29, #-48]
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_11 Depth=1
b .LBB0_33
.LBB0_33: // in Loop: Header=BB0_11 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #40]
stur x8, [x29, #-32]
b .LBB0_11
.LBB0_34:
ldr w8, [sp, #40]
mov w9, #31073 // =0x7961
movk w9, #65534, lsl #16
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_36
b .LBB0_35
.LBB0_35:
mov w8, #-1 // =0xffffffff
stur w8, [x29, #-4]
b .LBB0_39
.LBB0_36:
ldur x8, [x29, #-48]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_38
b .LBB0_37
.LBB0_37:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
adrp x9, hintsplit
str x8, [x9, :lo12:hintsplit]
b .LBB0_38
.LBB0_38:
ldur x8, [x29, #-48]
ldr x8, [x8]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_39
.LBB0_39:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 144
ldp x29, x30, [sp, #128] // 16-byte Folded Reload
add sp, sp, #144
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size SelectSplitPlaneNum, .Lfunc_end0-SelectSplitPlaneNum
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 3, 0x0
qfalse:
.xword 0
.size qfalse, 8
.type hintsplit,@object // @hintsplit
.globl hintsplit
.p2align 3, 0x0
hintsplit:
.xword 0
.size hintsplit, 8
.type BLOCK_SIZE,@object // @BLOCK_SIZE
.globl BLOCK_SIZE
.p2align 2, 0x0
BLOCK_SIZE:
.word 0 // 0x0
.size BLOCK_SIZE, 4
.type mapplanes,@object // @mapplanes
.globl mapplanes
.p2align 3, 0x0
mapplanes:
.xword 0
.size mapplanes, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0
.size qtrue, 8
.type SIDE_CROSS,@object // @SIDE_CROSS
.globl SIDE_CROSS
.p2align 2, 0x0
SIDE_CROSS:
.word 0 // 0x0
.size SIDE_CROSS, 4
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym floor
.addrsig_sym VectorClear
.addrsig_sym FindFloatPlane
.addrsig_sym WindingOnPlaneSide
.addrsig_sym qfalse
.addrsig_sym hintsplit
.addrsig_sym BLOCK_SIZE
.addrsig_sym mapplanes
.addrsig_sym qtrue
.addrsig_sym SIDE_CROSS
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
|
../AnghaBench/Quake-III-Arena/q3map/extr_facebsp.c_SelectSplitPlaneNum.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_3__ {int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * baseaxis ;
void TextureAxisFromPlane(plane_t *pln, vec3_t xv, vec3_t yv)
{
int bestaxis;
vec_t dot,best;
int i;
best = 0;
bestaxis = 0;
for (i=0 ; i<6 ; i++)
{
dot = DotProduct (pln->normal, baseaxis[i*3]);
if (dot > best)
{
best = dot;
bestaxis = i;
}
}
VectorCopy (baseaxis[bestaxis*3+1], xv);
VectorCopy (baseaxis[bestaxis*3+2], yv);
}
|
.text
.file "extr_map.c_TextureAxisFromPlane.c"
.globl TextureAxisFromPlane // -- Begin function TextureAxisFromPlane
.p2align 2
.type TextureAxisFromPlane,@function
TextureAxisFromPlane: // @TextureAxisFromPlane
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur w2, [x29, #-16]
str xzr, [sp, #24]
stur wzr, [x29, #-20]
str wzr, [sp, #20]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #20]
subs w8, w8, #6
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-8]
ldr w0, [x8]
adrp x8, baseaxis
ldr x8, [x8, :lo12:baseaxis]
ldr w9, [sp, #20]
mov w10, #3 // =0x3
mul w9, w9, w10
ldr w1, [x8, w9, sxtw #2]
bl DotProduct
str x0, [sp, #32]
ldr x8, [sp, #32]
ldr x9, [sp, #24]
subs x8, x8, x9
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
str x8, [sp, #24]
ldr w8, [sp, #20]
stur w8, [x29, #-20]
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #20]
add w8, w8, #1
str w8, [sp, #20]
b .LBB0_1
.LBB0_6:
adrp x8, baseaxis
str x8, [sp, #8] // 8-byte Folded Spill
ldr x8, [x8, :lo12:baseaxis]
ldur w9, [x29, #-20]
mov w10, #3 // =0x3
str w10, [sp, #16] // 4-byte Folded Spill
mul w9, w9, w10
add w9, w9, #1
ldr w0, [x8, w9, sxtw #2]
ldur w1, [x29, #-12]
bl VectorCopy
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr w10, [sp, #16] // 4-byte Folded Reload
ldr x8, [x8, :lo12:baseaxis]
ldur w9, [x29, #-20]
mul w9, w9, w10
add w9, w9, #2
ldr w0, [x8, w9, sxtw #2]
ldur w1, [x29, #-16]
bl VectorCopy
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size TextureAxisFromPlane, .Lfunc_end0-TextureAxisFromPlane
.cfi_endproc
// -- End function
.type baseaxis,@object // @baseaxis
.bss
.globl baseaxis
.p2align 3, 0x0
baseaxis:
.xword 0
.size baseaxis, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym DotProduct
.addrsig_sym VectorCopy
.addrsig_sym baseaxis
|
../AnghaBench/Quake-III-Arena/q3map/extr_map.c_TextureAxisFromPlane.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
void GLS_BeginScene (void)
{
}
|
.text
.file "extr_nodraw.c_GLS_BeginScene.c"
.globl GLS_BeginScene // -- Begin function GLS_BeginScene
.p2align 2
.type GLS_BeginScene,@function
GLS_BeginScene: // @GLS_BeginScene
.cfi_startproc
// %bb.0:
ret
.Lfunc_end0:
.size GLS_BeginScene, .Lfunc_end0-GLS_BeginScene
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
|
../AnghaBench/Quake-III-Arena/q3map/extr_nodraw.c_GLS_BeginScene.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_21__ TYPE_8__ ;
typedef struct TYPE_20__ TYPE_4__ ;
typedef struct TYPE_19__ TYPE_3__ ;
typedef struct TYPE_18__ TYPE_2__ ;
typedef struct TYPE_17__ TYPE_1__ ;
/* Type definitions */
struct TYPE_17__ {int contents; int surfaceFlags; scalar_t__ forceVLight; scalar_t__ forceTraceLight; } ;
typedef TYPE_1__ shaderInfo_t ;
struct TYPE_18__ {int numFacets; int /*<<< orphan*/ radius; int /*<<< orphan*/ origin; int /*<<< orphan*/ maxs; int /*<<< orphan*/ mins; TYPE_3__* facets; void* always_vsound; void* always_tracelight; scalar_t__ numvolumes; int /*<<< orphan*/ mutex; } ;
typedef TYPE_2__ lsurfaceTest_t ;
struct TYPE_19__ {int numpoints; int /*<<< orphan*/ * points; } ;
typedef TYPE_3__ lFacet_t ;
struct TYPE_20__ {size_t shaderNum; scalar_t__ lightmapNum; scalar_t__ surfaceType; int /*<<< orphan*/ patchWidth; int /*<<< orphan*/ numIndexes; } ;
typedef TYPE_4__ dsurface_t ;
struct TYPE_21__ {int /*<<< orphan*/ shader; } ;
/* Variables and functions */
int /*<<< orphan*/ AddPointToBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int CONTENTS_TRANSLUCENT ;
int /*<<< orphan*/ ClearBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Error (char*,scalar_t__) ;
scalar_t__ MAX_FACETS ;
scalar_t__ MST_PATCH ;
scalar_t__ MST_PLANAR ;
scalar_t__ MST_TRIANGLE_SOUP ;
int /*<<< orphan*/ MutexAlloc () ;
int SURF_ALPHASHADOW ;
TYPE_1__* ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VS_FacetsForPatch (TYPE_4__*,int,TYPE_1__*,TYPE_2__*) ;
int /*<<< orphan*/ VS_FacetsForTriangleSurface (TYPE_4__*,TYPE_1__*,TYPE_2__*) ;
int /*<<< orphan*/ VS_LinkSurfaces () ;
int /*<<< orphan*/ VS_SphereFromBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ _printf (char*,...) ;
TYPE_4__* drawSurfaces ;
TYPE_8__* dshaders ;
scalar_t__* entitySurface ;
TYPE_2__** lsurfaceTest ;
TYPE_2__* malloc (int) ;
int /*<<< orphan*/ memset (TYPE_2__*,int /*<<< orphan*/ ,int) ;
int numDrawSurfaces ;
scalar_t__ numfacets ;
void* qtrue ;
void VS_InitSurfacesForTesting( void ) {
int i, j, k;
dsurface_t *dsurf;
lsurfaceTest_t *test;
shaderInfo_t *si;
lFacet_t *facet;
for ( i = 0 ; i < numDrawSurfaces ; i++ ) {
// don't light the entity surfaces with vsound
if ( entitySurface[i] )
continue;
//
dsurf = &drawSurfaces[ i ];
if ( !dsurf->numIndexes && !dsurf->patchWidth ) {
continue;
}
si = ShaderInfoForShader( dshaders[ dsurf->shaderNum].shader );
// if the surface is translucent and does not cast an alpha shadow
if ( (si->contents & CONTENTS_TRANSLUCENT) && !(si->surfaceFlags & SURF_ALPHASHADOW) ) {
// if the surface has no lightmap
if ( dsurf->lightmapNum < 0 )
continue;
}
test = malloc( sizeof( *test ) );
memset(test, 0, sizeof( *test ));
test->mutex = MutexAlloc();
test->numvolumes = 0;
if (si->forceTraceLight)
test->always_tracelight = qtrue;
else if (si->forceVLight)
test->always_vsound = qtrue;
lsurfaceTest[i] = test;
if ( dsurf->surfaceType == MST_TRIANGLE_SOUP || dsurf->surfaceType == MST_PLANAR ) {
VS_FacetsForTriangleSurface( dsurf, si, test );
} else if ( dsurf->surfaceType == MST_PATCH ) {
VS_FacetsForPatch( dsurf, i, si, test );
}
if (numfacets >= MAX_FACETS)
Error("numfacets >= MAX_FACETS (%d)", MAX_FACETS);
ClearBounds( test->mins, test->maxs );
for (j = 0; j < test->numFacets; j++)
{
facet = &test->facets[j];
for ( k = 0 ; k < facet->numpoints; k++) {
AddPointToBounds( facet->points[k], test->mins, test->maxs );
}
}
VS_SphereFromBounds( test->mins, test->maxs, test->origin, &test->radius );
}
_printf("%6d facets\n", numfacets);
_printf("linking surfaces...\n");
VS_LinkSurfaces();
}
|
.text
.file "extr_soundv.c_VS_InitSurfacesForTesting.c"
.globl VS_InitSurfacesForTesting // -- Begin function VS_InitSurfacesForTesting
.p2align 2
.type VS_InitSurfacesForTesting,@function
VS_InitSurfacesForTesting: // @VS_InitSurfacesForTesting
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_26 Depth 2
// Child Loop BB0_28 Depth 3
ldur w8, [x29, #-4]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_35
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, entitySurface
ldr x8, [x8, :lo12:entitySurface]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_34
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #5
stur x8, [x29, #-24]
ldur x8, [x29, #-24]
ldr w8, [x8, #28]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr w8, [x8, #24]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
b .LBB0_34
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
adrp x8, dshaders
ldr x8, [x8, :lo12:dshaders]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldr w0, [x8, x9, lsl #2]
bl ShaderInfoForShader
str x0, [sp, #24]
ldr x8, [sp, #24]
ldr w8, [x8]
adrp x9, CONTENTS_TRANSLUCENT
ldr w9, [x9, :lo12:CONTENTS_TRANSLUCENT]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w8, [x8, #4]
adrp x9, SURF_ALPHASHADOW
ldr w9, [x9, :lo12:SURF_ALPHASHADOW]
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_12
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, ge
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_34
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
mov w0, #64 // =0x40
str w0, [sp, #12] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #12] // 4-byte Folded Reload
str x0, [sp, #32]
ldr x0, [sp, #32]
mov w1, wzr
bl memset
bl MutexAlloc
ldr x8, [sp, #32]
str w0, [x8, #56]
ldr x8, [sp, #32]
str xzr, [x8, #48]
ldr x8, [sp, #24]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldr x9, [sp, #32]
str x8, [x9, #40]
b .LBB0_17
.LBB0_14: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_1 Depth=1
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldr x9, [sp, #32]
str x8, [x9, #32]
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_1 Depth=1
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
adrp x9, lsurfaceTest
ldr x9, [x9, :lo12:lsurfaceTest]
ldursw x10, [x29, #-4]
str x8, [x9, x10, lsl #3]
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
adrp x9, MST_TRIANGLE_SOUP
ldr x9, [x9, :lo12:MST_TRIANGLE_SOUP]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, .LBB0_19
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
adrp x9, MST_PLANAR
ldr x9, [x9, :lo12:MST_PLANAR]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-24]
ldr x1, [sp, #24]
ldr x2, [sp, #32]
bl VS_FacetsForTriangleSurface
b .LBB0_23
.LBB0_20: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
adrp x9, MST_PATCH
ldr x9, [x9, :lo12:MST_PATCH]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-24]
ldur w1, [x29, #-4]
ldr x2, [sp, #24]
ldr x3, [sp, #32]
bl VS_FacetsForPatch
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_1 Depth=1
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_1 Depth=1
adrp x8, numfacets
ldr x8, [x8, :lo12:numfacets]
adrp x9, MAX_FACETS
ldr x9, [x9, :lo12:MAX_FACETS]
subs x8, x8, x9
cset w8, lt
tbnz w8, #0, .LBB0_25
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_1 Depth=1
adrp x8, MAX_FACETS
ldr x1, [x8, :lo12:MAX_FACETS]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
ldr w0, [x8, #16]
ldr x8, [sp, #32]
ldr w1, [x8, #12]
bl ClearBounds
stur wzr, [x29, #-8]
b .LBB0_26
.LBB0_26: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_28 Depth 3
ldur w8, [x29, #-8]
ldr x9, [sp, #32]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_33
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_26 Depth=2
ldr x8, [sp, #32]
ldr x8, [x8, #24]
ldursw x9, [x29, #-8]
add x8, x8, x9, lsl #4
str x8, [sp, #16]
stur wzr, [x29, #-12]
b .LBB0_28
.LBB0_28: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_26 Depth=2
// => This Inner Loop Header: Depth=3
ldur w8, [x29, #-12]
ldr x9, [sp, #16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_31
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_28 Depth=3
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-12]
ldr w0, [x8, x9, lsl #2]
ldr x8, [sp, #32]
ldr w1, [x8, #16]
ldr x8, [sp, #32]
ldr w2, [x8, #12]
bl AddPointToBounds
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_28 Depth=3
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_28
.LBB0_31: // in Loop: Header=BB0_26 Depth=2
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_26 Depth=2
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_26
.LBB0_33: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
ldr w0, [x8, #16]
ldr x8, [sp, #32]
ldr w1, [x8, #12]
ldr x8, [sp, #32]
ldr w2, [x8, #8]
ldr x8, [sp, #32]
add x3, x8, #4
bl VS_SphereFromBounds
b .LBB0_34
.LBB0_34: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_1
.LBB0_35:
adrp x8, numfacets
ldr x1, [x8, :lo12:numfacets]
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
bl VS_LinkSurfaces
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_InitSurfacesForTesting, .Lfunc_end0-VS_InitSurfacesForTesting
.cfi_endproc
// -- End function
.type numDrawSurfaces,@object // @numDrawSurfaces
.bss
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type entitySurface,@object // @entitySurface
.globl entitySurface
.p2align 3, 0x0
entitySurface:
.xword 0
.size entitySurface, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type dshaders,@object // @dshaders
.globl dshaders
.p2align 3, 0x0
dshaders:
.xword 0
.size dshaders, 8
.type CONTENTS_TRANSLUCENT,@object // @CONTENTS_TRANSLUCENT
.globl CONTENTS_TRANSLUCENT
.p2align 2, 0x0
CONTENTS_TRANSLUCENT:
.word 0 // 0x0
.size CONTENTS_TRANSLUCENT, 4
.type SURF_ALPHASHADOW,@object // @SURF_ALPHASHADOW
.globl SURF_ALPHASHADOW
.p2align 2, 0x0
SURF_ALPHASHADOW:
.word 0 // 0x0
.size SURF_ALPHASHADOW, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0
.size qtrue, 8
.type lsurfaceTest,@object // @lsurfaceTest
.globl lsurfaceTest
.p2align 3, 0x0
lsurfaceTest:
.xword 0
.size lsurfaceTest, 8
.type MST_TRIANGLE_SOUP,@object // @MST_TRIANGLE_SOUP
.globl MST_TRIANGLE_SOUP
.p2align 3, 0x0
MST_TRIANGLE_SOUP:
.xword 0 // 0x0
.size MST_TRIANGLE_SOUP, 8
.type MST_PLANAR,@object // @MST_PLANAR
.globl MST_PLANAR
.p2align 3, 0x0
MST_PLANAR:
.xword 0 // 0x0
.size MST_PLANAR, 8
.type MST_PATCH,@object // @MST_PATCH
.globl MST_PATCH
.p2align 3, 0x0
MST_PATCH:
.xword 0 // 0x0
.size MST_PATCH, 8
.type numfacets,@object // @numfacets
.globl numfacets
.p2align 3, 0x0
numfacets:
.xword 0 // 0x0
.size numfacets, 8
.type MAX_FACETS,@object // @MAX_FACETS
.globl MAX_FACETS
.p2align 3, 0x0
MAX_FACETS:
.xword 0 // 0x0
.size MAX_FACETS, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "numfacets >= MAX_FACETS (%d)"
.size .L.str, 29
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "%6d facets\n"
.size .L.str.1, 12
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "linking surfaces...\n"
.size .L.str.2, 21
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym ShaderInfoForShader
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym MutexAlloc
.addrsig_sym VS_FacetsForTriangleSurface
.addrsig_sym VS_FacetsForPatch
.addrsig_sym Error
.addrsig_sym ClearBounds
.addrsig_sym AddPointToBounds
.addrsig_sym VS_SphereFromBounds
.addrsig_sym _printf
.addrsig_sym VS_LinkSurfaces
.addrsig_sym numDrawSurfaces
.addrsig_sym entitySurface
.addrsig_sym drawSurfaces
.addrsig_sym dshaders
.addrsig_sym CONTENTS_TRANSLUCENT
.addrsig_sym SURF_ALPHASHADOW
.addrsig_sym qtrue
.addrsig_sym lsurfaceTest
.addrsig_sym MST_TRIANGLE_SOUP
.addrsig_sym MST_PLANAR
.addrsig_sym MST_PATCH
.addrsig_sym numfacets
.addrsig_sym MAX_FACETS
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_InitSurfacesForTesting.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_16__ TYPE_2__ ;
typedef struct TYPE_15__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ shaderInfo_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_15__ {int numpoints; int /*<<< orphan*/ * points; int /*<<< orphan*/ plane; int /*<<< orphan*/ * boundaries; int /*<<< orphan*/ ** lightmapCoords; scalar_t__ num; } ;
typedef TYPE_1__ lFacet_t ;
typedef int /*<<< orphan*/ dsurface_t ;
struct TYPE_16__ {int /*<<< orphan*/ * lightmap; int /*<<< orphan*/ xyz; } ;
typedef TYPE_2__ drawVert_t ;
/* Variables and functions */
int /*<<< orphan*/ VL_GenerateBoundaryForPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_LightmapMatrixFromPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,TYPE_2__*,TYPE_2__*,TYPE_2__*) ;
int /*<<< orphan*/ VL_PlaneFromPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_TextureMatrixFromPoints (TYPE_1__*,TYPE_2__*,TYPE_2__*,TYPE_2__*) ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
double VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * drawSurfaces ;
int /*<<< orphan*/ numfacets ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ * surfaceOrigin ;
qboolean VL_GenerateFacetFor3Points( dsurface_t *dsurf, shaderInfo_t *si, lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c ) {
//
vec3_t dir;
int i;
// if we can't generate a valid plane for the points, ignore the facet
if ( !VL_PlaneFromPoints( &f->plane, a->xyz, b->xyz, c->xyz ) ) {
f->numpoints = 0;
return qfalse;
}
f->num = numfacets++;
VectorAdd( a->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[0] );
VectorAdd( b->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[1] );
VectorAdd( c->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[2] );
f->lightmapCoords[0][0] = a->lightmap[0];
f->lightmapCoords[0][1] = a->lightmap[1];
f->lightmapCoords[1][0] = b->lightmap[0];
f->lightmapCoords[1][1] = b->lightmap[1];
f->lightmapCoords[2][0] = c->lightmap[0];
f->lightmapCoords[2][1] = c->lightmap[1];
VL_GenerateBoundaryForPoints( &f->boundaries[0], &f->plane, f->points[0], f->points[1] );
VL_GenerateBoundaryForPoints( &f->boundaries[1], &f->plane, f->points[1], f->points[2] );
VL_GenerateBoundaryForPoints( &f->boundaries[2], &f->plane, f->points[2], f->points[0] );
for (i = 0; i < 3; i++)
{
VectorSubtract(f->points[(i+1)%3], f->points[i], dir);
if (VectorLength(dir) < 0.1)
return qfalse;
}
VL_TextureMatrixFromPoints( f, a, b, c );
VL_LightmapMatrixFromPoints( dsurf, si, f, a, b, c );
f->numpoints = 3;
return qtrue;
}
|
.text
.file "extr_lightv.c_VL_GenerateFacetFor3Points.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_GenerateFacetFor3Points
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_GenerateFacetFor3Points
.p2align 2
.type VL_GenerateFacetFor3Points,@function
VL_GenerateFacetFor3Points: // @VL_GenerateFacetFor3Points
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
stur x3, [x29, #-40]
str x4, [sp, #48]
str x5, [sp, #40]
ldur x8, [x29, #-32]
ldur x9, [x29, #-40]
ldr w1, [x9, #8]
ldr x9, [sp, #48]
ldr w2, [x9, #8]
ldr x9, [sp, #40]
ldr w3, [x9, #8]
add x0, x8, #16
bl VL_PlaneFromPoints
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-32]
str wzr, [x8]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_2:
adrp x10, numfacets
ldrsw x8, [x10, :lo12:numfacets]
mov w9, w8
add w9, w9, #1
str w9, [x10, :lo12:numfacets]
ldur x9, [x29, #-32]
str x8, [x9, #40]
ldur x8, [x29, #-40]
ldr w0, [x8, #8]
adrp x8, surfaceOrigin
str x8, [sp, #8] // 8-byte Folded Spill
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
adrp x10, drawSurfaces
str x10, [sp, #16] // 8-byte Folded Spill
ldr x10, [x10, :lo12:drawSurfaces]
subs x9, x9, x10
mov x10, #4 // =0x4
str x10, [sp, #24] // 8-byte Folded Spill
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8]
bl VectorAdd
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x11, [sp, #16] // 8-byte Folded Reload
ldr x10, [sp, #24] // 8-byte Folded Reload
ldr x9, [sp, #48]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #4]
bl VectorAdd
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x11, [sp, #16] // 8-byte Folded Reload
ldr x10, [sp, #24] // 8-byte Folded Reload
ldr x9, [sp, #40]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #8]
bl VectorAdd
ldur x8, [x29, #-40]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9]
str w8, [x9]
ldur x8, [x29, #-40]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9]
str w8, [x9, #4]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #8]
str w8, [x9]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #8]
str w8, [x9, #4]
ldr x8, [sp, #40]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #16]
str w8, [x9]
ldr x8, [sp, #40]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #16]
str w8, [x9, #4]
ldur x8, [x29, #-32]
ldr x0, [x8, #24]
ldur x8, [x29, #-32]
add x1, x8, #16
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w3, [x8, #4]
bl VL_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #24]
add x0, x8, #4
ldur x8, [x29, #-32]
add x1, x8, #16
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #4]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w3, [x8, #8]
bl VL_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #24]
add x0, x8, #8
ldur x8, [x29, #-32]
add x1, x8, #16
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #8]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w3, [x8]
bl VL_GenerateBoundaryForPoints
str wzr, [sp, #32]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #32]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w9, [sp, #32]
add w9, w9, #1
mov w11, #3 // =0x3
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr w0, [x8, w9, sxtw #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldrsw x9, [sp, #32]
ldr w1, [x8, x9, lsl #2]
ldr w2, [sp, #36]
bl VectorSubtract
ldr w0, [sp, #36]
bl VectorLength
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #32]
add w8, w8, #1
str w8, [sp, #32]
b .LBB0_3
.LBB0_8:
ldur x0, [x29, #-32]
ldur x1, [x29, #-40]
ldr x2, [sp, #48]
ldr x3, [sp, #40]
bl VL_TextureMatrixFromPoints
ldur x0, [x29, #-16]
ldur x1, [x29, #-24]
ldur x2, [x29, #-32]
ldur x3, [x29, #-40]
ldr x4, [sp, #48]
ldr x5, [sp, #40]
bl VL_LightmapMatrixFromPoints
ldur x9, [x29, #-32]
mov w8, #3 // =0x3
str w8, [x9]
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_9:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_GenerateFacetFor3Points, .Lfunc_end0-VL_GenerateFacetFor3Points
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type numfacets,@object // @numfacets
.globl numfacets
.p2align 2, 0x0
numfacets:
.word 0 // 0x0
.size numfacets, 4
.type surfaceOrigin,@object // @surfaceOrigin
.globl surfaceOrigin
.p2align 3, 0x0
surfaceOrigin:
.xword 0
.size surfaceOrigin, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VL_PlaneFromPoints
.addrsig_sym VectorAdd
.addrsig_sym VL_GenerateBoundaryForPoints
.addrsig_sym VectorSubtract
.addrsig_sym VectorLength
.addrsig_sym VL_TextureMatrixFromPoints
.addrsig_sym VL_LightmapMatrixFromPoints
.addrsig_sym qfalse
.addrsig_sym numfacets
.addrsig_sym surfaceOrigin
.addrsig_sym drawSurfaces
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_GenerateFacetFor3Points.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int /*<<< orphan*/ forceTraceLight; scalar_t__ forceVLight; } ;
typedef TYPE_1__ shaderInfo_t ;
struct TYPE_7__ {scalar_t__ surfaceType; scalar_t__ lightmapNum; size_t shaderNum; } ;
typedef TYPE_2__ dsurface_t ;
struct TYPE_8__ {int /*<<< orphan*/ shader; } ;
/* Variables and functions */
scalar_t__ MST_TRIANGLE_SOUP ;
TYPE_1__* ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ TraceLtm (int) ;
scalar_t__ defaulttracelight ;
TYPE_2__* drawSurfaces ;
TYPE_3__* dshaders ;
int /*<<< orphan*/ * entitySurface ;
void VL_DoForcedTraceLight(int num)
{
dsurface_t *ds;
shaderInfo_t *si;
ds = &drawSurfaces[num];
if ( ds->surfaceType == MST_TRIANGLE_SOUP )
return;
if ( ds->lightmapNum < 0 )
return;
// always light entity surfaces with the old light algorithm
if ( !entitySurface[num] )
{
si = ShaderInfoForShader( dshaders[ ds->shaderNum].shader );
if (defaulttracelight)
{
if (si->forceVLight)
return;
}
else
{
if (!si->forceTraceLight)
return;
}
}
TraceLtm(num);
}
|
.text
.file "extr_lightv.c_VL_DoForcedTraceLight.c"
.globl VL_DoForcedTraceLight // -- Begin function VL_DoForcedTraceLight
.p2align 2
.type VL_DoForcedTraceLight,@function
VL_DoForcedTraceLight: // @VL_DoForcedTraceLight
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur w0, [x29, #-4]
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldursw x9, [x29, #-4]
mov x10, #24 // =0x18
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #16]
ldr x8, [sp, #16]
ldr x8, [x8]
adrp x9, MST_TRIANGLE_SOUP
ldr x9, [x9, :lo12:MST_TRIANGLE_SOUP]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_14
.LBB0_2:
ldr x8, [sp, #16]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
b .LBB0_14
.LBB0_4:
adrp x8, entitySurface
ldr x8, [x8, :lo12:entitySurface]
ldursw x9, [x29, #-4]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_5
.LBB0_5:
adrp x8, dshaders
ldr x8, [x8, :lo12:dshaders]
ldr x9, [sp, #16]
ldr x9, [x9, #16]
ldr w0, [x8, x9, lsl #2]
bl ShaderInfoForShader
str x0, [sp, #8]
adrp x8, defaulttracelight
ldr x8, [x8, :lo12:defaulttracelight]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_9
b .LBB0_6
.LBB0_6:
ldr x8, [sp, #8]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
b .LBB0_14
.LBB0_8:
b .LBB0_12
.LBB0_9:
ldr x8, [sp, #8]
ldr w8, [x8]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10:
b .LBB0_14
.LBB0_11:
b .LBB0_12
.LBB0_12:
b .LBB0_13
.LBB0_13:
ldur w0, [x29, #-4]
bl TraceLtm
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_DoForcedTraceLight, .Lfunc_end0-VL_DoForcedTraceLight
.cfi_endproc
// -- End function
.type drawSurfaces,@object // @drawSurfaces
.bss
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type MST_TRIANGLE_SOUP,@object // @MST_TRIANGLE_SOUP
.globl MST_TRIANGLE_SOUP
.p2align 3, 0x0
MST_TRIANGLE_SOUP:
.xword 0 // 0x0
.size MST_TRIANGLE_SOUP, 8
.type entitySurface,@object // @entitySurface
.globl entitySurface
.p2align 3, 0x0
entitySurface:
.xword 0
.size entitySurface, 8
.type dshaders,@object // @dshaders
.globl dshaders
.p2align 3, 0x0
dshaders:
.xword 0
.size dshaders, 8
.type defaulttracelight,@object // @defaulttracelight
.globl defaulttracelight
.p2align 3, 0x0
defaulttracelight:
.xword 0 // 0x0
.size defaulttracelight, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym ShaderInfoForShader
.addrsig_sym TraceLtm
.addrsig_sym drawSurfaces
.addrsig_sym MST_TRIANGLE_SOUP
.addrsig_sym entitySurface
.addrsig_sym dshaders
.addrsig_sym defaulttracelight
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_DoForcedTraceLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ shaderInfo_t ;
struct TYPE_7__ {int numFacets; int /*<<< orphan*/ * facets; int /*<<< orphan*/ * shader; void* trisoup; void* patch; } ;
typedef TYPE_1__ lsurfaceTest_t ;
struct TYPE_8__ {scalar_t__ surfaceType; int numIndexes; int firstIndex; int firstVert; } ;
typedef TYPE_2__ dsurface_t ;
typedef int /*<<< orphan*/ drawVert_t ;
/* Variables and functions */
scalar_t__ MST_TRIANGLE_SOUP ;
scalar_t__ VL_GenerateFacetFor3Points (TYPE_2__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
scalar_t__ VL_GenerateFacetFor4Points (TYPE_2__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int* drawIndexes ;
int /*<<< orphan*/ * drawVerts ;
int /*<<< orphan*/ * malloc (int) ;
void* qfalse ;
void* qtrue ;
void VL_FacetsForTriangleSurface( dsurface_t *dsurf, shaderInfo_t *si, lsurfaceTest_t *test ) {
int i;
drawVert_t *v1, *v2, *v3, *v4;
int count;
int i1, i2, i3, i4, i5, i6;
test->patch = qfalse;
if (dsurf->surfaceType == MST_TRIANGLE_SOUP)
test->trisoup = qtrue;
else
test->trisoup = qfalse;
test->numFacets = dsurf->numIndexes / 3;
test->facets = malloc( sizeof( test->facets[0] ) * test->numFacets );
test->shader = si;
count = 0;
for ( i = 0 ; i < test->numFacets ; i++ ) {
i1 = drawIndexes[ dsurf->firstIndex + i*3 ];
i2 = drawIndexes[ dsurf->firstIndex + i*3 + 1 ];
i3 = drawIndexes[ dsurf->firstIndex + i*3 + 2 ];
v1 = &drawVerts[ dsurf->firstVert + i1 ];
v2 = &drawVerts[ dsurf->firstVert + i2 ];
v3 = &drawVerts[ dsurf->firstVert + i3 ];
// try and make a quad out of two triangles
if ( i != test->numFacets - 1 ) {
i4 = drawIndexes[ dsurf->firstIndex + i*3 + 3 ];
i5 = drawIndexes[ dsurf->firstIndex + i*3 + 4 ];
i6 = drawIndexes[ dsurf->firstIndex + i*3 + 5 ];
if ( i4 == i3 && i5 == i2 ) {
v4 = &drawVerts[ dsurf->firstVert + i6 ];
if ( VL_GenerateFacetFor4Points( dsurf, si, &test->facets[count], v1, v2, v4, v3 ) ) {
count++;
i++; // skip next tri
continue;
}
}
}
if (VL_GenerateFacetFor3Points( dsurf, si, &test->facets[count], v1, v2, v3 )) {
count++;
}
}
// we may have turned some pairs into quads
test->numFacets = count;
}
|
.text
.file "extr_lightv.c_VL_FacetsForTriangleSurface.c"
.globl VL_FacetsForTriangleSurface // -- Begin function VL_FacetsForTriangleSurface
.p2align 2
.type VL_FacetsForTriangleSurface,@function
VL_FacetsForTriangleSurface: // @VL_FacetsForTriangleSurface
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
ldur x9, [x29, #-24]
str x8, [x9, #32]
ldur x8, [x29, #-8]
ldr x8, [x8]
adrp x9, MST_TRIANGLE_SOUP
ldr x9, [x9, :lo12:MST_TRIANGLE_SOUP]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldur x9, [x29, #-24]
str x8, [x9, #24]
b .LBB0_3
.LBB0_2:
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
ldur x9, [x29, #-24]
str x8, [x9, #24]
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-8]
ldr w8, [x8, #8]
mov w9, #3 // =0x3
sdiv w8, w8, w9
ldur x9, [x29, #-24]
str w8, [x9]
ldur x8, [x29, #-24]
ldrsw x9, [x8]
mov x8, #4 // =0x4
mul x8, x8, x9
mov w0, w8
bl malloc
ldur x8, [x29, #-24]
str x0, [x8, #8]
ldur x8, [x29, #-16]
ldur x9, [x29, #-24]
str x8, [x9, #16]
str wzr, [sp, #28]
stur wzr, [x29, #-28]
b .LBB0_4
.LBB0_4: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-28]
ldur x9, [x29, #-24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_16
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_4 Depth=1
adrp x8, drawIndexes
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mov w11, #3 // =0x3
mul w12, w12, w11
add w10, w10, w12
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #24]
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mul w12, w12, w11
add w10, w10, w12
add w10, w10, #1
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #20]
ldr x8, [x8, :lo12:drawIndexes]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
ldur w10, [x29, #-28]
mul w10, w10, w11
add w9, w9, w10
add w9, w9, #2
ldr w8, [x8, w9, sxtw #2]
str w8, [sp, #16]
adrp x8, drawVerts
ldr x9, [x8, :lo12:drawVerts]
ldur x10, [x29, #-8]
ldr w10, [x10, #16]
ldr w11, [sp, #24]
add w10, w10, w11
add x9, x9, w10, sxtw #2
stur x9, [x29, #-40]
ldr x9, [x8, :lo12:drawVerts]
ldur x10, [x29, #-8]
ldr w10, [x10, #16]
ldr w11, [sp, #20]
add w10, w10, w11
add x9, x9, w10, sxtw #2
str x9, [sp, #48]
ldr x8, [x8, :lo12:drawVerts]
ldur x9, [x29, #-8]
ldr w9, [x9, #16]
ldr w10, [sp, #16]
add w9, w9, w10
add x8, x8, w9, sxtw #2
str x8, [sp, #40]
ldur w8, [x29, #-28]
ldur x9, [x29, #-24]
ldr w9, [x9]
subs w9, w9, #1
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_4 Depth=1
adrp x8, drawIndexes
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mov w11, #3 // =0x3
mul w12, w12, w11
add w10, w10, w12
add w10, w10, #3
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #12]
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mul w12, w12, w11
add w10, w10, w12
add w10, w10, #4
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #8]
ldr x8, [x8, :lo12:drawIndexes]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
ldur w10, [x29, #-28]
mul w10, w10, w11
add w9, w9, w10
add w9, w9, #5
ldr w8, [x8, w9, sxtw #2]
str w8, [sp, #4]
ldr w8, [sp, #12]
ldr w9, [sp, #16]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_4 Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #20]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_4 Depth=1
adrp x8, drawVerts
ldr x8, [x8, :lo12:drawVerts]
ldur x9, [x29, #-8]
ldr w9, [x9, #16]
ldr w10, [sp, #4]
add w9, w9, w10
add x8, x8, w9, sxtw #2
str x8, [sp, #32]
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldrsw x9, [sp, #28]
add x2, x8, x9, lsl #2
ldur x3, [x29, #-40]
ldr x4, [sp, #48]
ldr x5, [sp, #32]
ldr x6, [sp, #40]
bl VL_GenerateFacetFor4Points
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_4 Depth=1
ldr w8, [sp, #28]
add w8, w8, #1
str w8, [sp, #28]
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b .LBB0_15
.LBB0_10: // in Loop: Header=BB0_4 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_4 Depth=1
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_4 Depth=1
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldrsw x9, [sp, #28]
add x2, x8, x9, lsl #2
ldur x3, [x29, #-40]
ldr x4, [sp, #48]
ldr x5, [sp, #40]
bl VL_GenerateFacetFor3Points
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_4 Depth=1
ldr w8, [sp, #28]
add w8, w8, #1
str w8, [sp, #28]
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_4 Depth=1
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_4 Depth=1
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b .LBB0_4
.LBB0_16:
ldr w8, [sp, #28]
ldur x9, [x29, #-24]
str w8, [x9]
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_FacetsForTriangleSurface, .Lfunc_end0-VL_FacetsForTriangleSurface
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 3, 0x0
qfalse:
.xword 0
.size qfalse, 8
.type MST_TRIANGLE_SOUP,@object // @MST_TRIANGLE_SOUP
.globl MST_TRIANGLE_SOUP
.p2align 3, 0x0
MST_TRIANGLE_SOUP:
.xword 0 // 0x0
.size MST_TRIANGLE_SOUP, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0
.size qtrue, 8
.type drawIndexes,@object // @drawIndexes
.globl drawIndexes
.p2align 3, 0x0
drawIndexes:
.xword 0
.size drawIndexes, 8
.type drawVerts,@object // @drawVerts
.globl drawVerts
.p2align 3, 0x0
drawVerts:
.xword 0
.size drawVerts, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym VL_GenerateFacetFor4Points
.addrsig_sym VL_GenerateFacetFor3Points
.addrsig_sym qfalse
.addrsig_sym MST_TRIANGLE_SOUP
.addrsig_sym qtrue
.addrsig_sym drawIndexes
.addrsig_sym drawVerts
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_FacetsForTriangleSurface.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ lsurfaceTest_t ;
struct TYPE_5__ {int lightmapNum; scalar_t__ surfaceType; int lightmapWidth; int lightmapHeight; int lightmapY; int lightmapX; size_t firstVert; int patchHeight; int patchWidth; } ;
typedef TYPE_1__ dsurface_t ;
struct TYPE_6__ {double* lightmap; } ;
typedef TYPE_2__ drawVert_t ;
/* Variables and functions */
int LIGHTMAP_HEIGHT ;
int LIGHTMAP_WIDTH ;
scalar_t__ MST_PATCH ;
TYPE_1__* drawSurfaces ;
TYPE_2__* drawVerts ;
float* lightFloats ;
int /*<<< orphan*/ ** lsurfaceTest ;
int numDrawSurfaces ;
void VS_ShiftPatchLightmaps(void)
{
int i, j, x, y, k;
drawVert_t *verts;
dsurface_t *ds;
lsurfaceTest_t *test;
float *ptr;
for ( i = 0 ; i < numDrawSurfaces ; i++ )
{
test = lsurfaceTest[ i ];
if (!test)
continue;
ds = &drawSurfaces[ i ];
if ( ds->lightmapNum < 0 )
continue;
if (ds->surfaceType != MST_PATCH)
continue;
for (x = ds->lightmapWidth; x > 0; x--)
{
for (y = 0; y <= ds->lightmapHeight; y++)
{
k = ( ds->lightmapNum * LIGHTMAP_HEIGHT + ds->lightmapY + y)
* LIGHTMAP_WIDTH + ds->lightmapX + x;
ptr = lightFloats + k*3;
ptr[0] = (lightFloats + (k-1)*3)[0];
ptr[1] = (lightFloats + (k-1)*3)[1];
ptr[2] = (lightFloats + (k-1)*3)[2];
}
}
for (y = ds->lightmapHeight; y > 0; y--)
{
for (x = 0; x <= ds->lightmapWidth; x++)
{
k = ( ds->lightmapNum * LIGHTMAP_HEIGHT + ds->lightmapY + y)
* LIGHTMAP_WIDTH + ds->lightmapX + x;
ptr = lightFloats + k*3;
ptr[0] = (lightFloats + (k-LIGHTMAP_WIDTH)*3)[0];
ptr[1] = (lightFloats + (k-LIGHTMAP_WIDTH)*3)[1];
ptr[2] = (lightFloats + (k-LIGHTMAP_WIDTH)*3)[2];
}
}
verts = &drawVerts[ ds->firstVert ];
for ( j = 0 ; j < ds->patchHeight * ds->patchWidth; j++ )
{
verts[j].lightmap[0] += 0.5 / LIGHTMAP_WIDTH;
verts[j].lightmap[1] += 0.5 / LIGHTMAP_HEIGHT;
}
ds->lightmapHeight++;
ds->lightmapWidth++;
}
}
|
.text
.file "extr_soundv.c_VS_ShiftPatchLightmaps.c"
.globl VS_ShiftPatchLightmaps // -- Begin function VS_ShiftPatchLightmaps
.p2align 2
.type VS_ShiftPatchLightmaps,@function
VS_ShiftPatchLightmaps: // @VS_ShiftPatchLightmaps
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
str wzr, [sp, #60]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_9 Depth 2
// Child Loop BB0_11 Depth 3
// Child Loop BB0_17 Depth 2
// Child Loop BB0_19 Depth 3
// Child Loop BB0_25 Depth 2
ldr w8, [sp, #60]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_30
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, lsurfaceTest
ldr x8, [x8, :lo12:lsurfaceTest]
ldrsw x9, [sp, #60]
ldr x8, [x8, x9, lsl #3]
str x8, [sp, #16]
ldr x8, [sp, #16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_29
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldrsw x9, [sp, #60]
mov x10, #48 // =0x30
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #24]
ldr x8, [sp, #24]
ldr w8, [x8]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
b .LBB0_29
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr x8, [x8, #8]
adrp x9, MST_PATCH
ldr x9, [x9, :lo12:MST_PATCH]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
b .LBB0_29
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w8, [x8, #16]
str w8, [sp, #52]
b .LBB0_9
.LBB0_9: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_11 Depth 3
ldr w8, [sp, #52]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, .LBB0_16
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=2
str wzr, [sp, #48]
b .LBB0_11
.LBB0_11: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_9 Depth=2
// => This Inner Loop Header: Depth=3
ldr w8, [sp, #48]
ldr x9, [sp, #24]
ldr w9, [x9, #20]
subs w8, w8, w9
cset w8, gt
tbnz w8, #0, .LBB0_14
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_11 Depth=3
ldr x8, [sp, #24]
ldr w8, [x8]
adrp x9, LIGHTMAP_HEIGHT
ldr w9, [x9, :lo12:LIGHTMAP_HEIGHT]
mul w8, w8, w9
ldr x9, [sp, #24]
ldr w9, [x9, #24]
add w8, w8, w9
ldr w9, [sp, #48]
add w8, w8, w9
adrp x9, LIGHTMAP_WIDTH
ldr w9, [x9, :lo12:LIGHTMAP_WIDTH]
mul w8, w8, w9
ldr x9, [sp, #24]
ldr w9, [x9, #28]
add w8, w8, w9
ldr w9, [sp, #52]
add w8, w8, w9
str w8, [sp, #44]
adrp x8, lightFloats
ldr x9, [x8, :lo12:lightFloats]
ldr w11, [sp, #44]
mov w10, #3 // =0x3
mul w11, w11, w10
add x9, x9, w11, sxtw #2
str x9, [sp, #8]
ldr x9, [x8, :lo12:lightFloats]
ldr w11, [sp, #44]
subs w11, w11, #1
mul w11, w11, w10
ldr s0, [x9, w11, sxtw #2]
ldr x9, [sp, #8]
str s0, [x9]
ldr x9, [x8, :lo12:lightFloats]
ldr w11, [sp, #44]
subs w11, w11, #1
mul w11, w11, w10
add x9, x9, w11, sxtw #2
ldr s0, [x9, #4]
ldr x9, [sp, #8]
str s0, [x9, #4]
ldr x8, [x8, :lo12:lightFloats]
ldr w9, [sp, #44]
subs w9, w9, #1
mul w9, w9, w10
add x8, x8, w9, sxtw #2
ldr s0, [x8, #8]
ldr x8, [sp, #8]
str s0, [x8, #8]
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_11 Depth=3
ldr w8, [sp, #48]
add w8, w8, #1
str w8, [sp, #48]
b .LBB0_11
.LBB0_14: // in Loop: Header=BB0_9 Depth=2
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_9 Depth=2
ldr w8, [sp, #52]
subs w8, w8, #1
str w8, [sp, #52]
b .LBB0_9
.LBB0_16: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w8, [x8, #20]
str w8, [sp, #48]
b .LBB0_17
.LBB0_17: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_19 Depth 3
ldr w8, [sp, #48]
subs w8, w8, #0
cset w8, le
tbnz w8, #0, .LBB0_24
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_17 Depth=2
str wzr, [sp, #52]
b .LBB0_19
.LBB0_19: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_17 Depth=2
// => This Inner Loop Header: Depth=3
ldr w8, [sp, #52]
ldr x9, [sp, #24]
ldr w9, [x9, #16]
subs w8, w8, w9
cset w8, gt
tbnz w8, #0, .LBB0_22
b .LBB0_20
.LBB0_20: // in Loop: Header=BB0_19 Depth=3
ldr x8, [sp, #24]
ldr w8, [x8]
adrp x9, LIGHTMAP_HEIGHT
ldr w9, [x9, :lo12:LIGHTMAP_HEIGHT]
mul w8, w8, w9
ldr x9, [sp, #24]
ldr w9, [x9, #24]
add w8, w8, w9
ldr w9, [sp, #48]
add w8, w8, w9
adrp x11, LIGHTMAP_WIDTH
ldr w9, [x11, :lo12:LIGHTMAP_WIDTH]
mul w8, w8, w9
ldr x9, [sp, #24]
ldr w9, [x9, #28]
add w8, w8, w9
ldr w9, [sp, #52]
add w8, w8, w9
str w8, [sp, #44]
adrp x8, lightFloats
ldr x9, [x8, :lo12:lightFloats]
ldr w12, [sp, #44]
mov w10, #3 // =0x3
mul w12, w12, w10
add x9, x9, w12, sxtw #2
str x9, [sp, #8]
ldr x9, [x8, :lo12:lightFloats]
ldr w12, [sp, #44]
ldr w13, [x11, :lo12:LIGHTMAP_WIDTH]
subs w12, w12, w13
mul w12, w12, w10
ldr s0, [x9, w12, sxtw #2]
ldr x9, [sp, #8]
str s0, [x9]
ldr x9, [x8, :lo12:lightFloats]
ldr w12, [sp, #44]
ldr w13, [x11, :lo12:LIGHTMAP_WIDTH]
subs w12, w12, w13
mul w12, w12, w10
add x9, x9, w12, sxtw #2
ldr s0, [x9, #4]
ldr x9, [sp, #8]
str s0, [x9, #4]
ldr x8, [x8, :lo12:lightFloats]
ldr w9, [sp, #44]
ldr w11, [x11, :lo12:LIGHTMAP_WIDTH]
subs w9, w9, w11
mul w9, w9, w10
add x8, x8, w9, sxtw #2
ldr s0, [x8, #8]
ldr x8, [sp, #8]
str s0, [x8, #8]
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_19 Depth=3
ldr w8, [sp, #52]
add w8, w8, #1
str w8, [sp, #52]
b .LBB0_19
.LBB0_22: // in Loop: Header=BB0_17 Depth=2
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_17 Depth=2
ldr w8, [sp, #48]
subs w8, w8, #1
str w8, [sp, #48]
b .LBB0_17
.LBB0_24: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawVerts
ldr x8, [x8, :lo12:drawVerts]
ldr x9, [sp, #24]
ldr x9, [x9, #32]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
str wzr, [sp, #56]
b .LBB0_25
.LBB0_25: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #56]
ldr x9, [sp, #24]
ldr w9, [x9, #40]
ldr x10, [sp, #24]
ldr w10, [x10, #44]
mul w9, w9, w10
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_28
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_25 Depth=2
adrp x8, LIGHTMAP_WIDTH
ldr s0, [x8, :lo12:LIGHTMAP_WIDTH]
fmov w8, s0
scvtf d1, w8
fmov d0, #0.50000000
fdiv d2, d0, d1
ldr x8, [sp, #32]
ldrsw x9, [sp, #56]
ldr x8, [x8, x9, lsl #3]
ldr d1, [x8]
fadd d1, d1, d2
str d1, [x8]
adrp x8, LIGHTMAP_HEIGHT
ldr s1, [x8, :lo12:LIGHTMAP_HEIGHT]
fmov w8, s1
scvtf d1, w8
fdiv d1, d0, d1
ldr x8, [sp, #32]
ldrsw x9, [sp, #56]
ldr x8, [x8, x9, lsl #3]
ldr d0, [x8, #8]
fadd d0, d0, d1
str d0, [x8, #8]
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_25 Depth=2
ldr w8, [sp, #56]
add w8, w8, #1
str w8, [sp, #56]
b .LBB0_25
.LBB0_28: // in Loop: Header=BB0_1 Depth=1
ldr x9, [sp, #24]
ldr w8, [x9, #20]
add w8, w8, #1
str w8, [x9, #20]
ldr x9, [sp, #24]
ldr w8, [x9, #16]
add w8, w8, #1
str w8, [x9, #16]
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #60]
add w8, w8, #1
str w8, [sp, #60]
b .LBB0_1
.LBB0_30:
add sp, sp, #64
.cfi_def_cfa_offset 0
ret
.Lfunc_end0:
.size VS_ShiftPatchLightmaps, .Lfunc_end0-VS_ShiftPatchLightmaps
.cfi_endproc
// -- End function
.type numDrawSurfaces,@object // @numDrawSurfaces
.bss
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type lsurfaceTest,@object // @lsurfaceTest
.globl lsurfaceTest
.p2align 3, 0x0
lsurfaceTest:
.xword 0
.size lsurfaceTest, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type MST_PATCH,@object // @MST_PATCH
.globl MST_PATCH
.p2align 3, 0x0
MST_PATCH:
.xword 0 // 0x0
.size MST_PATCH, 8
.type LIGHTMAP_HEIGHT,@object // @LIGHTMAP_HEIGHT
.globl LIGHTMAP_HEIGHT
.p2align 2, 0x0
LIGHTMAP_HEIGHT:
.word 0 // 0x0
.size LIGHTMAP_HEIGHT, 4
.type LIGHTMAP_WIDTH,@object // @LIGHTMAP_WIDTH
.globl LIGHTMAP_WIDTH
.p2align 2, 0x0
LIGHTMAP_WIDTH:
.word 0 // 0x0
.size LIGHTMAP_WIDTH, 4
.type lightFloats,@object // @lightFloats
.globl lightFloats
.p2align 3, 0x0
lightFloats:
.xword 0
.size lightFloats, 8
.type drawVerts,@object // @drawVerts
.globl drawVerts
.p2align 3, 0x0
drawVerts:
.xword 0
.size drawVerts, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym numDrawSurfaces
.addrsig_sym lsurfaceTest
.addrsig_sym drawSurfaces
.addrsig_sym MST_PATCH
.addrsig_sym LIGHTMAP_HEIGHT
.addrsig_sym LIGHTMAP_WIDTH
.addrsig_sym lightFloats
.addrsig_sym drawVerts
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_ShiftPatchLightmaps.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__* vec3_t ;
typedef int /*<<< orphan*/ traceWork_t ;
struct TYPE_5__ {int /*<<< orphan*/ origin; struct TYPE_5__* next; } ;
typedef TYPE_1__ light_t ;
struct TYPE_6__ {scalar_t__* color; scalar_t__* dir; } ;
typedef TYPE_2__ contribution_t ;
/* Variables and functions */
int /*<<< orphan*/ ColorToBytes (scalar_t__*,scalar_t__*) ;
float DotProduct (scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ LightContributionToPoint (TYPE_1__*,scalar_t__*,scalar_t__*,int /*<<< orphan*/ *) ;
int MAX_CONTRIBUTIONS ;
int /*<<< orphan*/ NormalToLatLong (scalar_t__*,scalar_t__*) ;
scalar_t__ PointInSolid (scalar_t__*) ;
int /*<<< orphan*/ SunToPoint (scalar_t__*,int /*<<< orphan*/ *,scalar_t__*) ;
int /*<<< orphan*/ VectorClear (scalar_t__*) ;
int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ;
float VectorLength (scalar_t__*) ;
int /*<<< orphan*/ VectorMA (scalar_t__*,double,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorNormalize (scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ;
scalar_t__* ambientColor ;
int* gridBounds ;
scalar_t__* gridData ;
scalar_t__* gridMins ;
int* gridSize ;
TYPE_1__* lights ;
scalar_t__* sunDirection ;
void TraceGrid( int num ) {
int x, y, z;
vec3_t origin;
light_t *light;
vec3_t color;
int mod;
vec3_t directedColor;
vec3_t summedDir;
contribution_t contributions[MAX_CONTRIBUTIONS];
int numCon;
int i;
traceWork_t tw;
float addSize;
mod = num;
z = mod / ( gridBounds[0] * gridBounds[1] );
mod -= z * ( gridBounds[0] * gridBounds[1] );
y = mod / gridBounds[0];
mod -= y * gridBounds[0];
x = mod;
origin[0] = gridMins[0] + x * gridSize[0];
origin[1] = gridMins[1] + y * gridSize[1];
origin[2] = gridMins[2] + z * gridSize[2];
if ( PointInSolid( origin ) ) {
vec3_t baseOrigin;
int step;
VectorCopy( origin, baseOrigin );
// try to nudge the origin around to find a valid point
for ( step = 9 ; step <= 18 ; step += 9 ) {
for ( i = 0 ; i < 8 ; i++ ) {
VectorCopy( baseOrigin, origin );
if ( i & 1 ) {
origin[0] += step;
} else {
origin[0] -= step;
}
if ( i & 2 ) {
origin[1] += step;
} else {
origin[1] -= step;
}
if ( i & 4 ) {
origin[2] += step;
} else {
origin[2] -= step;
}
if ( !PointInSolid( origin ) ) {
break;
}
}
if ( i != 8 ) {
break;
}
}
if ( step > 18 ) {
// can't find a valid point at all
for ( i = 0 ; i < 8 ; i++ ) {
gridData[ num*8 + i ] = 0;
}
return;
}
}
VectorClear( summedDir );
// trace to all the lights
// find the major light direction, and divide the
// total light between that along the direction and
// the remaining in the ambient
numCon = 0;
for ( light = lights ; light ; light = light->next ) {
vec3_t add;
vec3_t dir;
float addSize;
if ( !LightContributionToPoint( light, origin, add, &tw ) ) {
continue;
}
VectorSubtract( light->origin, origin, dir );
VectorNormalize( dir, dir );
VectorCopy( add, contributions[numCon].color );
VectorCopy( dir, contributions[numCon].dir );
numCon++;
addSize = VectorLength( add );
VectorMA( summedDir, addSize, dir, summedDir );
if ( numCon == MAX_CONTRIBUTIONS-1 ) {
break;
}
}
//
// trace directly to the sun
//
SunToPoint( origin, &tw, color );
addSize = VectorLength( color );
if ( addSize > 0 ) {
VectorCopy( color, contributions[numCon].color );
VectorCopy( sunDirection, contributions[numCon].dir );
VectorMA( summedDir, addSize, sunDirection, summedDir );
numCon++;
}
// now that we have identified the primary light direction,
// go back and seperate all the light into directed and ambient
VectorNormalize( summedDir, summedDir );
VectorCopy( ambientColor, color );
VectorClear( directedColor );
for ( i = 0 ; i < numCon ; i++ ) {
float d;
d = DotProduct( contributions[i].dir, summedDir );
if ( d < 0 ) {
d = 0;
}
VectorMA( directedColor, d, contributions[i].color, directedColor );
// the ambient light will be at 1/4 the value of directed light
d = 0.25 * ( 1.0 - d );
VectorMA( color, d, contributions[i].color, color );
}
// now do some fudging to keep the ambient from being too low
VectorMA( color, 0.25, directedColor, color );
//
// save the resulting value out
//
ColorToBytes( color, gridData + num*8 );
ColorToBytes( directedColor, gridData + num*8 + 3 );
VectorNormalize( summedDir, summedDir );
NormalToLatLong( summedDir, gridData + num*8 + 6);
}
|
.text
.file "extr_light.c_TraceGrid.c"
.globl TraceGrid // -- Begin function TraceGrid
.p2align 2
.type TraceGrid,@function
TraceGrid: // @TraceGrid
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub sp, sp, #160
stur w0, [x29, #-4]
adrp x8, MAX_CONTRIBUTIONS
ldr w8, [x8, :lo12:MAX_CONTRIBUTIONS]
// kill: def $x8 killed $w8
mov x9, sp
stur x9, [x29, #-72]
lsl x9, x8, #4
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x9, x9, x10
mov sp, x9
stur x9, [x29, #-144] // 8-byte Folded Spill
stur x8, [x29, #-80]
ldur w8, [x29, #-4]
stur w8, [x29, #-44]
ldur w8, [x29, #-44]
adrp x9, gridBounds
ldr x10, [x9, :lo12:gridBounds]
ldr w10, [x10]
ldr x11, [x9, :lo12:gridBounds]
ldr w11, [x11, #4]
mul w10, w10, w11
sdiv w8, w8, w10
stur w8, [x29, #-16]
ldur w8, [x29, #-16]
ldr x10, [x9, :lo12:gridBounds]
ldr w10, [x10]
ldr x11, [x9, :lo12:gridBounds]
ldr w11, [x11, #4]
mul w10, w10, w11
mul w10, w8, w10
ldur w8, [x29, #-44]
subs w8, w8, w10
stur w8, [x29, #-44]
ldur w8, [x29, #-44]
ldr x10, [x9, :lo12:gridBounds]
ldr w10, [x10]
sdiv w8, w8, w10
stur w8, [x29, #-12]
ldur w8, [x29, #-12]
ldr x9, [x9, :lo12:gridBounds]
ldr w9, [x9]
mul w9, w8, w9
ldur w8, [x29, #-44]
subs w8, w8, w9
stur w8, [x29, #-44]
ldur w8, [x29, #-44]
stur w8, [x29, #-8]
adrp x8, gridMins
ldr x9, [x8, :lo12:gridMins]
ldr x9, [x9]
ldur w11, [x29, #-8]
adrp x10, gridSize
ldr x12, [x10, :lo12:gridSize]
ldr w12, [x12]
mul w11, w11, w12
add x9, x9, w11, sxtw
ldur x11, [x29, #-24]
str x9, [x11]
ldr x9, [x8, :lo12:gridMins]
ldr x9, [x9, #8]
ldur w11, [x29, #-12]
ldr x12, [x10, :lo12:gridSize]
ldr w12, [x12, #4]
mul w11, w11, w12
add x9, x9, w11, sxtw
ldur x11, [x29, #-24]
str x9, [x11, #8]
ldr x8, [x8, :lo12:gridMins]
ldr x8, [x8, #16]
ldur w9, [x29, #-16]
ldr x10, [x10, :lo12:gridSize]
ldr w10, [x10, #8]
mul w9, w9, w10
add x8, x8, w9, sxtw
ldur x9, [x29, #-24]
str x8, [x9, #16]
ldur x0, [x29, #-24]
bl PointInSolid
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_29
b .LBB0_1
.LBB0_1:
ldur x0, [x29, #-24]
ldur x1, [x29, #-104]
bl VectorCopy
mov w8, #9 // =0x9
stur w8, [x29, #-108]
b .LBB0_2
.LBB0_2: // =>This Loop Header: Depth=1
// Child Loop BB0_4 Depth 2
ldur w8, [x29, #-108]
subs w8, w8, #18
cset w8, gt
tbnz w8, #0, .LBB0_22
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_2 Depth=1
stur wzr, [x29, #-88]
b .LBB0_4
.LBB0_4: // Parent Loop BB0_2 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-88]
subs w8, w8, #8
cset w8, ge
tbnz w8, #0, .LBB0_18
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_4 Depth=2
ldur x0, [x29, #-104]
ldur x1, [x29, #-24]
bl VectorCopy
ldur w8, [x29, #-88]
ands w8, w8, #0x1
cset w8, eq
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_4 Depth=2
ldursw x10, [x29, #-108]
ldur x9, [x29, #-24]
ldr x8, [x9]
add x8, x8, x10
str x8, [x9]
b .LBB0_8
.LBB0_7: // in Loop: Header=BB0_4 Depth=2
ldursw x10, [x29, #-108]
ldur x9, [x29, #-24]
ldr x8, [x9]
subs x8, x8, x10
str x8, [x9]
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_4 Depth=2
ldur w8, [x29, #-88]
ands w8, w8, #0x2
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_4 Depth=2
ldursw x10, [x29, #-108]
ldur x9, [x29, #-24]
ldr x8, [x9, #8]
add x8, x8, x10
str x8, [x9, #8]
b .LBB0_11
.LBB0_10: // in Loop: Header=BB0_4 Depth=2
ldursw x10, [x29, #-108]
ldur x9, [x29, #-24]
ldr x8, [x9, #8]
subs x8, x8, x10
str x8, [x9, #8]
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_4 Depth=2
ldur w8, [x29, #-88]
ands w8, w8, #0x4
cset w8, eq
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_4 Depth=2
ldursw x10, [x29, #-108]
ldur x9, [x29, #-24]
ldr x8, [x9, #16]
add x8, x8, x10
str x8, [x9, #16]
b .LBB0_14
.LBB0_13: // in Loop: Header=BB0_4 Depth=2
ldursw x10, [x29, #-108]
ldur x9, [x29, #-24]
ldr x8, [x9, #16]
subs x8, x8, x10
str x8, [x9, #16]
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_4 Depth=2
ldur x0, [x29, #-24]
bl PointInSolid
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_2 Depth=1
b .LBB0_18
.LBB0_16: // in Loop: Header=BB0_4 Depth=2
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_4 Depth=2
ldur w8, [x29, #-88]
add w8, w8, #1
stur w8, [x29, #-88]
b .LBB0_4
.LBB0_18: // in Loop: Header=BB0_2 Depth=1
ldur w8, [x29, #-88]
subs w8, w8, #8
cset w8, eq
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19:
b .LBB0_22
.LBB0_20: // in Loop: Header=BB0_2 Depth=1
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_2 Depth=1
ldur w8, [x29, #-108]
add w8, w8, #9
stur w8, [x29, #-108]
b .LBB0_2
.LBB0_22:
ldur w8, [x29, #-108]
subs w8, w8, #18
cset w8, le
tbnz w8, #0, .LBB0_28
b .LBB0_23
.LBB0_23:
stur wzr, [x29, #-88]
b .LBB0_24
.LBB0_24: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-88]
subs w8, w8, #8
cset w8, ge
tbnz w8, #0, .LBB0_27
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_24 Depth=1
adrp x8, gridData
ldr x9, [x8, :lo12:gridData]
ldur w10, [x29, #-4]
ldur w8, [x29, #-88]
add w10, w8, w10, lsl #3
mov x8, xzr
str x8, [x9, w10, sxtw #3]
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_24 Depth=1
ldur w8, [x29, #-88]
add w8, w8, #1
stur w8, [x29, #-88]
b .LBB0_24
.LBB0_27:
mov w8, #1 // =0x1
stur w8, [x29, #-112]
b .LBB0_46
.LBB0_28:
b .LBB0_29
.LBB0_29:
ldur x0, [x29, #-64]
bl VectorClear
stur wzr, [x29, #-84]
adrp x8, lights
ldr x8, [x8, :lo12:lights]
stur x8, [x29, #-32]
b .LBB0_30
.LBB0_30: // =>This Inner Loop Header: Depth=1
ldur x8, [x29, #-32]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_37
b .LBB0_31
.LBB0_31: // in Loop: Header=BB0_30 Depth=1
ldur x0, [x29, #-32]
ldur x1, [x29, #-24]
ldur x2, [x29, #-120]
sub x3, x29, #92
bl LightContributionToPoint
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_33
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_30 Depth=1
b .LBB0_36
.LBB0_33: // in Loop: Header=BB0_30 Depth=1
ldur x8, [x29, #-32]
ldr w0, [x8]
ldur x1, [x29, #-24]
ldur x2, [x29, #-128]
bl VectorSubtract
ldur x0, [x29, #-128]
ldur x1, [x29, #-128]
bl VectorNormalize
ldur x8, [x29, #-144] // 8-byte Folded Reload
ldur x0, [x29, #-120]
ldursw x9, [x29, #-84]
lsl x9, x9, #4
ldr x1, [x8, x9]
bl VectorCopy
ldur x8, [x29, #-144] // 8-byte Folded Reload
ldur x0, [x29, #-128]
ldursw x9, [x29, #-84]
add x8, x8, x9, lsl #4
ldr x1, [x8, #8]
bl VectorCopy
ldur w8, [x29, #-84]
add w8, w8, #1
stur w8, [x29, #-84]
ldur x0, [x29, #-120]
bl VectorLength
stur s0, [x29, #-132]
ldur x0, [x29, #-64]
ldur s0, [x29, #-132]
fcvt d0, s0
ldur x1, [x29, #-128]
ldur x2, [x29, #-64]
bl VectorMA
ldur w8, [x29, #-84]
adrp x9, MAX_CONTRIBUTIONS
ldr w9, [x9, :lo12:MAX_CONTRIBUTIONS]
subs w9, w9, #1
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_35
b .LBB0_34
.LBB0_34:
b .LBB0_37
.LBB0_35: // in Loop: Header=BB0_30 Depth=1
b .LBB0_36
.LBB0_36: // in Loop: Header=BB0_30 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
stur x8, [x29, #-32]
b .LBB0_30
.LBB0_37:
ldur x0, [x29, #-24]
ldur x2, [x29, #-40]
sub x1, x29, #92
bl SunToPoint
ldur x0, [x29, #-40]
bl VectorLength
stur s0, [x29, #-96]
ldur s0, [x29, #-96]
fcmp s0, #0.0
cset w8, le
tbnz w8, #0, .LBB0_39
b .LBB0_38
.LBB0_38:
ldur x8, [x29, #-144] // 8-byte Folded Reload
ldur x0, [x29, #-40]
ldursw x9, [x29, #-84]
lsl x9, x9, #4
ldr x1, [x8, x9]
bl VectorCopy
ldur x8, [x29, #-144] // 8-byte Folded Reload
adrp x9, sunDirection
stur x9, [x29, #-152] // 8-byte Folded Spill
ldr x0, [x9, :lo12:sunDirection]
ldursw x9, [x29, #-84]
add x8, x8, x9, lsl #4
ldr x1, [x8, #8]
bl VectorCopy
ldur x8, [x29, #-152] // 8-byte Folded Reload
ldur x0, [x29, #-64]
ldur s0, [x29, #-96]
fcvt d0, s0
ldr x1, [x8, :lo12:sunDirection]
ldur x2, [x29, #-64]
bl VectorMA
ldur w8, [x29, #-84]
add w8, w8, #1
stur w8, [x29, #-84]
b .LBB0_39
.LBB0_39:
ldur x0, [x29, #-64]
ldur x1, [x29, #-64]
bl VectorNormalize
adrp x8, ambientColor
ldr x0, [x8, :lo12:ambientColor]
ldur x1, [x29, #-40]
bl VectorCopy
ldur x0, [x29, #-56]
bl VectorClear
stur wzr, [x29, #-88]
b .LBB0_40
.LBB0_40: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-88]
ldur w9, [x29, #-84]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_45
b .LBB0_41
.LBB0_41: // in Loop: Header=BB0_40 Depth=1
ldur x8, [x29, #-144] // 8-byte Folded Reload
ldursw x9, [x29, #-88]
add x8, x8, x9, lsl #4
ldr x0, [x8, #8]
ldur x1, [x29, #-64]
bl DotProduct
stur s0, [x29, #-136]
ldur s0, [x29, #-136]
fcmp s0, #0.0
cset w8, pl
tbnz w8, #0, .LBB0_43
b .LBB0_42
.LBB0_42: // in Loop: Header=BB0_40 Depth=1
movi d0, #0000000000000000
stur s0, [x29, #-136]
b .LBB0_43
.LBB0_43: // in Loop: Header=BB0_40 Depth=1
ldur x8, [x29, #-144] // 8-byte Folded Reload
ldur x0, [x29, #-56]
ldur s0, [x29, #-136]
fcvt d0, s0
ldursw x9, [x29, #-88]
lsl x9, x9, #4
ldr x1, [x8, x9]
ldur x2, [x29, #-56]
bl VectorMA
ldur x8, [x29, #-144] // 8-byte Folded Reload
ldur s0, [x29, #-136]
fcvt d1, s0
fmov d0, #1.00000000
fsub d1, d0, d1
fmov d0, #0.25000000
fmul d0, d0, d1
fcvt s0, d0
stur s0, [x29, #-136]
ldur x0, [x29, #-40]
ldur s0, [x29, #-136]
fcvt d0, s0
ldursw x9, [x29, #-88]
lsl x9, x9, #4
ldr x1, [x8, x9]
ldur x2, [x29, #-40]
bl VectorMA
b .LBB0_44
.LBB0_44: // in Loop: Header=BB0_40 Depth=1
ldur w8, [x29, #-88]
add w8, w8, #1
stur w8, [x29, #-88]
b .LBB0_40
.LBB0_45:
ldur x0, [x29, #-40]
ldur x1, [x29, #-56]
ldur x2, [x29, #-40]
fmov d0, #0.25000000
bl VectorMA
ldur x0, [x29, #-40]
adrp x8, gridData
stur x8, [x29, #-160] // 8-byte Folded Spill
ldr x8, [x8, :lo12:gridData]
ldur w9, [x29, #-4]
lsl w9, w9, #3
add x1, x8, w9, sxtw #3
bl ColorToBytes
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldur x0, [x29, #-56]
ldr x8, [x8, :lo12:gridData]
ldur w9, [x29, #-4]
lsl w9, w9, #3
add x8, x8, w9, sxtw #3
add x1, x8, #24
bl ColorToBytes
ldur x0, [x29, #-64]
ldur x1, [x29, #-64]
bl VectorNormalize
ldur x8, [x29, #-160] // 8-byte Folded Reload
ldur x0, [x29, #-64]
ldr x8, [x8, :lo12:gridData]
ldur w9, [x29, #-4]
lsl w9, w9, #3
add x8, x8, w9, sxtw #3
add x1, x8, #48
bl NormalToLatLong
stur wzr, [x29, #-112]
b .LBB0_46
.LBB0_46:
ldur x8, [x29, #-72]
mov sp, x8
// %bb.47:
mov sp, x29
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
// %bb.48:
.Lfunc_end0:
.size TraceGrid, .Lfunc_end0-TraceGrid
.cfi_endproc
// -- End function
.type MAX_CONTRIBUTIONS,@object // @MAX_CONTRIBUTIONS
.bss
.globl MAX_CONTRIBUTIONS
.p2align 2, 0x0
MAX_CONTRIBUTIONS:
.word 0 // 0x0
.size MAX_CONTRIBUTIONS, 4
.type gridBounds,@object // @gridBounds
.globl gridBounds
.p2align 3, 0x0
gridBounds:
.xword 0
.size gridBounds, 8
.type gridMins,@object // @gridMins
.globl gridMins
.p2align 3, 0x0
gridMins:
.xword 0
.size gridMins, 8
.type gridSize,@object // @gridSize
.globl gridSize
.p2align 3, 0x0
gridSize:
.xword 0
.size gridSize, 8
.type gridData,@object // @gridData
.globl gridData
.p2align 3, 0x0
gridData:
.xword 0
.size gridData, 8
.type lights,@object // @lights
.globl lights
.p2align 3, 0x0
lights:
.xword 0
.size lights, 8
.type sunDirection,@object // @sunDirection
.globl sunDirection
.p2align 3, 0x0
sunDirection:
.xword 0
.size sunDirection, 8
.type ambientColor,@object // @ambientColor
.globl ambientColor
.p2align 3, 0x0
ambientColor:
.xword 0
.size ambientColor, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym PointInSolid
.addrsig_sym VectorCopy
.addrsig_sym VectorClear
.addrsig_sym LightContributionToPoint
.addrsig_sym VectorSubtract
.addrsig_sym VectorNormalize
.addrsig_sym VectorLength
.addrsig_sym VectorMA
.addrsig_sym SunToPoint
.addrsig_sym DotProduct
.addrsig_sym ColorToBytes
.addrsig_sym NormalToLatLong
.addrsig_sym MAX_CONTRIBUTIONS
.addrsig_sym gridBounds
.addrsig_sym gridMins
.addrsig_sym gridSize
.addrsig_sym gridData
.addrsig_sym lights
.addrsig_sym sunDirection
.addrsig_sym ambientColor
|
../AnghaBench/Quake-III-Arena/q3map/extr_light.c_TraceGrid.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_6__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
/* Variables and functions */
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_2__* dplanes ;
TYPE_1__* mapplanes ;
int nummapplanes ;
size_t numplanes ;
void EmitPlanes (void)
{
int i;
dplane_t *dp;
plane_t *mp;
mp = mapplanes;
for (i=0 ; i<nummapplanes ; i++, mp++)
{
dp = &dplanes[numplanes];
VectorCopy ( mp->normal, dp->normal);
dp->dist = mp->dist;
numplanes++;
}
}
|
.text
.file "extr_writebsp.c_EmitPlanes.c"
.globl EmitPlanes // -- Begin function EmitPlanes
.p2align 2
.type EmitPlanes,@function
EmitPlanes: // @EmitPlanes
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
adrp x8, mapplanes
ldr x8, [x8, :lo12:mapplanes]
str x8, [sp, #8]
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
adrp x9, nummapplanes
ldr w9, [x9, :lo12:nummapplanes]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
adrp x9, numplanes
str x9, [sp] // 8-byte Folded Spill
ldr x9, [x9, :lo12:numplanes]
add x8, x8, x9, lsl #3
str x8, [sp, #16]
ldr x8, [sp, #8]
ldr w0, [x8, #4]
ldr x8, [sp, #16]
ldr w1, [x8, #4]
bl VectorCopy
ldr x9, [sp] // 8-byte Folded Reload
ldr x8, [sp, #8]
ldr w8, [x8]
ldr x10, [sp, #16]
str w8, [x10]
ldr x8, [x9, :lo12:numplanes]
add x8, x8, #1
str x8, [x9, :lo12:numplanes]
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
ldr x8, [sp, #8]
add x8, x8, #8
str x8, [sp, #8]
b .LBB0_1
.LBB0_4:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size EmitPlanes, .Lfunc_end0-EmitPlanes
.cfi_endproc
// -- End function
.type mapplanes,@object // @mapplanes
.bss
.globl mapplanes
.p2align 3, 0x0
mapplanes:
.xword 0
.size mapplanes, 8
.type nummapplanes,@object // @nummapplanes
.globl nummapplanes
.p2align 2, 0x0
nummapplanes:
.word 0 // 0x0
.size nummapplanes, 4
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type numplanes,@object // @numplanes
.globl numplanes
.p2align 3, 0x0
numplanes:
.xword 0 // 0x0
.size numplanes, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorCopy
.addrsig_sym mapplanes
.addrsig_sym nummapplanes
.addrsig_sym dplanes
.addrsig_sym numplanes
|
../AnghaBench/Quake-III-Arena/q3map/extr_writebsp.c_EmitPlanes.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ BasePortalVis ;
int /*<<< orphan*/ CalcFastVis () ;
int /*<<< orphan*/ CalcPassagePortalVis () ;
int /*<<< orphan*/ CalcPassageVis () ;
int /*<<< orphan*/ CalcPortalVis () ;
int /*<<< orphan*/ ClusterMerge (int) ;
int /*<<< orphan*/ RunThreadsOnIndividual (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SortPortals () ;
int /*<<< orphan*/ _printf (char*,...) ;
scalar_t__ fastvis ;
scalar_t__ noPassageVis ;
int numportals ;
scalar_t__ passageVisOnly ;
int portalclusters ;
int /*<<< orphan*/ qtrue ;
int totalvis ;
void CalcVis (void)
{
int i;
RunThreadsOnIndividual (numportals*2, qtrue, BasePortalVis);
// RunThreadsOnIndividual (numportals*2, qtrue, BetterPortalVis);
SortPortals ();
if (fastvis) {
CalcFastVis();
}
else if ( noPassageVis ) {
CalcPortalVis();
}
else if ( passageVisOnly ) {
CalcPassageVis();
}
else {
CalcPassagePortalVis();
}
//
// assemble the leaf vis lists by oring and compressing the portal lists
//
_printf("creating leaf vis...\n");
for (i=0 ; i<portalclusters ; i++)
ClusterMerge (i);
_printf( "Total visible clusters: %i\n", totalvis );
_printf( "Average clusters visible: %i\n", totalvis / portalclusters );
}
|
.text
.file "extr_vis.c_CalcVis.c"
.globl CalcVis // -- Begin function CalcVis
.p2align 2
.type CalcVis,@function
CalcVis: // @CalcVis
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, numportals
ldr w8, [x8, :lo12:numportals]
lsl w0, w8, #1
adrp x8, qtrue
ldr w1, [x8, :lo12:qtrue]
adrp x8, BasePortalVis
ldr w2, [x8, :lo12:BasePortalVis]
bl RunThreadsOnIndividual
bl SortPortals
adrp x8, fastvis
ldr x8, [x8, :lo12:fastvis]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
bl CalcFastVis
b .LBB0_9
.LBB0_2:
adrp x8, noPassageVis
ldr x8, [x8, :lo12:noPassageVis]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
bl CalcPortalVis
b .LBB0_8
.LBB0_4:
adrp x8, passageVisOnly
ldr x8, [x8, :lo12:passageVisOnly]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
bl CalcPassageVis
b .LBB0_7
.LBB0_6:
bl CalcPassagePortalVis
b .LBB0_7
.LBB0_7:
b .LBB0_8
.LBB0_8:
b .LBB0_9
.LBB0_9:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
stur wzr, [x29, #-4]
b .LBB0_10
.LBB0_10: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_13
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_10 Depth=1
ldur w0, [x29, #-4]
bl ClusterMerge
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_10 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_10
.LBB0_13:
adrp x8, totalvis
str x8, [sp] // 8-byte Folded Spill
ldr w1, [x8, :lo12:totalvis]
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
ldr x8, [sp] // 8-byte Folded Reload
ldr w8, [x8, :lo12:totalvis]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
sdiv w1, w8, w9
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size CalcVis, .Lfunc_end0-CalcVis
.cfi_endproc
// -- End function
.type numportals,@object // @numportals
.bss
.globl numportals
.p2align 2, 0x0
numportals:
.word 0 // 0x0
.size numportals, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type BasePortalVis,@object // @BasePortalVis
.globl BasePortalVis
.p2align 2, 0x0
BasePortalVis:
.word 0 // 0x0
.size BasePortalVis, 4
.type fastvis,@object // @fastvis
.globl fastvis
.p2align 3, 0x0
fastvis:
.xword 0 // 0x0
.size fastvis, 8
.type noPassageVis,@object // @noPassageVis
.globl noPassageVis
.p2align 3, 0x0
noPassageVis:
.xword 0 // 0x0
.size noPassageVis, 8
.type passageVisOnly,@object // @passageVisOnly
.globl passageVisOnly
.p2align 3, 0x0
passageVisOnly:
.xword 0 // 0x0
.size passageVisOnly, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "creating leaf vis...\n"
.size .L.str, 22
.type portalclusters,@object // @portalclusters
.bss
.globl portalclusters
.p2align 2, 0x0
portalclusters:
.word 0 // 0x0
.size portalclusters, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "Total visible clusters: %i\n"
.size .L.str.1, 28
.type totalvis,@object // @totalvis
.bss
.globl totalvis
.p2align 2, 0x0
totalvis:
.word 0 // 0x0
.size totalvis, 4
.type .L.str.2,@object // @.str.2
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.2:
.asciz "Average clusters visible: %i\n"
.size .L.str.2, 30
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym RunThreadsOnIndividual
.addrsig_sym SortPortals
.addrsig_sym CalcFastVis
.addrsig_sym CalcPortalVis
.addrsig_sym CalcPassageVis
.addrsig_sym CalcPassagePortalVis
.addrsig_sym _printf
.addrsig_sym ClusterMerge
.addrsig_sym numportals
.addrsig_sym qtrue
.addrsig_sym BasePortalVis
.addrsig_sym fastvis
.addrsig_sym noPassageVis
.addrsig_sym passageVisOnly
.addrsig_sym portalclusters
.addrsig_sym totalvis
|
../AnghaBench/Quake-III-Arena/q3map/extr_vis.c_CalcVis.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_17__ TYPE_6__ ;
typedef struct TYPE_16__ TYPE_5__ ;
typedef struct TYPE_15__ TYPE_4__ ;
typedef struct TYPE_14__ TYPE_3__ ;
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
struct TYPE_13__ {size_t leaf; scalar_t__ status; scalar_t__ portalflood; scalar_t__ portalvis; scalar_t__ removed; TYPE_5__* passages; } ;
typedef TYPE_2__ vportal_t ;
struct TYPE_14__ {TYPE_1__* base; } ;
typedef TYPE_3__ threaddata_t ;
struct TYPE_15__ {int* mightsee; struct TYPE_15__* next; scalar_t__ depth; } ;
typedef TYPE_4__ pstack_t ;
struct TYPE_16__ {scalar_t__ cansee; struct TYPE_16__* next; } ;
typedef TYPE_5__ passage_t ;
struct TYPE_17__ {int numportals; TYPE_2__** portals; } ;
typedef TYPE_6__ leaf_t ;
struct TYPE_12__ {int* portalvis; } ;
/* Variables and functions */
TYPE_6__* leafs ;
int /*<<< orphan*/ memcpy (long*,long*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ portalbytes ;
int portallongs ;
TYPE_2__* portals ;
scalar_t__ stat_done ;
void RecursivePassageFlow (vportal_t *portal, threaddata_t *thread, pstack_t *prevstack)
{
pstack_t stack;
vportal_t *p;
leaf_t *leaf;
passage_t *passage, *nextpassage;
int i, j;
long *might, *vis, *prevmight, *cansee, *portalvis, more;
int pnum;
leaf = &leafs[portal->leaf];
prevstack->next = &stack;
stack.next = NULL;
stack.depth = prevstack->depth + 1;
vis = (long *)thread->base->portalvis;
passage = portal->passages;
nextpassage = passage;
// check all portals for flowing into other leafs
for (i = 0; i < leaf->numportals; i++, passage = nextpassage)
{
p = leaf->portals[i];
if ( p->removed ) {
continue;
}
nextpassage = passage->next;
pnum = p - portals;
if ( ! (prevstack->mightsee[pnum >> 3] & (1<<(pnum&7)) ) ) {
continue; // can't possibly see it
}
// mark the portal as visible
thread->base->portalvis[pnum>>3] |= (1<<(pnum&7));
prevmight = (long *)prevstack->mightsee;
cansee = (long *)passage->cansee;
might = (long *)stack.mightsee;
memcpy(might, prevmight, portalbytes);
if (p->status == stat_done)
portalvis = (long *) p->portalvis;
else
portalvis = (long *) p->portalflood;
more = 0;
for (j = 0; j < portallongs; j++)
{
if (*might)
{
*might &= *cansee++ & *portalvis++;
more |= (*might & ~vis[j]);
}
else
{
cansee++;
portalvis++;
}
might++;
}
if ( !more ) {
// can't see anything new
continue;
}
// flow through it for real
RecursivePassageFlow(p, thread, &stack);
stack.next = NULL;
}
}
|
.text
.file "extr_visflow.c_RecursivePassageFlow.c"
.globl RecursivePassageFlow // -- Begin function RecursivePassageFlow
.p2align 2
.type RecursivePassageFlow,@function
RecursivePassageFlow: // @RecursivePassageFlow
.cfi_startproc
// %bb.0:
sub sp, sp, #160
.cfi_def_cfa_offset 160
stp x29, x30, [sp, #144] // 16-byte Folded Spill
add x29, sp, #144
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub x8, x29, #8
str x0, [x8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
adrp x9, leafs
ldr x9, [x9, :lo12:leafs]
ldr x10, [x8]
ldr x10, [x10]
add x9, x9, x10, lsl #4
stur x9, [x29, #-64]
ldur x10, [x29, #-24]
sub x9, x29, #48
str x9, [x10, #8]
// kill: def $x9 killed $xzr
stur xzr, [x29, #-40]
ldur x9, [x29, #-24]
ldr x9, [x9, #16]
add x9, x9, #1
stur x9, [x29, #-32]
ldur x9, [x29, #-16]
ldr x9, [x9]
ldr x9, [x9]
str x9, [sp, #40]
ldr x8, [x8]
ldr x8, [x8, #40]
str x8, [sp, #72]
ldr x8, [sp, #72]
str x8, [sp, #64]
str wzr, [sp, #60]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_10 Depth 2
ldr w8, [sp, #60]
ldur x9, [x29, #-64]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_20
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-64]
ldr x8, [x8, #8]
ldrsw x9, [sp, #60]
ldr x8, [x8, x9, lsl #3]
stur x8, [x29, #-56]
ldur x8, [x29, #-56]
ldr x8, [x8, #32]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_19
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #72]
ldr x8, [x8, #8]
str x8, [sp, #64]
ldur x8, [x29, #-56]
adrp x9, portals
ldr x9, [x9, :lo12:portals]
subs x8, x8, x9
mov x9, #48 // =0x30
sdiv x8, x8, x9
// kill: def $w8 killed $w8 killed $x8
str w8, [sp, #4]
ldur x8, [x29, #-24]
ldr x8, [x8]
ldr w9, [sp, #4]
asr w9, w9, #3
ldr w8, [x8, w9, sxtw #2]
ldr w9, [sp, #4]
and w10, w9, #0x7
mov w9, #1 // =0x1
lsl w9, w9, w10
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
b .LBB0_19
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
and w9, w8, #0x7
mov w8, #1 // =0x1
lsl w10, w8, w9
ldur x8, [x29, #-16]
ldr x8, [x8]
ldr x8, [x8]
ldr w9, [sp, #4]
asr w9, w9, #3
add x9, x8, w9, sxtw #2
ldr w8, [x9]
orr w8, w8, w10
str w8, [x9]
ldur x8, [x29, #-24]
ldr x8, [x8]
str x8, [sp, #32]
ldr x8, [sp, #72]
ldr x8, [x8]
str x8, [sp, #24]
ldur x8, [x29, #-48]
str x8, [sp, #48]
ldr x0, [sp, #48]
ldr x1, [sp, #32]
adrp x8, portalbytes
ldr w2, [x8, :lo12:portalbytes]
bl memcpy
ldur x8, [x29, #-56]
ldr x8, [x8, #8]
adrp x9, stat_done
ldr x9, [x9, :lo12:stat_done]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-56]
ldr x8, [x8, #24]
str x8, [sp, #16]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-56]
ldr x8, [x8, #16]
str x8, [sp, #16]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
str xzr, [sp, #8]
str wzr, [sp, #56]
b .LBB0_10
.LBB0_10: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #56]
adrp x9, portallongs
ldr w9, [x9, :lo12:portallongs]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_16
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_10 Depth=2
ldr x8, [sp, #48]
ldr x8, [x8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_10 Depth=2
ldr x8, [sp, #24]
add x9, x8, #8
str x9, [sp, #24]
ldr x8, [x8]
ldr x9, [sp, #16]
add x10, x9, #8
str x10, [sp, #16]
ldr x9, [x9]
and x10, x8, x9
ldr x9, [sp, #48]
ldr x8, [x9]
and x8, x8, x10
str x8, [x9]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr x9, [sp, #40]
ldrsw x10, [sp, #56]
ldr x9, [x9, x10, lsl #3]
bic x9, x8, x9
ldr x8, [sp, #8]
orr x8, x8, x9
str x8, [sp, #8]
b .LBB0_14
.LBB0_13: // in Loop: Header=BB0_10 Depth=2
ldr x8, [sp, #24]
add x8, x8, #8
str x8, [sp, #24]
ldr x8, [sp, #16]
add x8, x8, #8
str x8, [sp, #16]
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_10 Depth=2
ldr x8, [sp, #48]
add x8, x8, #8
str x8, [sp, #48]
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_10 Depth=2
ldr w8, [sp, #56]
add w8, w8, #1
str w8, [sp, #56]
b .LBB0_10
.LBB0_16: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_18
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_1 Depth=1
b .LBB0_19
.LBB0_18: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-56]
ldur x1, [x29, #-16]
sub x2, x29, #48
bl RecursivePassageFlow
// kill: def $x8 killed $xzr
stur xzr, [x29, #-40]
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #60]
add w8, w8, #1
str w8, [sp, #60]
ldr x8, [sp, #64]
str x8, [sp, #72]
b .LBB0_1
.LBB0_20:
.cfi_def_cfa wsp, 160
ldp x29, x30, [sp, #144] // 16-byte Folded Reload
add sp, sp, #160
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size RecursivePassageFlow, .Lfunc_end0-RecursivePassageFlow
.cfi_endproc
// -- End function
.type leafs,@object // @leafs
.bss
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.type portals,@object // @portals
.globl portals
.p2align 3, 0x0
portals:
.xword 0
.size portals, 8
.type portalbytes,@object // @portalbytes
.globl portalbytes
.p2align 2, 0x0
portalbytes:
.word 0 // 0x0
.size portalbytes, 4
.type stat_done,@object // @stat_done
.globl stat_done
.p2align 3, 0x0
stat_done:
.xword 0 // 0x0
.size stat_done, 8
.type portallongs,@object // @portallongs
.globl portallongs
.p2align 2, 0x0
portallongs:
.word 0 // 0x0
.size portallongs, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym RecursivePassageFlow
.addrsig_sym memcpy
.addrsig_sym leafs
.addrsig_sym portals
.addrsig_sym portalbytes
.addrsig_sym stat_done
.addrsig_sym portallongs
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_RecursivePassageFlow.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {int /*<<< orphan*/ s_addr; } ;
struct sockaddr_in {int /*<<< orphan*/ sin_port; TYPE_1__ sin_addr; int /*<<< orphan*/ sin_family; } ;
struct sockaddr {int dummy; } ;
typedef int /*<<< orphan*/ address ;
typedef int /*<<< orphan*/ WSADATA ;
typedef int /*<<< orphan*/ WORD ;
/* Variables and functions */
int /*<<< orphan*/ AF_INET ;
int /*<<< orphan*/ Error (char*) ;
int /*<<< orphan*/ GLSERV_PORT ;
int /*<<< orphan*/ INADDR_LOOPBACK ;
int /*<<< orphan*/ IPPROTO_TCP ;
int /*<<< orphan*/ MAKEWORD (int,int) ;
int /*<<< orphan*/ PF_INET ;
int /*<<< orphan*/ SOCK_STREAM ;
int WSAStartup (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ closesocket (int) ;
int connect (int,struct sockaddr*,int) ;
int draw_socket ;
int /*<<< orphan*/ htonl (int /*<<< orphan*/ ) ;
scalar_t__ qtrue ;
int socket (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ wins_init ;
void GLS_BeginScene (void)
{
WSADATA winsockdata;
WORD wVersionRequested;
struct sockaddr_in address;
int r;
if (!wins_init)
{
wins_init = qtrue;
wVersionRequested = MAKEWORD(1, 1);
r = WSAStartup (MAKEWORD(1, 1), &winsockdata);
if (r)
Error ("Winsock initialization failed.");
}
// connect a socket to the server
draw_socket = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (draw_socket == -1)
Error ("draw_socket failed");
address.sin_family = AF_INET;
address.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
address.sin_port = GLSERV_PORT;
r = connect (draw_socket, (struct sockaddr *)&address, sizeof(address));
if (r == -1)
{
closesocket (draw_socket);
draw_socket = 0;
}
}
|
.text
.file "extr_gldraw.c_GLS_BeginScene.c"
.globl GLS_BeginScene // -- Begin function GLS_BeginScene
.p2align 2
.type GLS_BeginScene,@function
GLS_BeginScene: // @GLS_BeginScene
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
adrp x8, wins_init
ldr x8, [x8, :lo12:wins_init]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_1
.LBB0_1:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
adrp x9, wins_init
str x8, [x9, :lo12:wins_init]
mov w1, #1 // =0x1
str w1, [sp, #20] // 4-byte Folded Spill
mov w0, w1
bl MAKEWORD
ldr w1, [sp, #20] // 4-byte Folded Reload
stur w0, [x29, #-8]
mov w0, w1
bl MAKEWORD
sub x1, x29, #4
bl WSAStartup
str w0, [sp, #24]
ldr w8, [sp, #24]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, .LBB0_3
b .LBB0_2
.LBB0_2:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_3
.LBB0_3:
b .LBB0_4
.LBB0_4:
adrp x8, PF_INET
ldr w0, [x8, :lo12:PF_INET]
adrp x8, SOCK_STREAM
ldr w1, [x8, :lo12:SOCK_STREAM]
adrp x8, IPPROTO_TCP
ldr w2, [x8, :lo12:IPPROTO_TCP]
bl socket
adrp x8, draw_socket
str w0, [x8, :lo12:draw_socket]
ldr w8, [x8, :lo12:draw_socket]
adds w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl Error
b .LBB0_6
.LBB0_6:
adrp x8, AF_INET
ldr w8, [x8, :lo12:AF_INET]
sub x9, x29, #20
str x9, [sp, #8] // 8-byte Folded Spill
stur w8, [x29, #-12]
adrp x8, INADDR_LOOPBACK
ldr w0, [x8, :lo12:INADDR_LOOPBACK]
bl htonl
ldr x1, [sp, #8] // 8-byte Folded Reload
stur w0, [x29, #-16]
adrp x8, GLSERV_PORT
ldr w8, [x8, :lo12:GLSERV_PORT]
stur w8, [x29, #-20]
adrp x8, draw_socket
ldr w0, [x8, :lo12:draw_socket]
mov w2, #12 // =0xc
bl connect
str w0, [sp, #24]
ldr w8, [sp, #24]
adds w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
adrp x8, draw_socket
str x8, [sp] // 8-byte Folded Spill
ldr w0, [x8, :lo12:draw_socket]
bl closesocket
ldr x8, [sp] // 8-byte Folded Reload
str wzr, [x8, :lo12:draw_socket]
b .LBB0_8
.LBB0_8:
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size GLS_BeginScene, .Lfunc_end0-GLS_BeginScene
.cfi_endproc
// -- End function
.type wins_init,@object // @wins_init
.bss
.globl wins_init
.p2align 3, 0x0
wins_init:
.xword 0 // 0x0
.size wins_init, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0 // 0x0
.size qtrue, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Winsock initialization failed."
.size .L.str, 31
.type PF_INET,@object // @PF_INET
.bss
.globl PF_INET
.p2align 2, 0x0
PF_INET:
.word 0 // 0x0
.size PF_INET, 4
.type SOCK_STREAM,@object // @SOCK_STREAM
.globl SOCK_STREAM
.p2align 2, 0x0
SOCK_STREAM:
.word 0 // 0x0
.size SOCK_STREAM, 4
.type IPPROTO_TCP,@object // @IPPROTO_TCP
.globl IPPROTO_TCP
.p2align 2, 0x0
IPPROTO_TCP:
.word 0 // 0x0
.size IPPROTO_TCP, 4
.type draw_socket,@object // @draw_socket
.globl draw_socket
.p2align 2, 0x0
draw_socket:
.word 0 // 0x0
.size draw_socket, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "draw_socket failed"
.size .L.str.1, 19
.type AF_INET,@object // @AF_INET
.bss
.globl AF_INET
.p2align 2, 0x0
AF_INET:
.word 0 // 0x0
.size AF_INET, 4
.type INADDR_LOOPBACK,@object // @INADDR_LOOPBACK
.globl INADDR_LOOPBACK
.p2align 2, 0x0
INADDR_LOOPBACK:
.word 0 // 0x0
.size INADDR_LOOPBACK, 4
.type GLSERV_PORT,@object // @GLSERV_PORT
.globl GLSERV_PORT
.p2align 2, 0x0
GLSERV_PORT:
.word 0 // 0x0
.size GLSERV_PORT, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym MAKEWORD
.addrsig_sym WSAStartup
.addrsig_sym Error
.addrsig_sym socket
.addrsig_sym htonl
.addrsig_sym connect
.addrsig_sym closesocket
.addrsig_sym wins_init
.addrsig_sym qtrue
.addrsig_sym PF_INET
.addrsig_sym SOCK_STREAM
.addrsig_sym IPPROTO_TCP
.addrsig_sym draw_socket
.addrsig_sym AF_INET
.addrsig_sym INADDR_LOOPBACK
.addrsig_sym GLSERV_PORT
|
../AnghaBench/Quake-III-Arena/q3map/extr_gldraw.c_GLS_BeginScene.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ vec_t ;
typedef float* vec3_t ;
/* Variables and functions */
int /*<<< orphan*/ atan2 (float,float) ;
float cos (int /*<<< orphan*/ ) ;
int fabs (float) ;
float sin (int /*<<< orphan*/ ) ;
float sqrt (float) ;
void ComputeAxisBase(vec3_t normal,vec3_t texX,vec3_t texY)
{
vec_t RotY,RotZ;
// do some cleaning
if (fabs(normal[0])<1e-6)
normal[0]=0.0f;
if (fabs(normal[1])<1e-6)
normal[1]=0.0f;
if (fabs(normal[2])<1e-6)
normal[2]=0.0f;
// compute the two rotations around Y and Z to rotate X to normal
RotY=-atan2(normal[2],sqrt(normal[1]*normal[1]+normal[0]*normal[0]));
RotZ=atan2(normal[1],normal[0]);
// rotate (0,1,0) and (0,0,1) to compute texX and texY
texX[0]=-sin(RotZ);
texX[1]=cos(RotZ);
texX[2]=0;
// the texY vector is along -Z ( T texture coorinates axis )
texY[0]=-sin(RotY)*cos(RotZ);
texY[1]=-sin(RotY)*sin(RotZ);
texY[2]=-cos(RotY);
}
|
.text
.file "extr_brush_primit.c_ComputeAxisBase.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function ComputeAxisBase
.LCPI0_0:
.xword 0x3eb0c6f7a0b5ed8d // double 9.9999999999999995E-7
.text
.globl ComputeAxisBase
.p2align 2
.type ComputeAxisBase,@function
ComputeAxisBase: // @ComputeAxisBase
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
str x2, [sp, #24]
ldur x8, [x29, #-8]
ldr s0, [x8]
bl fabs
scvtf d0, w0
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-8]
movi d0, #0000000000000000
str s0, [x8]
b .LBB0_2
.LBB0_2:
ldur x8, [x29, #-8]
ldr s0, [x8, #4]
bl fabs
scvtf d0, w0
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-8]
movi d0, #0000000000000000
str s0, [x8, #4]
b .LBB0_4
.LBB0_4:
ldur x8, [x29, #-8]
ldr s0, [x8, #8]
bl fabs
scvtf d0, w0
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
ldur x8, [x29, #-8]
movi d0, #0000000000000000
str s0, [x8, #8]
b .LBB0_6
.LBB0_6:
ldur x8, [x29, #-8]
ldr s0, [x8, #8]
str s0, [sp, #4] // 4-byte Folded Spill
ldur x8, [x29, #-8]
ldr s0, [x8, #4]
ldur x8, [x29, #-8]
ldr s1, [x8, #4]
ldur x8, [x29, #-8]
ldr s2, [x8]
ldur x8, [x29, #-8]
ldr s3, [x8]
fmul s2, s2, s3
fmadd s0, s0, s1, s2
bl sqrt
fmov s1, s0
ldr s0, [sp, #4] // 4-byte Folded Reload
bl atan2
mov w8, wzr
subs w8, w8, w0
str w8, [sp, #20]
ldur x8, [x29, #-8]
ldr s0, [x8, #4]
ldur x8, [x29, #-8]
ldr s1, [x8]
bl atan2
str w0, [sp, #16]
ldr w0, [sp, #16]
bl sin
fneg s0, s0
ldur x8, [x29, #-16]
str s0, [x8]
ldr w0, [sp, #16]
bl cos
ldur x8, [x29, #-16]
str s0, [x8, #4]
ldur x8, [x29, #-16]
movi d0, #0000000000000000
str s0, [x8, #8]
ldr w0, [sp, #20]
bl sin
str s0, [sp, #8] // 4-byte Folded Spill
ldr w0, [sp, #16]
bl cos
fmov s1, s0
ldr s0, [sp, #8] // 4-byte Folded Reload
fnmul s0, s0, s1
ldr x8, [sp, #24]
str s0, [x8]
ldr w0, [sp, #20]
bl sin
str s0, [sp, #12] // 4-byte Folded Spill
ldr w0, [sp, #16]
bl sin
fmov s1, s0
ldr s0, [sp, #12] // 4-byte Folded Reload
fnmul s0, s0, s1
ldr x8, [sp, #24]
str s0, [x8, #4]
ldr w0, [sp, #20]
bl cos
fneg s0, s0
ldr x8, [sp, #24]
str s0, [x8, #8]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size ComputeAxisBase, .Lfunc_end0-ComputeAxisBase
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym fabs
.addrsig_sym atan2
.addrsig_sym sqrt
.addrsig_sym sin
.addrsig_sym cos
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush_primit.c_ComputeAxisBase.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_21__ TYPE_8__ ;
typedef struct TYPE_20__ TYPE_4__ ;
typedef struct TYPE_19__ TYPE_3__ ;
typedef struct TYPE_18__ TYPE_2__ ;
typedef struct TYPE_17__ TYPE_1__ ;
/* Type definitions */
struct TYPE_17__ {int contents; int surfaceFlags; scalar_t__ forceVLight; scalar_t__ forceTraceLight; } ;
typedef TYPE_1__ shaderInfo_t ;
struct TYPE_18__ {int numFacets; int /*<<< orphan*/ radius; int /*<<< orphan*/ origin; int /*<<< orphan*/ maxs; int /*<<< orphan*/ mins; TYPE_3__* facets; void* always_vlight; void* always_tracelight; scalar_t__ numvolumes; int /*<<< orphan*/ mutex; } ;
typedef TYPE_2__ lsurfaceTest_t ;
struct TYPE_19__ {int numpoints; int /*<<< orphan*/ * points; } ;
typedef TYPE_3__ lFacet_t ;
struct TYPE_20__ {size_t shaderNum; scalar_t__ lightmapNum; scalar_t__ surfaceType; int /*<<< orphan*/ patchWidth; int /*<<< orphan*/ numIndexes; } ;
typedef TYPE_4__ dsurface_t ;
struct TYPE_21__ {int /*<<< orphan*/ shader; } ;
/* Variables and functions */
int /*<<< orphan*/ AddPointToBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int CONTENTS_TRANSLUCENT ;
int /*<<< orphan*/ ClearBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Error (char*,scalar_t__) ;
scalar_t__ MAX_FACETS ;
scalar_t__ MST_PATCH ;
scalar_t__ MST_PLANAR ;
scalar_t__ MST_TRIANGLE_SOUP ;
int /*<<< orphan*/ MutexAlloc () ;
int SURF_ALPHASHADOW ;
TYPE_1__* ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_FacetsForPatch (TYPE_4__*,int,TYPE_1__*,TYPE_2__*) ;
int /*<<< orphan*/ VL_FacetsForTriangleSurface (TYPE_4__*,TYPE_1__*,TYPE_2__*) ;
int /*<<< orphan*/ VL_LinkSurfaces () ;
int /*<<< orphan*/ VL_SphereFromBounds (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ _printf (char*,...) ;
TYPE_4__* drawSurfaces ;
TYPE_8__* dshaders ;
scalar_t__* entitySurface ;
TYPE_2__** lsurfaceTest ;
TYPE_2__* malloc (int) ;
int /*<<< orphan*/ memset (TYPE_2__*,int /*<<< orphan*/ ,int) ;
int numDrawSurfaces ;
scalar_t__ numfacets ;
void* qtrue ;
void VL_InitSurfacesForTesting( void ) {
int i, j, k;
dsurface_t *dsurf;
lsurfaceTest_t *test;
shaderInfo_t *si;
lFacet_t *facet;
for ( i = 0 ; i < numDrawSurfaces ; i++ ) {
// don't light the entity surfaces with vlight
if ( entitySurface[i] )
continue;
//
dsurf = &drawSurfaces[ i ];
if ( !dsurf->numIndexes && !dsurf->patchWidth ) {
continue;
}
si = ShaderInfoForShader( dshaders[ dsurf->shaderNum].shader );
// if the surface is translucent and does not cast an alpha shadow
if ( (si->contents & CONTENTS_TRANSLUCENT) && !(si->surfaceFlags & SURF_ALPHASHADOW) ) {
// if the surface has no lightmap
if ( dsurf->lightmapNum < 0 )
continue;
}
test = malloc( sizeof( *test ) );
memset(test, 0, sizeof( *test ));
test->mutex = MutexAlloc();
test->numvolumes = 0;
if (si->forceTraceLight)
test->always_tracelight = qtrue;
else if (si->forceVLight)
test->always_vlight = qtrue;
lsurfaceTest[i] = test;
if ( dsurf->surfaceType == MST_TRIANGLE_SOUP || dsurf->surfaceType == MST_PLANAR ) {
VL_FacetsForTriangleSurface( dsurf, si, test );
} else if ( dsurf->surfaceType == MST_PATCH ) {
VL_FacetsForPatch( dsurf, i, si, test );
}
if (numfacets >= MAX_FACETS)
Error("numfacets >= MAX_FACETS (%d)", MAX_FACETS);
ClearBounds( test->mins, test->maxs );
for (j = 0; j < test->numFacets; j++)
{
facet = &test->facets[j];
for ( k = 0 ; k < facet->numpoints; k++) {
AddPointToBounds( facet->points[k], test->mins, test->maxs );
}
}
VL_SphereFromBounds( test->mins, test->maxs, test->origin, &test->radius );
}
_printf("%6d facets\n", numfacets);
_printf("linking surfaces...\n");
VL_LinkSurfaces();
}
|
.text
.file "extr_lightv.c_VL_InitSurfacesForTesting.c"
.globl VL_InitSurfacesForTesting // -- Begin function VL_InitSurfacesForTesting
.p2align 2
.type VL_InitSurfacesForTesting,@function
VL_InitSurfacesForTesting: // @VL_InitSurfacesForTesting
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_26 Depth 2
// Child Loop BB0_28 Depth 3
ldur w8, [x29, #-4]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_35
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, entitySurface
ldr x8, [x8, :lo12:entitySurface]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_34
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #5
stur x8, [x29, #-24]
ldur x8, [x29, #-24]
ldr w8, [x8, #28]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr w8, [x8, #24]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
b .LBB0_34
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
adrp x8, dshaders
ldr x8, [x8, :lo12:dshaders]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldr w0, [x8, x9, lsl #2]
bl ShaderInfoForShader
str x0, [sp, #24]
ldr x8, [sp, #24]
ldr w8, [x8]
adrp x9, CONTENTS_TRANSLUCENT
ldr w9, [x9, :lo12:CONTENTS_TRANSLUCENT]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr w8, [x8, #4]
adrp x9, SURF_ALPHASHADOW
ldr w9, [x9, :lo12:SURF_ALPHASHADOW]
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_12
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, ge
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_34
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
mov w0, #64 // =0x40
str w0, [sp, #12] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #12] // 4-byte Folded Reload
str x0, [sp, #32]
ldr x0, [sp, #32]
mov w1, wzr
bl memset
bl MutexAlloc
ldr x8, [sp, #32]
str w0, [x8, #56]
ldr x8, [sp, #32]
str xzr, [x8, #48]
ldr x8, [sp, #24]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldr x9, [sp, #32]
str x8, [x9, #40]
b .LBB0_17
.LBB0_14: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_1 Depth=1
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldr x9, [sp, #32]
str x8, [x9, #32]
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_1 Depth=1
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
adrp x9, lsurfaceTest
ldr x9, [x9, :lo12:lsurfaceTest]
ldursw x10, [x29, #-4]
str x8, [x9, x10, lsl #3]
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
adrp x9, MST_TRIANGLE_SOUP
ldr x9, [x9, :lo12:MST_TRIANGLE_SOUP]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, .LBB0_19
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
adrp x9, MST_PLANAR
ldr x9, [x9, :lo12:MST_PLANAR]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-24]
ldr x1, [sp, #24]
ldr x2, [sp, #32]
bl VL_FacetsForTriangleSurface
b .LBB0_23
.LBB0_20: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
adrp x9, MST_PATCH
ldr x9, [x9, :lo12:MST_PATCH]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-24]
ldur w1, [x29, #-4]
ldr x2, [sp, #24]
ldr x3, [sp, #32]
bl VL_FacetsForPatch
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_1 Depth=1
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_1 Depth=1
adrp x8, numfacets
ldr x8, [x8, :lo12:numfacets]
adrp x9, MAX_FACETS
ldr x9, [x9, :lo12:MAX_FACETS]
subs x8, x8, x9
cset w8, lt
tbnz w8, #0, .LBB0_25
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_1 Depth=1
adrp x8, MAX_FACETS
ldr x1, [x8, :lo12:MAX_FACETS]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
ldr w0, [x8, #16]
ldr x8, [sp, #32]
ldr w1, [x8, #12]
bl ClearBounds
stur wzr, [x29, #-8]
b .LBB0_26
.LBB0_26: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_28 Depth 3
ldur w8, [x29, #-8]
ldr x9, [sp, #32]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_33
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_26 Depth=2
ldr x8, [sp, #32]
ldr x8, [x8, #24]
ldursw x9, [x29, #-8]
add x8, x8, x9, lsl #4
str x8, [sp, #16]
stur wzr, [x29, #-12]
b .LBB0_28
.LBB0_28: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_26 Depth=2
// => This Inner Loop Header: Depth=3
ldur w8, [x29, #-12]
ldr x9, [sp, #16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_31
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_28 Depth=3
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-12]
ldr w0, [x8, x9, lsl #2]
ldr x8, [sp, #32]
ldr w1, [x8, #16]
ldr x8, [sp, #32]
ldr w2, [x8, #12]
bl AddPointToBounds
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_28 Depth=3
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_28
.LBB0_31: // in Loop: Header=BB0_26 Depth=2
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_26 Depth=2
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_26
.LBB0_33: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #32]
ldr w0, [x8, #16]
ldr x8, [sp, #32]
ldr w1, [x8, #12]
ldr x8, [sp, #32]
ldr w2, [x8, #8]
ldr x8, [sp, #32]
add x3, x8, #4
bl VL_SphereFromBounds
b .LBB0_34
.LBB0_34: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_1
.LBB0_35:
adrp x8, numfacets
ldr x1, [x8, :lo12:numfacets]
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
bl VL_LinkSurfaces
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_InitSurfacesForTesting, .Lfunc_end0-VL_InitSurfacesForTesting
.cfi_endproc
// -- End function
.type numDrawSurfaces,@object // @numDrawSurfaces
.bss
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type entitySurface,@object // @entitySurface
.globl entitySurface
.p2align 3, 0x0
entitySurface:
.xword 0
.size entitySurface, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type dshaders,@object // @dshaders
.globl dshaders
.p2align 3, 0x0
dshaders:
.xword 0
.size dshaders, 8
.type CONTENTS_TRANSLUCENT,@object // @CONTENTS_TRANSLUCENT
.globl CONTENTS_TRANSLUCENT
.p2align 2, 0x0
CONTENTS_TRANSLUCENT:
.word 0 // 0x0
.size CONTENTS_TRANSLUCENT, 4
.type SURF_ALPHASHADOW,@object // @SURF_ALPHASHADOW
.globl SURF_ALPHASHADOW
.p2align 2, 0x0
SURF_ALPHASHADOW:
.word 0 // 0x0
.size SURF_ALPHASHADOW, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0
.size qtrue, 8
.type lsurfaceTest,@object // @lsurfaceTest
.globl lsurfaceTest
.p2align 3, 0x0
lsurfaceTest:
.xword 0
.size lsurfaceTest, 8
.type MST_TRIANGLE_SOUP,@object // @MST_TRIANGLE_SOUP
.globl MST_TRIANGLE_SOUP
.p2align 3, 0x0
MST_TRIANGLE_SOUP:
.xword 0 // 0x0
.size MST_TRIANGLE_SOUP, 8
.type MST_PLANAR,@object // @MST_PLANAR
.globl MST_PLANAR
.p2align 3, 0x0
MST_PLANAR:
.xword 0 // 0x0
.size MST_PLANAR, 8
.type MST_PATCH,@object // @MST_PATCH
.globl MST_PATCH
.p2align 3, 0x0
MST_PATCH:
.xword 0 // 0x0
.size MST_PATCH, 8
.type numfacets,@object // @numfacets
.globl numfacets
.p2align 3, 0x0
numfacets:
.xword 0 // 0x0
.size numfacets, 8
.type MAX_FACETS,@object // @MAX_FACETS
.globl MAX_FACETS
.p2align 3, 0x0
MAX_FACETS:
.xword 0 // 0x0
.size MAX_FACETS, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "numfacets >= MAX_FACETS (%d)"
.size .L.str, 29
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "%6d facets\n"
.size .L.str.1, 12
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "linking surfaces...\n"
.size .L.str.2, 21
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym ShaderInfoForShader
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym MutexAlloc
.addrsig_sym VL_FacetsForTriangleSurface
.addrsig_sym VL_FacetsForPatch
.addrsig_sym Error
.addrsig_sym ClearBounds
.addrsig_sym AddPointToBounds
.addrsig_sym VL_SphereFromBounds
.addrsig_sym _printf
.addrsig_sym VL_LinkSurfaces
.addrsig_sym numDrawSurfaces
.addrsig_sym entitySurface
.addrsig_sym drawSurfaces
.addrsig_sym dshaders
.addrsig_sym CONTENTS_TRANSLUCENT
.addrsig_sym SURF_ALPHASHADOW
.addrsig_sym qtrue
.addrsig_sym lsurfaceTest
.addrsig_sym MST_TRIANGLE_SOUP
.addrsig_sym MST_PLANAR
.addrsig_sym MST_PATCH
.addrsig_sym numfacets
.addrsig_sym MAX_FACETS
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_InitSurfacesForTesting.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_23__ TYPE_3__ ;
typedef struct TYPE_22__ TYPE_2__ ;
typedef struct TYPE_21__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ shaderInfo_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_21__ {float dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_22__ {int numpoints; scalar_t__ num; int /*<<< orphan*/ * points; TYPE_1__ plane; int /*<<< orphan*/ * boundaries; int /*<<< orphan*/ ** lightmapCoords; } ;
typedef TYPE_2__ lFacet_t ;
typedef int /*<<< orphan*/ dsurface_t ;
struct TYPE_23__ {int /*<<< orphan*/ * lightmap; int /*<<< orphan*/ xyz; } ;
typedef TYPE_3__ drawVert_t ;
/* Variables and functions */
float DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ PLANAR_EPSILON ;
int /*<<< orphan*/ Plane_Equal (TYPE_1__*,TYPE_1__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_GenerateBoundaryForPoints (int /*<<< orphan*/ *,TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_LightmapMatrixFromPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_2__*,TYPE_3__*,TYPE_3__*,TYPE_3__*) ;
int /*<<< orphan*/ VL_PlaneFromPoints (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_TextureMatrixFromPoints (TYPE_2__*,TYPE_3__*,TYPE_3__*,TYPE_3__*) ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
double VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * drawSurfaces ;
scalar_t__ fabs (float) ;
int /*<<< orphan*/ numfacets ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ * surfaceOrigin ;
qboolean VL_GenerateFacetFor4Points( dsurface_t *dsurf, shaderInfo_t *si, lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c, drawVert_t *d ) {
float dist;
vec3_t dir;
int i;
plane_t plane;
// if we can't generate a valid plane for the points, ignore the facet
if ( !VL_PlaneFromPoints( &f->plane, a->xyz, b->xyz, c->xyz ) ) {
f->numpoints = 0;
return qfalse;
}
// if the fourth point is also on the plane, we can make a quad facet
dist = DotProduct( d->xyz, f->plane.normal ) - f->plane.dist;
if ( fabs( dist ) > PLANAR_EPSILON ) {
f->numpoints = 0;
return qfalse;
}
VectorAdd( a->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[0] );
VectorAdd( b->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[1] );
VectorAdd( c->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[2] );
VectorAdd( d->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[3] );
for (i = 1; i < 4; i++)
{
if ( !VL_PlaneFromPoints( &plane, f->points[i], f->points[(i+1) % 4], f->points[(i+2) % 4]) ) {
f->numpoints = 0;
return qfalse;
}
if (!Plane_Equal(&f->plane, &plane, qfalse)) {
f->numpoints = 0;
return qfalse;
}
}
f->lightmapCoords[0][0] = a->lightmap[0];
f->lightmapCoords[0][1] = a->lightmap[1];
f->lightmapCoords[1][0] = b->lightmap[0];
f->lightmapCoords[1][1] = b->lightmap[1];
f->lightmapCoords[2][0] = c->lightmap[0];
f->lightmapCoords[2][1] = c->lightmap[1];
f->lightmapCoords[3][0] = d->lightmap[0];
f->lightmapCoords[3][1] = d->lightmap[1];
VL_GenerateBoundaryForPoints( &f->boundaries[0], &f->plane, f->points[0], f->points[1] );
VL_GenerateBoundaryForPoints( &f->boundaries[1], &f->plane, f->points[1], f->points[2] );
VL_GenerateBoundaryForPoints( &f->boundaries[2], &f->plane, f->points[2], f->points[3] );
VL_GenerateBoundaryForPoints( &f->boundaries[3], &f->plane, f->points[3], f->points[0] );
for (i = 0; i < 4; i++)
{
VectorSubtract(f->points[(i+1)%4], f->points[i], dir);
if (VectorLength(dir) < 0.1)
return qfalse;
}
VL_TextureMatrixFromPoints( f, a, b, c );
VL_LightmapMatrixFromPoints( dsurf, si, f, a, b, c );
f->num = numfacets++;
f->numpoints = 4;
return qtrue;
}
|
.text
.file "extr_lightv.c_VL_GenerateFacetFor4Points.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_GenerateFacetFor4Points
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_GenerateFacetFor4Points
.p2align 2
.type VL_GenerateFacetFor4Points,@function
VL_GenerateFacetFor4Points: // @VL_GenerateFacetFor4Points
.cfi_startproc
// %bb.0:
sub sp, sp, #128
.cfi_def_cfa_offset 128
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
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
stur x3, [x29, #-40]
stur x4, [x29, #-48]
str x5, [sp, #56]
str x6, [sp, #48]
ldur x8, [x29, #-32]
ldur x9, [x29, #-40]
ldr w1, [x9, #8]
ldur x9, [x29, #-48]
ldr w2, [x9, #8]
ldr x9, [sp, #56]
ldr w3, [x9, #8]
add x0, x8, #24
bl VL_PlaneFromPoints
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-32]
str wzr, [x8]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_19
.LBB0_2:
ldr x8, [sp, #48]
ldr w0, [x8, #8]
ldur x8, [x29, #-32]
ldr w1, [x8, #28]
bl DotProduct
ldur x8, [x29, #-32]
ldr s1, [x8, #24]
fsub s0, s0, s1
str s0, [sp, #44]
ldr s0, [sp, #44]
bl fabs
adrp x8, PLANAR_EPSILON
ldr x8, [x8, :lo12:PLANAR_EPSILON]
subs x8, x0, x8
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-32]
str wzr, [x8]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_19
.LBB0_4:
ldur x8, [x29, #-40]
ldr w0, [x8, #8]
adrp x8, surfaceOrigin
str x8, [sp] // 8-byte Folded Spill
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
adrp x10, drawSurfaces
str x10, [sp, #8] // 8-byte Folded Spill
ldr x10, [x10, :lo12:drawSurfaces]
subs x9, x9, x10
mov x10, #4 // =0x4
str x10, [sp, #16] // 8-byte Folded Spill
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8]
bl VectorAdd
ldr x8, [sp] // 8-byte Folded Reload
ldr x11, [sp, #8] // 8-byte Folded Reload
ldr x10, [sp, #16] // 8-byte Folded Reload
ldur x9, [x29, #-48]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8, #4]
bl VectorAdd
ldr x8, [sp] // 8-byte Folded Reload
ldr x11, [sp, #8] // 8-byte Folded Reload
ldr x10, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #56]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8, #8]
bl VectorAdd
ldr x8, [sp] // 8-byte Folded Reload
ldr x11, [sp, #8] // 8-byte Folded Reload
ldr x10, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #48]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8, #12]
bl VectorAdd
mov w8, #1 // =0x1
str w8, [sp, #36]
b .LBB0_5
.LBB0_5: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #36]
subs w8, w8, #4
cset w8, ge
tbnz w8, #0, .LBB0_12
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldrsw x9, [sp, #36]
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w9, [sp, #36]
add w9, w9, #1
mov w11, #4 // =0x4
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr w2, [x8, w9, sxtw #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w9, [sp, #36]
add w9, w9, #2
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr w3, [x8, w9, sxtw #2]
add x0, sp, #28
bl VL_PlaneFromPoints
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
ldur x8, [x29, #-32]
str wzr, [x8]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_19
.LBB0_8: // in Loop: Header=BB0_5 Depth=1
ldur x8, [x29, #-32]
add x0, x8, #24
adrp x8, qfalse
ldr w2, [x8, :lo12:qfalse]
add x1, sp, #28
bl Plane_Equal
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9:
ldur x8, [x29, #-32]
str wzr, [x8]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_19
.LBB0_10: // in Loop: Header=BB0_5 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_5 Depth=1
ldr w8, [sp, #36]
add w8, w8, #1
str w8, [sp, #36]
b .LBB0_5
.LBB0_12:
ldur x8, [x29, #-40]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9]
str w8, [x9]
ldur x8, [x29, #-40]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9]
str w8, [x9, #4]
ldur x8, [x29, #-48]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9, #8]
str w8, [x9]
ldur x8, [x29, #-48]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9, #8]
str w8, [x9, #4]
ldr x8, [sp, #56]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9, #16]
str w8, [x9]
ldr x8, [sp, #56]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9, #16]
str w8, [x9, #4]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9, #24]
str w8, [x9]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #40]
ldr x9, [x9, #24]
str w8, [x9, #4]
ldur x8, [x29, #-32]
ldr x0, [x8, #32]
ldur x8, [x29, #-32]
add x1, x8, #24
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w3, [x8, #4]
bl VL_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
add x0, x8, #4
ldur x8, [x29, #-32]
add x1, x8, #24
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8, #4]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w3, [x8, #8]
bl VL_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
add x0, x8, #8
ldur x8, [x29, #-32]
add x1, x8, #24
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8, #8]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w3, [x8, #12]
bl VL_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #32]
add x0, x8, #12
ldur x8, [x29, #-32]
add x1, x8, #24
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w2, [x8, #12]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w3, [x8]
bl VL_GenerateBoundaryForPoints
str wzr, [sp, #36]
b .LBB0_13
.LBB0_13: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #36]
subs w8, w8, #4
cset w8, ge
tbnz w8, #0, .LBB0_18
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_13 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldr w9, [sp, #36]
add w9, w9, #1
mov w11, #4 // =0x4
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr w0, [x8, w9, sxtw #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #16]
ldrsw x9, [sp, #36]
ldr w1, [x8, x9, lsl #2]
ldr w2, [sp, #40]
bl VectorSubtract
ldr w0, [sp, #40]
bl VectorLength
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_19
.LBB0_16: // in Loop: Header=BB0_13 Depth=1
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_13 Depth=1
ldr w8, [sp, #36]
add w8, w8, #1
str w8, [sp, #36]
b .LBB0_13
.LBB0_18:
ldur x0, [x29, #-32]
ldur x1, [x29, #-40]
ldur x2, [x29, #-48]
ldr x3, [sp, #56]
bl VL_TextureMatrixFromPoints
ldur x0, [x29, #-16]
ldur x1, [x29, #-24]
ldur x2, [x29, #-32]
ldur x3, [x29, #-40]
ldur x4, [x29, #-48]
ldr x5, [sp, #56]
bl VL_LightmapMatrixFromPoints
adrp x10, numfacets
ldrsw x8, [x10, :lo12:numfacets]
mov w9, w8
add w9, w9, #1
str w9, [x10, :lo12:numfacets]
ldur x9, [x29, #-32]
str x8, [x9, #8]
ldur x9, [x29, #-32]
mov w8, #4 // =0x4
str w8, [x9]
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_19
.LBB0_19:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 128
ldp x29, x30, [sp, #112] // 16-byte Folded Reload
add sp, sp, #128
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_GenerateFacetFor4Points, .Lfunc_end0-VL_GenerateFacetFor4Points
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type PLANAR_EPSILON,@object // @PLANAR_EPSILON
.globl PLANAR_EPSILON
.p2align 3, 0x0
PLANAR_EPSILON:
.xword 0 // 0x0
.size PLANAR_EPSILON, 8
.type surfaceOrigin,@object // @surfaceOrigin
.globl surfaceOrigin
.p2align 3, 0x0
surfaceOrigin:
.xword 0
.size surfaceOrigin, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type numfacets,@object // @numfacets
.globl numfacets
.p2align 2, 0x0
numfacets:
.word 0 // 0x0
.size numfacets, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VL_PlaneFromPoints
.addrsig_sym DotProduct
.addrsig_sym fabs
.addrsig_sym VectorAdd
.addrsig_sym Plane_Equal
.addrsig_sym VL_GenerateBoundaryForPoints
.addrsig_sym VectorSubtract
.addrsig_sym VectorLength
.addrsig_sym VL_TextureMatrixFromPoints
.addrsig_sym VL_LightmapMatrixFromPoints
.addrsig_sym qfalse
.addrsig_sym PLANAR_EPSILON
.addrsig_sym surfaceOrigin
.addrsig_sym drawSurfaces
.addrsig_sym numfacets
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_GenerateFacetFor4Points.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_3__ {int /*<<< orphan*/ normal; int /*<<< orphan*/ dist; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ DotProduct (int /*<<< orphan*/ const,int /*<<< orphan*/ ) ;
scalar_t__ VectorNormalize (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ const,int /*<<< orphan*/ const,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean VL_PlaneFromPoints( plane_t *plane, const vec3_t a, const vec3_t b, const vec3_t c ) {
vec3_t d1, d2;
VectorSubtract( b, a, d1 );
VectorSubtract( c, a, d2 );
CrossProduct( d2, d1, plane->normal );
if ( VectorNormalize( plane->normal, plane->normal ) == 0 ) {
return qfalse;
}
plane->dist = DotProduct( a, plane->normal );
return qtrue;
}
|
.text
.file "extr_lightv.c_VL_PlaneFromPoints.c"
.globl VL_PlaneFromPoints // -- Begin function VL_PlaneFromPoints
.p2align 2
.type VL_PlaneFromPoints,@function
VL_PlaneFromPoints: // @VL_PlaneFromPoints
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-16]
stur w1, [x29, #-20]
str w2, [sp, #24]
str w3, [sp, #20]
ldr w0, [sp, #24]
ldur w1, [x29, #-20]
ldr w2, [sp, #16]
bl VectorSubtract
ldr w0, [sp, #20]
ldur w1, [x29, #-20]
ldr w2, [sp, #12]
bl VectorSubtract
ldr w0, [sp, #12]
ldr w1, [sp, #16]
ldur x8, [x29, #-16]
ldr w2, [x8]
bl CrossProduct
ldur x8, [x29, #-16]
ldr w0, [x8]
ldur x8, [x29, #-16]
ldr w1, [x8]
bl VectorNormalize
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_3
.LBB0_2:
ldur w0, [x29, #-20]
ldur x8, [x29, #-16]
ldr w1, [x8]
bl DotProduct
ldur x8, [x29, #-16]
str w0, [x8, #4]
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_3
.LBB0_3:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_PlaneFromPoints, .Lfunc_end0-VL_PlaneFromPoints
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorSubtract
.addrsig_sym CrossProduct
.addrsig_sym VectorNormalize
.addrsig_sym DotProduct
.addrsig_sym qfalse
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_PlaneFromPoints.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
int /*<<< orphan*/ LoadBSPFile (char*) ;
int /*<<< orphan*/ LoadMapFile (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ WriteBSPFile (char*) ;
int /*<<< orphan*/ name ;
int numDrawSurfaces ;
char* source ;
int /*<<< orphan*/ sprintf (char*,char*,char*) ;
void OnlyTextures( void ) { // FIXME!!!
char out[1024];
int i;
Error( "-onlytextures isn't working now..." );
sprintf (out, "%s.bsp", source);
LoadMapFile (name);
LoadBSPFile (out);
// replace all the drawsurface shader names
for ( i = 0 ; i < numDrawSurfaces ; i++ ) {
}
WriteBSPFile (out);
}
|
.text
.file "extr_bsp.c_OnlyTextures.c"
.globl OnlyTextures // -- Begin function OnlyTextures
.p2align 2
.type OnlyTextures,@function
OnlyTextures: // @OnlyTextures
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x28, [sp, #16] // 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1040
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
adrp x8, source
ldr x2, [x8, :lo12:source]
add x0, sp, #16
str x0, [sp] // 8-byte Folded Spill
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl sprintf
adrp x8, name
ldr w0, [x8, :lo12:name]
bl LoadMapFile
ldr x0, [sp] // 8-byte Folded Reload
bl LoadBSPFile
str wzr, [sp, #12]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_1
.LBB0_4:
add x0, sp, #16
bl WriteBSPFile
add sp, sp, #1040
.cfi_def_cfa wsp, 32
ldr x28, [sp, #16] // 8-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size OnlyTextures, .Lfunc_end0-OnlyTextures
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "-onlytextures isn't working now..."
.size .L.str, 35
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "%s.bsp"
.size .L.str.1, 7
.type source,@object // @source
.bss
.globl source
.p2align 3, 0x0
source:
.xword 0
.size source, 8
.type name,@object // @name
.globl name
.p2align 2, 0x0
name:
.word 0 // 0x0
.size name, 4
.type numDrawSurfaces,@object // @numDrawSurfaces
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
.addrsig_sym sprintf
.addrsig_sym LoadMapFile
.addrsig_sym LoadBSPFile
.addrsig_sym WriteBSPFile
.addrsig_sym source
.addrsig_sym name
.addrsig_sym numDrawSurfaces
|
../AnghaBench/Quake-III-Arena/q3map/extr_bsp.c_OnlyTextures.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef double vec_t ;
typedef int /*<<< orphan*/ FILE ;
/* Variables and functions */
scalar_t__ Q_rint (double) ;
double fabs (scalar_t__) ;
int /*<<< orphan*/ fprintf (int /*<<< orphan*/ *,char*,double) ;
void WriteFloat (FILE *f, vec_t v)
{
if ( fabs(v - Q_rint(v)) < 0.001 )
fprintf (f,"%i ",(int)Q_rint(v));
else
fprintf (f,"%f ",v);
}
|
.text
.file "extr_prtfile.c_WriteFloat.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function WriteFloat
.LCPI0_0:
.xword 0x3f50624dd2f1a9fc // double 0.001
.text
.globl WriteFloat
.p2align 2
.type WriteFloat,@function
WriteFloat: // @WriteFloat
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
str d0, [sp, #16]
ldr d0, [sp, #16]
str d0, [sp, #8] // 8-byte Folded Spill
ldr d0, [sp, #16]
bl Q_rint
ldr d0, [sp, #8] // 8-byte Folded Reload
scvtf d1, x0
fsub d0, d0, d1
fcvtzs x0, d0
bl fabs
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-8]
str x8, [sp] // 8-byte Folded Spill
ldr d0, [sp, #16]
bl Q_rint
mov x8, x0
ldr x0, [sp] // 8-byte Folded Reload
// kill: def $w8 killed $w8 killed $x8
scvtf d0, w8
adrp x1, .L.str
add x1, x1, :lo12:.L.str
bl fprintf
b .LBB0_3
.LBB0_2:
ldur x0, [x29, #-8]
ldr d0, [sp, #16]
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl fprintf
b .LBB0_3
.LBB0_3:
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size WriteFloat, .Lfunc_end0-WriteFloat
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "%i "
.size .L.str, 4
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "%f "
.size .L.str.1, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym fabs
.addrsig_sym Q_rint
.addrsig_sym fprintf
|
../AnghaBench/Quake-III-Arena/q3map/extr_prtfile.c_WriteFloat.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ GetToken (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ LoadScriptFile (char*) ;
int /*<<< orphan*/ MAX_OS_PATH ;
int MAX_SHADER_FILES ;
int /*<<< orphan*/ ParseShaderFile (char*) ;
int /*<<< orphan*/ free (char*) ;
char* gamedir ;
char* malloc (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ numShaderInfo ;
int /*<<< orphan*/ qprintf (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ sprintf (char*,char*,char*,...) ;
int /*<<< orphan*/ strcpy (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ token ;
void LoadShaderInfo( void ) {
char filename[1024];
int i;
char *shaderFiles[MAX_SHADER_FILES];
int numShaderFiles;
sprintf( filename, "%sscripts/shaderlist.txt", gamedir );
LoadScriptFile( filename );
numShaderFiles = 0;
while ( 1 ) {
if ( !GetToken( qtrue ) ) {
break;
}
shaderFiles[numShaderFiles] = malloc(MAX_OS_PATH);
strcpy( shaderFiles[ numShaderFiles ], token );
numShaderFiles++;
}
for ( i = 0 ; i < numShaderFiles ; i++ ) {
sprintf( filename, "%sscripts/%s.shader", gamedir, shaderFiles[i] );
ParseShaderFile( filename );
free(shaderFiles[i]);
}
qprintf( "%5i shaderInfo\n", numShaderInfo);
}
|
.text
.file "extr_shaders.c_LoadShaderInfo.c"
.globl LoadShaderInfo // -- Begin function LoadShaderInfo
.p2align 2
.type LoadShaderInfo,@function
LoadShaderInfo: // @LoadShaderInfo
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
stp x28, x19, [sp, #16] // 16-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w19, -8
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1088
mov x19, sp
adrp x8, MAX_SHADER_FILES
ldr w8, [x8, :lo12:MAX_SHADER_FILES]
// kill: def $x8 killed $w8
mov x9, sp
str x9, [x19, #48]
lsl x9, x8, #3
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x9, x9, x10
mov sp, x9
str x9, [x19, #16] // 8-byte Folded Spill
str x8, [x19, #40]
adrp x8, gamedir
ldr x2, [x8, :lo12:gamedir]
add x0, x19, #64
str x0, [x19, #24] // 8-byte Folded Spill
adrp x1, .L.str
add x1, x1, :lo12:.L.str
bl sprintf
ldr x0, [x19, #24] // 8-byte Folded Reload
bl LoadScriptFile
str wzr, [x19, #36]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, qtrue
ldr w0, [x8, :lo12:qtrue]
bl GetToken
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
b .LBB0_5
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
adrp x8, MAX_OS_PATH
ldr w0, [x8, :lo12:MAX_OS_PATH]
bl malloc
ldr x8, [x19, #16] // 8-byte Folded Reload
ldrsw x9, [x19, #36]
str x0, [x8, x9, lsl #3]
ldrsw x9, [x19, #36]
ldr x0, [x8, x9, lsl #3]
adrp x8, token
ldr w1, [x8, :lo12:token]
bl strcpy
ldr w8, [x19, #36]
add w8, w8, #1
str w8, [x19, #36]
b .LBB0_1
.LBB0_5:
str wzr, [x19, #60]
b .LBB0_6
.LBB0_6: // =>This Inner Loop Header: Depth=1
ldr w8, [x19, #60]
ldr w9, [x19, #36]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_9
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_6 Depth=1
ldr x8, [x19, #16] // 8-byte Folded Reload
adrp x9, gamedir
ldr x2, [x9, :lo12:gamedir]
ldrsw x9, [x19, #60]
ldr x3, [x8, x9, lsl #3]
add x0, x19, #64
str x0, [x19, #8] // 8-byte Folded Spill
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl sprintf
ldr x0, [x19, #8] // 8-byte Folded Reload
bl ParseShaderFile
ldr x8, [x19, #16] // 8-byte Folded Reload
ldrsw x9, [x19, #60]
ldr x0, [x8, x9, lsl #3]
bl free
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_6 Depth=1
ldr w8, [x19, #60]
add w8, w8, #1
str w8, [x19, #60]
b .LBB0_6
.LBB0_9:
adrp x8, numShaderInfo
ldr w1, [x8, :lo12:numShaderInfo]
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl qprintf
ldr x8, [x19, #48]
mov sp, x8
mov sp, x29
.cfi_def_cfa wsp, 32
ldp x28, x19, [sp, #16] // 16-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w19
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size LoadShaderInfo, .Lfunc_end0-LoadShaderInfo
.cfi_endproc
// -- End function
.type MAX_SHADER_FILES,@object // @MAX_SHADER_FILES
.bss
.globl MAX_SHADER_FILES
.p2align 2, 0x0
MAX_SHADER_FILES:
.word 0 // 0x0
.size MAX_SHADER_FILES, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "%sscripts/shaderlist.txt"
.size .L.str, 25
.type gamedir,@object // @gamedir
.bss
.globl gamedir
.p2align 3, 0x0
gamedir:
.xword 0
.size gamedir, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type MAX_OS_PATH,@object // @MAX_OS_PATH
.globl MAX_OS_PATH
.p2align 2, 0x0
MAX_OS_PATH:
.word 0 // 0x0
.size MAX_OS_PATH, 4
.type token,@object // @token
.globl token
.p2align 2, 0x0
token:
.word 0 // 0x0
.size token, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "%sscripts/%s.shader"
.size .L.str.1, 20
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "%5i shaderInfo\n"
.size .L.str.2, 16
.type numShaderInfo,@object // @numShaderInfo
.bss
.globl numShaderInfo
.p2align 2, 0x0
numShaderInfo:
.word 0 // 0x0
.size numShaderInfo, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym sprintf
.addrsig_sym LoadScriptFile
.addrsig_sym GetToken
.addrsig_sym malloc
.addrsig_sym strcpy
.addrsig_sym ParseShaderFile
.addrsig_sym free
.addrsig_sym qprintf
.addrsig_sym MAX_SHADER_FILES
.addrsig_sym gamedir
.addrsig_sym qtrue
.addrsig_sym MAX_OS_PATH
.addrsig_sym token
.addrsig_sym numShaderInfo
|
../AnghaBench/Quake-III-Arena/q3map/extr_shaders.c_LoadShaderInfo.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_7__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {void* status; scalar_t__ portalflood; int /*<<< orphan*/ plane; int /*<<< orphan*/ winding; scalar_t__ removed; } ;
typedef TYPE_1__ vportal_t ;
struct TYPE_10__ {scalar_t__ mightsee; scalar_t__ depth; int /*<<< orphan*/ portalplane; int /*<<< orphan*/ source; TYPE_1__* portal; } ;
struct TYPE_9__ {TYPE_7__ pstack_head; TYPE_1__* base; } ;
typedef TYPE_2__ threaddata_t ;
typedef int /*<<< orphan*/ data ;
/* Variables and functions */
int /*<<< orphan*/ RecursivePassageFlow (TYPE_1__*,TYPE_2__*,TYPE_7__*) ;
int /*<<< orphan*/ _printf (char*,int) ;
int /*<<< orphan*/ memset (TYPE_2__*,int /*<<< orphan*/ ,int) ;
int portallongs ;
TYPE_1__** sorted_portals ;
void* stat_done ;
void* stat_working ;
void PassageFlow (int portalnum)
{
threaddata_t data;
int i;
vportal_t *p;
// int c_might, c_can;
#ifdef MREDEBUG
_printf("\r%6d", portalnum);
#endif
p = sorted_portals[portalnum];
if (p->removed)
{
p->status = stat_done;
return;
}
p->status = stat_working;
// c_might = CountBits (p->portalflood, numportals*2);
memset (&data, 0, sizeof(data));
data.base = p;
data.pstack_head.portal = p;
data.pstack_head.source = p->winding;
data.pstack_head.portalplane = p->plane;
data.pstack_head.depth = 0;
for (i=0 ; i<portallongs ; i++)
((long *)data.pstack_head.mightsee)[i] = ((long *)p->portalflood)[i];
RecursivePassageFlow (p, &data, &data.pstack_head);
p->status = stat_done;
/*
c_can = CountBits (p->portalvis, numportals*2);
qprintf ("portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
(int)(p - portals), c_might, c_can, data.c_chains);
*/
}
|
.text
.file "extr_visflow.c_PassageFlow.c"
.globl PassageFlow // -- Begin function PassageFlow
.p2align 2
.type PassageFlow,@function
PassageFlow: // @PassageFlow
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
adrp x8, sorted_portals
ldr x8, [x8, :lo12:sorted_portals]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
str x8, [sp]
ldr x8, [sp]
ldr x8, [x8, #24]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, stat_done
ldr x8, [x8, :lo12:stat_done]
ldr x9, [sp]
str x8, [x9]
b .LBB0_7
.LBB0_2:
adrp x8, stat_working
ldr x8, [x8, :lo12:stat_working]
ldr x9, [sp]
str x8, [x9]
add x0, sp, #16
mov w1, wzr
mov w2, #40 // =0x28
bl memset
ldr x8, [sp]
str x8, [sp, #48]
ldr x8, [sp]
str x8, [sp, #40]
ldr x8, [sp]
ldr w8, [x8, #20]
str w8, [sp, #36]
ldr x8, [sp]
ldr w8, [x8, #16]
str w8, [sp, #32]
str xzr, [sp, #24]
str wzr, [sp, #12]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
adrp x9, portallongs
ldr w9, [x9, :lo12:portallongs]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldr x8, [sp]
ldr x8, [x8, #8]
ldrsw x9, [sp, #12]
ldr x8, [x8, x9, lsl #3]
ldr x9, [sp, #16]
ldrsw x10, [sp, #12]
str x8, [x9, x10, lsl #3]
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_3
.LBB0_6:
ldr x0, [sp]
add x2, sp, #16
mov x1, x2
bl RecursivePassageFlow
adrp x8, stat_done
ldr x8, [x8, :lo12:stat_done]
ldr x9, [sp]
str x8, [x9]
b .LBB0_7
.LBB0_7:
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size PassageFlow, .Lfunc_end0-PassageFlow
.cfi_endproc
// -- End function
.type sorted_portals,@object // @sorted_portals
.bss
.globl sorted_portals
.p2align 3, 0x0
sorted_portals:
.xword 0
.size sorted_portals, 8
.type stat_done,@object // @stat_done
.globl stat_done
.p2align 3, 0x0
stat_done:
.xword 0
.size stat_done, 8
.type stat_working,@object // @stat_working
.globl stat_working
.p2align 3, 0x0
stat_working:
.xword 0
.size stat_working, 8
.type portallongs,@object // @portallongs
.globl portallongs
.p2align 2, 0x0
portallongs:
.word 0 // 0x0
.size portallongs, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym memset
.addrsig_sym RecursivePassageFlow
.addrsig_sym sorted_portals
.addrsig_sym stat_done
.addrsig_sym stat_working
.addrsig_sym portallongs
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_PassageFlow.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ tree_t ;
struct TYPE_3__ {int firstDrawSurf; } ;
typedef TYPE_1__ entity_t ;
/* Variables and functions */
int numMapDrawSurfs ;
int /*<<< orphan*/ numSideRefs ;
int /*<<< orphan*/ qprintf (char*,...) ;
void MergeSides( entity_t *e, tree_t *tree ) {
int i;
qprintf( "----- MergeSides -----\n");
for ( i = e->firstDrawSurf ; i < numMapDrawSurfs ; i++ ) {
// AddSideRef( side );
}
qprintf( "%5i siderefs\n", numSideRefs );
}
|
.text
.file "extr_surface.c_MergeSides.c"
.globl MergeSides // -- Begin function MergeSides
.p2align 2
.type MergeSides,@function
MergeSides: // @MergeSides
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
str x1, [sp, #16]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl qprintf
ldur x8, [x29, #-8]
ldr w8, [x8]
str w8, [sp, #12]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
adrp x9, numMapDrawSurfs
ldr w9, [x9, :lo12:numMapDrawSurfs]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_1
.LBB0_4:
adrp x8, numSideRefs
ldr w1, [x8, :lo12:numSideRefs]
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl qprintf
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size MergeSides, .Lfunc_end0-MergeSides
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "----- MergeSides -----\n"
.size .L.str, 24
.type numMapDrawSurfs,@object // @numMapDrawSurfs
.bss
.globl numMapDrawSurfs
.p2align 2, 0x0
numMapDrawSurfs:
.word 0 // 0x0
.size numMapDrawSurfs, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "%5i siderefs\n"
.size .L.str.1, 14
.type numSideRefs,@object // @numSideRefs
.bss
.globl numSideRefs
.p2align 2, 0x0
numSideRefs:
.word 0 // 0x0
.size numSideRefs, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym qprintf
.addrsig_sym numMapDrawSurfs
.addrsig_sym numSideRefs
|
../AnghaBench/Quake-III-Arena/q3map/extr_surface.c_MergeSides.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_6__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
typedef int /*<<< orphan*/ vsound_t ;
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_10__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_11__ {int cluster; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VS_FloodRadialAreaLight (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int VS_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_6__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
void VS_R_SubdivideRadialAreaLight(vsound_t *light, int nodenum, winding_t *w)
{
int leafnum, res;
dnode_t *node;
dplane_t *plane;
winding_t back;
plane_t split;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VS_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
memcpy(&back, w, sizeof(winding_t));
VS_R_SubdivideRadialAreaLight(light, node->children[1], &back);
nodenum = node->children[0];
}
else
{
VS_R_SubdivideRadialAreaLight(light, node->children[1], &back);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
if (dleafs[leafnum].cluster != -1)
{
VS_FloodRadialAreaLight(light, w, leafnum);
}
}
|
.text
.file "extr_soundv.c_VS_R_SubdivideRadialAreaLight.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_R_SubdivideRadialAreaLight
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VS_R_SubdivideRadialAreaLight
.p2align 2
.type VS_R_SubdivideRadialAreaLight,@function
VS_R_SubdivideRadialAreaLight: // @VS_R_SubdivideRadialAreaLight
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur x2, [x29, #-24]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-12]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-12]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w0, [x8, #4]
add x8, sp, #20
str x8, [sp, #8] // 8-byte Folded Spill
ldr w1, [sp, #24]
bl VectorCopy
ldr x2, [sp, #8] // 8-byte Folded Reload
ldr x8, [sp, #32]
ldr w8, [x8]
str w8, [sp, #20]
ldur x0, [x29, #-24]
add x1, sp, #28
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VS_SplitWinding
stur w0, [x29, #-32]
ldur w8, [x29, #-32]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_11
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-12]
b .LBB0_10
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-24]
add x0, sp, #28
str x0, [sp] // 8-byte Folded Spill
mov w2, #4 // =0x4
bl memcpy
ldr x2, [sp] // 8-byte Folded Reload
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
bl VS_R_SubdivideRadialAreaLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
add x2, sp, #28
bl VS_R_SubdivideRadialAreaLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_12:
ldur w9, [x29, #-12]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-28]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-28]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur x0, [x29, #-8]
ldur x1, [x29, #-24]
ldur w2, [x29, #-28]
bl VS_FloodRadialAreaLight
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_R_SubdivideRadialAreaLight, .Lfunc_end0-VS_R_SubdivideRadialAreaLight
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_R_SubdivideRadialAreaLight
.addrsig_sym VectorCopy
.addrsig_sym VS_SplitWinding
.addrsig_sym memcpy
.addrsig_sym VS_FloodRadialAreaLight
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_R_SubdivideRadialAreaLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef scalar_t__* vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_3__ {scalar_t__* normal; scalar_t__ dist; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
scalar_t__ DIST_EPSILON ;
scalar_t__ NORMAL_EPSILON ;
scalar_t__ fabs (scalar_t__) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean PlaneEqual (plane_t *p, vec3_t normal, vec_t dist)
{
#if 1
if (
fabs(p->normal[0] - normal[0]) < NORMAL_EPSILON
&& fabs(p->normal[1] - normal[1]) < NORMAL_EPSILON
&& fabs(p->normal[2] - normal[2]) < NORMAL_EPSILON
&& fabs(p->dist - dist) < DIST_EPSILON )
return qtrue;
#else
if (p->normal[0] == normal[0]
&& p->normal[1] == normal[1]
&& p->normal[2] == normal[2]
&& p->dist == dist)
return qtrue;
#endif
return qfalse;
}
|
.text
.file "extr_map.c_PlaneEqual.c"
.globl PlaneEqual // -- Begin function PlaneEqual
.p2align 2
.type PlaneEqual,@function
PlaneEqual: // @PlaneEqual
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
str x0, [sp, #16]
str x1, [sp, #8]
str x2, [sp]
ldr x8, [sp, #16]
ldr x8, [x8]
ldr x8, [x8]
ldr x9, [sp, #8]
ldr x9, [x9]
subs x0, x8, x9
bl fabs
adrp x8, NORMAL_EPSILON
ldr x8, [x8, :lo12:NORMAL_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_5
b .LBB0_1
.LBB0_1:
ldr x8, [sp, #16]
ldr x8, [x8]
ldr x8, [x8, #8]
ldr x9, [sp, #8]
ldr x9, [x9, #8]
subs x0, x8, x9
bl fabs
adrp x8, NORMAL_EPSILON
ldr x8, [x8, :lo12:NORMAL_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_5
b .LBB0_2
.LBB0_2:
ldr x8, [sp, #16]
ldr x8, [x8]
ldr x8, [x8, #16]
ldr x9, [sp, #8]
ldr x9, [x9, #16]
subs x0, x8, x9
bl fabs
adrp x8, NORMAL_EPSILON
ldr x8, [x8, :lo12:NORMAL_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_5
b .LBB0_3
.LBB0_3:
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldr x9, [sp]
subs x0, x8, x9
bl fabs
adrp x8, DIST_EPSILON
ldr x8, [x8, :lo12:DIST_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_6
.LBB0_5:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_6
.LBB0_6:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size PlaneEqual, .Lfunc_end0-PlaneEqual
.cfi_endproc
// -- End function
.type NORMAL_EPSILON,@object // @NORMAL_EPSILON
.bss
.globl NORMAL_EPSILON
.p2align 3, 0x0
NORMAL_EPSILON:
.xword 0 // 0x0
.size NORMAL_EPSILON, 8
.type DIST_EPSILON,@object // @DIST_EPSILON
.globl DIST_EPSILON
.p2align 3, 0x0
DIST_EPSILON:
.xword 0 // 0x0
.size DIST_EPSILON, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym fabs
.addrsig_sym NORMAL_EPSILON
.addrsig_sym DIST_EPSILON
.addrsig_sym qtrue
.addrsig_sym qfalse
|
../AnghaBench/Quake-III-Arena/q3map/extr_map.c_PlaneEqual.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ portal_t ;
/* Variables and functions */
scalar_t__ c_active_portals ;
scalar_t__ c_peak_portals ;
int /*<<< orphan*/ * malloc (int) ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
int numthreads ;
portal_t *AllocPortal (void)
{
portal_t *p;
if (numthreads == 1)
c_active_portals++;
if (c_active_portals > c_peak_portals)
c_peak_portals = c_active_portals;
p = malloc (sizeof(portal_t));
memset (p, 0, sizeof(portal_t));
return p;
}
|
.text
.file "extr_portals.c_AllocPortal.c"
.globl AllocPortal // -- Begin function AllocPortal
.p2align 2
.type AllocPortal,@function
AllocPortal: // @AllocPortal
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, numthreads
ldr w8, [x8, :lo12:numthreads]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x9, c_active_portals
ldr x8, [x9, :lo12:c_active_portals]
add x8, x8, #1
str x8, [x9, :lo12:c_active_portals]
b .LBB0_2
.LBB0_2:
adrp x8, c_active_portals
ldr x8, [x8, :lo12:c_active_portals]
adrp x9, c_peak_portals
ldr x9, [x9, :lo12:c_peak_portals]
subs x8, x8, x9
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
adrp x8, c_active_portals
ldr x8, [x8, :lo12:c_active_portals]
adrp x9, c_peak_portals
str x8, [x9, :lo12:c_peak_portals]
b .LBB0_4
.LBB0_4:
mov w0, #4 // =0x4
str w0, [sp, #4] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #4] // 4-byte Folded Reload
str x0, [sp, #8]
ldr x0, [sp, #8]
mov w1, wzr
bl memset
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size AllocPortal, .Lfunc_end0-AllocPortal
.cfi_endproc
// -- End function
.type numthreads,@object // @numthreads
.bss
.globl numthreads
.p2align 2, 0x0
numthreads:
.word 0 // 0x0
.size numthreads, 4
.type c_active_portals,@object // @c_active_portals
.globl c_active_portals
.p2align 3, 0x0
c_active_portals:
.xword 0 // 0x0
.size c_active_portals, 8
.type c_peak_portals,@object // @c_peak_portals
.globl c_peak_portals
.p2align 3, 0x0
c_peak_portals:
.xword 0 // 0x0
.size c_peak_portals, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym numthreads
.addrsig_sym c_active_portals
.addrsig_sym c_peak_portals
|
../AnghaBench/Quake-III-Arena/q3map/extr_portals.c_AllocPortal.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef float* vec3_t ;
struct TYPE_4__ {float* normal; float dist; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
scalar_t__ DIST_EPSILON ;
scalar_t__ NORMAL_EPSILON ;
scalar_t__ fabs (float) ;
int qfalse ;
int qtrue ;
__attribute__((used)) static int Plane_Equal(plane_t *a, plane_t *b, int flip)
{
vec3_t normal;
float dist;
if (flip) {
normal[0] = - b->normal[0];
normal[1] = - b->normal[1];
normal[2] = - b->normal[2];
dist = - b->dist;
}
else {
normal[0] = b->normal[0];
normal[1] = b->normal[1];
normal[2] = b->normal[2];
dist = b->dist;
}
if (
fabs(a->normal[0] - normal[0]) < NORMAL_EPSILON
&& fabs(a->normal[1] - normal[1]) < NORMAL_EPSILON
&& fabs(a->normal[2] - normal[2]) < NORMAL_EPSILON
&& fabs(a->dist - dist) < DIST_EPSILON )
return qtrue;
return qfalse;
}
|
.text
.file "extr_soundv.c_Plane_Equal.c"
.p2align 2 // -- Begin function Plane_Equal
.type Plane_Equal,@function
Plane_Equal: // @Plane_Equal
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-16]
str x1, [sp, #24]
str w2, [sp, #20]
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldr x8, [sp, #24]
ldr x8, [x8]
ldr s0, [x8]
fneg s0, s0
ldr x8, [sp, #8]
str s0, [x8]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr s0, [x8, #4]
fneg s0, s0
ldr x8, [sp, #8]
str s0, [x8, #4]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr s0, [x8, #8]
fneg s0, s0
ldr x8, [sp, #8]
str s0, [x8, #8]
ldr x8, [sp, #24]
ldr s0, [x8, #8]
fneg s0, s0
str s0, [sp, #4]
b .LBB0_3
.LBB0_2:
ldr x8, [sp, #24]
ldr x8, [x8]
ldr s0, [x8]
ldr x8, [sp, #8]
str s0, [x8]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr s0, [x8, #4]
ldr x8, [sp, #8]
str s0, [x8, #4]
ldr x8, [sp, #24]
ldr x8, [x8]
ldr s0, [x8, #8]
ldr x8, [sp, #8]
str s0, [x8, #8]
ldr x8, [sp, #24]
ldr s0, [x8, #8]
str s0, [sp, #4]
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-16]
ldr x8, [x8]
ldr s0, [x8]
ldr x8, [sp, #8]
ldr s1, [x8]
fsub s0, s0, s1
bl fabs
adrp x8, NORMAL_EPSILON
ldr x8, [x8, :lo12:NORMAL_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_4
.LBB0_4:
ldur x8, [x29, #-16]
ldr x8, [x8]
ldr s0, [x8, #4]
ldr x8, [sp, #8]
ldr s1, [x8, #4]
fsub s0, s0, s1
bl fabs
adrp x8, NORMAL_EPSILON
ldr x8, [x8, :lo12:NORMAL_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_5
.LBB0_5:
ldur x8, [x29, #-16]
ldr x8, [x8]
ldr s0, [x8, #8]
ldr x8, [sp, #8]
ldr s1, [x8, #8]
fsub s0, s0, s1
bl fabs
adrp x8, NORMAL_EPSILON
ldr x8, [x8, :lo12:NORMAL_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_6
.LBB0_6:
ldur x8, [x29, #-16]
ldr s0, [x8, #8]
ldr s1, [sp, #4]
fsub s0, s0, s1
bl fabs
adrp x8, DIST_EPSILON
ldr x8, [x8, :lo12:DIST_EPSILON]
subs x8, x0, x8
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_8:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_9:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size Plane_Equal, .Lfunc_end0-Plane_Equal
.cfi_endproc
// -- End function
.type NORMAL_EPSILON,@object // @NORMAL_EPSILON
.bss
.globl NORMAL_EPSILON
.p2align 3, 0x0
NORMAL_EPSILON:
.xword 0 // 0x0
.size NORMAL_EPSILON, 8
.type DIST_EPSILON,@object // @DIST_EPSILON
.globl DIST_EPSILON
.p2align 3, 0x0
DIST_EPSILON:
.xword 0 // 0x0
.size DIST_EPSILON, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Plane_Equal
.addrsig_sym fabs
.addrsig_sym NORMAL_EPSILON
.addrsig_sym DIST_EPSILON
.addrsig_sym qtrue
.addrsig_sym qfalse
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_Plane_Equal.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vlight_t ;
typedef int /*<<< orphan*/ plane_t ;
struct TYPE_7__ {scalar_t__ surfaceNum; scalar_t__ numtransFacets; int /*<<< orphan*/ transSurfaces; int /*<<< orphan*/ transFacets; int /*<<< orphan*/ farplane; int /*<<< orphan*/ cluster; int /*<<< orphan*/ type; int /*<<< orphan*/ facetNum; int /*<<< orphan*/ endplane; scalar_t__ num; int /*<<< orphan*/ facetTested; int /*<<< orphan*/ clusterTested; } ;
typedef TYPE_1__ lightvolume_t ;
/* Variables and functions */
int /*<<< orphan*/ VL_R_CastLightAtSurface (int /*<<< orphan*/ *,TYPE_1__*) ;
int /*<<< orphan*/ VL_R_FloodLight (int /*<<< orphan*/ *,TYPE_1__*,int,int) ;
int VL_SplitLightVolume (TYPE_1__*,TYPE_1__*,int /*<<< orphan*/ *,double) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ numvolumes ;
int VL_R_SplitLightVolume(vlight_t *light, lightvolume_t *volume, plane_t *split, int cluster, int firstportal)
{
lightvolume_t back;
int res;
//
res = VL_SplitLightVolume(volume, &back, split, 0.1);
// if the volume was split
if (res == 2)
{
memcpy(back.clusterTested, volume->clusterTested, sizeof(back.clusterTested));
memcpy(back.facetTested, volume->facetTested, sizeof(back.facetTested));
back.num = numvolumes++;
back.endplane = volume->endplane;
back.surfaceNum = volume->surfaceNum;
back.facetNum = volume->facetNum;
back.type = volume->type;
back.cluster = volume->cluster;
back.farplane = volume->farplane;
if (volume->numtransFacets > 0)
{
memcpy(back.transFacets, volume->transFacets, sizeof(back.transFacets));
memcpy(back.transSurfaces, volume->transSurfaces, sizeof(back.transSurfaces));
}
back.numtransFacets = volume->numtransFacets;
//
// flood the volume at the back of the split plane
VL_R_FloodLight(light, &back, cluster, firstportal);
// if the back volume hit a surface
if (back.surfaceNum >= 0)
{
VL_R_CastLightAtSurface(light, &back);
}
}
return res;
}
|
.text
.file "extr_lightv.c_VL_R_SplitLightVolume.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_R_SplitLightVolume
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_R_SplitLightVolume
.p2align 2
.type VL_R_SplitLightVolume,@function
VL_R_SplitLightVolume: // @VL_R_SplitLightVolume
.cfi_startproc
// %bb.0:
sub sp, sp, #128
.cfi_def_cfa_offset 128
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
stur w3, [x29, #-28]
stur w4, [x29, #-32]
ldur x0, [x29, #-16]
ldur x2, [x29, #-24]
add x1, sp, #16
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VL_SplitLightVolume
str w0, [sp, #12]
ldr w8, [sp, #12]
subs w8, w8, #2
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_1
.LBB0_1:
ldr w0, [sp, #76]
ldur x8, [x29, #-16]
ldr w1, [x8, #60]
mov w2, #4 // =0x4
str w2, [sp, #8] // 4-byte Folded Spill
bl memcpy
ldr w2, [sp, #8] // 4-byte Folded Reload
ldr w0, [sp, #72]
ldur x8, [x29, #-16]
ldr w1, [x8, #56]
bl memcpy
adrp x10, numvolumes
ldrsw x8, [x10, :lo12:numvolumes]
mov w9, w8
add w9, w9, #1
str w9, [x10, :lo12:numvolumes]
str x8, [sp, #64]
ldur x8, [x29, #-16]
ldr w8, [x8, #40]
str w8, [sp, #56]
ldur x8, [x29, #-16]
ldr x8, [x8]
str x8, [sp, #16]
ldur x8, [x29, #-16]
ldr w8, [x8, #36]
str w8, [sp, #52]
ldur x8, [x29, #-16]
ldr w8, [x8, #32]
str w8, [sp, #48]
ldur x8, [x29, #-16]
ldr w8, [x8, #28]
str w8, [sp, #44]
ldur x8, [x29, #-16]
ldr w8, [x8, #24]
str w8, [sp, #40]
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, le
tbnz w8, #0, .LBB0_3
b .LBB0_2
.LBB0_2:
ldr w0, [sp, #36]
ldur x8, [x29, #-16]
ldr w1, [x8, #20]
mov w2, #4 // =0x4
str w2, [sp, #4] // 4-byte Folded Spill
bl memcpy
ldr w2, [sp, #4] // 4-byte Folded Reload
ldr w0, [sp, #32]
ldur x8, [x29, #-16]
ldr w1, [x8, #16]
bl memcpy
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
add x1, sp, #16
str x8, [sp, #24]
ldur x0, [x29, #-8]
ldur w2, [x29, #-28]
ldur w3, [x29, #-32]
bl VL_R_FloodLight
ldr x8, [sp, #16]
subs x8, x8, #0
cset w8, lt
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
ldur x0, [x29, #-8]
add x1, sp, #16
bl VL_R_CastLightAtSurface
b .LBB0_5
.LBB0_5:
b .LBB0_6
.LBB0_6:
ldr w0, [sp, #12]
.cfi_def_cfa wsp, 128
ldp x29, x30, [sp, #112] // 16-byte Folded Reload
add sp, sp, #128
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_R_SplitLightVolume, .Lfunc_end0-VL_R_SplitLightVolume
.cfi_endproc
// -- End function
.type numvolumes,@object // @numvolumes
.bss
.globl numvolumes
.p2align 2, 0x0
numvolumes:
.word 0 // 0x0
.size numvolumes, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VL_SplitLightVolume
.addrsig_sym memcpy
.addrsig_sym VL_R_FloodLight
.addrsig_sym VL_R_CastLightAtSurface
.addrsig_sym numvolumes
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_R_SplitLightVolume.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_7__ {int planenum; int /*<<< orphan*/ visibleHull; } ;
typedef TYPE_1__ side_t ;
struct TYPE_8__ {int /*<<< orphan*/ normal; int /*<<< orphan*/ dist; } ;
typedef TYPE_2__ plane_t ;
struct TYPE_9__ {int planenum; int /*<<< orphan*/ opaque; struct TYPE_9__** children; } ;
typedef TYPE_3__ node_t ;
/* Variables and functions */
int /*<<< orphan*/ AddWindingToConvexHull (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ClipWindingEpsilon (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ **,int /*<<< orphan*/ **) ;
int /*<<< orphan*/ FreeWinding (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ON_EPSILON ;
int PLANENUM_LEAF ;
TYPE_2__* mapplanes ;
void ClipSideIntoTree_r( winding_t *w, side_t *side, node_t *node ) {
plane_t *plane;
winding_t *front, *back;
if ( !w ) {
return;
}
if ( node->planenum != PLANENUM_LEAF ) {
if ( side->planenum == node->planenum ) {
ClipSideIntoTree_r( w, side, node->children[0] );
return;
}
if ( side->planenum == ( node->planenum ^ 1) ) {
ClipSideIntoTree_r( w, side, node->children[1] );
return;
}
plane = &mapplanes[ node->planenum ];
ClipWindingEpsilon ( w, plane->normal, plane->dist,
ON_EPSILON, &front, &back );
FreeWinding( w );
ClipSideIntoTree_r( front, side, node->children[0] );
ClipSideIntoTree_r( back, side, node->children[1] );
return;
}
// if opaque leaf, don't add
if ( !node->opaque ) {
AddWindingToConvexHull( w, &side->visibleHull, mapplanes[ side->planenum ].normal );
}
FreeWinding( w );
return;
}
|
.text
.file "extr_surface.c_ClipSideIntoTree_r.c"
.globl ClipSideIntoTree_r // -- Begin function ClipSideIntoTree_r
.p2align 2
.type ClipSideIntoTree_r,@function
ClipSideIntoTree_r: // @ClipSideIntoTree_r
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
str x2, [sp, #24]
ldur x8, [x29, #-8]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_11
.LBB0_2:
ldr x8, [sp, #24]
ldr w8, [x8]
adrp x9, PLANENUM_LEAF
ldr w9, [x9, :lo12:PLANENUM_LEAF]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-16]
ldr w8, [x8]
ldr x9, [sp, #24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldr x2, [x8]
bl ClipSideIntoTree_r
b .LBB0_11
.LBB0_5:
ldur x8, [x29, #-16]
ldr w8, [x8]
ldr x9, [sp, #24]
ldr w9, [x9]
eor w9, w9, #0x1
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldr x2, [x8, #8]
bl ClipSideIntoTree_r
b .LBB0_11
.LBB0_7:
adrp x8, mapplanes
ldr x8, [x8, :lo12:mapplanes]
ldr x9, [sp, #24]
ldrsw x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #16]
ldur x0, [x29, #-8]
ldr x8, [sp, #16]
ldr w1, [x8]
ldr x8, [sp, #16]
ldr w2, [x8, #4]
adrp x8, ON_EPSILON
ldr w3, [x8, :lo12:ON_EPSILON]
add x4, sp, #8
mov x5, sp
bl ClipWindingEpsilon
ldur x0, [x29, #-8]
bl FreeWinding
ldr x0, [sp, #8]
ldur x1, [x29, #-16]
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldr x2, [x8]
bl ClipSideIntoTree_r
ldr x0, [sp]
ldur x1, [x29, #-16]
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldr x2, [x8, #8]
bl ClipSideIntoTree_r
b .LBB0_11
.LBB0_8:
ldr x8, [sp, #24]
ldr w8, [x8, #4]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9:
ldur x0, [x29, #-8]
ldur x8, [x29, #-16]
add x1, x8, #4
adrp x8, mapplanes
ldr x8, [x8, :lo12:mapplanes]
ldur x9, [x29, #-16]
ldrsw x9, [x9]
lsl x9, x9, #3
ldr w2, [x8, x9]
bl AddWindingToConvexHull
b .LBB0_10
.LBB0_10:
ldur x0, [x29, #-8]
bl FreeWinding
b .LBB0_11
.LBB0_11:
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size ClipSideIntoTree_r, .Lfunc_end0-ClipSideIntoTree_r
.cfi_endproc
// -- End function
.type PLANENUM_LEAF,@object // @PLANENUM_LEAF
.bss
.globl PLANENUM_LEAF
.p2align 2, 0x0
PLANENUM_LEAF:
.word 0 // 0x0
.size PLANENUM_LEAF, 4
.type mapplanes,@object // @mapplanes
.globl mapplanes
.p2align 3, 0x0
mapplanes:
.xword 0
.size mapplanes, 8
.type ON_EPSILON,@object // @ON_EPSILON
.globl ON_EPSILON
.p2align 2, 0x0
ON_EPSILON:
.word 0 // 0x0
.size ON_EPSILON, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym ClipSideIntoTree_r
.addrsig_sym ClipWindingEpsilon
.addrsig_sym FreeWinding
.addrsig_sym AddWindingToConvexHull
.addrsig_sym PLANENUM_LEAF
.addrsig_sym mapplanes
.addrsig_sym ON_EPSILON
|
../AnghaBench/Quake-III-Arena/q3map/extr_surface.c_ClipSideIntoTree_r.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_18__ TYPE_8__ ;
typedef struct TYPE_17__ TYPE_7__ ;
typedef struct TYPE_16__ TYPE_6__ ;
typedef struct TYPE_15__ TYPE_5__ ;
typedef struct TYPE_14__ TYPE_4__ ;
typedef struct TYPE_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
typedef float* vec3_t ;
typedef int /*<<< orphan*/ tree_t ;
struct TYPE_11__ {float* xyz; int normal; } ;
typedef TYPE_1__ md3XyzNormal_t ;
struct TYPE_12__ {int /*<<< orphan*/ * indexes; } ;
typedef TYPE_2__ md3Triangle_t ;
struct TYPE_13__ {int ofsShaders; int numVerts; int numTriangles; int ofsTriangles; int ofsSt; int ofsXyzNormals; int ofsEnd; } ;
typedef TYPE_3__ md3Surface_t ;
struct TYPE_14__ {int /*<<< orphan*/ * st; } ;
typedef TYPE_4__ md3St_t ;
struct TYPE_15__ {int /*<<< orphan*/ name; } ;
typedef TYPE_5__ md3Shader_t ;
struct TYPE_16__ {int numSurfaces; int ofsSurfaces; } ;
typedef TYPE_6__ md3Header_t ;
struct TYPE_17__ {int numVerts; int numIndexes; int lightmapNum; int fogNum; TYPE_8__* verts; int /*<<< orphan*/ * indexes; int /*<<< orphan*/ shaderInfo; int /*<<< orphan*/ miscModel; } ;
typedef TYPE_7__ mapDrawSurface_t ;
struct TYPE_18__ {int* color; float* xyz; float* normal; scalar_t__* lightmap; int /*<<< orphan*/ * st; } ;
typedef TYPE_8__ drawVert_t ;
typedef int /*<<< orphan*/ byte ;
/* Variables and functions */
TYPE_7__* AllocDrawSurf () ;
TYPE_6__* LoadModel (char const*) ;
float MD3_XYZ_SCALE ;
float Q_PI ;
int /*<<< orphan*/ ShaderInfoForShader (int /*<<< orphan*/ ) ;
int c_triangleIndexes ;
int /*<<< orphan*/ c_triangleModels ;
int c_triangleSurfaces ;
int c_triangleVertexes ;
float cos (float) ;
void* malloc (int) ;
int /*<<< orphan*/ qtrue ;
float sin (float) ;
void InsertMD3Model( const char *modelName, vec3_t origin, float angle, tree_t *tree ) {
int i, j;
md3Header_t *md3;
md3Surface_t *surf;
md3Shader_t *shader;
md3Triangle_t *tri;
md3St_t *st;
md3XyzNormal_t *xyz;
drawVert_t *outv;
float lat, lng;
float angleCos, angleSin;
mapDrawSurface_t *out;
vec3_t temp;
angle = angle / 180 * Q_PI;
angleCos = cos( angle );
angleSin = sin( angle );
// load the model
md3 = LoadModel( modelName );
if ( !md3 ) {
return;
}
// each md3 surface will become a new bsp surface
c_triangleModels++;
c_triangleSurfaces += md3->numSurfaces;
// expand, translate, and rotate the vertexes
// swap all the surfaces
surf = (md3Surface_t *) ( (byte *)md3 + md3->ofsSurfaces );
for ( i = 0 ; i < md3->numSurfaces ; i++) {
// allocate a surface
out = AllocDrawSurf();
out->miscModel = qtrue;
shader = (md3Shader_t *) ( (byte *)surf + surf->ofsShaders );
out->shaderInfo = ShaderInfoForShader( shader->name );
out->numVerts = surf->numVerts;
out->verts = malloc( out->numVerts * sizeof( out->verts[0] ) );
out->numIndexes = surf->numTriangles * 3;
out->indexes = malloc( out->numIndexes * sizeof( out->indexes[0] ) );
out->lightmapNum = -1;
out->fogNum = -1;
// emit the indexes
c_triangleIndexes += surf->numTriangles * 3;
tri = (md3Triangle_t *) ( (byte *)surf + surf->ofsTriangles );
for ( j = 0 ; j < surf->numTriangles ; j++, tri++ ) {
out->indexes[j*3+0] = tri->indexes[0];
out->indexes[j*3+1] = tri->indexes[1];
out->indexes[j*3+2] = tri->indexes[2];
}
// emit the vertexes
st = (md3St_t *) ( (byte *)surf + surf->ofsSt );
xyz = (md3XyzNormal_t *) ( (byte *)surf + surf->ofsXyzNormals );
c_triangleVertexes += surf->numVerts;
for ( j = 0 ; j < surf->numVerts ; j++, st++, xyz++ ) {
outv = &out->verts[ j ];
outv->st[0] = st->st[0];
outv->st[1] = st->st[1];
outv->lightmap[0] = 0;
outv->lightmap[1] = 0;
// the colors will be set by the lighting pass
outv->color[0] = 255;
outv->color[1] = 255;
outv->color[2] = 255;
outv->color[3] = 255;
outv->xyz[0] = origin[0] + MD3_XYZ_SCALE * ( xyz->xyz[0] * angleCos - xyz->xyz[1] * angleSin );
outv->xyz[1] = origin[1] + MD3_XYZ_SCALE * ( xyz->xyz[0] * angleSin + xyz->xyz[1] * angleCos );
outv->xyz[2] = origin[2] + MD3_XYZ_SCALE * ( xyz->xyz[2] );
// decode the lat/lng normal to a 3 float normal
lat = ( xyz->normal >> 8 ) & 0xff;
lng = ( xyz->normal & 0xff );
lat *= Q_PI/128;
lng *= Q_PI/128;
temp[0] = cos(lat) * sin(lng);
temp[1] = sin(lat) * sin(lng);
temp[2] = cos(lng);
// rotate the normal
outv->normal[0] = temp[0] * angleCos - temp[1] * angleSin;
outv->normal[1] = temp[0] * angleSin + temp[1] * angleCos;
outv->normal[2] = temp[2];
}
// find the next surface
surf = (md3Surface_t *)( (byte *)surf + surf->ofsEnd );
}
}
|
.text
.file "extr_misc_model.c_InsertMD3Model.c"
.globl InsertMD3Model // -- Begin function InsertMD3Model
.p2align 2
.type InsertMD3Model,@function
InsertMD3Model: // @InsertMD3Model
.cfi_startproc
// %bb.0:
sub sp, sp, #160
.cfi_def_cfa_offset 160
stp x29, x30, [sp, #144] // 16-byte Folded Spill
add x29, sp, #144
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur s0, [x29, #-20]
stur x2, [x29, #-32]
ldur s0, [x29, #-20]
mov w8, #1127481344 // =0x43340000
fmov s1, w8
fdiv s0, s0, s1
adrp x8, Q_PI
ldr s1, [x8, :lo12:Q_PI]
fmul s0, s0, s1
stur s0, [x29, #-20]
ldur s0, [x29, #-20]
bl cos
str s0, [sp, #36]
ldur s0, [x29, #-20]
bl sin
str s0, [sp, #32]
ldur x0, [x29, #-8]
bl LoadModel
stur x0, [x29, #-48]
ldur x8, [x29, #-48]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_14
.LBB0_2:
adrp x9, c_triangleModels
ldr w8, [x9, :lo12:c_triangleModels]
add w8, w8, #1
str w8, [x9, :lo12:c_triangleModels]
ldur x8, [x29, #-48]
ldr w10, [x8]
adrp x9, c_triangleSurfaces
ldr w8, [x9, :lo12:c_triangleSurfaces]
add w8, w8, w10
str w8, [x9, :lo12:c_triangleSurfaces]
ldur x8, [x29, #-48]
ldur x9, [x29, #-48]
ldrsw x9, [x9, #4]
add x8, x8, x9, lsl #2
stur x8, [x29, #-56]
stur wzr, [x29, #-36]
b .LBB0_3
.LBB0_3: // =>This Loop Header: Depth=1
// Child Loop BB0_5 Depth 2
// Child Loop BB0_9 Depth 2
ldur w8, [x29, #-36]
ldur x9, [x29, #-48]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_14
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
bl AllocDrawSurf
str x0, [sp, #24]
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
ldr x9, [sp, #24]
str w8, [x9, #36]
ldur x8, [x29, #-56]
ldur x9, [x29, #-56]
ldrsw x9, [x9]
add x8, x8, x9, lsl #2
stur x8, [x29, #-64]
ldur x8, [x29, #-64]
ldr w0, [x8]
bl ShaderInfoForShader
ldr x8, [sp, #24]
str w0, [x8, #32]
ldur x8, [x29, #-56]
ldr w8, [x8, #4]
ldr x9, [sp, #24]
str w8, [x9]
ldr x8, [sp, #24]
ldrsw x8, [x8]
mov x9, #40 // =0x28
mul x8, x8, x9
mov w0, w8
bl malloc
ldr x8, [sp, #24]
str x0, [x8, #16]
ldur x8, [x29, #-56]
ldr w8, [x8, #8]
mov w9, #3 // =0x3
str w9, [sp, #12] // 4-byte Folded Spill
mul w8, w8, w9
ldr x9, [sp, #24]
str w8, [x9, #4]
ldr x8, [sp, #24]
ldrsw x8, [x8, #4]
lsl x8, x8, #2
mov w0, w8
bl malloc
ldr w9, [sp, #12] // 4-byte Folded Reload
ldr x8, [sp, #24]
str x0, [x8, #24]
ldr x10, [sp, #24]
mov w8, #-1 // =0xffffffff
str w8, [x10, #8]
ldr x10, [sp, #24]
str w8, [x10, #12]
ldur x8, [x29, #-56]
ldr w8, [x8, #8]
mul w10, w8, w9
adrp x9, c_triangleIndexes
ldr w8, [x9, :lo12:c_triangleIndexes]
add w8, w8, w10
str w8, [x9, :lo12:c_triangleIndexes]
ldur x8, [x29, #-56]
ldur x9, [x29, #-56]
ldrsw x9, [x9, #12]
add x8, x8, x9, lsl #2
str x8, [sp, #72]
stur wzr, [x29, #-40]
b .LBB0_5
.LBB0_5: // Parent Loop BB0_3 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-40]
ldur x9, [x29, #-56]
ldr w9, [x9, #8]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp, #72]
ldr x8, [x8]
ldr w8, [x8]
ldr x9, [sp, #24]
ldr x9, [x9, #24]
ldur w10, [x29, #-40]
mov w11, #3 // =0x3
mul w10, w10, w11
add w10, w10, #0
str w8, [x9, w10, sxtw #2]
ldr x8, [sp, #72]
ldr x8, [x8]
ldr w8, [x8, #4]
ldr x9, [sp, #24]
ldr x9, [x9, #24]
ldur w10, [x29, #-40]
mul w10, w10, w11
add w10, w10, #1
str w8, [x9, w10, sxtw #2]
ldr x8, [sp, #72]
ldr x8, [x8]
ldr w8, [x8, #8]
ldr x9, [sp, #24]
ldr x9, [x9, #24]
ldur w10, [x29, #-40]
mul w10, w10, w11
add w10, w10, #2
str w8, [x9, w10, sxtw #2]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=2
ldur w8, [x29, #-40]
add w8, w8, #1
stur w8, [x29, #-40]
ldr x8, [sp, #72]
add x8, x8, #8
str x8, [sp, #72]
b .LBB0_5
.LBB0_8: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-56]
ldur x9, [x29, #-56]
ldrsw x9, [x9, #16]
add x8, x8, x9, lsl #2
str x8, [sp, #64]
ldur x8, [x29, #-56]
ldur x9, [x29, #-56]
ldrsw x9, [x9, #20]
add x8, x8, x9, lsl #2
str x8, [sp, #56]
ldur x8, [x29, #-56]
ldr w10, [x8, #4]
adrp x9, c_triangleVertexes
ldr w8, [x9, :lo12:c_triangleVertexes]
add w8, w8, w10
str w8, [x9, :lo12:c_triangleVertexes]
stur wzr, [x29, #-40]
b .LBB0_9
.LBB0_9: // Parent Loop BB0_3 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-40]
ldur x9, [x29, #-56]
ldr w9, [x9, #4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_12
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=2
ldr x8, [sp, #24]
ldr x8, [x8, #16]
ldursw x9, [x29, #-40]
mov x10, #40 // =0x28
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #48]
ldr x8, [sp, #64]
ldr x8, [x8]
ldr w8, [x8]
ldr x9, [sp, #48]
ldr x9, [x9, #32]
str w8, [x9]
ldr x8, [sp, #64]
ldr x8, [x8]
ldr w8, [x8, #4]
ldr x9, [sp, #48]
ldr x9, [x9, #32]
str w8, [x9, #4]
ldr x8, [sp, #48]
ldr x8, [x8, #24]
str xzr, [x8]
ldr x8, [sp, #48]
ldr x8, [x8, #24]
str xzr, [x8, #8]
ldr x8, [sp, #48]
ldr x9, [x8]
mov w8, #255 // =0xff
str w8, [x9]
ldr x9, [sp, #48]
ldr x9, [x9]
str w8, [x9, #4]
ldr x9, [sp, #48]
ldr x9, [x9]
str w8, [x9, #8]
ldr x9, [sp, #48]
ldr x9, [x9]
str w8, [x9, #12]
ldur x8, [x29, #-16]
ldr s2, [x8]
adrp x8, MD3_XYZ_SCALE
ldr s0, [x8, :lo12:MD3_XYZ_SCALE]
ldr x9, [sp, #56]
ldr x9, [x9]
ldr s1, [x9]
ldr s3, [sp, #36]
ldr x9, [sp, #56]
ldr x9, [x9]
ldr s4, [x9, #4]
ldr s5, [sp, #32]
fmul s4, s4, s5
fnmsub s1, s1, s3, s4
fmadd s0, s0, s1, s2
ldr x9, [sp, #48]
ldr x9, [x9, #8]
str s0, [x9]
ldur x9, [x29, #-16]
ldr s2, [x9, #4]
ldr s0, [x8, :lo12:MD3_XYZ_SCALE]
ldr x9, [sp, #56]
ldr x9, [x9]
ldr s1, [x9]
ldr s3, [sp, #32]
ldr x9, [sp, #56]
ldr x9, [x9]
ldr s4, [x9, #4]
ldr s5, [sp, #36]
fmul s4, s4, s5
fmadd s1, s1, s3, s4
fmadd s0, s0, s1, s2
ldr x9, [sp, #48]
ldr x9, [x9, #8]
str s0, [x9, #4]
ldur x9, [x29, #-16]
ldr s2, [x9, #8]
ldr s0, [x8, :lo12:MD3_XYZ_SCALE]
ldr x8, [sp, #56]
ldr x8, [x8]
ldr s1, [x8, #8]
fmadd s0, s0, s1, s2
ldr x8, [sp, #48]
ldr x8, [x8, #8]
str s0, [x8, #8]
ldr x8, [sp, #56]
ldr w8, [x8, #8]
asr w8, w8, #8
and w8, w8, #0xff
scvtf s0, w8
str s0, [sp, #44]
ldr x8, [sp, #56]
ldrb w8, [x8, #8]
scvtf s0, w8
str s0, [sp, #40]
adrp x8, Q_PI
ldr s0, [x8, :lo12:Q_PI]
movi v1.2s, #67, lsl #24
// kill: def $s1 killed $s1 killed $d1
fdiv s2, s0, s1
ldr s0, [sp, #44]
fmul s0, s0, s2
str s0, [sp, #44]
ldr s0, [x8, :lo12:Q_PI]
fdiv s1, s0, s1
ldr s0, [sp, #40]
fmul s0, s0, s1
str s0, [sp, #40]
ldr s0, [sp, #44]
bl cos
str s0, [sp, #4] // 4-byte Folded Spill
ldr s0, [sp, #40]
bl sin
fmov s1, s0
ldr s0, [sp, #4] // 4-byte Folded Reload
fmul s0, s0, s1
ldr x8, [sp, #16]
str s0, [x8]
ldr s0, [sp, #44]
bl sin
str s0, [sp, #8] // 4-byte Folded Spill
ldr s0, [sp, #40]
bl sin
fmov s1, s0
ldr s0, [sp, #8] // 4-byte Folded Reload
fmul s0, s0, s1
ldr x8, [sp, #16]
str s0, [x8, #4]
ldr s0, [sp, #40]
bl cos
ldr x8, [sp, #16]
str s0, [x8, #8]
ldr x8, [sp, #16]
ldr s0, [x8]
ldr s1, [sp, #36]
ldr x8, [sp, #16]
ldr s2, [x8, #4]
ldr s3, [sp, #32]
fmul s2, s2, s3
fnmsub s0, s0, s1, s2
ldr x8, [sp, #48]
ldr x8, [x8, #16]
str s0, [x8]
ldr x8, [sp, #16]
ldr s0, [x8]
ldr s1, [sp, #32]
ldr x8, [sp, #16]
ldr s2, [x8, #4]
ldr s3, [sp, #36]
fmul s2, s2, s3
fmadd s0, s0, s1, s2
ldr x8, [sp, #48]
ldr x8, [x8, #16]
str s0, [x8, #4]
ldr x8, [sp, #16]
ldr s0, [x8, #8]
ldr x8, [sp, #48]
ldr x8, [x8, #16]
str s0, [x8, #8]
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_9 Depth=2
ldur w8, [x29, #-40]
add w8, w8, #1
stur w8, [x29, #-40]
ldr x8, [sp, #64]
add x8, x8, #8
str x8, [sp, #64]
ldr x8, [sp, #56]
add x8, x8, #16
str x8, [sp, #56]
b .LBB0_9
.LBB0_12: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-56]
ldur x9, [x29, #-56]
ldrsw x9, [x9, #24]
add x8, x8, x9, lsl #2
stur x8, [x29, #-56]
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_3 Depth=1
ldur w8, [x29, #-36]
add w8, w8, #1
stur w8, [x29, #-36]
b .LBB0_3
.LBB0_14:
.cfi_def_cfa wsp, 160
ldp x29, x30, [sp, #144] // 16-byte Folded Reload
add sp, sp, #160
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size InsertMD3Model, .Lfunc_end0-InsertMD3Model
.cfi_endproc
// -- End function
.type Q_PI,@object // @Q_PI
.bss
.globl Q_PI
.p2align 2, 0x0
Q_PI:
.word 0x00000000 // float 0
.size Q_PI, 4
.type c_triangleModels,@object // @c_triangleModels
.globl c_triangleModels
.p2align 2, 0x0
c_triangleModels:
.word 0 // 0x0
.size c_triangleModels, 4
.type c_triangleSurfaces,@object // @c_triangleSurfaces
.globl c_triangleSurfaces
.p2align 2, 0x0
c_triangleSurfaces:
.word 0 // 0x0
.size c_triangleSurfaces, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type c_triangleIndexes,@object // @c_triangleIndexes
.globl c_triangleIndexes
.p2align 2, 0x0
c_triangleIndexes:
.word 0 // 0x0
.size c_triangleIndexes, 4
.type c_triangleVertexes,@object // @c_triangleVertexes
.globl c_triangleVertexes
.p2align 2, 0x0
c_triangleVertexes:
.word 0 // 0x0
.size c_triangleVertexes, 4
.type MD3_XYZ_SCALE,@object // @MD3_XYZ_SCALE
.globl MD3_XYZ_SCALE
.p2align 2, 0x0
MD3_XYZ_SCALE:
.word 0x00000000 // float 0
.size MD3_XYZ_SCALE, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym cos
.addrsig_sym sin
.addrsig_sym LoadModel
.addrsig_sym AllocDrawSurf
.addrsig_sym ShaderInfoForShader
.addrsig_sym malloc
.addrsig_sym Q_PI
.addrsig_sym c_triangleModels
.addrsig_sym c_triangleSurfaces
.addrsig_sym qtrue
.addrsig_sym c_triangleIndexes
.addrsig_sym c_triangleVertexes
.addrsig_sym MD3_XYZ_SCALE
|
../AnghaBench/Quake-III-Arena/q3map/extr_misc_model.c_InsertMD3Model.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int* color; int width; int height; float* pixels; int /*<<< orphan*/ averageColor; scalar_t__* shader; scalar_t__* editorimage; scalar_t__* lightimage; } ;
typedef TYPE_1__ shaderInfo_t ;
typedef scalar_t__ qboolean ;
typedef int /*<<< orphan*/ byte ;
/* Variables and functions */
int /*<<< orphan*/ ColorNormalize (float*,int*) ;
int /*<<< orphan*/ DefaultExtension (char*,char*) ;
int /*<<< orphan*/ * LoadImageFile (char*,scalar_t__*) ;
int /*<<< orphan*/ LoadJPGBuff (int /*<<< orphan*/ *,float**,int*,int*) ;
int /*<<< orphan*/ LoadTGABuffer (int /*<<< orphan*/ *,float**,int*,int*) ;
int /*<<< orphan*/ VectorClear (float*) ;
int /*<<< orphan*/ VectorScale (float*,double,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ _printf (char*,scalar_t__*) ;
int /*<<< orphan*/ free (int /*<<< orphan*/ *) ;
char* gamedir ;
float* malloc (int) ;
int /*<<< orphan*/ memset (float*,int,int) ;
scalar_t__ qtrue ;
int /*<<< orphan*/ sprintf (char*,char*,char*,scalar_t__*) ;
__attribute__((used)) static void LoadShaderImage( shaderInfo_t *si ) {
char filename[1024];
int i, count;
float color[4];
byte *buffer;
qboolean bTGA = qtrue;
// look for the lightimage if it is specified
if ( si->lightimage[0] ) {
sprintf( filename, "%s%s", gamedir, si->lightimage );
DefaultExtension( filename, ".tga" );
buffer = LoadImageFile(filename, &bTGA);
if ( buffer != NULL) {
goto loadTga;
}
}
// look for the editorimage if it is specified
if ( si->editorimage[0] ) {
sprintf( filename, "%s%s", gamedir, si->editorimage );
DefaultExtension( filename, ".tga" );
buffer = LoadImageFile(filename, &bTGA);
if ( buffer != NULL) {
goto loadTga;
}
}
// just try the shader name with a .tga
// on unix, we have case sensitivity problems...
sprintf( filename, "%s%s.tga", gamedir, si->shader );
buffer = LoadImageFile(filename, &bTGA);
if ( buffer != NULL) {
goto loadTga;
}
sprintf( filename, "%s%s.TGA", gamedir, si->shader );
buffer = LoadImageFile(filename, &bTGA);
if ( buffer != NULL) {
goto loadTga;
}
// couldn't load anything
_printf("WARNING: Couldn't find image for shader %s\n", si->shader );
si->color[0] = 1;
si->color[1] = 1;
si->color[2] = 1;
si->width = 64;
si->height = 64;
si->pixels = malloc( si->width * si->height * 4 );
memset ( si->pixels, 255, si->width * si->height * 4 );
return;
// load the image to get dimensions and color
loadTga:
if ( bTGA) {
LoadTGABuffer( buffer, &si->pixels, &si->width, &si->height );
}
else {
#ifdef _WIN32
LoadJPGBuff(buffer, &si->pixels, &si->width, &si->height );
#endif
}
free(buffer);
count = si->width * si->height;
VectorClear( color );
color[ 3 ] = 0;
for ( i = 0 ; i < count ; i++ ) {
color[0] += si->pixels[ i * 4 + 0 ];
color[1] += si->pixels[ i * 4 + 1 ];
color[2] += si->pixels[ i * 4 + 2 ];
color[3] += si->pixels[ i * 4 + 3 ];
}
ColorNormalize( color, si->color );
VectorScale( color, 1.0/count, si->averageColor );
}
|
.text
.file "extr_shaders.c_LoadShaderImage.c"
.p2align 2 // -- Begin function LoadShaderImage
.type LoadShaderImage,@function
LoadShaderImage: // @LoadShaderImage
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x28, [sp, #16] // 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1120
stur x0, [x29, #-8]
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
str x8, [sp, #48]
ldur x8, [x29, #-8]
ldr x8, [x8, #48]
ldr x8, [x8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_1
.LBB0_1:
adrp x8, gamedir
ldr x2, [x8, :lo12:gamedir]
ldur x8, [x29, #-8]
ldr x3, [x8, #48]
add x0, sp, #88
str x0, [sp, #40] // 8-byte Folded Spill
adrp x1, .L.str
add x1, x1, :lo12:.L.str
bl sprintf
ldr x0, [sp, #40] // 8-byte Folded Reload
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl DefaultExtension
ldr x0, [sp, #40] // 8-byte Folded Reload
add x1, sp, #48
bl LoadImageFile
str x0, [sp, #56]
ldr x8, [sp, #56]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_3
b .LBB0_2
.LBB0_2:
b .LBB0_13
.LBB0_3:
b .LBB0_4
.LBB0_4:
ldur x8, [x29, #-8]
ldr x8, [x8, #40]
ldr x8, [x8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_5
.LBB0_5:
adrp x8, gamedir
ldr x2, [x8, :lo12:gamedir]
ldur x8, [x29, #-8]
ldr x3, [x8, #40]
add x0, sp, #88
str x0, [sp, #32] // 8-byte Folded Spill
adrp x1, .L.str
add x1, x1, :lo12:.L.str
bl sprintf
ldr x0, [sp, #32] // 8-byte Folded Reload
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl DefaultExtension
ldr x0, [sp, #32] // 8-byte Folded Reload
add x1, sp, #48
bl LoadImageFile
str x0, [sp, #56]
ldr x8, [sp, #56]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
b .LBB0_13
.LBB0_7:
b .LBB0_8
.LBB0_8:
adrp x8, gamedir
ldr x2, [x8, :lo12:gamedir]
ldur x8, [x29, #-8]
ldr x3, [x8, #32]
add x0, sp, #88
str x0, [sp, #24] // 8-byte Folded Spill
adrp x1, .L.str.2
add x1, x1, :lo12:.L.str.2
bl sprintf
ldr x0, [sp, #24] // 8-byte Folded Reload
add x1, sp, #48
bl LoadImageFile
str x0, [sp, #56]
ldr x8, [sp, #56]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9:
b .LBB0_13
.LBB0_10:
adrp x8, gamedir
ldr x2, [x8, :lo12:gamedir]
ldur x8, [x29, #-8]
ldr x3, [x8, #32]
add x0, sp, #88
str x0, [sp, #16] // 8-byte Folded Spill
adrp x1, .L.str.3
add x1, x1, :lo12:.L.str.3
bl sprintf
ldr x0, [sp, #16] // 8-byte Folded Reload
add x1, sp, #48
bl LoadImageFile
str x0, [sp, #56]
ldr x8, [sp, #56]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11:
b .LBB0_13
.LBB0_12:
ldur x8, [x29, #-8]
ldr x1, [x8, #32]
adrp x0, .L.str.4
add x0, x0, :lo12:.L.str.4
bl _printf
ldur x8, [x29, #-8]
ldr x9, [x8]
mov w8, #1 // =0x1
str w8, [x9]
ldur x9, [x29, #-8]
ldr x9, [x9]
str w8, [x9, #4]
ldur x9, [x29, #-8]
ldr x9, [x9]
str w8, [x9, #8]
ldur x9, [x29, #-8]
mov w8, #64 // =0x40
str w8, [x9, #8]
ldur x9, [x29, #-8]
str w8, [x9, #12]
ldur x8, [x29, #-8]
ldr w8, [x8, #8]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
mul w8, w8, w9
lsl w0, w8, #2
bl malloc
ldur x8, [x29, #-8]
str x0, [x8, #16]
ldur x8, [x29, #-8]
ldr x0, [x8, #16]
ldur x8, [x29, #-8]
ldr w8, [x8, #8]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
mul w8, w8, w9
lsl w2, w8, #2
mov w1, #255 // =0xff
bl memset
b .LBB0_21
.LBB0_13:
ldr x8, [sp, #48]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14:
ldr x0, [sp, #56]
ldur x8, [x29, #-8]
add x1, x8, #16
ldur x8, [x29, #-8]
add x2, x8, #8
ldur x8, [x29, #-8]
add x3, x8, #12
bl LoadTGABuffer
b .LBB0_16
.LBB0_15:
b .LBB0_16
.LBB0_16:
ldr x0, [sp, #56]
bl free
ldur x8, [x29, #-8]
ldr w8, [x8, #8]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
mul w8, w8, w9
str w8, [sp, #80]
add x0, sp, #64
bl VectorClear
movi d0, #0000000000000000
str s0, [sp, #76]
str wzr, [sp, #84]
b .LBB0_17
.LBB0_17: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #84]
ldr w9, [sp, #80]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_20
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-8]
ldr x8, [x8, #16]
ldr w9, [sp, #84]
lsl w9, w9, #2
add w9, w9, #0
ldr s1, [x8, w9, sxtw #2]
ldr s0, [sp, #64]
fadd s0, s0, s1
str s0, [sp, #64]
ldur x8, [x29, #-8]
ldr x8, [x8, #16]
ldr w9, [sp, #84]
lsl w9, w9, #2
add w9, w9, #1
ldr s1, [x8, w9, sxtw #2]
ldr s0, [sp, #68]
fadd s0, s0, s1
str s0, [sp, #68]
ldur x8, [x29, #-8]
ldr x8, [x8, #16]
ldr w9, [sp, #84]
lsl w9, w9, #2
add w9, w9, #2
ldr s1, [x8, w9, sxtw #2]
ldr s0, [sp, #72]
fadd s0, s0, s1
str s0, [sp, #72]
ldur x8, [x29, #-8]
ldr x8, [x8, #16]
ldr w9, [sp, #84]
lsl w9, w9, #2
add w9, w9, #3
ldr s1, [x8, w9, sxtw #2]
ldr s0, [sp, #76]
fadd s0, s0, s1
str s0, [sp, #76]
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #84]
add w8, w8, #1
str w8, [sp, #84]
b .LBB0_17
.LBB0_20:
ldur x8, [x29, #-8]
ldr x1, [x8]
add x0, sp, #64
str x0, [sp, #8] // 8-byte Folded Spill
bl ColorNormalize
ldr x0, [sp, #8] // 8-byte Folded Reload
ldr s0, [sp, #80]
fmov w8, s0
scvtf d1, w8
fmov d0, #1.00000000
fdiv d0, d0, d1
ldur x8, [x29, #-8]
ldr w1, [x8, #24]
bl VectorScale
b .LBB0_21
.LBB0_21:
add sp, sp, #1120
.cfi_def_cfa wsp, 32
ldr x28, [sp, #16] // 8-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size LoadShaderImage, .Lfunc_end0-LoadShaderImage
.cfi_endproc
// -- End function
.type qtrue,@object // @qtrue
.bss
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0 // 0x0
.size qtrue, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "%s%s"
.size .L.str, 5
.type gamedir,@object // @gamedir
.bss
.globl gamedir
.p2align 3, 0x0
gamedir:
.xword 0
.size gamedir, 8
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz ".tga"
.size .L.str.1, 5
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "%s%s.tga"
.size .L.str.2, 9
.type .L.str.3,@object // @.str.3
.L.str.3:
.asciz "%s%s.TGA"
.size .L.str.3, 9
.type .L.str.4,@object // @.str.4
.L.str.4:
.asciz "WARNING: Couldn't find image for shader %s\n"
.size .L.str.4, 44
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym LoadShaderImage
.addrsig_sym sprintf
.addrsig_sym DefaultExtension
.addrsig_sym LoadImageFile
.addrsig_sym _printf
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym LoadTGABuffer
.addrsig_sym free
.addrsig_sym VectorClear
.addrsig_sym ColorNormalize
.addrsig_sym VectorScale
.addrsig_sym qtrue
.addrsig_sym gamedir
|
../AnghaBench/Quake-III-Arena/q3map/extr_shaders.c_LoadShaderImage.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_19__ TYPE_5__ ;
typedef struct TYPE_18__ TYPE_4__ ;
typedef struct TYPE_17__ TYPE_3__ ;
typedef struct TYPE_16__ TYPE_2__ ;
typedef struct TYPE_15__ TYPE_1__ ;
/* Type definitions */
struct TYPE_17__ {int width; int height; TYPE_5__* verts; } ;
typedef TYPE_3__ mesh_t ;
struct TYPE_18__ {int patchWidth; int patchHeight; int lightmapWidth; int lightmapHeight; int lightmapX; int lightmapY; scalar_t__ lightmapNum; TYPE_2__* mapBrush; TYPE_1__* shaderInfo; TYPE_5__* verts; } ;
typedef TYPE_4__ mapDrawSurface_t ;
struct TYPE_19__ {float* lightmap; } ;
typedef TYPE_5__ drawVert_t ;
struct TYPE_16__ {int /*<<< orphan*/ brushnum; int /*<<< orphan*/ entitynum; } ;
struct TYPE_15__ {int lightmapSampleSize; } ;
/* Variables and functions */
int /*<<< orphan*/ AllocLMBlock (int,int,int*,int*) ;
int /*<<< orphan*/ Error (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ FreeMesh (TYPE_3__*) ;
int LIGHTMAP_HEIGHT ;
int LIGHTMAP_WIDTH ;
int /*<<< orphan*/ PrepareNewLightmap () ;
int /*<<< orphan*/ PutMeshOnCurve (TYPE_3__) ;
TYPE_3__* RemoveLinearMeshColumnsRows (TYPE_3__*) ;
TYPE_3__* SubdivideMesh (TYPE_3__,int,int) ;
TYPE_3__* SubdivideMeshQuads (TYPE_3__*,int,int,int*,int*) ;
int c_exactLightmap ;
scalar_t__ numLightmaps ;
int* originalHeights ;
int* originalWidths ;
int samplesize ;
void AllocateLightmapForPatch( mapDrawSurface_t *ds ) {
int i, j, k;
drawVert_t *verts;
int w, h;
int x, y;
float s, t;
mesh_t mesh, *subdividedMesh, *tempMesh, *newmesh;
int widthtable[LIGHTMAP_WIDTH], heighttable[LIGHTMAP_HEIGHT], ssize;
verts = ds->verts;
mesh.width = ds->patchWidth;
mesh.height = ds->patchHeight;
mesh.verts = verts;
newmesh = SubdivideMesh( mesh, 8, 999 );
PutMeshOnCurve( *newmesh );
tempMesh = RemoveLinearMeshColumnsRows( newmesh );
FreeMesh(newmesh);
ssize = samplesize;
if (ds->shaderInfo->lightmapSampleSize)
ssize = ds->shaderInfo->lightmapSampleSize;
#ifdef LIGHTMAP_PATCHSHIFT
subdividedMesh = SubdivideMeshQuads( tempMesh, ssize, LIGHTMAP_WIDTH-1, widthtable, heighttable);
#else
subdividedMesh = SubdivideMeshQuads( tempMesh, ssize, LIGHTMAP_WIDTH, widthtable, heighttable);
#endif
w = subdividedMesh->width;
h = subdividedMesh->height;
#ifdef LIGHTMAP_PATCHSHIFT
w++;
h++;
#endif
FreeMesh(subdividedMesh);
// allocate the lightmap
c_exactLightmap += w * h;
if ( !AllocLMBlock( w, h, &x, &y ) ) {
PrepareNewLightmap();
if ( !AllocLMBlock( w, h, &x, &y ) ) {
Error("Entity %i, brush %i: Lightmap allocation failed",
ds->mapBrush->entitynum, ds->mapBrush->brushnum );
}
}
#ifdef LIGHTMAP_PATCHSHIFT
w--;
h--;
#endif
// set the lightmap texture coordinates in the drawVerts
ds->lightmapNum = numLightmaps - 1;
ds->lightmapWidth = w;
ds->lightmapHeight = h;
ds->lightmapX = x;
ds->lightmapY = y;
for ( i = 0 ; i < ds->patchWidth ; i++ ) {
for ( k = 0 ; k < w ; k++ ) {
if ( originalWidths[k] >= i ) {
break;
}
}
if (k >= w)
k = w-1;
s = x + k;
for ( j = 0 ; j < ds->patchHeight ; j++ ) {
for ( k = 0 ; k < h ; k++ ) {
if ( originalHeights[k] >= j ) {
break;
}
}
if (k >= h)
k = h-1;
t = y + k;
verts[i + j * ds->patchWidth].lightmap[0] = ( s + 0.5 ) / LIGHTMAP_WIDTH;
verts[i + j * ds->patchWidth].lightmap[1] = ( t + 0.5 ) / LIGHTMAP_HEIGHT;
}
}
}
|
.text
.file "extr_lightmaps.c_AllocateLightmapForPatch.c"
.globl AllocateLightmapForPatch // -- Begin function AllocateLightmapForPatch
.p2align 2
.type AllocateLightmapForPatch,@function
AllocateLightmapForPatch: // @AllocateLightmapForPatch
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub sp, sp, #144
stur x0, [x29, #-8]
adrp x8, LIGHTMAP_WIDTH
ldr w8, [x8, :lo12:LIGHTMAP_WIDTH]
// kill: def $x8 killed $w8
mov x9, sp
stur x9, [x29, #-104]
lsl x9, x8, #2
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x0, x9, x10
stur x0, [x29, #-144] // 8-byte Folded Spill
mov sp, x0
stur x8, [x29, #-112]
adrp x8, LIGHTMAP_HEIGHT
ldr w8, [x8, :lo12:LIGHTMAP_HEIGHT]
// kill: def $x8 killed $w8
lsl x9, x8, #2
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x0, x9, x10
stur x0, [x29, #-136] // 8-byte Folded Spill
mov sp, x0
stur x8, [x29, #-120]
ldur x8, [x29, #-8]
ldr x8, [x8, #48]
stur x8, [x29, #-32]
ldur x8, [x29, #-8]
ldr w8, [x8]
stur w8, [x29, #-72]
ldur x8, [x29, #-8]
ldr w8, [x8, #4]
stur w8, [x29, #-68]
ldur x8, [x29, #-32]
stur x8, [x29, #-64]
ldur x0, [x29, #-72]
ldur x1, [x29, #-64]
mov w2, #8 // =0x8
mov w3, #999 // =0x3e7
bl SubdivideMesh
stur x0, [x29, #-96]
ldur x8, [x29, #-96]
ldr x0, [x8]
ldr x1, [x8, #8]
bl PutMeshOnCurve
ldur x0, [x29, #-96]
bl RemoveLinearMeshColumnsRows
stur x0, [x29, #-88]
ldur x0, [x29, #-96]
bl FreeMesh
adrp x8, samplesize
ldr w8, [x8, :lo12:samplesize]
stur w8, [x29, #-124]
ldur x8, [x29, #-8]
ldr x8, [x8, #40]
ldr w8, [x8]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-8]
ldr x8, [x8, #40]
ldr w8, [x8]
stur w8, [x29, #-124]
b .LBB0_2
.LBB0_2:
ldur x4, [x29, #-136] // 8-byte Folded Reload
ldur x3, [x29, #-144] // 8-byte Folded Reload
ldur x0, [x29, #-88]
ldur w1, [x29, #-124]
adrp x8, LIGHTMAP_WIDTH
ldr w2, [x8, :lo12:LIGHTMAP_WIDTH]
bl SubdivideMeshQuads
stur x0, [x29, #-80]
ldur x8, [x29, #-80]
ldr w8, [x8]
stur w8, [x29, #-36]
ldur x8, [x29, #-80]
ldr w8, [x8, #4]
stur w8, [x29, #-40]
ldur x0, [x29, #-80]
bl FreeMesh
ldur w8, [x29, #-36]
ldur w9, [x29, #-40]
mul w10, w8, w9
adrp x9, c_exactLightmap
ldr w8, [x9, :lo12:c_exactLightmap]
add w8, w8, w10
str w8, [x9, :lo12:c_exactLightmap]
ldur w0, [x29, #-36]
ldur w1, [x29, #-40]
sub x2, x29, #44
sub x3, x29, #48
bl AllocLMBlock
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_3
.LBB0_3:
bl PrepareNewLightmap
ldur w0, [x29, #-36]
ldur w1, [x29, #-40]
sub x2, x29, #44
sub x3, x29, #48
bl AllocLMBlock
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
ldur x8, [x29, #-8]
ldr x8, [x8, #32]
ldr w1, [x8, #4]
ldur x8, [x29, #-8]
ldr x8, [x8, #32]
ldr w2, [x8]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_5
.LBB0_5:
b .LBB0_6
.LBB0_6:
adrp x8, numLightmaps
ldr x8, [x8, :lo12:numLightmaps]
subs x8, x8, #1
ldur x9, [x29, #-8]
str x8, [x9, #24]
ldur w8, [x29, #-36]
ldur x9, [x29, #-8]
str w8, [x9, #8]
ldur w8, [x29, #-40]
ldur x9, [x29, #-8]
str w8, [x9, #12]
ldur w8, [x29, #-44]
ldur x9, [x29, #-8]
str w8, [x9, #16]
ldur w8, [x29, #-48]
ldur x9, [x29, #-8]
str w8, [x9, #20]
stur wzr, [x29, #-12]
b .LBB0_7
.LBB0_7: // =>This Loop Header: Depth=1
// Child Loop BB0_9 Depth 2
// Child Loop BB0_17 Depth 2
// Child Loop BB0_19 Depth 3
ldur w8, [x29, #-12]
ldur x9, [x29, #-8]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_30
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
stur wzr, [x29, #-20]
b .LBB0_9
.LBB0_9: // Parent Loop BB0_7 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-20]
ldur w9, [x29, #-36]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_14
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=2
adrp x8, originalWidths
ldr x8, [x8, :lo12:originalWidths]
ldursw x9, [x29, #-20]
ldr w8, [x8, x9, lsl #2]
ldur w9, [x29, #-12]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_7 Depth=1
b .LBB0_14
.LBB0_12: // in Loop: Header=BB0_9 Depth=2
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_9 Depth=2
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_9
.LBB0_14: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-20]
ldur w9, [x29, #-36]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-36]
subs w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-44]
ldur w9, [x29, #-20]
add w8, w8, w9
scvtf s0, w8
stur s0, [x29, #-52]
stur wzr, [x29, #-16]
b .LBB0_17
.LBB0_17: // Parent Loop BB0_7 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_19 Depth 3
ldur w8, [x29, #-16]
ldur x9, [x29, #-8]
ldr w9, [x9, #4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_28
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_17 Depth=2
stur wzr, [x29, #-20]
b .LBB0_19
.LBB0_19: // Parent Loop BB0_7 Depth=1
// Parent Loop BB0_17 Depth=2
// => This Inner Loop Header: Depth=3
ldur w8, [x29, #-20]
ldur w9, [x29, #-40]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_24
b .LBB0_20
.LBB0_20: // in Loop: Header=BB0_19 Depth=3
adrp x8, originalHeights
ldr x8, [x8, :lo12:originalHeights]
ldursw x9, [x29, #-20]
ldr w8, [x8, x9, lsl #2]
ldur w9, [x29, #-16]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_17 Depth=2
b .LBB0_24
.LBB0_22: // in Loop: Header=BB0_19 Depth=3
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_19 Depth=3
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_19
.LBB0_24: // in Loop: Header=BB0_17 Depth=2
ldur w8, [x29, #-20]
ldur w9, [x29, #-40]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_26
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_17 Depth=2
ldur w8, [x29, #-40]
subs w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_17 Depth=2
ldur w8, [x29, #-48]
ldur w9, [x29, #-20]
add w8, w8, w9
scvtf s0, w8
stur s0, [x29, #-56]
ldur s0, [x29, #-52]
fcvt d0, s0
fmov d1, #0.50000000
fadd d0, d0, d1
adrp x8, LIGHTMAP_WIDTH
ldr s2, [x8, :lo12:LIGHTMAP_WIDTH]
fmov w8, s2
scvtf d2, w8
fdiv d0, d0, d2
fcvt s0, d0
ldur x8, [x29, #-32]
ldur w9, [x29, #-12]
ldur w10, [x29, #-16]
ldur x11, [x29, #-8]
ldr w11, [x11]
mul w10, w10, w11
add w9, w9, w10
ldr x8, [x8, w9, sxtw #3]
str s0, [x8]
ldur s0, [x29, #-56]
fcvt d0, s0
fadd d0, d0, d1
adrp x8, LIGHTMAP_HEIGHT
ldr s1, [x8, :lo12:LIGHTMAP_HEIGHT]
fmov w8, s1
scvtf d1, w8
fdiv d0, d0, d1
fcvt s0, d0
ldur x8, [x29, #-32]
ldur w9, [x29, #-12]
ldur w10, [x29, #-16]
ldur x11, [x29, #-8]
ldr w11, [x11]
mul w10, w10, w11
add w9, w9, w10
ldr x8, [x8, w9, sxtw #3]
str s0, [x8, #4]
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_17 Depth=2
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_17
.LBB0_28: // in Loop: Header=BB0_7 Depth=1
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_7
.LBB0_30:
ldur x8, [x29, #-104]
mov sp, x8
mov sp, x29
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size AllocateLightmapForPatch, .Lfunc_end0-AllocateLightmapForPatch
.cfi_endproc
// -- End function
.type LIGHTMAP_WIDTH,@object // @LIGHTMAP_WIDTH
.bss
.globl LIGHTMAP_WIDTH
.p2align 2, 0x0
LIGHTMAP_WIDTH:
.word 0 // 0x0
.size LIGHTMAP_WIDTH, 4
.type LIGHTMAP_HEIGHT,@object // @LIGHTMAP_HEIGHT
.globl LIGHTMAP_HEIGHT
.p2align 2, 0x0
LIGHTMAP_HEIGHT:
.word 0 // 0x0
.size LIGHTMAP_HEIGHT, 4
.type samplesize,@object // @samplesize
.globl samplesize
.p2align 2, 0x0
samplesize:
.word 0 // 0x0
.size samplesize, 4
.type c_exactLightmap,@object // @c_exactLightmap
.globl c_exactLightmap
.p2align 2, 0x0
c_exactLightmap:
.word 0 // 0x0
.size c_exactLightmap, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Entity %i, brush %i: Lightmap allocation failed"
.size .L.str, 48
.type numLightmaps,@object // @numLightmaps
.bss
.globl numLightmaps
.p2align 3, 0x0
numLightmaps:
.xword 0 // 0x0
.size numLightmaps, 8
.type originalWidths,@object // @originalWidths
.globl originalWidths
.p2align 3, 0x0
originalWidths:
.xword 0
.size originalWidths, 8
.type originalHeights,@object // @originalHeights
.globl originalHeights
.p2align 3, 0x0
originalHeights:
.xword 0
.size originalHeights, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym SubdivideMesh
.addrsig_sym PutMeshOnCurve
.addrsig_sym RemoveLinearMeshColumnsRows
.addrsig_sym FreeMesh
.addrsig_sym SubdivideMeshQuads
.addrsig_sym AllocLMBlock
.addrsig_sym PrepareNewLightmap
.addrsig_sym Error
.addrsig_sym LIGHTMAP_WIDTH
.addrsig_sym LIGHTMAP_HEIGHT
.addrsig_sym samplesize
.addrsig_sym c_exactLightmap
.addrsig_sym numLightmaps
.addrsig_sym originalWidths
.addrsig_sym originalHeights
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightmaps.c_AllocateLightmapForPatch.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {struct TYPE_5__** next; TYPE_2__** nodes; } ;
typedef TYPE_1__ portal_t ;
struct TYPE_6__ {scalar_t__ planenum; int cluster; int area; TYPE_1__* portals; scalar_t__ opaque; struct TYPE_6__** children; } ;
typedef TYPE_2__ node_t ;
/* Variables and functions */
scalar_t__ PLANENUM_LEAF ;
scalar_t__ Portal_Passable (TYPE_1__*) ;
int /*<<< orphan*/ num_solidfaces ;
int num_visclusters ;
int /*<<< orphan*/ num_visportals ;
void NumberLeafs_r (node_t *node)
{
portal_t *p;
if ( node->planenum != PLANENUM_LEAF ) {
// decision node
node->cluster = -99;
NumberLeafs_r (node->children[0]);
NumberLeafs_r (node->children[1]);
return;
}
node->area = -1;
if ( node->opaque ) {
// solid block, viewpoint never inside
node->cluster = -1;
return;
}
node->cluster = num_visclusters;
num_visclusters++;
// count the portals
for (p = node->portals ; p ; )
{
if (p->nodes[0] == node) // only write out from first leaf
{
if (Portal_Passable(p))
num_visportals++;
else
num_solidfaces++;
p = p->next[0];
}
else
{
if (!Portal_Passable(p))
num_solidfaces++;
p = p->next[1];
}
}
}
|
.text
.file "extr_prtfile.c_NumberLeafs_r.c"
.globl NumberLeafs_r // -- Begin function NumberLeafs_r
.p2align 2
.type NumberLeafs_r,@function
NumberLeafs_r: // @NumberLeafs_r
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
str x0, [sp, #8]
ldr x8, [sp, #8]
ldr x8, [x8]
adrp x9, PLANENUM_LEAF
ldr x9, [x9, :lo12:PLANENUM_LEAF]
subs x8, x8, x9
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldr x9, [sp, #8]
mov w8, #-99 // =0xffffff9d
str w8, [x9, #8]
ldr x8, [sp, #8]
ldr x8, [x8, #32]
ldr x0, [x8]
bl NumberLeafs_r
ldr x8, [sp, #8]
ldr x8, [x8, #32]
ldr x0, [x8, #8]
bl NumberLeafs_r
b .LBB0_15
.LBB0_2:
ldr x9, [sp, #8]
mov w8, #-1 // =0xffffffff
str w8, [x9, #12]
ldr x8, [sp, #8]
ldr x8, [x8, #24]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldr x9, [sp, #8]
mov w8, #-1 // =0xffffffff
str w8, [x9, #8]
b .LBB0_15
.LBB0_4:
adrp x9, num_visclusters
ldr w8, [x9, :lo12:num_visclusters]
ldr x10, [sp, #8]
str w8, [x10, #8]
ldr w8, [x9, :lo12:num_visclusters]
add w8, w8, #1
str w8, [x9, :lo12:num_visclusters]
ldr x8, [sp, #8]
ldr x8, [x8, #16]
str x8, [sp]
b .LBB0_5
.LBB0_5: // =>This Inner Loop Header: Depth=1
ldr x8, [sp]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_15
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=1
ldr x8, [sp]
ldr x8, [x8, #8]
ldr x8, [x8]
ldr x9, [sp, #8]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=1
ldr x0, [sp]
bl Portal_Passable
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_5 Depth=1
adrp x9, num_visportals
ldr w8, [x9, :lo12:num_visportals]
add w8, w8, #1
str w8, [x9, :lo12:num_visportals]
b .LBB0_10
.LBB0_9: // in Loop: Header=BB0_5 Depth=1
adrp x9, num_solidfaces
ldr w8, [x9, :lo12:num_solidfaces]
add w8, w8, #1
str w8, [x9, :lo12:num_solidfaces]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_5 Depth=1
ldr x8, [sp]
ldr x8, [x8]
ldr x8, [x8]
str x8, [sp]
b .LBB0_14
.LBB0_11: // in Loop: Header=BB0_5 Depth=1
ldr x0, [sp]
bl Portal_Passable
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_5 Depth=1
adrp x9, num_solidfaces
ldr w8, [x9, :lo12:num_solidfaces]
add w8, w8, #1
str w8, [x9, :lo12:num_solidfaces]
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_5 Depth=1
ldr x8, [sp]
ldr x8, [x8]
ldr x8, [x8, #8]
str x8, [sp]
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_5 Depth=1
b .LBB0_5
.LBB0_15:
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size NumberLeafs_r, .Lfunc_end0-NumberLeafs_r
.cfi_endproc
// -- End function
.type PLANENUM_LEAF,@object // @PLANENUM_LEAF
.bss
.globl PLANENUM_LEAF
.p2align 3, 0x0
PLANENUM_LEAF:
.xword 0 // 0x0
.size PLANENUM_LEAF, 8
.type num_visclusters,@object // @num_visclusters
.globl num_visclusters
.p2align 2, 0x0
num_visclusters:
.word 0 // 0x0
.size num_visclusters, 4
.type num_visportals,@object // @num_visportals
.globl num_visportals
.p2align 2, 0x0
num_visportals:
.word 0 // 0x0
.size num_visportals, 4
.type num_solidfaces,@object // @num_solidfaces
.globl num_solidfaces
.p2align 2, 0x0
num_solidfaces:
.word 0 // 0x0
.size num_solidfaces, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym NumberLeafs_r
.addrsig_sym Portal_Passable
.addrsig_sym PLANENUM_LEAF
.addrsig_sym num_visclusters
.addrsig_sym num_visportals
.addrsig_sym num_solidfaces
|
../AnghaBench/Quake-III-Arena/q3map/extr_prtfile.c_NumberLeafs_r.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int numpoints; scalar_t__** p; } ;
typedef TYPE_1__ winding_t ;
typedef int /*<<< orphan*/ qboolean ;
/* Variables and functions */
scalar_t__ MAX_WORLD_COORD ;
scalar_t__ MIN_WORLD_COORD ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean WindingIsHuge (winding_t *w)
{
int i, j;
for (i=0 ; i<w->numpoints ; i++)
{
for (j=0 ; j<3 ; j++)
if (w->p[i][j] <= MIN_WORLD_COORD || w->p[i][j] >= MAX_WORLD_COORD)
return qtrue;
}
return qfalse;
}
|
.text
.file "extr_brush.c_WindingIsHuge.c"
.globl WindingIsHuge // -- Begin function WindingIsHuge
.p2align 2
.type WindingIsHuge,@function
WindingIsHuge: // @WindingIsHuge
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
str x0, [sp, #16]
str wzr, [sp, #12]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_3 Depth 2
ldr w8, [sp, #12]
ldr x9, [sp, #16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_11
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
str wzr, [sp, #8]
b .LBB0_3
.LBB0_3: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #8]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_9
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #12]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #8]
ldr x8, [x8, x9, lsl #3]
adrp x9, MIN_WORLD_COORD
ldr x9, [x9, :lo12:MIN_WORLD_COORD]
subs x8, x8, x9
cset w8, le
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #12]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #8]
ldr x8, [x8, x9, lsl #3]
adrp x9, MAX_WORLD_COORD
ldr x9, [x9, :lo12:MAX_WORLD_COORD]
subs x8, x8, x9
cset w8, lt
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
str w8, [sp, #28]
b .LBB0_12
.LBB0_7: // in Loop: Header=BB0_3 Depth=2
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_3 Depth=2
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
b .LBB0_3
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_1
.LBB0_11:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
str w8, [sp, #28]
b .LBB0_12
.LBB0_12:
ldr w0, [sp, #28]
add sp, sp, #32
.cfi_def_cfa_offset 0
ret
.Lfunc_end0:
.size WindingIsHuge, .Lfunc_end0-WindingIsHuge
.cfi_endproc
// -- End function
.type MIN_WORLD_COORD,@object // @MIN_WORLD_COORD
.bss
.globl MIN_WORLD_COORD
.p2align 3, 0x0
MIN_WORLD_COORD:
.xword 0 // 0x0
.size MIN_WORLD_COORD, 8
.type MAX_WORLD_COORD,@object // @MAX_WORLD_COORD
.globl MAX_WORLD_COORD
.p2align 3, 0x0
MAX_WORLD_COORD:
.xword 0 // 0x0
.size MAX_WORLD_COORD, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym MIN_WORLD_COORD
.addrsig_sym MAX_WORLD_COORD
.addrsig_sym qtrue
.addrsig_sym qfalse
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_WindingIsHuge.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_16__ TYPE_2__ ;
typedef struct TYPE_15__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ shaderInfo_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_15__ {int numpoints; int /*<<< orphan*/ * points; int /*<<< orphan*/ plane; int /*<<< orphan*/ * boundaries; int /*<<< orphan*/ ** lightmapCoords; scalar_t__ num; } ;
typedef TYPE_1__ lFacet_t ;
typedef int /*<<< orphan*/ dsurface_t ;
struct TYPE_16__ {int /*<<< orphan*/ * lightmap; int /*<<< orphan*/ xyz; } ;
typedef TYPE_2__ drawVert_t ;
/* Variables and functions */
int /*<<< orphan*/ VS_GenerateBoundaryForPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VS_LightmapMatrixFromPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,TYPE_2__*,TYPE_2__*,TYPE_2__*) ;
int /*<<< orphan*/ VS_PlaneFromPoints (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VS_TextureMatrixFromPoints (TYPE_1__*,TYPE_2__*,TYPE_2__*,TYPE_2__*) ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
double VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * drawSurfaces ;
int /*<<< orphan*/ numfacets ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ * surfaceOrigin ;
qboolean VS_GenerateFacetFor3Points( dsurface_t *dsurf, shaderInfo_t *si, lFacet_t *f, drawVert_t *a, drawVert_t *b, drawVert_t *c ) {
//
vec3_t dir;
int i;
// if we can't generate a valid plane for the points, ignore the facet
if ( !VS_PlaneFromPoints( &f->plane, a->xyz, b->xyz, c->xyz ) ) {
f->numpoints = 0;
return qfalse;
}
f->num = numfacets++;
VectorAdd( a->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[0] );
VectorAdd( b->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[1] );
VectorAdd( c->xyz, surfaceOrigin[dsurf - drawSurfaces], f->points[2] );
f->lightmapCoords[0][0] = a->lightmap[0];
f->lightmapCoords[0][1] = a->lightmap[1];
f->lightmapCoords[1][0] = b->lightmap[0];
f->lightmapCoords[1][1] = b->lightmap[1];
f->lightmapCoords[2][0] = c->lightmap[0];
f->lightmapCoords[2][1] = c->lightmap[1];
VS_GenerateBoundaryForPoints( &f->boundaries[0], &f->plane, f->points[0], f->points[1] );
VS_GenerateBoundaryForPoints( &f->boundaries[1], &f->plane, f->points[1], f->points[2] );
VS_GenerateBoundaryForPoints( &f->boundaries[2], &f->plane, f->points[2], f->points[0] );
for (i = 0; i < 3; i++)
{
VectorSubtract(f->points[(i+1)%3], f->points[i], dir);
if (VectorLength(dir) < 0.1)
return qfalse;
}
VS_TextureMatrixFromPoints( f, a, b, c );
VS_LightmapMatrixFromPoints( dsurf, si, f, a, b, c );
f->numpoints = 3;
return qtrue;
}
|
.text
.file "extr_soundv.c_VS_GenerateFacetFor3Points.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_GenerateFacetFor3Points
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VS_GenerateFacetFor3Points
.p2align 2
.type VS_GenerateFacetFor3Points,@function
VS_GenerateFacetFor3Points: // @VS_GenerateFacetFor3Points
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
stur x3, [x29, #-40]
str x4, [sp, #48]
str x5, [sp, #40]
ldur x8, [x29, #-32]
ldur x9, [x29, #-40]
ldr w1, [x9, #8]
ldr x9, [sp, #48]
ldr w2, [x9, #8]
ldr x9, [sp, #40]
ldr w3, [x9, #8]
add x0, x8, #16
bl VS_PlaneFromPoints
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-32]
str wzr, [x8]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_2:
adrp x10, numfacets
ldrsw x8, [x10, :lo12:numfacets]
mov w9, w8
add w9, w9, #1
str w9, [x10, :lo12:numfacets]
ldur x9, [x29, #-32]
str x8, [x9, #40]
ldur x8, [x29, #-40]
ldr w0, [x8, #8]
adrp x8, surfaceOrigin
str x8, [sp, #8] // 8-byte Folded Spill
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
adrp x10, drawSurfaces
str x10, [sp, #16] // 8-byte Folded Spill
ldr x10, [x10, :lo12:drawSurfaces]
subs x9, x9, x10
mov x10, #4 // =0x4
str x10, [sp, #24] // 8-byte Folded Spill
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8]
bl VectorAdd
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x11, [sp, #16] // 8-byte Folded Reload
ldr x10, [sp, #24] // 8-byte Folded Reload
ldr x9, [sp, #48]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #4]
bl VectorAdd
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x11, [sp, #16] // 8-byte Folded Reload
ldr x10, [sp, #24] // 8-byte Folded Reload
ldr x9, [sp, #40]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:surfaceOrigin]
ldur x9, [x29, #-16]
ldr x11, [x11, :lo12:drawSurfaces]
subs x9, x9, x11
sdiv x9, x9, x10
ldr w1, [x8, x9, lsl #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #8]
bl VectorAdd
ldur x8, [x29, #-40]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9]
str w8, [x9]
ldur x8, [x29, #-40]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9]
str w8, [x9, #4]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #8]
str w8, [x9]
ldr x8, [sp, #48]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #8]
str w8, [x9, #4]
ldr x8, [sp, #40]
ldr x8, [x8]
ldr w8, [x8]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #16]
str w8, [x9]
ldr x8, [sp, #40]
ldr x8, [x8]
ldr w8, [x8, #4]
ldur x9, [x29, #-32]
ldr x9, [x9, #32]
ldr x9, [x9, #16]
str w8, [x9, #4]
ldur x8, [x29, #-32]
ldr x0, [x8, #24]
ldur x8, [x29, #-32]
add x1, x8, #16
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w3, [x8, #4]
bl VS_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #24]
add x0, x8, #4
ldur x8, [x29, #-32]
add x1, x8, #16
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #4]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w3, [x8, #8]
bl VS_GenerateBoundaryForPoints
ldur x8, [x29, #-32]
ldr x8, [x8, #24]
add x0, x8, #8
ldur x8, [x29, #-32]
add x1, x8, #16
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w2, [x8, #8]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w3, [x8]
bl VS_GenerateBoundaryForPoints
str wzr, [sp, #32]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #32]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldr w9, [sp, #32]
add w9, w9, #1
mov w11, #3 // =0x3
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr w0, [x8, w9, sxtw #2]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldrsw x9, [sp, #32]
ldr w1, [x8, x9, lsl #2]
ldr w2, [sp, #36]
bl VectorSubtract
ldr w0, [sp, #36]
bl VectorLength
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldr w8, [sp, #32]
add w8, w8, #1
str w8, [sp, #32]
b .LBB0_3
.LBB0_8:
ldur x0, [x29, #-32]
ldur x1, [x29, #-40]
ldr x2, [sp, #48]
ldr x3, [sp, #40]
bl VS_TextureMatrixFromPoints
ldur x0, [x29, #-16]
ldur x1, [x29, #-24]
ldur x2, [x29, #-32]
ldur x3, [x29, #-40]
ldr x4, [sp, #48]
ldr x5, [sp, #40]
bl VS_LightmapMatrixFromPoints
ldur x9, [x29, #-32]
mov w8, #3 // =0x3
str w8, [x9]
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_9:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_GenerateFacetFor3Points, .Lfunc_end0-VS_GenerateFacetFor3Points
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type numfacets,@object // @numfacets
.globl numfacets
.p2align 2, 0x0
numfacets:
.word 0 // 0x0
.size numfacets, 4
.type surfaceOrigin,@object // @surfaceOrigin
.globl surfaceOrigin
.p2align 3, 0x0
surfaceOrigin:
.xword 0
.size surfaceOrigin, 8
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_PlaneFromPoints
.addrsig_sym VectorAdd
.addrsig_sym VS_GenerateBoundaryForPoints
.addrsig_sym VectorSubtract
.addrsig_sym VectorLength
.addrsig_sym VS_TextureMatrixFromPoints
.addrsig_sym VS_LightmapMatrixFromPoints
.addrsig_sym qfalse
.addrsig_sym numfacets
.addrsig_sym surfaceOrigin
.addrsig_sym drawSurfaces
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_GenerateFacetFor3Points.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {int numpoints; float** points; } ;
typedef TYPE_1__ winding_t ;
typedef float vec_t ;
typedef float* vec3_t ;
struct TYPE_9__ {int* normal; float dist; } ;
typedef TYPE_2__ plane_t ;
/* Variables and functions */
float DotProduct (float*,int*) ;
int MAX_POINTS_ON_FIXED_WINDING ;
size_t SIDE_BACK ;
int SIDE_CROSS ;
size_t SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VectorCopy (float*,float*) ;
int /*<<< orphan*/ _printf (char*) ;
int /*<<< orphan*/ memcpy (TYPE_1__*,TYPE_1__*,int) ;
int VL_SplitWinding (winding_t *in, winding_t *back, plane_t *split, float epsilon)
{
vec_t dists[128];
int sides[128];
int counts[3];
vec_t dot;
int i, j;
vec_t *p1, *p2;
vec3_t mid;
winding_t out;
winding_t *neww;
counts[0] = counts[1] = counts[2] = 0;
// determine sides for each point
for (i=0 ; i<in->numpoints ; i++)
{
dot = DotProduct (in->points[i], split->normal);
dot -= split->dist;
dists[i] = dot;
if (dot > epsilon)
sides[i] = SIDE_FRONT;
else if (dot < -epsilon)
sides[i] = SIDE_BACK;
else
{
sides[i] = SIDE_ON;
}
counts[sides[i]]++;
}
if (!counts[SIDE_BACK])
{
if (!counts[SIDE_FRONT])
return SIDE_ON;
else
return SIDE_FRONT;
}
if (!counts[SIDE_FRONT])
{
return SIDE_BACK;
}
sides[i] = sides[0];
dists[i] = dists[0];
neww = &out;
neww->numpoints = 0;
back->numpoints = 0;
for (i=0 ; i<in->numpoints ; i++)
{
p1 = in->points[i];
if (neww->numpoints >= MAX_POINTS_ON_FIXED_WINDING)
{
_printf("WARNING: VL_SplitWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n");
return SIDE_FRONT; // can't chop -- fall back to original
}
if (back->numpoints >= MAX_POINTS_ON_FIXED_WINDING)
{
_printf("WARNING: VL_SplitWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n");
return SIDE_FRONT;
}
if (sides[i] == SIDE_ON)
{
VectorCopy (p1, neww->points[neww->numpoints]);
neww->numpoints++;
VectorCopy (p1, back->points[back->numpoints]);
back->numpoints++;
continue;
}
if (sides[i] == SIDE_FRONT)
{
VectorCopy (p1, neww->points[neww->numpoints]);
neww->numpoints++;
}
if (sides[i] == SIDE_BACK)
{
VectorCopy (p1, back->points[back->numpoints]);
back->numpoints++;
}
if (sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
continue;
if (neww->numpoints >= MAX_POINTS_ON_FIXED_WINDING)
{
_printf("WARNING: VL_SplitWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n");
return SIDE_FRONT; // can't chop -- fall back to original
}
if (back->numpoints >= MAX_POINTS_ON_FIXED_WINDING)
{
_printf("WARNING: VL_SplitWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n");
return SIDE_FRONT; // can't chop -- fall back to original
}
// generate a split point
p2 = in->points[(i+1)%in->numpoints];
dot = dists[i] / (dists[i]-dists[i+1]);
for (j=0 ; j<3 ; j++)
{ // avoid round off error when possible
if (split->normal[j] == 1)
mid[j] = split->dist;
else if (split->normal[j] == -1)
mid[j] = -split->dist;
else
mid[j] = p1[j] + dot*(p2[j]-p1[j]);
}
VectorCopy (mid, neww->points[neww->numpoints]);
neww->numpoints++;
VectorCopy (mid, back->points[back->numpoints]);
back->numpoints++;
}
memcpy(in, &out, sizeof(winding_t));
return SIDE_CROSS;
}
|
.text
.file "extr_lightv.c_VL_SplitWinding.c"
.globl VL_SplitWinding // -- Begin function VL_SplitWinding
.p2align 2
.type VL_SplitWinding,@function
VL_SplitWinding: // @VL_SplitWinding
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x28, [sp, #16] // 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1136
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
stur s0, [x29, #-36]
str wzr, [sp, #72]
str wzr, [sp, #68]
str wzr, [sp, #64]
str wzr, [sp, #56]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #56]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_10
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #56]
ldr x0, [x8, x9, lsl #3]
ldur x8, [x29, #-32]
ldr x1, [x8]
bl DotProduct
str s0, [sp, #60]
ldur x8, [x29, #-32]
ldr s1, [x8, #8]
ldr s0, [sp, #60]
fsub s0, s0, s1
str s0, [sp, #60]
ldr s0, [sp, #60]
ldrsw x9, [sp, #56]
add x8, sp, #588
str s0, [x8, x9, lsl #2]
ldr s0, [sp, #60]
ldur s1, [x29, #-36]
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
ldrsw x10, [sp, #56]
add x9, sp, #76
// kill: def $w8 killed $w8 killed $x8
str w8, [x9, x10, lsl #2]
b .LBB0_8
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldr s0, [sp, #60]
ldur s1, [x29, #-36]
fneg s1, s1
fcmp s0, s1
cset w8, pl
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_BACK
ldr x8, [x8, :lo12:SIDE_BACK]
ldrsw x10, [sp, #56]
add x9, sp, #76
// kill: def $w8 killed $w8 killed $x8
str w8, [x9, x10, lsl #2]
b .LBB0_7
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
adrp x8, SIDE_ON
ldr w8, [x8, :lo12:SIDE_ON]
ldrsw x10, [sp, #56]
add x9, sp, #76
str w8, [x9, x10, lsl #2]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldrsw x9, [sp, #56]
add x8, sp, #76
ldrsw x9, [x8, x9, lsl #2]
add x8, sp, #64
add x9, x8, x9, lsl #2
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #56]
add w8, w8, #1
str w8, [sp, #56]
b .LBB0_1
.LBB0_10:
adrp x8, SIDE_BACK
ldr x9, [x8, :lo12:SIDE_BACK]
add x8, sp, #64
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_14
b .LBB0_11
.LBB0_11:
adrp x8, SIDE_FRONT
ldr x9, [x8, :lo12:SIDE_FRONT]
add x8, sp, #64
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12:
adrp x8, SIDE_ON
ldr w8, [x8, :lo12:SIDE_ON]
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_13:
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_14:
adrp x8, SIDE_FRONT
ldr x9, [x8, :lo12:SIDE_FRONT]
add x8, sp, #64
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15:
adrp x8, SIDE_BACK
ldr x8, [x8, :lo12:SIDE_BACK]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_16:
add x9, sp, #76
ldr w8, [sp, #76]
ldrsw x10, [sp, #56]
str w8, [x9, x10, lsl #2]
add x8, sp, #588
ldr s0, [sp, #588]
ldrsw x9, [sp, #56]
str s0, [x8, x9, lsl #2]
add x8, sp, #8
str x8, [sp]
ldr x8, [sp]
str wzr, [x8]
ldur x8, [x29, #-24]
str wzr, [x8]
str wzr, [sp, #56]
b .LBB0_17
.LBB0_17: // =>This Loop Header: Depth=1
// Child Loop BB0_36 Depth 2
ldr w8, [sp, #56]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_47
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #56]
ldr x8, [x8, x9, lsl #3]
str x8, [sp, #40]
ldr x8, [sp]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_20: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-24]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_22: // in Loop: Header=BB0_17 Depth=1
ldrsw x9, [sp, #56]
add x8, sp, #76
ldr w8, [x8, x9, lsl #2]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_24
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #40]
ldr x8, [sp]
ldr x8, [x8, #8]
ldr x9, [sp]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
ldr x0, [sp, #40]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldur x9, [x29, #-24]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldur x9, [x29, #-24]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_46
.LBB0_24: // in Loop: Header=BB0_17 Depth=1
ldrsw x9, [sp, #56]
add x8, sp, #76
ldrsw x8, [x8, x9, lsl #2]
adrp x9, SIDE_FRONT
ldr x9, [x9, :lo12:SIDE_FRONT]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_26
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #40]
ldr x8, [sp]
ldr x8, [x8, #8]
ldr x9, [sp]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_17 Depth=1
ldrsw x9, [sp, #56]
add x8, sp, #76
ldrsw x8, [x8, x9, lsl #2]
adrp x9, SIDE_BACK
ldr x9, [x9, :lo12:SIDE_BACK]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_28
b .LBB0_27
.LBB0_27: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #40]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldur x9, [x29, #-24]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldur x9, [x29, #-24]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_28
.LBB0_28: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #56]
add w9, w8, #1
add x8, sp, #76
ldr w8, [x8, w9, sxtw #2]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_30
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #56]
add w8, w8, #1
add x9, sp, #76
ldr w8, [x9, w8, sxtw #2]
ldrsw x10, [sp, #56]
ldr w9, [x9, x10, lsl #2]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_31
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_17 Depth=1
b .LBB0_46
.LBB0_31: // in Loop: Header=BB0_17 Depth=1
ldr x8, [sp]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_33
b .LBB0_32
.LBB0_32:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_33: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-24]
ldr w8, [x8]
adrp x9, MAX_POINTS_ON_FIXED_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_FIXED_WINDING]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_35
b .LBB0_34
.LBB0_34:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
adrp x8, SIDE_FRONT
ldr x8, [x8, :lo12:SIDE_FRONT]
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_35: // in Loop: Header=BB0_17 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldr w9, [sp, #56]
add w9, w9, #1
ldur x10, [x29, #-16]
ldr w11, [x10]
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr x8, [x8, w9, sxtw #3]
str x8, [sp, #32]
ldrsw x9, [sp, #56]
add x8, sp, #588
ldr s0, [x8, x9, lsl #2]
ldrsw x9, [sp, #56]
ldr s1, [x8, x9, lsl #2]
ldr w9, [sp, #56]
add w9, w9, #1
ldr s2, [x8, w9, sxtw #2]
fsub s1, s1, s2
fdiv s0, s0, s1
str s0, [sp, #60]
str wzr, [sp, #52]
b .LBB0_36
.LBB0_36: // Parent Loop BB0_17 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp, #52]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_45
b .LBB0_37
.LBB0_37: // in Loop: Header=BB0_36 Depth=2
ldur x8, [x29, #-32]
ldr x8, [x8]
ldrsw x9, [sp, #52]
ldr w8, [x8, x9, lsl #2]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_39
b .LBB0_38
.LBB0_38: // in Loop: Header=BB0_36 Depth=2
ldur x8, [x29, #-32]
ldr s0, [x8, #8]
ldr x8, [sp, #24]
ldrsw x9, [sp, #52]
str s0, [x8, x9, lsl #2]
b .LBB0_43
.LBB0_39: // in Loop: Header=BB0_36 Depth=2
ldur x8, [x29, #-32]
ldr x8, [x8]
ldrsw x9, [sp, #52]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_41
b .LBB0_40
.LBB0_40: // in Loop: Header=BB0_36 Depth=2
ldur x8, [x29, #-32]
ldr s0, [x8, #8]
fneg s0, s0
ldr x8, [sp, #24]
ldrsw x9, [sp, #52]
str s0, [x8, x9, lsl #2]
b .LBB0_42
.LBB0_41: // in Loop: Header=BB0_36 Depth=2
ldr x8, [sp, #40]
ldrsw x9, [sp, #52]
ldr s2, [x8, x9, lsl #2]
ldr s0, [sp, #60]
ldr x8, [sp, #32]
ldrsw x9, [sp, #52]
ldr s1, [x8, x9, lsl #2]
ldr x8, [sp, #40]
ldrsw x9, [sp, #52]
ldr s3, [x8, x9, lsl #2]
fsub s1, s1, s3
fmadd s0, s0, s1, s2
ldr x8, [sp, #24]
ldrsw x9, [sp, #52]
str s0, [x8, x9, lsl #2]
b .LBB0_42
.LBB0_42: // in Loop: Header=BB0_36 Depth=2
b .LBB0_43
.LBB0_43: // in Loop: Header=BB0_36 Depth=2
b .LBB0_44
.LBB0_44: // in Loop: Header=BB0_36 Depth=2
ldr w8, [sp, #52]
add w8, w8, #1
str w8, [sp, #52]
b .LBB0_36
.LBB0_45: // in Loop: Header=BB0_17 Depth=1
ldr x0, [sp, #24]
ldr x8, [sp]
ldr x8, [x8, #8]
ldr x9, [sp]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldr x9, [sp]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
ldr x0, [sp, #24]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldur x9, [x29, #-24]
ldrsw x9, [x9]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
ldur x9, [x29, #-24]
ldr w8, [x9]
add w8, w8, #1
str w8, [x9]
b .LBB0_46
.LBB0_46: // in Loop: Header=BB0_17 Depth=1
ldr w8, [sp, #56]
add w8, w8, #1
str w8, [sp, #56]
b .LBB0_17
.LBB0_47:
ldur x0, [x29, #-16]
add x1, sp, #8
mov w2, #16 // =0x10
bl memcpy
adrp x8, SIDE_CROSS
ldr w8, [x8, :lo12:SIDE_CROSS]
stur w8, [x29, #-4]
b .LBB0_48
.LBB0_48:
ldur w0, [x29, #-4]
add sp, sp, #1136
.cfi_def_cfa wsp, 32
ldr x28, [sp, #16] // 8-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_SplitWinding, .Lfunc_end0-VL_SplitWinding
.cfi_endproc
// -- End function
.type SIDE_FRONT,@object // @SIDE_FRONT
.bss
.globl SIDE_FRONT
.p2align 3, 0x0
SIDE_FRONT:
.xword 0 // 0x0
.size SIDE_FRONT, 8
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 3, 0x0
SIDE_BACK:
.xword 0 // 0x0
.size SIDE_BACK, 8
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type MAX_POINTS_ON_FIXED_WINDING,@object // @MAX_POINTS_ON_FIXED_WINDING
.globl MAX_POINTS_ON_FIXED_WINDING
.p2align 2, 0x0
MAX_POINTS_ON_FIXED_WINDING:
.word 0 // 0x0
.size MAX_POINTS_ON_FIXED_WINDING, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "WARNING: VL_SplitWinding -> MAX_POINTS_ON_FIXED_WINDING overflowed\n"
.size .L.str, 68
.type SIDE_CROSS,@object // @SIDE_CROSS
.bss
.globl SIDE_CROSS
.p2align 2, 0x0
SIDE_CROSS:
.word 0 // 0x0
.size SIDE_CROSS, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym DotProduct
.addrsig_sym _printf
.addrsig_sym VectorCopy
.addrsig_sym memcpy
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym MAX_POINTS_ON_FIXED_WINDING
.addrsig_sym SIDE_CROSS
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_SplitWinding.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_6__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
typedef int /*<<< orphan*/ vsound_t ;
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_10__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_11__ {int cluster; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VS_FloodAreaSpotLight (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int VS_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_6__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
void VS_R_SubdivideAreaSpotLight(vsound_t *light, int nodenum, winding_t *w)
{
int leafnum, res;
dnode_t *node;
dplane_t *plane;
winding_t back;
plane_t split;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VS_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
memcpy(&back, w, sizeof(winding_t));
VS_R_SubdivideAreaSpotLight(light, node->children[1], &back);
nodenum = node->children[0];
}
else
{
VS_R_SubdivideAreaSpotLight(light, node->children[1], &back);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
if (dleafs[leafnum].cluster != -1)
{
VS_FloodAreaSpotLight(light, w, leafnum);
}
}
|
.text
.file "extr_soundv.c_VS_R_SubdivideAreaSpotLight.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_R_SubdivideAreaSpotLight
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VS_R_SubdivideAreaSpotLight
.p2align 2
.type VS_R_SubdivideAreaSpotLight,@function
VS_R_SubdivideAreaSpotLight: // @VS_R_SubdivideAreaSpotLight
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur x2, [x29, #-24]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-12]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-12]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w0, [x8, #4]
add x8, sp, #20
str x8, [sp, #8] // 8-byte Folded Spill
ldr w1, [sp, #24]
bl VectorCopy
ldr x2, [sp, #8] // 8-byte Folded Reload
ldr x8, [sp, #32]
ldr w8, [x8]
str w8, [sp, #20]
ldur x0, [x29, #-24]
add x1, sp, #28
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VS_SplitWinding
stur w0, [x29, #-32]
ldur w8, [x29, #-32]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_11
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-12]
b .LBB0_10
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-32]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-24]
add x0, sp, #28
str x0, [sp] // 8-byte Folded Spill
mov w2, #4 // =0x4
bl memcpy
ldr x2, [sp] // 8-byte Folded Reload
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
bl VS_R_SubdivideAreaSpotLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldur x0, [x29, #-8]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
add x2, sp, #28
bl VS_R_SubdivideAreaSpotLight
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-12]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_12:
ldur w9, [x29, #-12]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-28]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-28]
ldr w8, [x8, x9, lsl #2]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur x0, [x29, #-8]
ldur x1, [x29, #-24]
ldur w2, [x29, #-28]
bl VS_FloodAreaSpotLight
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_R_SubdivideAreaSpotLight, .Lfunc_end0-VS_R_SubdivideAreaSpotLight
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_R_SubdivideAreaSpotLight
.addrsig_sym VectorCopy
.addrsig_sym VS_SplitWinding
.addrsig_sym memcpy
.addrsig_sym VS_FloodAreaSpotLight
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_R_SubdivideAreaSpotLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
struct TYPE_11__ {int /*<<< orphan*/ headnode; } ;
typedef TYPE_2__ tree_t ;
struct TYPE_12__ {TYPE_4__* brushes; } ;
typedef TYPE_3__ entity_t ;
struct TYPE_13__ {int numsides; TYPE_1__* sides; scalar_t__ detail; struct TYPE_13__* next; } ;
typedef TYPE_4__ bspbrush_t ;
struct TYPE_10__ {int /*<<< orphan*/ visible; scalar_t__ winding; } ;
/* Variables and functions */
TYPE_4__* CopyBrush (TYPE_4__*) ;
int FilterBrushIntoTree_r (TYPE_4__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qprintf (char*,...) ;
int /*<<< orphan*/ qtrue ;
void FilterStructuralBrushesIntoTree( entity_t *e, tree_t *tree ) {
bspbrush_t *b, *newb;
int r;
int c_unique, c_clusters;
int i;
qprintf( "----- FilterStructuralBrushesIntoTree -----\n");
c_unique = 0;
c_clusters = 0;
for ( b = e->brushes ; b ; b = b->next ) {
if ( b->detail ) {
continue;
}
c_unique++;
newb = CopyBrush( b );
r = FilterBrushIntoTree_r( newb, tree->headnode );
c_clusters += r;
// mark all sides as visible so drawsurfs are created
if ( r ) {
for ( i = 0 ; i < b->numsides ; i++ ) {
if ( b->sides[i].winding ) {
b->sides[i].visible = qtrue;
}
}
}
}
qprintf( "%5i structural brushes\n", c_unique );
qprintf( "%5i cluster references\n", c_clusters );
}
|
.text
.file "extr_brush.c_FilterStructuralBrushesIntoTree.c"
.globl FilterStructuralBrushesIntoTree // -- Begin function FilterStructuralBrushesIntoTree
.p2align 2
.type FilterStructuralBrushesIntoTree,@function
FilterStructuralBrushesIntoTree: // @FilterStructuralBrushesIntoTree
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl qprintf
str wzr, [sp, #8]
str wzr, [sp, #4]
ldur x8, [x29, #-8]
ldr x8, [x8]
str x8, [sp, #24]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_6 Depth 2
ldr x8, [sp, #24]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #8]
add w8, w8, #1
str w8, [sp, #8]
ldr x0, [sp, #24]
bl CopyBrush
str x0, [sp, #16]
ldr x0, [sp, #16]
ldur x8, [x29, #-16]
ldr w1, [x8]
bl FilterBrushIntoTree_r
str w0, [sp, #12]
ldr w9, [sp, #12]
ldr w8, [sp, #4]
add w8, w8, w9
str w8, [sp, #4]
ldr w8, [sp, #12]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
str wzr, [sp]
b .LBB0_6
.LBB0_6: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldr w8, [sp]
ldr x9, [sp, #24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_11
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_6 Depth=2
ldr x8, [sp, #24]
ldr x8, [x8, #8]
ldrsw x9, [sp]
add x8, x8, x9, lsl #4
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_6 Depth=2
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
ldr x9, [sp, #24]
ldr x9, [x9, #8]
ldrsw x10, [sp]
lsl x10, x10, #4
str w8, [x9, x10]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_6 Depth=2
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_6 Depth=2
ldr w8, [sp]
add w8, w8, #1
str w8, [sp]
b .LBB0_6
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #24]
ldr x8, [x8, #24]
str x8, [sp, #24]
b .LBB0_1
.LBB0_14:
ldr w1, [sp, #8]
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl qprintf
ldr w1, [sp, #4]
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl qprintf
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FilterStructuralBrushesIntoTree, .Lfunc_end0-FilterStructuralBrushesIntoTree
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "----- FilterStructuralBrushesIntoTree -----\n"
.size .L.str, 45
.type qtrue,@object // @qtrue
.bss
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "%5i structural brushes\n"
.size .L.str.1, 24
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "%5i cluster references\n"
.size .L.str.2, 24
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym qprintf
.addrsig_sym CopyBrush
.addrsig_sym FilterBrushIntoTree_r
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_FilterStructuralBrushesIntoTree.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_13__ TYPE_4__ ;
typedef struct TYPE_12__ TYPE_3__ ;
typedef struct TYPE_11__ TYPE_2__ ;
typedef struct TYPE_10__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__* vec3_t ;
struct TYPE_10__ {int entitynum; struct TYPE_10__* next; struct TYPE_10__* original; int /*<<< orphan*/ brushnum; } ;
typedef TYPE_1__ bspbrush_t ;
struct TYPE_13__ {int contents; int /*<<< orphan*/ maxs; int /*<<< orphan*/ mins; int /*<<< orphan*/ detail; } ;
struct TYPE_12__ {int /*<<< orphan*/ origin; } ;
struct TYPE_11__ {TYPE_1__* brushes; } ;
/* Variables and functions */
int /*<<< orphan*/ AddBackSides () ;
int /*<<< orphan*/ AddBrushBevels () ;
int CONTENTS_AREAPORTAL ;
int CONTENTS_MONSTERCLIP ;
int CONTENTS_ORIGIN ;
int CONTENTS_PLAYERCLIP ;
TYPE_1__* CopyBrush (TYPE_4__*) ;
int /*<<< orphan*/ CreateBrushWindings (TYPE_4__*) ;
int /*<<< orphan*/ SetKeyValue (TYPE_3__*,char*,char*) ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__*) ;
int /*<<< orphan*/ VectorCopy (scalar_t__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (scalar_t__*,double,scalar_t__*) ;
int /*<<< orphan*/ _printf (char*,int,int /*<<< orphan*/ ) ;
TYPE_4__* buildBrush ;
int /*<<< orphan*/ c_detail ;
TYPE_3__* entities ;
int /*<<< orphan*/ entitySourceBrushes ;
TYPE_2__* mapent ;
int num_entities ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ sprintf (char*,char*,int,int,int) ;
bspbrush_t *FinishBrush( void ) {
bspbrush_t *b;
// liquids may need to have extra sides created for back sides
AddBackSides();
// create windings for sides and bounds for brush
if ( !CreateBrushWindings( buildBrush ) ) {
// don't keep this brush
return NULL;
}
// brushes that will not be visible at all are forced to be detail
if ( buildBrush->contents & (CONTENTS_PLAYERCLIP|CONTENTS_MONSTERCLIP) )
{
buildBrush->detail = qtrue;
c_detail++;
}
//
// origin brushes are removed, but they set
// the rotation origin for the rest of the brushes
// in the entity. After the entire entity is parsed,
// the planenums and texinfos will be adjusted for
// the origin brush
//
if ( buildBrush->contents & CONTENTS_ORIGIN )
{
char string[32];
vec3_t origin;
if (num_entities == 1) {
_printf ("Entity %i, Brush %i: origin brushes not allowed in world\n"
, num_entities - 1, entitySourceBrushes);
return NULL;
}
VectorAdd (buildBrush->mins, buildBrush->maxs, origin);
VectorScale (origin, 0.5, origin);
sprintf (string, "%i %i %i", (int)origin[0], (int)origin[1], (int)origin[2]);
SetKeyValue (&entities[num_entities - 1], "origin", string);
VectorCopy (origin, entities[num_entities - 1].origin);
// don't keep this brush
return NULL;
}
if ( buildBrush->contents & CONTENTS_AREAPORTAL ) {
if (num_entities != 1) {
_printf ("Entity %i, Brush %i: areaportals only allowed in world\n"
, num_entities - 1, entitySourceBrushes);
return NULL;
}
}
AddBrushBevels ();
// keep it
b = CopyBrush( buildBrush );
b->entitynum = num_entities-1;
b->brushnum = entitySourceBrushes;
b->original = b;
b->next = mapent->brushes;
mapent->brushes = b;
return b;
}
|
.text
.file "extr_map.c_FinishBrush.c"
.globl FinishBrush // -- Begin function FinishBrush
.p2align 2
.type FinishBrush,@function
FinishBrush: // @FinishBrush
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
bl AddBackSides
adrp x8, buildBrush
ldr x0, [x8, :lo12:buildBrush]
bl CreateBrushWindings
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_13
.LBB0_2:
adrp x8, buildBrush
ldr x8, [x8, :lo12:buildBrush]
ldr w8, [x8]
adrp x9, CONTENTS_PLAYERCLIP
ldr w9, [x9, :lo12:CONTENTS_PLAYERCLIP]
adrp x10, CONTENTS_MONSTERCLIP
ldr w10, [x10, :lo12:CONTENTS_MONSTERCLIP]
orr w9, w9, w10
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
adrp x9, buildBrush
ldr x9, [x9, :lo12:buildBrush]
str w8, [x9, #12]
adrp x9, c_detail
ldr w8, [x9, :lo12:c_detail]
add w8, w8, #1
str w8, [x9, :lo12:c_detail]
b .LBB0_4
.LBB0_4:
adrp x8, buildBrush
ldr x8, [x8, :lo12:buildBrush]
ldr w8, [x8]
adrp x9, CONTENTS_ORIGIN
ldr w9, [x9, :lo12:CONTENTS_ORIGIN]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_5
.LBB0_5:
adrp x8, num_entities
ldr w8, [x8, :lo12:num_entities]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
adrp x8, num_entities
ldr w8, [x8, :lo12:num_entities]
subs w1, w8, #1
adrp x8, entitySourceBrushes
ldr w2, [x8, :lo12:entitySourceBrushes]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_13
.LBB0_7:
adrp x8, buildBrush
ldr x9, [x8, :lo12:buildBrush]
ldr w0, [x9, #8]
ldr x8, [x8, :lo12:buildBrush]
ldr w1, [x8, #4]
ldr x2, [sp, #24]
bl VectorAdd
ldr x0, [sp, #24]
ldr x1, [sp, #24]
fmov d0, #0.50000000
bl VectorScale
ldr x8, [sp, #24]
ldr x8, [x8]
mov w2, w8
ldr x8, [sp, #24]
ldr x8, [x8, #8]
mov w3, w8
ldr x8, [sp, #24]
ldr x8, [x8, #16]
mov w4, w8
add x0, sp, #32
str x0, [sp] // 8-byte Folded Spill
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl sprintf
ldr x2, [sp] // 8-byte Folded Reload
adrp x8, entities
str x8, [sp, #8] // 8-byte Folded Spill
ldr x8, [x8, :lo12:entities]
adrp x9, num_entities
str x9, [sp, #16] // 8-byte Folded Spill
ldr w9, [x9, :lo12:num_entities]
subs w9, w9, #1
add x0, x8, w9, sxtw #2
adrp x1, .L.str.2
add x1, x1, :lo12:.L.str.2
bl SetKeyValue
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x9, [sp, #16] // 8-byte Folded Reload
ldr x0, [sp, #24]
ldr x8, [x8, :lo12:entities]
ldr w9, [x9, :lo12:num_entities]
subs w9, w9, #1
ldr w1, [x8, w9, sxtw #2]
bl VectorCopy
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_13
.LBB0_8:
adrp x8, buildBrush
ldr x8, [x8, :lo12:buildBrush]
ldr w8, [x8]
adrp x9, CONTENTS_AREAPORTAL
ldr w9, [x9, :lo12:CONTENTS_AREAPORTAL]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_9
.LBB0_9:
adrp x8, num_entities
ldr w8, [x8, :lo12:num_entities]
subs w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10:
adrp x8, num_entities
ldr w8, [x8, :lo12:num_entities]
subs w1, w8, #1
adrp x8, entitySourceBrushes
ldr w2, [x8, :lo12:entitySourceBrushes]
adrp x0, .L.str.3
add x0, x0, :lo12:.L.str.3
bl _printf
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_13
.LBB0_11:
b .LBB0_12
.LBB0_12:
bl AddBrushBevels
adrp x8, buildBrush
ldr x0, [x8, :lo12:buildBrush]
bl CopyBrush
stur x0, [x29, #-16]
adrp x8, num_entities
ldr w8, [x8, :lo12:num_entities]
subs w8, w8, #1
ldur x9, [x29, #-16]
str w8, [x9]
adrp x8, entitySourceBrushes
ldr w8, [x8, :lo12:entitySourceBrushes]
ldur x9, [x29, #-16]
str w8, [x9, #24]
ldur x8, [x29, #-16]
ldur x9, [x29, #-16]
str x8, [x9, #16]
adrp x9, mapent
ldr x8, [x9, :lo12:mapent]
ldr x8, [x8]
ldur x10, [x29, #-16]
str x8, [x10, #8]
ldur x8, [x29, #-16]
ldr x9, [x9, :lo12:mapent]
str x8, [x9]
ldur x8, [x29, #-16]
stur x8, [x29, #-8]
b .LBB0_13
.LBB0_13:
ldur x0, [x29, #-8]
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FinishBrush, .Lfunc_end0-FinishBrush
.cfi_endproc
// -- End function
.type buildBrush,@object // @buildBrush
.bss
.globl buildBrush
.p2align 3, 0x0
buildBrush:
.xword 0
.size buildBrush, 8
.type CONTENTS_PLAYERCLIP,@object // @CONTENTS_PLAYERCLIP
.globl CONTENTS_PLAYERCLIP
.p2align 2, 0x0
CONTENTS_PLAYERCLIP:
.word 0 // 0x0
.size CONTENTS_PLAYERCLIP, 4
.type CONTENTS_MONSTERCLIP,@object // @CONTENTS_MONSTERCLIP
.globl CONTENTS_MONSTERCLIP
.p2align 2, 0x0
CONTENTS_MONSTERCLIP:
.word 0 // 0x0
.size CONTENTS_MONSTERCLIP, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type c_detail,@object // @c_detail
.globl c_detail
.p2align 2, 0x0
c_detail:
.word 0 // 0x0
.size c_detail, 4
.type CONTENTS_ORIGIN,@object // @CONTENTS_ORIGIN
.globl CONTENTS_ORIGIN
.p2align 2, 0x0
CONTENTS_ORIGIN:
.word 0 // 0x0
.size CONTENTS_ORIGIN, 4
.type num_entities,@object // @num_entities
.globl num_entities
.p2align 2, 0x0
num_entities:
.word 0 // 0x0
.size num_entities, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Entity %i, Brush %i: origin brushes not allowed in world\n"
.size .L.str, 58
.type entitySourceBrushes,@object // @entitySourceBrushes
.bss
.globl entitySourceBrushes
.p2align 2, 0x0
entitySourceBrushes:
.word 0 // 0x0
.size entitySourceBrushes, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "%i %i %i"
.size .L.str.1, 9
.type entities,@object // @entities
.bss
.globl entities
.p2align 3, 0x0
entities:
.xword 0
.size entities, 8
.type .L.str.2,@object // @.str.2
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.2:
.asciz "origin"
.size .L.str.2, 7
.type CONTENTS_AREAPORTAL,@object // @CONTENTS_AREAPORTAL
.bss
.globl CONTENTS_AREAPORTAL
.p2align 2, 0x0
CONTENTS_AREAPORTAL:
.word 0 // 0x0
.size CONTENTS_AREAPORTAL, 4
.type .L.str.3,@object // @.str.3
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.3:
.asciz "Entity %i, Brush %i: areaportals only allowed in world\n"
.size .L.str.3, 56
.type mapent,@object // @mapent
.bss
.globl mapent
.p2align 3, 0x0
mapent:
.xword 0
.size mapent, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym AddBackSides
.addrsig_sym CreateBrushWindings
.addrsig_sym _printf
.addrsig_sym VectorAdd
.addrsig_sym VectorScale
.addrsig_sym sprintf
.addrsig_sym SetKeyValue
.addrsig_sym VectorCopy
.addrsig_sym AddBrushBevels
.addrsig_sym CopyBrush
.addrsig_sym buildBrush
.addrsig_sym CONTENTS_PLAYERCLIP
.addrsig_sym CONTENTS_MONSTERCLIP
.addrsig_sym qtrue
.addrsig_sym c_detail
.addrsig_sym CONTENTS_ORIGIN
.addrsig_sym num_entities
.addrsig_sym entitySourceBrushes
.addrsig_sym entities
.addrsig_sym CONTENTS_AREAPORTAL
.addrsig_sym mapent
|
../AnghaBench/Quake-III-Arena/q3map/extr_map.c_FinishBrush.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ FILE ;
/* Variables and functions */
int /*<<< orphan*/ DefaultExtension (char*,char*) ;
int /*<<< orphan*/ LoadBSPFile (char*) ;
int /*<<< orphan*/ PrintBSPFileSizes () ;
int Q_filelength (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ _printf (char*,...) ;
int /*<<< orphan*/ fclose (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * fopen (char*,char*) ;
int /*<<< orphan*/ strcpy (char*,char*) ;
void Bspinfo( int count, char **fileNames ) {
int i;
char source[1024];
int size;
FILE *f;
if ( count < 1 ) {
_printf( "No files to dump info for.\n");
return;
}
for ( i = 0 ; i < count ; i++ ) {
_printf ("---------------------\n");
strcpy (source, fileNames[ i ] );
DefaultExtension (source, ".bsp");
f = fopen (source, "rb");
if (f)
{
size = Q_filelength (f);
fclose (f);
}
else
size = 0;
_printf ("%s: %i\n", source, size);
LoadBSPFile (source);
PrintBSPFileSizes ();
_printf ("---------------------\n");
}
}
|
.text
.file "extr_bsp.c_Bspinfo.c"
.globl Bspinfo // -- Begin function Bspinfo
.p2align 2
.type Bspinfo,@function
Bspinfo: // @Bspinfo
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-32]! // 16-byte Folded Spill
.cfi_def_cfa_offset 32
str x28, [sp, #16] // 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub sp, sp, #1072
stur w0, [x29, #-4]
stur x1, [x29, #-16]
ldur w8, [x29, #-4]
subs w8, w8, #1
cset w8, ge
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
b .LBB0_9
.LBB0_2:
stur wzr, [x29, #-20]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-20]
ldur w9, [x29, #-4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_9
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
ldur x8, [x29, #-16]
ldursw x9, [x29, #-20]
ldr x1, [x8, x9, lsl #3]
add x0, sp, #28
str x0, [sp, #8] // 8-byte Folded Spill
bl strcpy
ldr x0, [sp, #8] // 8-byte Folded Reload
adrp x1, .L.str.2
add x1, x1, :lo12:.L.str.2
bl DefaultExtension
ldr x0, [sp, #8] // 8-byte Folded Reload
adrp x1, .L.str.3
add x1, x1, :lo12:.L.str.3
bl fopen
str x0, [sp, #16]
ldr x8, [sp, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=1
ldr x0, [sp, #16]
bl Q_filelength
str w0, [sp, #24]
ldr x0, [sp, #16]
bl fclose
b .LBB0_7
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
str wzr, [sp, #24]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldr w2, [sp, #24]
adrp x0, .L.str.4
add x0, x0, :lo12:.L.str.4
add x1, sp, #28
str x1, [sp] // 8-byte Folded Spill
bl _printf
ldr x0, [sp] // 8-byte Folded Reload
bl LoadBSPFile
bl PrintBSPFileSizes
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_3 Depth=1
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_3
.LBB0_9:
add sp, sp, #1072
.cfi_def_cfa wsp, 32
ldr x28, [sp, #16] // 8-byte Folded Reload
ldp x29, x30, [sp], #32 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size Bspinfo, .Lfunc_end0-Bspinfo
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "No files to dump info for.\n"
.size .L.str, 28
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "---------------------\n"
.size .L.str.1, 23
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz ".bsp"
.size .L.str.2, 5
.type .L.str.3,@object // @.str.3
.L.str.3:
.asciz "rb"
.size .L.str.3, 3
.type .L.str.4,@object // @.str.4
.L.str.4:
.asciz "%s: %i\n"
.size .L.str.4, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym _printf
.addrsig_sym strcpy
.addrsig_sym DefaultExtension
.addrsig_sym fopen
.addrsig_sym Q_filelength
.addrsig_sym fclose
.addrsig_sym LoadBSPFile
.addrsig_sym PrintBSPFileSizes
|
../AnghaBench/Quake-III-Arena/q3map/extr_bsp.c_Bspinfo.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_19__ TYPE_7__ ;
typedef struct TYPE_18__ TYPE_5__ ;
typedef struct TYPE_17__ TYPE_4__ ;
typedef struct TYPE_16__ TYPE_3__ ;
typedef struct TYPE_15__ TYPE_2__ ;
typedef struct TYPE_14__ TYPE_1__ ;
/* Type definitions */
struct TYPE_16__ {int numpoints; int /*<<< orphan*/ * points; } ;
typedef TYPE_3__ winding_t ;
struct TYPE_17__ {scalar_t__ atten_disttype; float photons; int /*<<< orphan*/ normal; } ;
typedef TYPE_4__ vsound_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_15__ {int /*<<< orphan*/ normal; void* dist; } ;
struct TYPE_18__ {int numplanes; int surfaceNum; int /*<<< orphan*/ cluster; int /*<<< orphan*/ type; TYPE_2__ endplane; TYPE_2__ farplane; int /*<<< orphan*/ * points; TYPE_1__* planes; } ;
typedef TYPE_5__ lightvolume_t ;
struct TYPE_19__ {int /*<<< orphan*/ cluster; } ;
struct TYPE_14__ {int /*<<< orphan*/ normal; void* dist; } ;
/* Variables and functions */
int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
void* DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ LDAT_LINEAR ;
scalar_t__ LDAT_NOSCALE ;
float MAX_WORLD_COORD ;
int /*<<< orphan*/ VOLUME_DIRECTED ;
int /*<<< orphan*/ VS_R_CastLightAtSurface (TYPE_4__*,TYPE_5__*) ;
int /*<<< orphan*/ VS_R_FloodLight (TYPE_4__*,TYPE_5__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorInverse (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_7__* dleafs ;
float lightLinearScale ;
int /*<<< orphan*/ memset (TYPE_5__*,int /*<<< orphan*/ ,int) ;
float sqrt (float) ;
void VS_FloodDirectedLight(vsound_t *light, winding_t *w, int leafnum)
{
int i;
float dist;
lightvolume_t volume;
vec3_t dir;
if (light->atten_disttype == LDAT_NOSCALE)
{
// light travels without decrease in intensity over distance
dist = MAX_WORLD_COORD;
}
else
{
if ( light->atten_disttype == LDAT_LINEAR )
dist = light->photons * lightLinearScale;
else
dist = sqrt(light->photons);
}
memset(&volume, 0, sizeof(lightvolume_t));
for (i = 0; i < w->numpoints; i++)
{
VectorMA(w->points[i], dist, light->normal, volume.points[i]);
VectorSubtract(w->points[(i+1)%w->numpoints], w->points[i], dir);
CrossProduct(light->normal, dir, volume.planes[i].normal);
VectorNormalize(volume.planes[i].normal, volume.planes[i].normal);
volume.planes[i].dist = DotProduct(volume.planes[i].normal, w->points[i]);
}
volume.numplanes = w->numpoints;
VectorCopy(light->normal, volume.endplane.normal);
VectorInverse(volume.endplane.normal);
volume.endplane.dist = DotProduct(volume.endplane.normal, volume.points[0]);
volume.farplane = volume.endplane;
volume.surfaceNum = -1;
volume.type = VOLUME_DIRECTED;
volume.cluster = dleafs[leafnum].cluster;
VS_R_FloodLight(light, &volume, volume.cluster, 0);
if (volume.surfaceNum >= 0)
{
VS_R_CastLightAtSurface(light, &volume);
}
}
|
.text
.file "extr_soundv.c_VS_FloodDirectedLight.c"
.globl VS_FloodDirectedLight // -- Begin function VS_FloodDirectedLight
.p2align 2
.type VS_FloodDirectedLight,@function
VS_FloodDirectedLight: // @VS_FloodDirectedLight
.cfi_startproc
// %bb.0:
sub sp, sp, #128
.cfi_def_cfa_offset 128
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur w2, [x29, #-20]
ldur x8, [x29, #-8]
ldr x8, [x8]
adrp x9, LDAT_NOSCALE
ldr x9, [x9, :lo12:LDAT_NOSCALE]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, MAX_WORLD_COORD
ldr s0, [x8, :lo12:MAX_WORLD_COORD]
stur s0, [x29, #-28]
b .LBB0_6
.LBB0_2:
ldur x8, [x29, #-8]
ldr x8, [x8]
adrp x9, LDAT_LINEAR
ldr x9, [x9, :lo12:LDAT_LINEAR]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-8]
ldr s0, [x8, #8]
adrp x8, lightLinearScale
ldr s1, [x8, :lo12:lightLinearScale]
fmul s0, s0, s1
stur s0, [x29, #-28]
b .LBB0_5
.LBB0_4:
ldur x8, [x29, #-8]
ldr s0, [x8, #8]
bl sqrt
stur s0, [x29, #-28]
b .LBB0_5
.LBB0_5:
b .LBB0_6
.LBB0_6:
add x0, sp, #16
mov w1, wzr
mov w2, #64 // =0x40
bl memset
stur wzr, [x29, #-24]
b .LBB0_7
.LBB0_7: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-24]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_10
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-24]
ldr w0, [x8, x9, lsl #2]
ldur s0, [x29, #-28]
ldur x8, [x29, #-8]
ldr w1, [x8, #12]
ldr x8, [sp, #64]
ldursw x9, [x29, #-24]
ldr w2, [x8, x9, lsl #2]
bl VectorMA
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldur w9, [x29, #-24]
add w9, w9, #1
ldur x10, [x29, #-16]
ldr w11, [x10]
sdiv w10, w9, w11
mul w10, w10, w11
subs w9, w9, w10
ldr w0, [x8, w9, sxtw #2]
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-24]
ldr w1, [x8, x9, lsl #2]
ldr w2, [sp, #12]
bl VectorSubtract
ldur x8, [x29, #-8]
ldr w0, [x8, #12]
ldr w1, [sp, #12]
ldr x8, [sp, #72]
ldursw x9, [x29, #-24]
lsl x9, x9, #4
ldr w2, [x8, x9]
bl CrossProduct
ldr x8, [sp, #72]
ldursw x9, [x29, #-24]
lsl x9, x9, #4
ldr w0, [x8, x9]
ldr x8, [sp, #72]
ldursw x9, [x29, #-24]
lsl x9, x9, #4
ldr w1, [x8, x9]
bl VectorNormalize
ldr x8, [sp, #72]
ldursw x9, [x29, #-24]
lsl x9, x9, #4
ldr w0, [x8, x9]
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-24]
ldr w1, [x8, x9, lsl #2]
bl DotProduct
ldr x8, [sp, #72]
ldursw x9, [x29, #-24]
add x8, x8, x9, lsl #4
str x0, [x8, #8]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-24]
add w8, w8, #1
stur w8, [x29, #-24]
b .LBB0_7
.LBB0_10:
ldur x8, [x29, #-16]
ldr w8, [x8]
add x9, sp, #16
str x9, [sp] // 8-byte Folded Spill
str w8, [sp, #16]
ldur x8, [x29, #-8]
ldr w0, [x8, #12]
ldr w1, [sp, #32]
bl VectorCopy
ldr w0, [sp, #32]
bl VectorInverse
ldr w0, [sp, #32]
ldr x8, [sp, #64]
ldr w1, [x8]
bl DotProduct
ldr x1, [sp] // 8-byte Folded Reload
str x0, [sp, #40]
ldr q0, [sp, #32]
str q0, [sp, #48]
mov w8, #-1 // =0xffffffff
str w8, [sp, #20]
adrp x8, VOLUME_DIRECTED
ldr w8, [x8, :lo12:VOLUME_DIRECTED]
str w8, [sp, #28]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-20]
ldr w8, [x8, x9, lsl #2]
str w8, [sp, #24]
ldur x0, [x29, #-8]
ldr w2, [sp, #24]
mov w3, wzr
bl VS_R_FloodLight
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11:
ldur x0, [x29, #-8]
add x1, sp, #16
bl VS_R_CastLightAtSurface
b .LBB0_12
.LBB0_12:
.cfi_def_cfa wsp, 128
ldp x29, x30, [sp, #112] // 16-byte Folded Reload
add sp, sp, #128
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_FloodDirectedLight, .Lfunc_end0-VS_FloodDirectedLight
.cfi_endproc
// -- End function
.type LDAT_NOSCALE,@object // @LDAT_NOSCALE
.bss
.globl LDAT_NOSCALE
.p2align 3, 0x0
LDAT_NOSCALE:
.xword 0 // 0x0
.size LDAT_NOSCALE, 8
.type MAX_WORLD_COORD,@object // @MAX_WORLD_COORD
.globl MAX_WORLD_COORD
.p2align 2, 0x0
MAX_WORLD_COORD:
.word 0x00000000 // float 0
.size MAX_WORLD_COORD, 4
.type LDAT_LINEAR,@object // @LDAT_LINEAR
.globl LDAT_LINEAR
.p2align 3, 0x0
LDAT_LINEAR:
.xword 0 // 0x0
.size LDAT_LINEAR, 8
.type lightLinearScale,@object // @lightLinearScale
.globl lightLinearScale
.p2align 2, 0x0
lightLinearScale:
.word 0x00000000 // float 0
.size lightLinearScale, 4
.type VOLUME_DIRECTED,@object // @VOLUME_DIRECTED
.globl VOLUME_DIRECTED
.p2align 2, 0x0
VOLUME_DIRECTED:
.word 0 // 0x0
.size VOLUME_DIRECTED, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym sqrt
.addrsig_sym memset
.addrsig_sym VectorMA
.addrsig_sym VectorSubtract
.addrsig_sym CrossProduct
.addrsig_sym VectorNormalize
.addrsig_sym DotProduct
.addrsig_sym VectorCopy
.addrsig_sym VectorInverse
.addrsig_sym VS_R_FloodLight
.addrsig_sym VS_R_CastLightAtSurface
.addrsig_sym LDAT_NOSCALE
.addrsig_sym MAX_WORLD_COORD
.addrsig_sym LDAT_LINEAR
.addrsig_sym lightLinearScale
.addrsig_sym VOLUME_DIRECTED
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_FloodDirectedLight.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
/* Variables and functions */
float DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float VectorLength (int /*<<< orphan*/ ) ;
float VectorNormalize (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean ColinearEdge( vec3_t v1, vec3_t v2, vec3_t v3 ) {
vec3_t midpoint, dir, offset, on;
float d;
VectorSubtract( v2, v1, midpoint );
VectorSubtract( v3, v1, dir );
d = VectorNormalize( dir, dir );
if ( d == 0 ) {
return qfalse; // degenerate
}
d = DotProduct( midpoint, dir );
VectorScale( dir, d, on );
VectorSubtract( midpoint, on, offset );
d = VectorLength ( offset );
if ( d < 0.1 ) {
return qtrue;
}
return qfalse;
}
|
.text
.file "extr_tjunction.c_ColinearEdge.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function ColinearEdge
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl ColinearEdge
.p2align 2
.type ColinearEdge,@function
ColinearEdge: // @ColinearEdge
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur w0, [x29, #-8]
stur w1, [x29, #-12]
stur w2, [x29, #-16]
ldur w0, [x29, #-12]
ldur w1, [x29, #-8]
ldur w2, [x29, #-20]
bl VectorSubtract
ldur w0, [x29, #-16]
ldur w1, [x29, #-8]
ldr w2, [sp, #24]
bl VectorSubtract
ldr w0, [sp, #24]
ldr w1, [sp, #24]
bl VectorNormalize
str s0, [sp, #12]
ldr s0, [sp, #12]
fcmp s0, #0.0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_5
.LBB0_2:
ldur w0, [x29, #-20]
ldr w1, [sp, #24]
bl DotProduct
str s0, [sp, #12]
ldr w0, [sp, #24]
ldr s0, [sp, #12]
ldr w1, [sp, #16]
bl VectorScale
ldur w0, [x29, #-20]
ldr w1, [sp, #16]
ldr w2, [sp, #20]
bl VectorSubtract
ldr w0, [sp, #20]
bl VectorLength
str s0, [sp, #12]
ldr s0, [sp, #12]
fcvt d0, s0
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_5
.LBB0_4:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_5
.LBB0_5:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size ColinearEdge, .Lfunc_end0-ColinearEdge
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorSubtract
.addrsig_sym VectorNormalize
.addrsig_sym DotProduct
.addrsig_sym VectorScale
.addrsig_sym VectorLength
.addrsig_sym qfalse
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_tjunction.c_ColinearEdge.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int numsides; TYPE_1__* sides; } ;
typedef TYPE_2__ bspbrush_t ;
struct TYPE_5__ {scalar_t__ winding; } ;
/* Variables and functions */
int /*<<< orphan*/ FreeWinding (scalar_t__) ;
int /*<<< orphan*/ c_active_brushes ;
int /*<<< orphan*/ free (TYPE_2__*) ;
int numthreads ;
void FreeBrush (bspbrush_t *brushes)
{
int i;
for (i=0 ; i<brushes->numsides ; i++)
if (brushes->sides[i].winding)
FreeWinding(brushes->sides[i].winding);
free (brushes);
if (numthreads == 1)
c_active_brushes--;
}
|
.text
.file "extr_brush.c_FreeBrush.c"
.globl FreeBrush // -- Begin function FreeBrush
.p2align 2
.type FreeBrush,@function
FreeBrush: // @FreeBrush
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
str x0, [sp, #8]
str wzr, [sp, #4]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #4]
ldr x9, [sp, #8]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldrsw x9, [sp, #4]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #8]
ldr x8, [x8, #8]
ldrsw x9, [sp, #4]
ldr x0, [x8, x9, lsl #3]
bl FreeWinding
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #4]
add w8, w8, #1
str w8, [sp, #4]
b .LBB0_1
.LBB0_6:
ldr x0, [sp, #8]
bl free
adrp x8, numthreads
ldr w8, [x8, :lo12:numthreads]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
adrp x9, c_active_brushes
ldr w8, [x9, :lo12:c_active_brushes]
subs w8, w8, #1
str w8, [x9, :lo12:c_active_brushes]
b .LBB0_8
.LBB0_8:
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FreeBrush, .Lfunc_end0-FreeBrush
.cfi_endproc
// -- End function
.type numthreads,@object // @numthreads
.bss
.globl numthreads
.p2align 2, 0x0
numthreads:
.word 0 // 0x0
.size numthreads, 4
.type c_active_brushes,@object // @c_active_brushes
.globl c_active_brushes
.p2align 2, 0x0
c_active_brushes:
.word 0 // 0x0
.size c_active_brushes, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym FreeWinding
.addrsig_sym free
.addrsig_sym numthreads
.addrsig_sym c_active_brushes
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_FreeBrush.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_6__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_10__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_11__ {int cluster; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VL_LinkSurfaceIntoCluster (int,int) ;
int VL_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_6__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
void VL_R_LinkSurface(int nodenum, int surfaceNum, winding_t *w)
{
int leafnum, cluster, res;
dnode_t *node;
dplane_t *plane;
winding_t back;
plane_t split;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VL_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
memcpy(&back, w, sizeof(winding_t));
VL_R_LinkSurface(node->children[1], surfaceNum, &back);
nodenum = node->children[0];
}
else
{
VL_R_LinkSurface(node->children[1], surfaceNum, &back);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
cluster = dleafs[leafnum].cluster;
if (cluster != -1)
{
VL_LinkSurfaceIntoCluster(cluster, surfaceNum);
}
}
|
.text
.file "extr_lightv.c_VL_R_LinkSurface.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_R_LinkSurface
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_R_LinkSurface
.p2align 2
.type VL_R_LinkSurface,@function
VL_R_LinkSurface: // @VL_R_LinkSurface
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
stur w1, [x29, #-8]
stur x2, [x29, #-16]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w0, [x8, #4]
add x8, sp, #20
str x8, [sp, #8] // 8-byte Folded Spill
ldr w1, [sp, #24]
bl VectorCopy
ldr x2, [sp, #8] // 8-byte Folded Reload
ldr x8, [sp, #32]
ldr w8, [x8]
str w8, [sp, #20]
ldur x0, [x29, #-16]
add x1, sp, #28
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VL_SplitWinding
stur w0, [x29, #-28]
ldur w8, [x29, #-28]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-4]
b .LBB0_11
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-28]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-4]
b .LBB0_10
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-28]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-16]
add x0, sp, #28
str x0, [sp] // 8-byte Folded Spill
mov w2, #4 // =0x4
bl memcpy
ldr x2, [sp] // 8-byte Folded Reload
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w0, [x8, #4]
ldur w1, [x29, #-8]
bl VL_R_LinkSurface
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w0, [x8, #4]
ldur w1, [x29, #-8]
add x2, sp, #28
bl VL_R_LinkSurface
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_12:
ldur w9, [x29, #-4]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-20]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-20]
ldr w8, [x8, x9, lsl #2]
stur w8, [x29, #-24]
ldur w8, [x29, #-24]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur w0, [x29, #-24]
ldur w1, [x29, #-8]
bl VL_LinkSurfaceIntoCluster
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_R_LinkSurface, .Lfunc_end0-VL_R_LinkSurface
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VL_R_LinkSurface
.addrsig_sym VectorCopy
.addrsig_sym VL_SplitWinding
.addrsig_sym memcpy
.addrsig_sym VL_LinkSurfaceIntoCluster
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_R_LinkSurface.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_16__ TYPE_5__ ;
typedef struct TYPE_15__ TYPE_4__ ;
typedef struct TYPE_14__ TYPE_3__ ;
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
struct TYPE_12__ {int numpoints; int /*<<< orphan*/ points; } ;
typedef TYPE_1__ winding_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_13__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ plane_t ;
struct TYPE_14__ {int firstSide; int numSides; } ;
typedef TYPE_3__ dbrush_t ;
struct TYPE_16__ {size_t planeNum; } ;
struct TYPE_15__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
/* Variables and functions */
TYPE_1__* BaseWindingForPlane (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int SIDE_BACK ;
int VL_ChopWinding (TYPE_1__*,TYPE_2__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorInverse (int /*<<< orphan*/ ) ;
TYPE_5__* dbrushsides ;
TYPE_4__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
winding_t *VL_WindingForBrushSide(dbrush_t *brush, int side, winding_t *w)
{
int i, res;
winding_t *tmpw;
plane_t plane;
VectorCopy(dplanes[ dbrushsides[ brush->firstSide + side ].planeNum ].normal, plane.normal);
VectorInverse(plane.normal);
plane.dist = -dplanes[ dbrushsides[ brush->firstSide + side ].planeNum ].dist;
tmpw = BaseWindingForPlane( plane.normal, plane.dist );
memcpy(w->points, tmpw->points, sizeof(vec3_t) * tmpw->numpoints);
w->numpoints = tmpw->numpoints;
for (i = 0; i < brush->numSides; i++)
{
if (i == side)
continue;
VectorCopy(dplanes[ dbrushsides[ brush->firstSide + i ].planeNum ].normal, plane.normal);
VectorInverse(plane.normal);
plane.dist = -dplanes[ dbrushsides[ brush->firstSide + i ].planeNum ].dist;
res = VL_ChopWinding(w, &plane, 0.1);
if (res == SIDE_BACK)
return NULL;
}
return w;
}
|
.text
.file "extr_lightv.c_VL_WindingForBrushSide.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_WindingForBrushSide
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_WindingForBrushSide
.p2align 2
.type VL_WindingForBrushSide,@function
VL_WindingForBrushSide: // @VL_WindingForBrushSide
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-16]
stur w1, [x29, #-20]
stur x2, [x29, #-32]
adrp x8, dplanes
str x8, [sp, #24] // 8-byte Folded Spill
ldr x8, [x8, :lo12:dplanes]
adrp x9, dbrushsides
str x9, [sp, #32] // 8-byte Folded Spill
ldr x9, [x9, :lo12:dbrushsides]
ldur x10, [x29, #-16]
ldr w10, [x10]
ldur w11, [x29, #-20]
add w10, w10, w11
ldr x9, [x9, w10, sxtw #3]
add x8, x8, x9, lsl #3
ldr w0, [x8, #4]
ldr w1, [sp, #44]
bl VectorCopy
ldr w0, [sp, #44]
bl VectorInverse
ldr x8, [sp, #24] // 8-byte Folded Reload
ldr x9, [sp, #32] // 8-byte Folded Reload
ldr x8, [x8, :lo12:dplanes]
ldr x9, [x9, :lo12:dbrushsides]
ldur x10, [x29, #-16]
ldr w10, [x10]
ldur w11, [x29, #-20]
add w10, w10, w11
ldr x9, [x9, w10, sxtw #3]
lsl x9, x9, #3
ldr w9, [x8, x9]
mov w8, wzr
subs w8, w8, w9
str w8, [sp, #40]
ldr w0, [sp, #44]
ldr w1, [sp, #40]
bl BaseWindingForPlane
str x0, [sp, #48]
ldur x8, [x29, #-32]
ldr w0, [x8, #4]
ldr x8, [sp, #48]
ldr w1, [x8, #4]
ldr x8, [sp, #48]
ldrsw x9, [x8]
mov x8, #4 // =0x4
mul x8, x8, x9
mov w2, w8
bl memcpy
ldr x8, [sp, #48]
ldr w8, [x8]
ldur x9, [x29, #-32]
str w8, [x9]
stur wzr, [x29, #-36]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-36]
ldur x9, [x29, #-16]
ldr w9, [x9, #4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-36]
ldur w9, [x29, #-20]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_7
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
adrp x8, dplanes
str x8, [sp] // 8-byte Folded Spill
ldr x8, [x8, :lo12:dplanes]
adrp x9, dbrushsides
str x9, [sp, #8] // 8-byte Folded Spill
ldr x9, [x9, :lo12:dbrushsides]
ldur x10, [x29, #-16]
ldr w10, [x10]
ldur w11, [x29, #-36]
add w10, w10, w11
ldr x9, [x9, w10, sxtw #3]
add x8, x8, x9, lsl #3
ldr w0, [x8, #4]
add x8, sp, #40
str x8, [sp, #16] // 8-byte Folded Spill
ldr w1, [sp, #44]
bl VectorCopy
ldr w0, [sp, #44]
bl VectorInverse
ldr x8, [sp] // 8-byte Folded Reload
ldr x9, [sp, #8] // 8-byte Folded Reload
ldr x1, [sp, #16] // 8-byte Folded Reload
ldr x8, [x8, :lo12:dplanes]
ldr x9, [x9, :lo12:dbrushsides]
ldur x10, [x29, #-16]
ldr w10, [x10]
ldur w11, [x29, #-36]
add w10, w10, w11
ldr x9, [x9, w10, sxtw #3]
lsl x9, x9, #3
ldr w9, [x8, x9]
mov w8, wzr
subs w8, w8, w9
str w8, [sp, #40]
ldur x0, [x29, #-32]
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VL_ChopWinding
stur w0, [x29, #-40]
ldur w8, [x29, #-40]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_9
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-36]
add w8, w8, #1
stur w8, [x29, #-36]
b .LBB0_1
.LBB0_8:
ldur x8, [x29, #-32]
stur x8, [x29, #-8]
b .LBB0_9
.LBB0_9:
ldur x0, [x29, #-8]
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_WindingForBrushSide, .Lfunc_end0-VL_WindingForBrushSide
.cfi_endproc
// -- End function
.type dplanes,@object // @dplanes
.bss
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type dbrushsides,@object // @dbrushsides
.globl dbrushsides
.p2align 3, 0x0
dbrushsides:
.xword 0
.size dbrushsides, 8
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorCopy
.addrsig_sym VectorInverse
.addrsig_sym BaseWindingForPlane
.addrsig_sym memcpy
.addrsig_sym VL_ChopWinding
.addrsig_sym dplanes
.addrsig_sym dbrushsides
.addrsig_sym SIDE_BACK
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_WindingForBrushSide.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_14__ TYPE_4__ ;
typedef struct TYPE_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
struct TYPE_12__ {int numpoints; int /*<<< orphan*/ * p; } ;
typedef TYPE_2__ winding_t ;
struct TYPE_13__ {int /*<<< orphan*/ headnode; } ;
typedef TYPE_3__ tree_t ;
struct TYPE_14__ {int numIndexes; size_t* indexes; int numVerts; TYPE_1__* verts; } ;
typedef TYPE_4__ mapDrawSurface_t ;
struct TYPE_11__ {int /*<<< orphan*/ xyz; } ;
/* Variables and functions */
TYPE_2__* AllocWinding (int) ;
scalar_t__ FilterMapDrawSurfIntoTree (int /*<<< orphan*/ ,TYPE_4__*,int /*<<< orphan*/ ) ;
scalar_t__ FilterMapDrawSurfIntoTree_r (TYPE_2__*,TYPE_4__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int FilterMiscModelSurfIntoTree( mapDrawSurface_t *ds, tree_t *tree ) {
int i;
int l;
winding_t *w;
l = 0;
for (i = 0; i < ds->numIndexes-2; i++) {
w = AllocWinding(3);
VectorCopy(ds->verts[ds->indexes[i]].xyz, w->p[0]);
VectorCopy(ds->verts[ds->indexes[i+1]].xyz, w->p[1]);
VectorCopy(ds->verts[ds->indexes[i+2]].xyz, w->p[2]);
w->numpoints = 3;
l += FilterMapDrawSurfIntoTree_r( w, ds, tree->headnode );
}
// also use the old point filtering into the tree
for ( i = 0 ; i < ds->numVerts ; i++ ) {
l += FilterMapDrawSurfIntoTree( ds->verts[i].xyz, ds, tree->headnode );
}
return l;
}
|
.text
.file "extr_surface.c_FilterMiscModelSurfIntoTree.c"
.globl FilterMiscModelSurfIntoTree // -- Begin function FilterMiscModelSurfIntoTree
.p2align 2
.type FilterMiscModelSurfIntoTree,@function
FilterMiscModelSurfIntoTree: // @FilterMiscModelSurfIntoTree
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-8]
stur x1, [x29, #-16]
str wzr, [sp, #24]
stur wzr, [x29, #-20]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-20]
ldur x9, [x29, #-8]
ldr w9, [x9]
subs w9, w9, #2
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
mov w0, #3 // =0x3
str w0, [sp, #12] // 4-byte Folded Spill
bl AllocWinding
str x0, [sp, #16]
ldur x8, [x29, #-8]
ldr x8, [x8, #24]
ldur x9, [x29, #-8]
ldr x9, [x9, #8]
ldursw x10, [x29, #-20]
ldr x9, [x9, x10, lsl #3]
ldr w0, [x8, x9, lsl #2]
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldr w1, [x8]
bl VectorCopy
ldur x8, [x29, #-8]
ldr x8, [x8, #24]
ldur x9, [x29, #-8]
ldr x9, [x9, #8]
ldur w10, [x29, #-20]
add w10, w10, #1
ldr x9, [x9, w10, sxtw #3]
ldr w0, [x8, x9, lsl #2]
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldr w1, [x8, #4]
bl VectorCopy
ldur x8, [x29, #-8]
ldr x8, [x8, #24]
ldur x9, [x29, #-8]
ldr x9, [x9, #8]
ldur w10, [x29, #-20]
add w10, w10, #2
ldr x9, [x9, w10, sxtw #3]
ldr w0, [x8, x9, lsl #2]
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldr w1, [x8, #8]
bl VectorCopy
ldr w8, [sp, #12] // 4-byte Folded Reload
ldr x9, [sp, #16]
str w8, [x9]
ldr x0, [sp, #16]
ldur x1, [x29, #-8]
ldur x8, [x29, #-16]
ldr w2, [x8]
bl FilterMapDrawSurfIntoTree_r
ldrsw x8, [sp, #24]
add x8, x8, x0
// kill: def $w8 killed $w8 killed $x8
str w8, [sp, #24]
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_1
.LBB0_4:
stur wzr, [x29, #-20]
b .LBB0_5
.LBB0_5: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-20]
ldur x9, [x29, #-8]
ldr w9, [x9, #16]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=1
ldur x8, [x29, #-8]
ldr x8, [x8, #24]
ldursw x9, [x29, #-20]
ldr w0, [x8, x9, lsl #2]
ldur x1, [x29, #-8]
ldur x8, [x29, #-16]
ldr w2, [x8]
bl FilterMapDrawSurfIntoTree
ldrsw x8, [sp, #24]
add x8, x8, x0
// kill: def $w8 killed $w8 killed $x8
str w8, [sp, #24]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=1
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_5
.LBB0_8:
ldr w0, [sp, #24]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FilterMiscModelSurfIntoTree, .Lfunc_end0-FilterMiscModelSurfIntoTree
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym AllocWinding
.addrsig_sym VectorCopy
.addrsig_sym FilterMapDrawSurfIntoTree_r
.addrsig_sym FilterMapDrawSurfIntoTree
|
../AnghaBench/Quake-III-Arena/q3map/extr_surface.c_FilterMiscModelSurfIntoTree.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {struct TYPE_4__* hash_chain; int /*<<< orphan*/ dist; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
int PLANE_HASHES ;
scalar_t__ fabs (int /*<<< orphan*/ ) ;
TYPE_1__** planehash ;
void AddPlaneToHash (plane_t *p)
{
int hash;
hash = (int)fabs(p->dist) / 8;
hash &= (PLANE_HASHES-1);
p->hash_chain = planehash[hash];
planehash[hash] = p;
}
|
.text
.file "extr_map.c_AddPlaneToHash.c"
.globl AddPlaneToHash // -- Begin function AddPlaneToHash
.p2align 2
.type AddPlaneToHash,@function
AddPlaneToHash: // @AddPlaneToHash
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
str x0, [sp, #8]
ldr x8, [sp, #8]
ldr w0, [x8, #8]
bl fabs
mov w8, w0
mov w9, #8 // =0x8
sdiv w8, w8, w9
str w8, [sp, #4]
adrp x8, PLANE_HASHES
ldr w8, [x8, :lo12:PLANE_HASHES]
subs w9, w8, #1
ldr w8, [sp, #4]
and w8, w8, w9
str w8, [sp, #4]
adrp x9, planehash
ldr x8, [x9, :lo12:planehash]
ldrsw x10, [sp, #4]
ldr x8, [x8, x10, lsl #3]
ldr x10, [sp, #8]
str x8, [x10]
ldr x8, [sp, #8]
ldr x9, [x9, :lo12:planehash]
ldrsw x10, [sp, #4]
str x8, [x9, x10, lsl #3]
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size AddPlaneToHash, .Lfunc_end0-AddPlaneToHash
.cfi_endproc
// -- End function
.type PLANE_HASHES,@object // @PLANE_HASHES
.bss
.globl PLANE_HASHES
.p2align 2, 0x0
PLANE_HASHES:
.word 0 // 0x0
.size PLANE_HASHES, 4
.type planehash,@object // @planehash
.globl planehash
.p2align 3, 0x0
planehash:
.xword 0
.size planehash, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym fabs
.addrsig_sym PLANE_HASHES
.addrsig_sym planehash
|
../AnghaBench/Quake-III-Arena/q3map/extr_map.c_AddPlaneToHash.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int /*<<< orphan*/ contents; int /*<<< orphan*/ surfaceFlags; } ;
typedef TYPE_1__ shaderInfo_t ;
struct TYPE_5__ {int /*<<< orphan*/ contentFlags; int /*<<< orphan*/ surfaceFlags; int /*<<< orphan*/ shader; } ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
int MAX_MAP_SHADERS ;
int /*<<< orphan*/ Q_stricmp (char const*,int /*<<< orphan*/ ) ;
TYPE_1__* ShaderInfoForShader (char const*) ;
TYPE_2__* dshaders ;
int numShaders ;
int /*<<< orphan*/ strcpy (int /*<<< orphan*/ ,char const*) ;
int EmitShader( const char *shader ) {
int i;
shaderInfo_t *si;
if ( !shader ) {
shader = "noshader";
}
for ( i = 0 ; i < numShaders ; i++ ) {
if ( !Q_stricmp( shader, dshaders[i].shader ) ) {
return i;
}
}
if ( i == MAX_MAP_SHADERS ) {
Error( "MAX_MAP_SHADERS" );
}
numShaders++;
strcpy( dshaders[i].shader, shader );
si = ShaderInfoForShader( shader );
dshaders[i].surfaceFlags = si->surfaceFlags;
dshaders[i].contentFlags = si->contents;
return i;
}
|
.text
.file "extr_writebsp.c_EmitShader.c"
.globl EmitShader // -- Begin function EmitShader
.p2align 2
.type EmitShader,@function
EmitShader: // @EmitShader
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur x0, [x29, #-16]
ldur x8, [x29, #-16]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, .L.str
add x8, x8, :lo12:.L.str
stur x8, [x29, #-16]
b .LBB0_2
.LBB0_2:
stur wzr, [x29, #-20]
b .LBB0_3
.LBB0_3: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-20]
adrp x9, numShaders
ldr w9, [x9, :lo12:numShaders]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=1
ldur x0, [x29, #-16]
adrp x8, dshaders
ldr x8, [x8, :lo12:dshaders]
ldursw x9, [x29, #-20]
mov x10, #12 // =0xc
mul x9, x9, x10
add x8, x8, x9
ldr w1, [x8, #8]
bl Q_stricmp
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
ldur w8, [x29, #-20]
stur w8, [x29, #-4]
b .LBB0_11
.LBB0_6: // in Loop: Header=BB0_3 Depth=1
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=1
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_3
.LBB0_8:
ldur w8, [x29, #-20]
adrp x9, MAX_MAP_SHADERS
ldr w9, [x9, :lo12:MAX_MAP_SHADERS]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9:
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl Error
b .LBB0_10
.LBB0_10:
adrp x9, numShaders
ldr w8, [x9, :lo12:numShaders]
add w8, w8, #1
str w8, [x9, :lo12:numShaders]
adrp x8, dshaders
str x8, [sp] // 8-byte Folded Spill
ldr x8, [x8, :lo12:dshaders]
ldursw x9, [x29, #-20]
mov x10, #12 // =0xc
str x10, [sp, #8] // 8-byte Folded Spill
mul x9, x9, x10
add x8, x8, x9
ldr w0, [x8, #8]
ldur x1, [x29, #-16]
bl strcpy
ldur x0, [x29, #-16]
bl ShaderInfoForShader
ldr x9, [sp] // 8-byte Folded Reload
ldr x11, [sp, #8] // 8-byte Folded Reload
str x0, [sp, #16]
ldr x8, [sp, #16]
ldr w8, [x8, #4]
ldr x10, [x9, :lo12:dshaders]
ldursw x12, [x29, #-20]
mul x12, x12, x11
add x10, x10, x12
str w8, [x10, #4]
ldr x8, [sp, #16]
ldr w8, [x8]
ldr x9, [x9, :lo12:dshaders]
ldursw x10, [x29, #-20]
mul x10, x10, x11
str w8, [x9, x10]
ldur w8, [x29, #-20]
stur w8, [x29, #-4]
b .LBB0_11
.LBB0_11:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size EmitShader, .Lfunc_end0-EmitShader
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "noshader"
.size .L.str, 9
.type numShaders,@object // @numShaders
.bss
.globl numShaders
.p2align 2, 0x0
numShaders:
.word 0 // 0x0
.size numShaders, 4
.type dshaders,@object // @dshaders
.globl dshaders
.p2align 3, 0x0
dshaders:
.xword 0
.size dshaders, 8
.type MAX_MAP_SHADERS,@object // @MAX_MAP_SHADERS
.globl MAX_MAP_SHADERS
.p2align 2, 0x0
MAX_MAP_SHADERS:
.word 0 // 0x0
.size MAX_MAP_SHADERS, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "MAX_MAP_SHADERS"
.size .L.str.1, 16
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Q_stricmp
.addrsig_sym Error
.addrsig_sym strcpy
.addrsig_sym ShaderInfoForShader
.addrsig_sym numShaders
.addrsig_sym dshaders
.addrsig_sym MAX_MAP_SHADERS
|
../AnghaBench/Quake-III-Arena/q3map/extr_writebsp.c_EmitShader.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ RunThreadsOnIndividual (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VL_SurfaceRadiosity ;
int /*<<< orphan*/ _printf (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ free (float*) ;
float* lightFloats ;
scalar_t__ malloc (int) ;
int /*<<< orphan*/ memcpy (float*,float*,int) ;
int /*<<< orphan*/ numDrawSurfaces ;
int numLightBytes ;
float* oldLightFloats ;
int /*<<< orphan*/ qtrue ;
void VL_Radiosity(void) {
oldLightFloats = lightFloats;
lightFloats = (float *) malloc(numLightBytes * sizeof(float));
memcpy(lightFloats, oldLightFloats, numLightBytes * sizeof(float));
_printf("%7i surfaces\n", numDrawSurfaces);
RunThreadsOnIndividual( numDrawSurfaces, qtrue, VL_SurfaceRadiosity );
free(oldLightFloats);
}
|
.text
.file "extr_lightv.c_VL_Radiosity.c"
.globl VL_Radiosity // -- Begin function VL_Radiosity
.p2align 2
.type VL_Radiosity,@function
VL_Radiosity: // @VL_Radiosity
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
adrp x8, lightFloats
str x8, [sp] // 8-byte Folded Spill
ldr x8, [x8, :lo12:lightFloats]
adrp x9, oldLightFloats
stur x9, [x29, #-8] // 8-byte Folded Spill
str x8, [x9, :lo12:oldLightFloats]
adrp x8, numLightBytes
str x8, [sp, #8] // 8-byte Folded Spill
ldrsw x8, [x8, :lo12:numLightBytes]
lsl x8, x8, #2
mov w0, w8
bl malloc
ldr x10, [sp] // 8-byte Folded Reload
ldr x8, [sp, #8] // 8-byte Folded Reload
ldur x9, [x29, #-8] // 8-byte Folded Reload
str x0, [x10, :lo12:lightFloats]
ldr x0, [x10, :lo12:lightFloats]
ldr x1, [x9, :lo12:oldLightFloats]
ldrsw x8, [x8, :lo12:numLightBytes]
lsl x8, x8, #2
mov w2, w8
bl memcpy
adrp x8, numDrawSurfaces
str x8, [sp, #16] // 8-byte Folded Spill
ldr w1, [x8, :lo12:numDrawSurfaces]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr w0, [x8, :lo12:numDrawSurfaces]
adrp x8, qtrue
ldr w1, [x8, :lo12:qtrue]
adrp x8, VL_SurfaceRadiosity
ldr w2, [x8, :lo12:VL_SurfaceRadiosity]
bl RunThreadsOnIndividual
ldur x8, [x29, #-8] // 8-byte Folded Reload
ldr x0, [x8, :lo12:oldLightFloats]
bl free
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_Radiosity, .Lfunc_end0-VL_Radiosity
.cfi_endproc
// -- End function
.type lightFloats,@object // @lightFloats
.bss
.globl lightFloats
.p2align 3, 0x0
lightFloats:
.xword 0
.size lightFloats, 8
.type oldLightFloats,@object // @oldLightFloats
.globl oldLightFloats
.p2align 3, 0x0
oldLightFloats:
.xword 0
.size oldLightFloats, 8
.type numLightBytes,@object // @numLightBytes
.globl numLightBytes
.p2align 2, 0x0
numLightBytes:
.word 0 // 0x0
.size numLightBytes, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "%7i surfaces\n"
.size .L.str, 14
.type numDrawSurfaces,@object // @numDrawSurfaces
.bss
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type VL_SurfaceRadiosity,@object // @VL_SurfaceRadiosity
.globl VL_SurfaceRadiosity
.p2align 2, 0x0
VL_SurfaceRadiosity:
.word 0 // 0x0
.size VL_SurfaceRadiosity, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym memcpy
.addrsig_sym _printf
.addrsig_sym RunThreadsOnIndividual
.addrsig_sym free
.addrsig_sym lightFloats
.addrsig_sym oldLightFloats
.addrsig_sym numLightBytes
.addrsig_sym numDrawSurfaces
.addrsig_sym qtrue
.addrsig_sym VL_SurfaceRadiosity
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_Radiosity.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_3__ {int /*<<< orphan*/ * windings; scalar_t__* freewindings; } ;
typedef TYPE_1__ pstack_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
winding_t *AllocStackWinding (pstack_t *stack)
{
int i;
for (i=0 ; i<3 ; i++)
{
if (stack->freewindings[i])
{
stack->freewindings[i] = 0;
return &stack->windings[i];
}
}
Error ("AllocStackWinding: failed");
return NULL;
}
|
.text
.file "extr_visflow.c_AllocStackWinding.c"
.globl AllocStackWinding // -- Begin function AllocStackWinding
.p2align 2
.type AllocStackWinding,@function
AllocStackWinding: // @AllocStackWinding
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
str x0, [sp, #16]
str wzr, [sp, #12]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldr w8, [sp, #12]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #16]
ldr x8, [x8, #8]
ldrsw x9, [sp, #12]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldr x8, [sp, #16]
ldr x9, [x8, #8]
ldrsw x10, [sp, #12]
mov x8, xzr
str x8, [x9, x10, lsl #3]
ldr x8, [sp, #16]
ldr x8, [x8]
ldrsw x9, [sp, #12]
add x8, x8, x9, lsl #2
stur x8, [x29, #-8]
b .LBB0_7
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #12]
add w8, w8, #1
str w8, [sp, #12]
b .LBB0_1
.LBB0_6:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
// kill: def $x8 killed $xzr
stur xzr, [x29, #-8]
b .LBB0_7
.LBB0_7:
ldur x0, [x29, #-8]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size AllocStackWinding, .Lfunc_end0-AllocStackWinding
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "AllocStackWinding: failed"
.size .L.str, 26
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
|
../AnghaBench/Quake-III-Arena/q3map/extr_visflow.c_AllocStackWinding.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
/* Variables and functions */
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (int /*<<< orphan*/ ,double,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
void VS_SphereFromBounds( vec3_t mins, vec3_t maxs, vec3_t origin, float *radius ) {
vec3_t temp;
VectorAdd( mins, maxs, origin );
VectorScale( origin, 0.5, origin );
VectorSubtract( maxs, origin, temp );
*radius = VectorLength( temp );
}
|
.text
.file "extr_soundv.c_VS_SphereFromBounds.c"
.globl VS_SphereFromBounds // -- Begin function VS_SphereFromBounds
.p2align 2
.type VS_SphereFromBounds,@function
VS_SphereFromBounds: // @VS_SphereFromBounds
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur w0, [x29, #-4]
stur w1, [x29, #-8]
stur w2, [x29, #-12]
str x3, [sp, #8]
ldur w0, [x29, #-4]
ldur w1, [x29, #-8]
ldur w2, [x29, #-12]
bl VectorAdd
ldur w0, [x29, #-12]
ldur w1, [x29, #-12]
fmov d0, #0.50000000
bl VectorScale
ldur w0, [x29, #-8]
ldur w1, [x29, #-12]
ldr w2, [sp, #4]
bl VectorSubtract
ldr w0, [sp, #4]
bl VectorLength
ldr x8, [sp, #8]
str s0, [x8]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_SphereFromBounds, .Lfunc_end0-VS_SphereFromBounds
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorAdd
.addrsig_sym VectorScale
.addrsig_sym VectorSubtract
.addrsig_sym VectorLength
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_SphereFromBounds.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_14__ TYPE_3__ ;
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
struct TYPE_12__ {int numpoints; double** points; } ;
typedef TYPE_1__ winding_t ;
struct TYPE_13__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ plane_t ;
struct TYPE_14__ {size_t numportals; int leaf; TYPE_2__ plane; TYPE_1__* winding; struct TYPE_14__** portals; } ;
typedef TYPE_3__ lportal_t ;
typedef TYPE_3__ lleaf_t ;
typedef int /*<<< orphan*/ FILE ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*,...) ;
int MAX_CLUSTERS ;
int MAX_POINTS_ON_WINDING ;
size_t MAX_PORTALS_ON_LEAF ;
char* PORTALFILE ;
void* VL_AllocWinding (int) ;
int /*<<< orphan*/ VL_PlaneFromWinding (TYPE_1__*,TYPE_2__*) ;
int /*<<< orphan*/ VL_SetPortalSphere (TYPE_3__*) ;
int /*<<< orphan*/ VectorCopy (double*,double*) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ _printf (char*,int) ;
int /*<<< orphan*/ fclose (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * fopen (char*,char*) ;
int fscanf (int /*<<< orphan*/ *,char*,...) ;
TYPE_3__* leafs ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int numfaces ;
int numportals ;
int portalclusters ;
TYPE_3__* portals ;
int /*<<< orphan*/ * stdin ;
scalar_t__ strcmp (char*,char*) ;
int /*<<< orphan*/ vec3_origin ;
void VL_LoadPortals (char *name)
{
int i, j, hint;
lportal_t *p;
lleaf_t *l;
char magic[80];
FILE *f;
int numpoints;
winding_t *w;
int leafnums[2];
plane_t plane;
//
if (!strcmp(name,"-"))
f = stdin;
else
{
f = fopen(name, "r");
if (!f)
Error ("LoadPortals: couldn't read %s\n",name);
}
if (fscanf (f,"%79s\n%i\n%i\n%i\n",magic, &portalclusters, &numportals, &numfaces) != 4)
Error ("LoadPortals: failed to read header");
if (strcmp(magic, PORTALFILE))
Error ("LoadPortals: not a portal file");
_printf ("%6i portalclusters\n", portalclusters);
_printf ("%6i numportals\n", numportals);
_printf ("%6i numfaces\n", numfaces);
if (portalclusters >= MAX_CLUSTERS)
Error ("more than %d clusters in portal file\n", MAX_CLUSTERS);
// each file portal is split into two memory portals
portals = malloc(2*numportals*sizeof(lportal_t));
memset (portals, 0, 2*numportals*sizeof(lportal_t));
leafs = malloc(portalclusters*sizeof(lleaf_t));
memset (leafs, 0, portalclusters*sizeof(lleaf_t));
for (i=0, p=portals ; i<numportals ; i++)
{
if (fscanf (f, "%i %i %i ", &numpoints, &leafnums[0], &leafnums[1]) != 3)
Error ("LoadPortals: reading portal %i", i);
if (numpoints > MAX_POINTS_ON_WINDING)
Error ("LoadPortals: portal %i has too many points", i);
if ( (unsigned)leafnums[0] > portalclusters
|| (unsigned)leafnums[1] > portalclusters)
Error ("LoadPortals: reading portal %i", i);
if (fscanf (f, "%i ", &hint) != 1)
Error ("LoadPortals: reading hint state");
w = p->winding = VL_AllocWinding (numpoints);
w->numpoints = numpoints;
for (j=0 ; j<numpoints ; j++)
{
double v[3];
int k;
// scanf into double, then assign to vec_t
// so we don't care what size vec_t is
if (fscanf (f, "(%lf %lf %lf ) "
, &v[0], &v[1], &v[2]) != 3)
Error ("LoadPortals: reading portal %i", i);
for (k=0 ; k<3 ; k++)
w->points[j][k] = v[k];
}
fscanf (f, "\n");
// calc plane
VL_PlaneFromWinding (w, &plane);
// create forward portal
l = &leafs[leafnums[0]];
if (l->numportals == MAX_PORTALS_ON_LEAF)
Error ("Leaf with too many portals");
l->portals[l->numportals] = p;
l->numportals++;
p->winding = w;
VectorSubtract (vec3_origin, plane.normal, p->plane.normal);
p->plane.dist = -plane.dist;
p->leaf = leafnums[1];
VL_SetPortalSphere (p);
p++;
// create backwards portal
l = &leafs[leafnums[1]];
if (l->numportals == MAX_PORTALS_ON_LEAF)
Error ("Leaf with too many portals");
l->portals[l->numportals] = p;
l->numportals++;
p->winding = VL_AllocWinding(w->numpoints);
p->winding->numpoints = w->numpoints;
for (j=0 ; j<w->numpoints ; j++)
{
VectorCopy (w->points[w->numpoints-1-j], p->winding->points[j]);
}
p->plane = plane;
p->leaf = leafnums[0];
VL_SetPortalSphere (p);
p++;
}
fclose (f);
}
|
.text
.file "extr_lightv.c_VL_LoadPortals.c"
.globl VL_LoadPortals // -- Begin function VL_LoadPortals
.p2align 2
.type VL_LoadPortals,@function
VL_LoadPortals: // @VL_LoadPortals
.cfi_startproc
// %bb.0:
sub sp, sp, #288
.cfi_def_cfa_offset 288
stp x29, x30, [sp, #256] // 16-byte Folded Spill
str x28, [sp, #272] // 8-byte Folded Spill
add x29, sp, #256
.cfi_def_cfa w29, 32
.cfi_offset w28, -16
.cfi_offset w30, -24
.cfi_offset w29, -32
sub x8, x29, #40
str x8, [sp, #56] // 8-byte Folded Spill
str x0, [x8, #32]
ldr x0, [x8, #32]
adrp x1, .L.str
add x1, x1, :lo12:.L.str
bl strcmp
subs x8, x0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, stdin
ldr x8, [x8, :lo12:stdin]
str x8, [sp, #128]
b .LBB0_5
.LBB0_2:
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x0, [x8, #32]
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl fopen
str x0, [sp, #128]
ldr x8, [sp, #128]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x1, [x8, #32]
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl Error
b .LBB0_4
.LBB0_4:
b .LBB0_5
.LBB0_5:
ldr x0, [sp, #128]
adrp x1, .L.str.3
add x1, x1, :lo12:.L.str.3
sub x2, x29, #120
adrp x3, portalclusters
add x3, x3, :lo12:portalclusters
adrp x4, numportals
add x4, x4, :lo12:numportals
adrp x5, numfaces
add x5, x5, :lo12:numfaces
bl fscanf
subs w8, w0, #4
cset w8, eq
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
adrp x0, .L.str.4
add x0, x0, :lo12:.L.str.4
bl Error
b .LBB0_7
.LBB0_7:
adrp x8, PORTALFILE
ldr x1, [x8, :lo12:PORTALFILE]
sub x0, x29, #120
bl strcmp
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8:
adrp x0, .L.str.5
add x0, x0, :lo12:.L.str.5
bl Error
b .LBB0_9
.LBB0_9:
adrp x8, portalclusters
str x8, [sp, #48] // 8-byte Folded Spill
ldr w1, [x8, :lo12:portalclusters]
adrp x0, .L.str.6
add x0, x0, :lo12:.L.str.6
bl _printf
adrp x8, numportals
ldr w1, [x8, :lo12:numportals]
adrp x0, .L.str.7
add x0, x0, :lo12:.L.str.7
bl _printf
adrp x8, numfaces
ldr w1, [x8, :lo12:numfaces]
adrp x0, .L.str.8
add x0, x0, :lo12:.L.str.8
bl _printf
ldr x8, [sp, #48] // 8-byte Folded Reload
ldr w8, [x8, :lo12:portalclusters]
adrp x9, MAX_CLUSTERS
ldr w9, [x9, :lo12:MAX_CLUSTERS]
subs w8, w8, w9
cset w8, lt
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10:
adrp x8, MAX_CLUSTERS
ldr w1, [x8, :lo12:MAX_CLUSTERS]
adrp x0, .L.str.9
add x0, x0, :lo12:.L.str.9
bl Error
b .LBB0_11
.LBB0_11:
adrp x8, numportals
str x8, [sp] // 8-byte Folded Spill
ldr w9, [x8, :lo12:numportals]
mov w8, #2 // =0x2
str w8, [sp, #12] // 4-byte Folded Spill
mul w8, w8, w9
mov x9, #40 // =0x28
str x9, [sp, #24] // 8-byte Folded Spill
mov w9, #40 // =0x28
smull x8, w8, w9
mov w0, w8
bl malloc
ldr x9, [sp] // 8-byte Folded Reload
ldr w8, [sp, #12] // 4-byte Folded Reload
adrp x10, portals
str x10, [sp, #40] // 8-byte Folded Spill
str x0, [x10, :lo12:portals]
ldr x0, [x10, :lo12:portals]
ldr w9, [x9, :lo12:numportals]
mul w8, w8, w9
mov w9, #40 // =0x28
smull x8, w8, w9
mov w2, w8
mov w1, wzr
str w1, [sp, #36] // 4-byte Folded Spill
bl memset
ldr x9, [sp, #24] // 8-byte Folded Reload
adrp x8, portalclusters
str x8, [sp, #16] // 8-byte Folded Spill
ldrsw x8, [x8, :lo12:portalclusters]
mul x8, x8, x9
mov w0, w8
bl malloc
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x9, [sp, #24] // 8-byte Folded Reload
ldr w1, [sp, #36] // 4-byte Folded Reload
adrp x10, leafs
str x0, [x10, :lo12:leafs]
ldr x0, [x10, :lo12:leafs]
ldrsw x8, [x8, :lo12:portalclusters]
mul x8, x8, x9
mov w2, w8
bl memset
ldr x8, [sp, #40] // 8-byte Folded Reload
ldr x9, [sp, #56] // 8-byte Folded Reload
stur wzr, [x29, #-12]
ldr x8, [x8, :lo12:portals]
str x8, [x9, #8]
b .LBB0_12
.LBB0_12: // =>This Loop Header: Depth=1
// Child Loop BB0_23 Depth 2
// Child Loop BB0_27 Depth 3
// Child Loop BB0_37 Depth 2
ldur w8, [x29, #-12]
adrp x9, numportals
ldr w9, [x9, :lo12:numportals]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_42
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_12 Depth=1
ldr x0, [sp, #128]
add x3, sp, #104
add x4, x3, #4
adrp x1, .L.str.10
add x1, x1, :lo12:.L.str.10
add x2, sp, #124
bl fscanf
subs w8, w0, #3
cset w8, eq
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_12 Depth=1
ldur w1, [x29, #-12]
adrp x0, .L.str.11
add x0, x0, :lo12:.L.str.11
bl Error
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_12 Depth=1
ldr w8, [sp, #124]
adrp x9, MAX_POINTS_ON_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_WINDING]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_12 Depth=1
ldur w1, [x29, #-12]
adrp x0, .L.str.12
add x0, x0, :lo12:.L.str.12
bl Error
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_12 Depth=1
ldr w8, [sp, #104]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, hi
tbnz w8, #0, .LBB0_19
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_12 Depth=1
ldr w8, [sp, #108]
adrp x9, portalclusters
ldr w9, [x9, :lo12:portalclusters]
subs w8, w8, w9
cset w8, ls
tbnz w8, #0, .LBB0_20
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_12 Depth=1
ldur w1, [x29, #-12]
adrp x0, .L.str.11
add x0, x0, :lo12:.L.str.11
bl Error
b .LBB0_20
.LBB0_20: // in Loop: Header=BB0_12 Depth=1
ldr x0, [sp, #128]
adrp x1, .L.str.13
add x1, x1, :lo12:.L.str.13
sub x2, x29, #20
bl fscanf
subs w8, w0, #1
cset w8, eq
tbnz w8, #0, .LBB0_22
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_12 Depth=1
adrp x0, .L.str.14
add x0, x0, :lo12:.L.str.14
bl Error
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_12 Depth=1
ldr w0, [sp, #124]
bl VL_AllocWinding
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x9, [x8, #8]
mov x8, x0
str x8, [x9, #24]
str x0, [sp, #112]
ldr w8, [sp, #124]
ldr x9, [sp, #112]
str w8, [x9]
stur wzr, [x29, #-16]
b .LBB0_23
.LBB0_23: // Parent Loop BB0_12 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_27 Depth 3
ldur w8, [x29, #-16]
ldr w9, [sp, #124]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_32
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_23 Depth=2
ldr x0, [sp, #128]
add x2, sp, #72
add x3, x2, #8
add x4, x2, #16
adrp x1, .L.str.15
add x1, x1, :lo12:.L.str.15
bl fscanf
subs w8, w0, #3
cset w8, eq
tbnz w8, #0, .LBB0_26
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_23 Depth=2
ldur w1, [x29, #-12]
adrp x0, .L.str.11
add x0, x0, :lo12:.L.str.11
bl Error
b .LBB0_26
.LBB0_26: // in Loop: Header=BB0_23 Depth=2
str wzr, [sp, #68]
b .LBB0_27
.LBB0_27: // Parent Loop BB0_12 Depth=1
// Parent Loop BB0_23 Depth=2
// => This Inner Loop Header: Depth=3
ldr w8, [sp, #68]
subs w8, w8, #3
cset w8, ge
tbnz w8, #0, .LBB0_30
b .LBB0_28
.LBB0_28: // in Loop: Header=BB0_27 Depth=3
ldrsw x9, [sp, #68]
add x8, sp, #72
ldr d0, [x8, x9, lsl #3]
ldr x8, [sp, #112]
ldr x8, [x8, #8]
ldursw x9, [x29, #-16]
ldr x8, [x8, x9, lsl #3]
ldrsw x9, [sp, #68]
str d0, [x8, x9, lsl #3]
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_27 Depth=3
ldr w8, [sp, #68]
add w8, w8, #1
str w8, [sp, #68]
b .LBB0_27
.LBB0_30: // in Loop: Header=BB0_23 Depth=2
b .LBB0_31
.LBB0_31: // in Loop: Header=BB0_23 Depth=2
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_23
.LBB0_32: // in Loop: Header=BB0_12 Depth=1
ldr x0, [sp, #128]
adrp x1, .L.str.16
add x1, x1, :lo12:.L.str.16
bl fscanf
ldr x0, [sp, #112]
add x1, sp, #96
bl VL_PlaneFromWinding
ldr x8, [sp, #56] // 8-byte Folded Reload
adrp x9, leafs
ldr x9, [x9, :lo12:leafs]
ldrsw x10, [sp, #104]
mov x11, #40 // =0x28
mul x10, x10, x11
add x9, x9, x10
str x9, [x8]
ldr x8, [x8]
ldr x8, [x8]
adrp x9, MAX_PORTALS_ON_LEAF
ldr x9, [x9, :lo12:MAX_PORTALS_ON_LEAF]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_34
b .LBB0_33
.LBB0_33: // in Loop: Header=BB0_12 Depth=1
adrp x0, .L.str.17
add x0, x0, :lo12:.L.str.17
bl Error
b .LBB0_34
.LBB0_34: // in Loop: Header=BB0_12 Depth=1
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x9, [x8, #8]
ldr x10, [x8]
ldr x10, [x10, #32]
ldr x11, [x8]
ldr x11, [x11]
str x9, [x10, x11, lsl #3]
ldr x10, [x8]
ldr x9, [x10]
add x9, x9, #1
str x9, [x10]
ldr x9, [sp, #112]
ldr x10, [x8, #8]
str x9, [x10, #24]
adrp x9, vec3_origin
ldr w0, [x9, :lo12:vec3_origin]
ldr w1, [sp, #100]
ldr x8, [x8, #8]
ldr w2, [x8, #16]
bl VectorSubtract
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr w10, [sp, #96]
mov w9, wzr
subs w9, w9, w10
ldr x10, [x8, #8]
str w9, [x10, #12]
ldr w9, [sp, #108]
ldr x10, [x8, #8]
str w9, [x10, #8]
ldr x0, [x8, #8]
bl VL_SetPortalSphere
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x9, [x8, #8]
mov x11, #40 // =0x28
add x9, x9, #40
str x9, [x8, #8]
adrp x9, leafs
ldr x9, [x9, :lo12:leafs]
ldrsw x10, [sp, #108]
mul x10, x10, x11
add x9, x9, x10
str x9, [x8]
ldr x8, [x8]
ldr x8, [x8]
adrp x9, MAX_PORTALS_ON_LEAF
ldr x9, [x9, :lo12:MAX_PORTALS_ON_LEAF]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_36
b .LBB0_35
.LBB0_35: // in Loop: Header=BB0_12 Depth=1
adrp x0, .L.str.17
add x0, x0, :lo12:.L.str.17
bl Error
b .LBB0_36
.LBB0_36: // in Loop: Header=BB0_12 Depth=1
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x9, [x8, #8]
ldr x10, [x8]
ldr x10, [x10, #32]
ldr x11, [x8]
ldr x11, [x11]
str x9, [x10, x11, lsl #3]
ldr x9, [x8]
ldr x8, [x9]
add x8, x8, #1
str x8, [x9]
ldr x8, [sp, #112]
ldr w0, [x8]
bl VL_AllocWinding
ldr x9, [sp, #56] // 8-byte Folded Reload
ldr x8, [x9, #8]
str x0, [x8, #24]
ldr x8, [sp, #112]
ldr w8, [x8]
ldr x9, [x9, #8]
ldr x9, [x9, #24]
str w8, [x9]
stur wzr, [x29, #-16]
b .LBB0_37
.LBB0_37: // Parent Loop BB0_12 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-16]
ldr x9, [sp, #112]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_40
b .LBB0_38
.LBB0_38: // in Loop: Header=BB0_37 Depth=2
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x9, [sp, #112]
ldr x9, [x9, #8]
ldr x10, [sp, #112]
ldr w10, [x10]
subs w10, w10, #1
ldur w11, [x29, #-16]
subs w10, w10, w11
ldr x0, [x9, w10, sxtw #3]
ldr x8, [x8, #8]
ldr x8, [x8, #24]
ldr x8, [x8, #8]
ldursw x9, [x29, #-16]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
b .LBB0_39
.LBB0_39: // in Loop: Header=BB0_37 Depth=2
ldur w8, [x29, #-16]
add w8, w8, #1
stur w8, [x29, #-16]
b .LBB0_37
.LBB0_40: // in Loop: Header=BB0_12 Depth=1
ldr x8, [sp, #56] // 8-byte Folded Reload
ldr x10, [x8, #8]
ldr x9, [sp, #96]
stur x9, [x10, #12]
ldr w9, [sp, #104]
ldr x10, [x8, #8]
str w9, [x10, #8]
ldr x0, [x8, #8]
bl VL_SetPortalSphere
ldr x9, [sp, #56] // 8-byte Folded Reload
ldr x8, [x9, #8]
add x8, x8, #40
str x8, [x9, #8]
b .LBB0_41
.LBB0_41: // in Loop: Header=BB0_12 Depth=1
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_12
.LBB0_42:
ldr x0, [sp, #128]
bl fclose
.cfi_def_cfa wsp, 288
ldr x28, [sp, #272] // 8-byte Folded Reload
ldp x29, x30, [sp, #256] // 16-byte Folded Reload
add sp, sp, #288
.cfi_def_cfa_offset 0
.cfi_restore w28
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_LoadPortals, .Lfunc_end0-VL_LoadPortals
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "-"
.size .L.str, 2
.type stdin,@object // @stdin
.bss
.globl stdin
.p2align 3, 0x0
stdin:
.xword 0
.size stdin, 8
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "r"
.size .L.str.1, 2
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "LoadPortals: couldn't read %s\n"
.size .L.str.2, 31
.type .L.str.3,@object // @.str.3
.L.str.3:
.asciz "%79s\n%i\n%i\n%i\n"
.size .L.str.3, 15
.type portalclusters,@object // @portalclusters
.bss
.globl portalclusters
.p2align 2, 0x0
portalclusters:
.word 0 // 0x0
.size portalclusters, 4
.type numportals,@object // @numportals
.globl numportals
.p2align 2, 0x0
numportals:
.word 0 // 0x0
.size numportals, 4
.type numfaces,@object // @numfaces
.globl numfaces
.p2align 2, 0x0
numfaces:
.word 0 // 0x0
.size numfaces, 4
.type .L.str.4,@object // @.str.4
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.4:
.asciz "LoadPortals: failed to read header"
.size .L.str.4, 35
.type PORTALFILE,@object // @PORTALFILE
.bss
.globl PORTALFILE
.p2align 3, 0x0
PORTALFILE:
.xword 0
.size PORTALFILE, 8
.type .L.str.5,@object // @.str.5
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.5:
.asciz "LoadPortals: not a portal file"
.size .L.str.5, 31
.type .L.str.6,@object // @.str.6
.L.str.6:
.asciz "%6i portalclusters\n"
.size .L.str.6, 20
.type .L.str.7,@object // @.str.7
.L.str.7:
.asciz "%6i numportals\n"
.size .L.str.7, 16
.type .L.str.8,@object // @.str.8
.L.str.8:
.asciz "%6i numfaces\n"
.size .L.str.8, 14
.type MAX_CLUSTERS,@object // @MAX_CLUSTERS
.bss
.globl MAX_CLUSTERS
.p2align 2, 0x0
MAX_CLUSTERS:
.word 0 // 0x0
.size MAX_CLUSTERS, 4
.type .L.str.9,@object // @.str.9
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.9:
.asciz "more than %d clusters in portal file\n"
.size .L.str.9, 38
.type portals,@object // @portals
.bss
.globl portals
.p2align 3, 0x0
portals:
.xword 0
.size portals, 8
.type leafs,@object // @leafs
.globl leafs
.p2align 3, 0x0
leafs:
.xword 0
.size leafs, 8
.type .L.str.10,@object // @.str.10
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.10:
.asciz "%i %i %i "
.size .L.str.10, 10
.type .L.str.11,@object // @.str.11
.L.str.11:
.asciz "LoadPortals: reading portal %i"
.size .L.str.11, 31
.type MAX_POINTS_ON_WINDING,@object // @MAX_POINTS_ON_WINDING
.bss
.globl MAX_POINTS_ON_WINDING
.p2align 2, 0x0
MAX_POINTS_ON_WINDING:
.word 0 // 0x0
.size MAX_POINTS_ON_WINDING, 4
.type .L.str.12,@object // @.str.12
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.12:
.asciz "LoadPortals: portal %i has too many points"
.size .L.str.12, 43
.type .L.str.13,@object // @.str.13
.L.str.13:
.asciz "%i "
.size .L.str.13, 4
.type .L.str.14,@object // @.str.14
.L.str.14:
.asciz "LoadPortals: reading hint state"
.size .L.str.14, 32
.type .L.str.15,@object // @.str.15
.L.str.15:
.asciz "(%lf %lf %lf ) "
.size .L.str.15, 16
.type .L.str.16,@object // @.str.16
.L.str.16:
.asciz "\n"
.size .L.str.16, 2
.type MAX_PORTALS_ON_LEAF,@object // @MAX_PORTALS_ON_LEAF
.bss
.globl MAX_PORTALS_ON_LEAF
.p2align 3, 0x0
MAX_PORTALS_ON_LEAF:
.xword 0 // 0x0
.size MAX_PORTALS_ON_LEAF, 8
.type .L.str.17,@object // @.str.17
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.17:
.asciz "Leaf with too many portals"
.size .L.str.17, 27
.type vec3_origin,@object // @vec3_origin
.bss
.globl vec3_origin
.p2align 2, 0x0
vec3_origin:
.word 0 // 0x0
.size vec3_origin, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym strcmp
.addrsig_sym fopen
.addrsig_sym Error
.addrsig_sym fscanf
.addrsig_sym _printf
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym VL_AllocWinding
.addrsig_sym VL_PlaneFromWinding
.addrsig_sym VectorSubtract
.addrsig_sym VL_SetPortalSphere
.addrsig_sym VectorCopy
.addrsig_sym fclose
.addrsig_sym stdin
.addrsig_sym portalclusters
.addrsig_sym numportals
.addrsig_sym numfaces
.addrsig_sym PORTALFILE
.addrsig_sym MAX_CLUSTERS
.addrsig_sym portals
.addrsig_sym leafs
.addrsig_sym MAX_POINTS_ON_WINDING
.addrsig_sym MAX_PORTALS_ON_LEAF
.addrsig_sym vec3_origin
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_LoadPortals.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ qboolean ;
typedef int /*<<< orphan*/ byte ;
/* Variables and functions */
scalar_t__ FileExists (char*) ;
int /*<<< orphan*/ LoadFileBlock (char*,int /*<<< orphan*/ **) ;
int /*<<< orphan*/ PakLoadAnyFile (char*,int /*<<< orphan*/ **) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
int strlen (char*) ;
byte* LoadImageFile(char *filename, qboolean *bTGA)
{
byte *buffer = NULL;
int nLen = 0;
*bTGA = qtrue;
if (FileExists(filename))
{
LoadFileBlock(filename, &buffer);
}
#ifdef _WIN32
else
{
PakLoadAnyFile(filename, &buffer);
}
#endif
if ( buffer == NULL)
{
nLen = strlen(filename);
filename[nLen-3] = 'j';
filename[nLen-2] = 'p';
filename[nLen-1] = 'g';
if (FileExists(filename))
{
LoadFileBlock(filename, &buffer);
}
#ifdef _WIN32
else
{
PakLoadAnyFile(filename, &buffer);
}
#endif
if ( buffer )
{
*bTGA = qfalse;
}
}
return buffer;
}
|
.text
.file "extr_shaders.c_LoadImageFile.c"
.globl LoadImageFile // -- Begin function LoadImageFile
.p2align 2
.type LoadImageFile,@function
LoadImageFile: // @LoadImageFile
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
str x1, [sp, #16]
// kill: def $x8 killed $xzr
str xzr, [sp, #8]
str wzr, [sp, #4]
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
ldr x9, [sp, #16]
str w8, [x9]
ldur x0, [x29, #-8]
bl FileExists
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x0, [x29, #-8]
add x1, sp, #8
bl LoadFileBlock
b .LBB0_2
.LBB0_2:
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_3
.LBB0_3:
ldur x0, [x29, #-8]
bl strlen
str w0, [sp, #4]
ldur x8, [x29, #-8]
ldr w9, [sp, #4]
subs w9, w9, #3
add x9, x8, w9, sxtw
mov w8, #106 // =0x6a
strb w8, [x9]
ldur x8, [x29, #-8]
ldr w9, [sp, #4]
subs w9, w9, #2
add x9, x8, w9, sxtw
mov w8, #112 // =0x70
strb w8, [x9]
ldur x8, [x29, #-8]
ldr w9, [sp, #4]
subs w9, w9, #1
add x9, x8, w9, sxtw
mov w8, #103 // =0x67
strb w8, [x9]
ldur x0, [x29, #-8]
bl FileExists
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
ldur x0, [x29, #-8]
add x1, sp, #8
bl LoadFileBlock
b .LBB0_5
.LBB0_5:
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
ldr x9, [sp, #16]
str w8, [x9]
b .LBB0_7
.LBB0_7:
b .LBB0_8
.LBB0_8:
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size LoadImageFile, .Lfunc_end0-LoadImageFile
.cfi_endproc
// -- End function
.type qtrue,@object // @qtrue
.bss
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym FileExists
.addrsig_sym LoadFileBlock
.addrsig_sym strlen
.addrsig_sym qtrue
.addrsig_sym qfalse
|
../AnghaBench/Quake-III-Arena/q3map/extr_shaders.c_LoadImageFile.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int width; int height; int /*<<< orphan*/ * verts; } ;
typedef TYPE_1__ mesh_t ;
typedef int /*<<< orphan*/ drawVert_t ;
/* Variables and functions */
int /*<<< orphan*/ FreeMesh (TYPE_1__*) ;
void* malloc (int) ;
mesh_t *TransposeMesh( mesh_t *in ) {
int w, h;
mesh_t *out;
out = malloc( sizeof( *out ) );
out->width = in->height;
out->height = in->width;
out->verts = malloc( out->width * out->height * sizeof( drawVert_t ) );
for ( h = 0 ; h < in->height ; h++ ) {
for ( w = 0 ; w < in->width ; w++ ) {
out->verts[ w * in->height + h ] = in->verts[ h * in->width + w ];
}
}
FreeMesh( in );
return out;
}
|
.text
.file "extr_mesh.c_TransposeMesh.c"
.globl TransposeMesh // -- Begin function TransposeMesh
.p2align 2
.type TransposeMesh,@function
TransposeMesh: // @TransposeMesh
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
mov w0, #16 // =0x10
bl malloc
str x0, [sp, #8]
ldur x8, [x29, #-8]
ldr w8, [x8, #4]
ldr x9, [sp, #8]
str w8, [x9]
ldur x8, [x29, #-8]
ldr w8, [x8]
ldr x9, [sp, #8]
str w8, [x9, #4]
ldr x8, [sp, #8]
ldr w8, [x8]
ldr x9, [sp, #8]
ldr w9, [x9, #4]
mul w9, w8, w9
// implicit-def: $x8
mov w8, w9
sxtw x8, w8
lsl x8, x8, #2
mov w0, w8
bl malloc
ldr x8, [sp, #8]
str x0, [x8, #8]
str wzr, [sp, #16]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_3 Depth 2
ldr w8, [sp, #16]
ldur x9, [x29, #-8]
ldr w9, [x9, #4]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_8
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-12]
b .LBB0_3
.LBB0_3: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-12]
ldur x9, [x29, #-8]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-8]
ldr x8, [x8, #8]
ldr w9, [sp, #16]
ldur x10, [x29, #-8]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-12]
add w9, w9, w10
ldr w8, [x8, w9, sxtw #2]
ldr x9, [sp, #8]
ldr x9, [x9, #8]
ldur w10, [x29, #-12]
ldur x11, [x29, #-8]
ldr w11, [x11, #4]
mul w10, w10, w11
ldr w11, [sp, #16]
add w10, w10, w11
str w8, [x9, w10, sxtw #2]
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=2
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_3
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #16]
add w8, w8, #1
str w8, [sp, #16]
b .LBB0_1
.LBB0_8:
ldur x0, [x29, #-8]
bl FreeMesh
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size TransposeMesh, .Lfunc_end0-TransposeMesh
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym FreeMesh
|
../AnghaBench/Quake-III-Arena/q3map/extr_mesh.c_TransposeMesh.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {scalar_t__ numvolumes; } ;
struct TYPE_3__ {scalar_t__ insolid; } ;
/* Variables and functions */
float FloatForKey (int /*<<< orphan*/ *,char*) ;
int /*<<< orphan*/ GetVectorForKey (int /*<<< orphan*/ *,char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ RunThreadsOnIndividual (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VS_DoForcedTraceLightSurfaces () ;
int /*<<< orphan*/ VS_FloodLightThread ;
int /*<<< orphan*/ VS_Radiosity () ;
int /*<<< orphan*/ VS_StoreLightmap () ;
int /*<<< orphan*/ VectorScale (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ _printf (char*,int) ;
int /*<<< orphan*/ * entities ;
int /*<<< orphan*/ lightAmbientColor ;
TYPE_2__** lsurfaceTest ;
int numDrawSurfaces ;
int numvsounds ;
int /*<<< orphan*/ qtrue ;
int radiosity ;
int radiosity_scale ;
TYPE_1__** vsounds ;
void VS_LightWorld(void)
{
int i, numcastedvolumes, numvsoundsinsolid;
float f;
// find the optional world ambient
GetVectorForKey( &entities[0], "_color", lightAmbientColor );
f = FloatForKey( &entities[0], "ambient" );
VectorScale( lightAmbientColor, f, lightAmbientColor );
/*
_printf("\r%6d lights out of %d", 0, numvsounds);
for (i = 0; i < numvsounds; i++)
{
_printf("\r%6d", i);
VS_FloodLight(vsounds[i]);
}
_printf("\r%6d lights out of %d\n", i, numvsounds);
*/
_printf("%7i lights\n", numvsounds);
RunThreadsOnIndividual( numvsounds, qtrue, VS_FloodLightThread );
numcastedvolumes = 0;
for ( i = 0 ; i < numDrawSurfaces ; i++ ) {
if (lsurfaceTest[i])
numcastedvolumes += lsurfaceTest[i]->numvolumes;
}
_printf("%7i light volumes casted\n", numcastedvolumes);
numvsoundsinsolid = 0;
for (i = 0; i < numvsounds; i++)
{
if (vsounds[i]->insolid)
numvsoundsinsolid++;
}
_printf("%7i lights in solid\n", numvsoundsinsolid);
//
radiosity_scale = 1;
for (i = 0; i < radiosity; i++) {
VS_Radiosity();
radiosity_scale <<= 1;
}
//
VS_StoreLightmap();
// redo surfaces with the old light algorithm when needed
VS_DoForcedTraceLightSurfaces();
}
|
.text
.file "extr_soundv.c_VS_LightWorld.c"
.globl VS_LightWorld // -- Begin function VS_LightWorld
.p2align 2
.type VS_LightWorld,@function
VS_LightWorld: // @VS_LightWorld
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
adrp x8, entities
str x8, [sp, #8] // 8-byte Folded Spill
ldr x0, [x8, :lo12:entities]
adrp x8, lightAmbientColor
str x8, [sp, #16] // 8-byte Folded Spill
ldr w2, [x8, :lo12:lightAmbientColor]
adrp x1, .L.str
add x1, x1, :lo12:.L.str
bl GetVectorForKey
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x0, [x8, :lo12:entities]
adrp x1, .L.str.1
add x1, x1, :lo12:.L.str.1
bl FloatForKey
ldr x8, [sp, #16] // 8-byte Folded Reload
stur s0, [x29, #-16]
ldr w0, [x8, :lo12:lightAmbientColor]
ldur s0, [x29, #-16]
ldr w1, [x8, :lo12:lightAmbientColor]
bl VectorScale
adrp x8, numvsounds
str x8, [sp, #24] // 8-byte Folded Spill
ldr w1, [x8, :lo12:numvsounds]
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
ldr x8, [sp, #24] // 8-byte Folded Reload
ldr w0, [x8, :lo12:numvsounds]
adrp x8, qtrue
ldr w1, [x8, :lo12:qtrue]
adrp x8, VS_FloodLightThread
ldr w2, [x8, :lo12:VS_FloodLightThread]
bl RunThreadsOnIndividual
stur wzr, [x29, #-8]
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_6
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, lsurfaceTest
ldr x8, [x8, :lo12:lsurfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
adrp x8, lsurfaceTest
ldr x8, [x8, :lo12:lsurfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
ldr x9, [x8]
ldursw x8, [x29, #-8]
add x8, x8, x9
// kill: def $w8 killed $w8 killed $x8
stur w8, [x29, #-8]
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_1
.LBB0_6:
ldur w1, [x29, #-8]
adrp x0, .L.str.3
add x0, x0, :lo12:.L.str.3
bl _printf
stur wzr, [x29, #-12]
stur wzr, [x29, #-4]
b .LBB0_7
.LBB0_7: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
adrp x9, numvsounds
ldr w9, [x9, :lo12:numvsounds]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_12
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
adrp x8, vsounds
ldr x8, [x8, :lo12:vsounds]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
ldr x8, [x8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_7 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_7
.LBB0_12:
ldur w1, [x29, #-12]
adrp x0, .L.str.4
add x0, x0, :lo12:.L.str.4
bl _printf
adrp x9, radiosity_scale
mov w8, #1 // =0x1
str w8, [x9, :lo12:radiosity_scale]
stur wzr, [x29, #-4]
b .LBB0_13
.LBB0_13: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
adrp x9, radiosity
ldr w9, [x9, :lo12:radiosity]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_16
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_13 Depth=1
bl VS_Radiosity
adrp x9, radiosity_scale
ldr w8, [x9, :lo12:radiosity_scale]
lsl w8, w8, #1
str w8, [x9, :lo12:radiosity_scale]
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_13 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_13
.LBB0_16:
bl VS_StoreLightmap
bl VS_DoForcedTraceLightSurfaces
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_LightWorld, .Lfunc_end0-VS_LightWorld
.cfi_endproc
// -- End function
.type entities,@object // @entities
.bss
.globl entities
.p2align 3, 0x0
entities:
.xword 0
.size entities, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "_color"
.size .L.str, 7
.type lightAmbientColor,@object // @lightAmbientColor
.bss
.globl lightAmbientColor
.p2align 2, 0x0
lightAmbientColor:
.word 0 // 0x0
.size lightAmbientColor, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "ambient"
.size .L.str.1, 8
.type .L.str.2,@object // @.str.2
.L.str.2:
.asciz "%7i lights\n"
.size .L.str.2, 12
.type numvsounds,@object // @numvsounds
.bss
.globl numvsounds
.p2align 2, 0x0
numvsounds:
.word 0 // 0x0
.size numvsounds, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type VS_FloodLightThread,@object // @VS_FloodLightThread
.globl VS_FloodLightThread
.p2align 2, 0x0
VS_FloodLightThread:
.word 0 // 0x0
.size VS_FloodLightThread, 4
.type numDrawSurfaces,@object // @numDrawSurfaces
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type lsurfaceTest,@object // @lsurfaceTest
.globl lsurfaceTest
.p2align 3, 0x0
lsurfaceTest:
.xword 0
.size lsurfaceTest, 8
.type .L.str.3,@object // @.str.3
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.3:
.asciz "%7i light volumes casted\n"
.size .L.str.3, 26
.type vsounds,@object // @vsounds
.bss
.globl vsounds
.p2align 3, 0x0
vsounds:
.xword 0
.size vsounds, 8
.type .L.str.4,@object // @.str.4
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.4:
.asciz "%7i lights in solid\n"
.size .L.str.4, 21
.type radiosity_scale,@object // @radiosity_scale
.bss
.globl radiosity_scale
.p2align 2, 0x0
radiosity_scale:
.word 0 // 0x0
.size radiosity_scale, 4
.type radiosity,@object // @radiosity
.globl radiosity
.p2align 2, 0x0
radiosity:
.word 0 // 0x0
.size radiosity, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym GetVectorForKey
.addrsig_sym FloatForKey
.addrsig_sym VectorScale
.addrsig_sym _printf
.addrsig_sym RunThreadsOnIndividual
.addrsig_sym VS_Radiosity
.addrsig_sym VS_StoreLightmap
.addrsig_sym VS_DoForcedTraceLightSurfaces
.addrsig_sym entities
.addrsig_sym lightAmbientColor
.addrsig_sym numvsounds
.addrsig_sym qtrue
.addrsig_sym VS_FloodLightThread
.addrsig_sym numDrawSurfaces
.addrsig_sym lsurfaceTest
.addrsig_sym vsounds
.addrsig_sym radiosity_scale
.addrsig_sym radiosity
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_LightWorld.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_12__ TYPE_4__ ;
typedef struct TYPE_11__ TYPE_3__ ;
typedef struct TYPE_10__ TYPE_2__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_10__ {int /*<<< orphan*/ normal; int /*<<< orphan*/ dist; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_11__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_12__ {int cluster; size_t firstLeafBrush; int /*<<< orphan*/ numLeafBrushes; } ;
typedef TYPE_4__ dleaf_t ;
/* Variables and functions */
scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int VS_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
scalar_t__ VS_WindingAreaOutsideBrushes (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * dleafbrushes ;
TYPE_4__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
float VS_R_WindingAreaOutsideSolid(winding_t *w, vec3_t normal, int nodenum)
{
int leafnum, res;
float area;
dnode_t *node;
dleaf_t *leaf;
dplane_t *plane;
winding_t back;
plane_t split;
area = 0;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VS_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
if (DotProduct(normal, plane->normal) > 0)
nodenum = node->children[0];
else
nodenum = node->children[1];
}
else
{
area += VS_R_WindingAreaOutsideSolid(&back, normal, node->children[1]);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
leaf = &dleafs[leafnum];
if (leaf->cluster != -1)
{
area += VS_WindingAreaOutsideBrushes(w, &dleafbrushes[leaf->firstLeafBrush], leaf->numLeafBrushes);
}
return area;
}
|
.text
.file "extr_soundv.c_VS_R_WindingAreaOutsideSolid.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_R_WindingAreaOutsideSolid
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VS_R_WindingAreaOutsideSolid
.p2align 2
.type VS_R_WindingAreaOutsideSolid,@function
VS_R_WindingAreaOutsideSolid: // @VS_R_WindingAreaOutsideSolid
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur w2, [x29, #-16]
movi d0, #0000000000000000
stur s0, [x29, #-28]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-16]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_15
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-16]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #24]
ldr x8, [sp, #24]
ldr w0, [x8]
add x8, sp, #12
str x8, [sp] // 8-byte Folded Spill
ldr w1, [sp, #16]
bl VectorCopy
ldr x2, [sp] // 8-byte Folded Reload
ldr x8, [sp, #24]
ldr w8, [x8, #4]
str w8, [sp, #12]
ldur x0, [x29, #-8]
add x1, sp, #20
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VS_SplitWinding
stur w0, [x29, #-24]
ldur w8, [x29, #-24]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-16]
b .LBB0_14
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-24]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-16]
b .LBB0_13
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-24]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur w0, [x29, #-12]
ldr x8, [sp, #24]
ldr w1, [x8]
bl DotProduct
subs x8, x0, #0
cset w8, le
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-16]
b .LBB0_10
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-16]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_12
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
ldur w1, [x29, #-12]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w2, [x8, #4]
add x0, sp, #20
bl VS_R_WindingAreaOutsideSolid
fmov s1, s0
ldur s0, [x29, #-28]
fadd s0, s0, s1
stur s0, [x29, #-28]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-16]
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_15:
ldur w9, [x29, #-16]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-20]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-20]
mov x10, #24 // =0x18
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w8, [x8]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16:
ldur x0, [x29, #-8]
adrp x8, dleafbrushes
ldr x8, [x8, :lo12:dleafbrushes]
ldr x9, [sp, #32]
ldr x9, [x9, #8]
add x1, x8, x9, lsl #2
ldr x8, [sp, #32]
ldr w2, [x8, #16]
bl VS_WindingAreaOutsideBrushes
scvtf s1, x0
ldur s0, [x29, #-28]
fadd s0, s0, s1
stur s0, [x29, #-28]
b .LBB0_17
.LBB0_17:
ldur s0, [x29, #-28]
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_R_WindingAreaOutsideSolid, .Lfunc_end0-VS_R_WindingAreaOutsideSolid
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.type dleafbrushes,@object // @dleafbrushes
.globl dleafbrushes
.p2align 3, 0x0
dleafbrushes:
.xword 0
.size dleafbrushes, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_R_WindingAreaOutsideSolid
.addrsig_sym VectorCopy
.addrsig_sym VS_SplitWinding
.addrsig_sym DotProduct
.addrsig_sym VS_WindingAreaOutsideBrushes
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
.addrsig_sym dleafbrushes
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_R_WindingAreaOutsideSolid.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {scalar_t__* points; } ;
typedef TYPE_1__ winding_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*,int) ;
int MAX_POINTS_ON_WINDING ;
TYPE_1__* malloc (int) ;
int /*<<< orphan*/ memset (TYPE_1__*,int /*<<< orphan*/ ,int) ;
winding_t *VL_AllocWinding (int points)
{
winding_t *w;
int size;
if (points > MAX_POINTS_ON_WINDING)
Error ("NewWinding: %i points", points);
size = (int)((winding_t *)0)->points[points];
w = malloc (size);
memset (w, 0, size);
return w;
}
|
.text
.file "extr_lightv.c_VL_AllocWinding.c"
.globl VL_AllocWinding // -- Begin function VL_AllocWinding
.p2align 2
.type VL_AllocWinding,@function
VL_AllocWinding: // @VL_AllocWinding
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur w0, [x29, #-4]
ldur w8, [x29, #-4]
adrp x9, MAX_POINTS_ON_WINDING
ldr w9, [x9, :lo12:MAX_POINTS_ON_WINDING]
subs w8, w8, w9
cset w8, le
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur w1, [x29, #-4]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_2
.LBB0_2:
mov x8, xzr
ldr x8, [x8]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
// kill: def $w8 killed $w8 killed $x8
str w8, [sp, #12]
ldr w0, [sp, #12]
bl malloc
str x0, [sp, #16]
ldr x0, [sp, #16]
ldr w2, [sp, #12]
mov w1, wzr
bl memset
ldr x0, [sp, #16]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_AllocWinding, .Lfunc_end0-VL_AllocWinding
.cfi_endproc
// -- End function
.type MAX_POINTS_ON_WINDING,@object // @MAX_POINTS_ON_WINDING
.bss
.globl MAX_POINTS_ON_WINDING
.p2align 2, 0x0
MAX_POINTS_ON_WINDING:
.word 0 // 0x0
.size MAX_POINTS_ON_WINDING, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "NewWinding: %i points"
.size .L.str, 22
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym MAX_POINTS_ON_WINDING
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_AllocWinding.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_16__ TYPE_5__ ;
typedef struct TYPE_15__ TYPE_4__ ;
typedef struct TYPE_14__ TYPE_3__ ;
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_12__ {int /*<<< orphan*/ headnode; } ;
typedef TYPE_1__ tree_t ;
struct TYPE_13__ {int planenum; int /*<<< orphan*/ * visibleHull; scalar_t__ bevel; int /*<<< orphan*/ * winding; TYPE_3__* shaderInfo; } ;
typedef TYPE_2__ side_t ;
struct TYPE_14__ {int surfaceFlags; int contents; scalar_t__ autosprite; } ;
typedef TYPE_3__ shaderInfo_t ;
struct TYPE_15__ {TYPE_5__* brushes; } ;
typedef TYPE_4__ entity_t ;
struct TYPE_16__ {int numsides; TYPE_2__* sides; struct TYPE_16__* next; } ;
typedef TYPE_5__ bspbrush_t ;
/* Variables and functions */
int CONTENTS_FOG ;
int /*<<< orphan*/ ClipSideIntoTree_r (int /*<<< orphan*/ *,TYPE_2__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * CopyWinding (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ DrawSurfaceForSide (TYPE_5__*,TYPE_2__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ Error (char*) ;
int /*<<< orphan*/ * ReverseWinding (int /*<<< orphan*/ *) ;
int SURF_NODRAW ;
TYPE_2__* malloc (int) ;
int /*<<< orphan*/ qprintf (char*) ;
void ClipSidesIntoTree( entity_t *e, tree_t *tree ) {
bspbrush_t *b;
int i;
winding_t *w;
side_t *side, *newSide;
shaderInfo_t *si;
qprintf( "----- ClipSidesIntoTree -----\n");
for ( b = e->brushes ; b ; b = b->next ) {
for ( i = 0 ; i < b->numsides ; i++ ) {
side = &b->sides[i];
if ( !side->winding) {
continue;
}
w = CopyWinding( side->winding );
side->visibleHull = NULL;
ClipSideIntoTree_r( w, side, tree->headnode );
w = side->visibleHull;
if ( !w ) {
continue;
}
si = side->shaderInfo;
if ( !si ) {
continue;
}
// don't create faces for non-visible sides
if ( si->surfaceFlags & SURF_NODRAW ) {
continue;
}
// always use the original quad winding for auto sprites
if ( side->shaderInfo->autosprite ) {
w = side->winding;
}
//
if ( side->bevel ) {
Error( "monkey tried to create draw surface for brush bevel" );
}
// save this winding as a visible surface
DrawSurfaceForSide( b, side, w );
// make a back side for it if needed
if ( !(si->contents & CONTENTS_FOG) ) {
continue;
}
// duplicate the up-facing side
w = ReverseWinding( w );
newSide = malloc( sizeof( *side ) );
*newSide = *side;
newSide->visibleHull = w;
newSide->planenum ^= 1;
// save this winding as a visible surface
DrawSurfaceForSide( b, newSide, w );
}
}
}
|
.text
.file "extr_surface.c_ClipSidesIntoTree.c"
.globl ClipSidesIntoTree // -- Begin function ClipSidesIntoTree
.p2align 2
.type ClipSidesIntoTree,@function
ClipSidesIntoTree: // @ClipSidesIntoTree
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl qprintf
ldur x8, [x29, #-8]
ldr x8, [x8]
stur x8, [x29, #-24]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_3 Depth 2
ldur x8, [x29, #-24]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_22
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-28]
b .LBB0_3
.LBB0_3: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-28]
ldur x9, [x29, #-24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_20
b .LBB0_4
.LBB0_4: // in Loop: Header=BB0_3 Depth=2
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldursw x9, [x29, #-28]
mov x10, #40 // =0x28
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #16]
ldr x8, [sp, #16]
ldr x8, [x8, #24]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_6: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x0, [x8, #24]
bl CopyWinding
str x0, [sp, #24]
ldr x8, [sp, #16]
// kill: def $x9 killed $xzr
str xzr, [x8, #8]
ldr x0, [sp, #24]
ldr x1, [sp, #16]
ldur x8, [x29, #-16]
ldr w2, [x8]
bl ClipSideIntoTree_r
ldr x8, [sp, #16]
ldr x8, [x8, #8]
str x8, [sp, #24]
ldr x8, [sp, #24]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_8: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x8, [x8, #32]
str x8, [sp]
ldr x8, [sp]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_10: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp]
ldr w8, [x8]
adrp x9, SURF_NODRAW
ldr w9, [x9, :lo12:SURF_NODRAW]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_12: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x8, [x8, #32]
ldr x8, [x8, #8]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x8, [x8, #24]
str x8, [sp, #24]
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_3 Depth=2
ldr x8, [sp, #16]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_16
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_3 Depth=2
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl Error
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_3 Depth=2
ldur x0, [x29, #-24]
ldr x1, [sp, #16]
ldr x2, [sp, #24]
bl DrawSurfaceForSide
ldr x8, [sp]
ldr w8, [x8, #4]
adrp x9, CONTENTS_FOG
ldr w9, [x9, :lo12:CONTENTS_FOG]
ands w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_18
b .LBB0_17
.LBB0_17: // in Loop: Header=BB0_3 Depth=2
b .LBB0_19
.LBB0_18: // in Loop: Header=BB0_3 Depth=2
ldr x0, [sp, #24]
bl ReverseWinding
str x0, [sp, #24]
mov w0, #40 // =0x28
bl malloc
str x0, [sp, #8]
ldr x0, [sp, #8]
ldr x1, [sp, #16]
mov x2, #40 // =0x28
bl memcpy
ldr x8, [sp, #24]
ldr x9, [sp, #8]
str x8, [x9, #8]
ldr x9, [sp, #8]
ldr w8, [x9]
eor w8, w8, #0x1
str w8, [x9]
ldur x0, [x29, #-24]
ldr x1, [sp, #8]
ldr x2, [sp, #24]
bl DrawSurfaceForSide
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_3 Depth=2
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b .LBB0_3
.LBB0_20: // in Loop: Header=BB0_1 Depth=1
b .LBB0_21
.LBB0_21: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-24]
ldr x8, [x8, #16]
stur x8, [x29, #-24]
b .LBB0_1
.LBB0_22:
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size ClipSidesIntoTree, .Lfunc_end0-ClipSidesIntoTree
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "----- ClipSidesIntoTree -----\n"
.size .L.str, 31
.type SURF_NODRAW,@object // @SURF_NODRAW
.bss
.globl SURF_NODRAW
.p2align 2, 0x0
SURF_NODRAW:
.word 0 // 0x0
.size SURF_NODRAW, 4
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "monkey tried to create draw surface for brush bevel"
.size .L.str.1, 52
.type CONTENTS_FOG,@object // @CONTENTS_FOG
.bss
.globl CONTENTS_FOG
.p2align 2, 0x0
CONTENTS_FOG:
.word 0 // 0x0
.size CONTENTS_FOG, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym qprintf
.addrsig_sym CopyWinding
.addrsig_sym ClipSideIntoTree_r
.addrsig_sym Error
.addrsig_sym DrawSurfaceForSide
.addrsig_sym ReverseWinding
.addrsig_sym malloc
.addrsig_sym SURF_NODRAW
.addrsig_sym CONTENTS_FOG
|
../AnghaBench/Quake-III-Arena/q3map/extr_surface.c_ClipSidesIntoTree.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ * vec3_t ;
typedef int /*<<< orphan*/ shaderInfo_t ;
typedef int /*<<< orphan*/ bspbrush_t ;
struct TYPE_4__ {int* portalareas; int /*<<< orphan*/ contents; int /*<<< orphan*/ brushnum; scalar_t__ entitynum; int /*<<< orphan*/ detail; scalar_t__ numsides; } ;
/* Variables and functions */
int /*<<< orphan*/ AddBrushSide (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ CONTENTS_DETAIL ;
int /*<<< orphan*/ * FinishBrush () ;
scalar_t__ MIN_WORLD_COORD ;
int /*<<< orphan*/ RemoveDuplicateBrushPlanes (TYPE_1__*) ;
int /*<<< orphan*/ SetBrushContents (TYPE_1__*) ;
int /*<<< orphan*/ VectorSet (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__) ;
TYPE_1__* buildBrush ;
int /*<<< orphan*/ entitySourceBrushes ;
scalar_t__ num_entities ;
int /*<<< orphan*/ qfalse ;
void MakeBrushFromTriangle( vec3_t v1, vec3_t v2, vec3_t v3, shaderInfo_t *terrainShader ) {
bspbrush_t *b;
vec3_t d1;
vec3_t d2;
vec3_t d3;
VectorSet( d1, v1[ 0 ], v1[ 1 ], MIN_WORLD_COORD + 10 ); //FIXME
VectorSet( d2, v2[ 0 ], v2[ 1 ], MIN_WORLD_COORD + 10 );
VectorSet( d3, v3[ 0 ], v3[ 1 ], MIN_WORLD_COORD + 10 );
buildBrush->numsides = 0;
buildBrush->detail = qfalse;
AddBrushSide( v1, v2, v3, terrainShader );
AddBrushSide( v1, d1, v2, terrainShader );
AddBrushSide( v2, d2, v3, terrainShader );
AddBrushSide( v3, d3, v1, terrainShader );
AddBrushSide( d3, d2, d1, terrainShader );
buildBrush->portalareas[0] = -1;
buildBrush->portalareas[1] = -1;
buildBrush->entitynum = num_entities-1;
buildBrush->brushnum = entitySourceBrushes;
// if there are mirrored planes, the entire brush is invalid
if ( !RemoveDuplicateBrushPlanes( buildBrush ) ) {
return;
}
// get the content for the entire brush
SetBrushContents( buildBrush );
buildBrush->contents |= CONTENTS_DETAIL;
b = FinishBrush();
if ( !b ) {
return;
}
}
|
.text
.file "extr_terrain.c_MakeBrushFromTriangle.c"
.globl MakeBrushFromTriangle // -- Begin function MakeBrushFromTriangle
.p2align 2
.type MakeBrushFromTriangle,@function
MakeBrushFromTriangle: // @MakeBrushFromTriangle
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
stur x3, [x29, #-32]
ldr x0, [sp, #48]
ldur x8, [x29, #-8]
ldr w1, [x8]
ldur x8, [x29, #-8]
ldr w2, [x8, #4]
adrp x8, MIN_WORLD_COORD
str x8, [sp, #16] // 8-byte Folded Spill
ldr x8, [x8, :lo12:MIN_WORLD_COORD]
add x3, x8, #10
bl VectorSet
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x0, [sp, #40]
ldur x9, [x29, #-16]
ldr w1, [x9]
ldur x9, [x29, #-16]
ldr w2, [x9, #4]
ldr x8, [x8, :lo12:MIN_WORLD_COORD]
add x3, x8, #10
bl VectorSet
ldr x8, [sp, #16] // 8-byte Folded Reload
ldr x0, [sp, #32]
ldur x9, [x29, #-24]
ldr w1, [x9]
ldur x9, [x29, #-24]
ldr w2, [x9, #4]
ldr x8, [x8, :lo12:MIN_WORLD_COORD]
add x3, x8, #10
bl VectorSet
adrp x9, buildBrush
str x9, [sp, #24] // 8-byte Folded Spill
ldr x8, [x9, :lo12:buildBrush]
str xzr, [x8, #32]
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
ldr x9, [x9, :lo12:buildBrush]
str w8, [x9, #24]
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldur x2, [x29, #-24]
ldur x3, [x29, #-32]
bl AddBrushSide
ldur x0, [x29, #-8]
ldr x1, [sp, #48]
ldur x2, [x29, #-16]
ldur x3, [x29, #-32]
bl AddBrushSide
ldur x0, [x29, #-16]
ldr x1, [sp, #40]
ldur x2, [x29, #-24]
ldur x3, [x29, #-32]
bl AddBrushSide
ldur x0, [x29, #-24]
ldr x1, [sp, #32]
ldur x2, [x29, #-8]
ldur x3, [x29, #-32]
bl AddBrushSide
ldr x0, [sp, #32]
ldr x1, [sp, #40]
ldr x2, [sp, #48]
ldur x3, [x29, #-32]
bl AddBrushSide
ldr x8, [sp, #24] // 8-byte Folded Reload
ldr x9, [x8, :lo12:buildBrush]
ldr x10, [x9]
mov w9, #-1 // =0xffffffff
str w9, [x10]
ldr x10, [x8, :lo12:buildBrush]
ldr x10, [x10]
str w9, [x10, #4]
adrp x9, num_entities
ldr x9, [x9, :lo12:num_entities]
subs x9, x9, #1
ldr x10, [x8, :lo12:buildBrush]
str x9, [x10, #16]
adrp x9, entitySourceBrushes
ldr w9, [x9, :lo12:entitySourceBrushes]
ldr x10, [x8, :lo12:buildBrush]
str w9, [x10, #12]
ldr x0, [x8, :lo12:buildBrush]
bl RemoveDuplicateBrushPlanes
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_4
.LBB0_2:
adrp x8, buildBrush
str x8, [sp, #8] // 8-byte Folded Spill
ldr x0, [x8, :lo12:buildBrush]
bl SetBrushContents
ldr x8, [sp, #8] // 8-byte Folded Reload
adrp x9, CONTENTS_DETAIL
ldr w10, [x9, :lo12:CONTENTS_DETAIL]
ldr x9, [x8, :lo12:buildBrush]
ldr w8, [x9, #8]
orr w8, w8, w10
str w8, [x9, #8]
bl FinishBrush
stur x0, [x29, #-40]
ldur x8, [x29, #-40]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
b .LBB0_4
.LBB0_4:
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size MakeBrushFromTriangle, .Lfunc_end0-MakeBrushFromTriangle
.cfi_endproc
// -- End function
.type MIN_WORLD_COORD,@object // @MIN_WORLD_COORD
.bss
.globl MIN_WORLD_COORD
.p2align 3, 0x0
MIN_WORLD_COORD:
.xword 0 // 0x0
.size MIN_WORLD_COORD, 8
.type buildBrush,@object // @buildBrush
.globl buildBrush
.p2align 3, 0x0
buildBrush:
.xword 0
.size buildBrush, 8
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type num_entities,@object // @num_entities
.globl num_entities
.p2align 3, 0x0
num_entities:
.xword 0 // 0x0
.size num_entities, 8
.type entitySourceBrushes,@object // @entitySourceBrushes
.globl entitySourceBrushes
.p2align 2, 0x0
entitySourceBrushes:
.word 0 // 0x0
.size entitySourceBrushes, 4
.type CONTENTS_DETAIL,@object // @CONTENTS_DETAIL
.globl CONTENTS_DETAIL
.p2align 2, 0x0
CONTENTS_DETAIL:
.word 0 // 0x0
.size CONTENTS_DETAIL, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorSet
.addrsig_sym AddBrushSide
.addrsig_sym RemoveDuplicateBrushPlanes
.addrsig_sym SetBrushContents
.addrsig_sym FinishBrush
.addrsig_sym MIN_WORLD_COORD
.addrsig_sym buildBrush
.addrsig_sym qfalse
.addrsig_sym num_entities
.addrsig_sym entitySourceBrushes
.addrsig_sym CONTENTS_DETAIL
|
../AnghaBench/Quake-III-Arena/q3map/extr_terrain.c_MakeBrushFromTriangle.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_7__ {int /*<<< orphan*/ headnode; } ;
typedef TYPE_1__ tree_t ;
struct TYPE_8__ {int /*<<< orphan*/ side; } ;
typedef TYPE_2__ mapDrawSurface_t ;
/* Variables and functions */
int FilterSideIntoTree_r (int /*<<< orphan*/ *,int /*<<< orphan*/ ,TYPE_2__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * WindingFromDrawSurf (TYPE_2__*) ;
int FilterFaceIntoTree( mapDrawSurface_t *ds, tree_t *tree ) {
int l;
winding_t *w;
w = WindingFromDrawSurf( ds );
l = FilterSideIntoTree_r( w, ds->side, ds, tree->headnode );
return l;
}
|
.text
.file "extr_surface.c_FilterFaceIntoTree.c"
.globl FilterFaceIntoTree // -- Begin function FilterFaceIntoTree
.p2align 2
.type FilterFaceIntoTree,@function
FilterFaceIntoTree: // @FilterFaceIntoTree
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur x0, [x29, #-8]
str x1, [sp, #16]
ldur x0, [x29, #-8]
bl WindingFromDrawSurf
str x0, [sp]
ldr x0, [sp]
ldur x8, [x29, #-8]
ldr w1, [x8]
ldur x2, [x29, #-8]
ldr x8, [sp, #16]
ldr w3, [x8]
bl FilterSideIntoTree_r
str w0, [sp, #12]
ldr w0, [sp, #12]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size FilterFaceIntoTree, .Lfunc_end0-FilterFaceIntoTree
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym WindingFromDrawSurf
.addrsig_sym FilterSideIntoTree_r
|
../AnghaBench/Quake-III-Arena/q3map/extr_surface.c_FilterFaceIntoTree.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
/* Variables and functions */
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (int /*<<< orphan*/ ,double,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
void SphereFromBounds( vec3_t mins, vec3_t maxs, vec3_t origin, float *radius ) {
vec3_t temp;
VectorAdd( mins, maxs, origin );
VectorScale( origin, 0.5, origin );
VectorSubtract( maxs, origin, temp );
*radius = VectorLength( temp );
}
|
.text
.file "extr_light_trace.c_SphereFromBounds.c"
.globl SphereFromBounds // -- Begin function SphereFromBounds
.p2align 2
.type SphereFromBounds,@function
SphereFromBounds: // @SphereFromBounds
.cfi_startproc
// %bb.0:
sub sp, sp, #48
.cfi_def_cfa_offset 48
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
stur w0, [x29, #-4]
stur w1, [x29, #-8]
stur w2, [x29, #-12]
str x3, [sp, #8]
ldur w0, [x29, #-4]
ldur w1, [x29, #-8]
ldur w2, [x29, #-12]
bl VectorAdd
ldur w0, [x29, #-12]
ldur w1, [x29, #-12]
fmov d0, #0.50000000
bl VectorScale
ldur w0, [x29, #-8]
ldur w1, [x29, #-12]
ldr w2, [sp, #4]
bl VectorSubtract
ldr w0, [sp, #4]
bl VectorLength
ldr x8, [sp, #8]
str s0, [x8]
.cfi_def_cfa wsp, 48
ldp x29, x30, [sp, #32] // 16-byte Folded Reload
add sp, sp, #48
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size SphereFromBounds, .Lfunc_end0-SphereFromBounds
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorAdd
.addrsig_sym VectorScale
.addrsig_sym VectorSubtract
.addrsig_sym VectorLength
|
../AnghaBench/Quake-III-Arena/q3map/extr_light_trace.c_SphereFromBounds.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_6__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_8__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_10__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_11__ {int cluster; } ;
/* Variables and functions */
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int /*<<< orphan*/ VS_LinkSurfaceIntoCluster (int,int) ;
int VS_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_6__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
void VS_R_LinkSurface(int nodenum, int surfaceNum, winding_t *w)
{
int leafnum, cluster, res;
dnode_t *node;
dplane_t *plane;
winding_t back;
plane_t split;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VS_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
memcpy(&back, w, sizeof(winding_t));
VS_R_LinkSurface(node->children[1], surfaceNum, &back);
nodenum = node->children[0];
}
else
{
VS_R_LinkSurface(node->children[1], surfaceNum, &back);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
cluster = dleafs[leafnum].cluster;
if (cluster != -1)
{
VS_LinkSurfaceIntoCluster(cluster, surfaceNum);
}
}
|
.text
.file "extr_soundv.c_VS_R_LinkSurface.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_R_LinkSurface
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VS_R_LinkSurface
.p2align 2
.type VS_R_LinkSurface,@function
VS_R_LinkSurface: // @VS_R_LinkSurface
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
stur w1, [x29, #-8]
stur x2, [x29, #-16]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-4]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_12
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w0, [x8, #4]
add x8, sp, #20
str x8, [sp, #8] // 8-byte Folded Spill
ldr w1, [sp, #24]
bl VectorCopy
ldr x2, [sp, #8] // 8-byte Folded Reload
ldr x8, [sp, #32]
ldr w8, [x8]
str w8, [sp, #20]
ldur x0, [x29, #-16]
add x1, sp, #28
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VS_SplitWinding
stur w0, [x29, #-28]
ldur w8, [x29, #-28]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-4]
b .LBB0_11
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-28]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-4]
b .LBB0_10
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-28]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur x1, [x29, #-16]
add x0, sp, #28
str x0, [sp] // 8-byte Folded Spill
mov w2, #4 // =0x4
bl memcpy
ldr x2, [sp] // 8-byte Folded Reload
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w0, [x8, #4]
ldur w1, [x29, #-8]
bl VS_R_LinkSurface
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w0, [x8, #4]
ldur w1, [x29, #-8]
add x2, sp, #28
bl VS_R_LinkSurface
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-4]
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_12:
ldur w9, [x29, #-4]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-20]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-20]
ldr w8, [x8, x9, lsl #2]
stur w8, [x29, #-24]
ldur w8, [x29, #-24]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13:
ldur w0, [x29, #-24]
ldur w1, [x29, #-8]
bl VS_LinkSurfaceIntoCluster
b .LBB0_14
.LBB0_14:
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_R_LinkSurface, .Lfunc_end0-VS_R_LinkSurface
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VS_R_LinkSurface
.addrsig_sym VectorCopy
.addrsig_sym VS_SplitWinding
.addrsig_sym memcpy
.addrsig_sym VS_LinkSurfaceIntoCluster
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_R_LinkSurface.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_12__ TYPE_4__ ;
typedef struct TYPE_11__ TYPE_3__ ;
typedef struct TYPE_10__ TYPE_2__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_9__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ plane_t ;
struct TYPE_10__ {int /*<<< orphan*/ normal; int /*<<< orphan*/ dist; } ;
typedef TYPE_2__ dplane_t ;
struct TYPE_11__ {size_t planeNum; int* children; } ;
typedef TYPE_3__ dnode_t ;
struct TYPE_12__ {int cluster; size_t firstLeafBrush; int /*<<< orphan*/ numLeafBrushes; } ;
typedef TYPE_4__ dleaf_t ;
/* Variables and functions */
scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int SIDE_BACK ;
int SIDE_FRONT ;
int SIDE_ON ;
int VL_SplitWinding (int /*<<< orphan*/ *,int /*<<< orphan*/ *,TYPE_1__*,double) ;
scalar_t__ VL_WindingAreaOutsideBrushes (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * dleafbrushes ;
TYPE_4__* dleafs ;
TYPE_3__* dnodes ;
TYPE_2__* dplanes ;
float VL_R_WindingAreaOutsideSolid(winding_t *w, vec3_t normal, int nodenum)
{
int leafnum, res;
float area;
dnode_t *node;
dleaf_t *leaf;
dplane_t *plane;
winding_t back;
plane_t split;
area = 0;
while(nodenum >= 0)
{
node = &dnodes[nodenum];
plane = &dplanes[node->planeNum];
VectorCopy(plane->normal, split.normal);
split.dist = plane->dist;
res = VL_SplitWinding (w, &back, &split, 0.1);
if (res == SIDE_FRONT)
{
nodenum = node->children[0];
}
else if (res == SIDE_BACK)
{
nodenum = node->children[1];
}
else if (res == SIDE_ON)
{
if (DotProduct(normal, plane->normal) > 0)
nodenum = node->children[0];
else
nodenum = node->children[1];
}
else
{
area += VL_R_WindingAreaOutsideSolid(&back, normal, node->children[1]);
nodenum = node->children[0];
}
}
leafnum = -nodenum - 1;
leaf = &dleafs[leafnum];
if (leaf->cluster != -1)
{
area += VL_WindingAreaOutsideBrushes(w, &dleafbrushes[leaf->firstLeafBrush], leaf->numLeafBrushes);
}
return area;
}
|
.text
.file "extr_lightv.c_VL_R_WindingAreaOutsideSolid.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VL_R_WindingAreaOutsideSolid
.LCPI0_0:
.xword 0x3fb999999999999a // double 0.10000000000000001
.text
.globl VL_R_WindingAreaOutsideSolid
.p2align 2
.type VL_R_WindingAreaOutsideSolid,@function
VL_R_WindingAreaOutsideSolid: // @VL_R_WindingAreaOutsideSolid
.cfi_startproc
// %bb.0:
sub sp, sp, #96
.cfi_def_cfa_offset 96
stp x29, x30, [sp, #80] // 16-byte Folded Spill
add x29, sp, #80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur w1, [x29, #-12]
stur w2, [x29, #-16]
movi d0, #0000000000000000
stur s0, [x29, #-28]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-16]
subs w8, w8, #0
cset w8, lt
tbnz w8, #0, .LBB0_15
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, dnodes
ldr x8, [x8, :lo12:dnodes]
ldursw x9, [x29, #-16]
add x8, x8, x9, lsl #4
str x8, [sp, #40]
adrp x8, dplanes
ldr x8, [x8, :lo12:dplanes]
ldr x9, [sp, #40]
ldr x9, [x9]
add x8, x8, x9, lsl #3
str x8, [sp, #24]
ldr x8, [sp, #24]
ldr w0, [x8]
add x8, sp, #12
str x8, [sp] // 8-byte Folded Spill
ldr w1, [sp, #16]
bl VectorCopy
ldr x2, [sp] // 8-byte Folded Reload
ldr x8, [sp, #24]
ldr w8, [x8, #4]
str w8, [sp, #12]
ldur x0, [x29, #-8]
add x1, sp, #20
adrp x8, .LCPI0_0
ldr d0, [x8, :lo12:.LCPI0_0]
bl VL_SplitWinding
stur w0, [x29, #-24]
ldur w8, [x29, #-24]
adrp x9, SIDE_FRONT
ldr w9, [x9, :lo12:SIDE_FRONT]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-16]
b .LBB0_14
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-24]
adrp x9, SIDE_BACK
ldr w9, [x9, :lo12:SIDE_BACK]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-16]
b .LBB0_13
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-24]
adrp x9, SIDE_ON
ldr w9, [x9, :lo12:SIDE_ON]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldur w0, [x29, #-12]
ldr x8, [sp, #24]
ldr w1, [x8]
bl DotProduct
subs x8, x0, #0
cset w8, le
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-16]
b .LBB0_10
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8, #4]
stur w8, [x29, #-16]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
b .LBB0_12
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
ldur w1, [x29, #-12]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w2, [x8, #4]
add x0, sp, #20
bl VL_R_WindingAreaOutsideSolid
fmov s1, s0
ldur s0, [x29, #-28]
fadd s0, s0, s1
stur s0, [x29, #-28]
ldr x8, [sp, #40]
ldr x8, [x8, #8]
ldr w8, [x8]
stur w8, [x29, #-16]
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_1 Depth=1
b .LBB0_1
.LBB0_15:
ldur w9, [x29, #-16]
mov w8, wzr
subs w8, w8, w9
subs w8, w8, #1
stur w8, [x29, #-20]
adrp x8, dleafs
ldr x8, [x8, :lo12:dleafs]
ldursw x9, [x29, #-20]
mov x10, #24 // =0x18
mul x9, x9, x10
add x8, x8, x9
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr w8, [x8]
adds w8, w8, #1
cset w8, eq
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16:
ldur x0, [x29, #-8]
adrp x8, dleafbrushes
ldr x8, [x8, :lo12:dleafbrushes]
ldr x9, [sp, #32]
ldr x9, [x9, #8]
add x1, x8, x9, lsl #2
ldr x8, [sp, #32]
ldr w2, [x8, #16]
bl VL_WindingAreaOutsideBrushes
scvtf s1, x0
ldur s0, [x29, #-28]
fadd s0, s0, s1
stur s0, [x29, #-28]
b .LBB0_17
.LBB0_17:
ldur s0, [x29, #-28]
.cfi_def_cfa wsp, 96
ldp x29, x30, [sp, #80] // 16-byte Folded Reload
add sp, sp, #96
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VL_R_WindingAreaOutsideSolid, .Lfunc_end0-VL_R_WindingAreaOutsideSolid
.cfi_endproc
// -- End function
.type dnodes,@object // @dnodes
.bss
.globl dnodes
.p2align 3, 0x0
dnodes:
.xword 0
.size dnodes, 8
.type dplanes,@object // @dplanes
.globl dplanes
.p2align 3, 0x0
dplanes:
.xword 0
.size dplanes, 8
.type SIDE_FRONT,@object // @SIDE_FRONT
.globl SIDE_FRONT
.p2align 2, 0x0
SIDE_FRONT:
.word 0 // 0x0
.size SIDE_FRONT, 4
.type SIDE_BACK,@object // @SIDE_BACK
.globl SIDE_BACK
.p2align 2, 0x0
SIDE_BACK:
.word 0 // 0x0
.size SIDE_BACK, 4
.type SIDE_ON,@object // @SIDE_ON
.globl SIDE_ON
.p2align 2, 0x0
SIDE_ON:
.word 0 // 0x0
.size SIDE_ON, 4
.type dleafs,@object // @dleafs
.globl dleafs
.p2align 3, 0x0
dleafs:
.xword 0
.size dleafs, 8
.type dleafbrushes,@object // @dleafbrushes
.globl dleafbrushes
.p2align 3, 0x0
dleafbrushes:
.xword 0
.size dleafbrushes, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VL_R_WindingAreaOutsideSolid
.addrsig_sym VectorCopy
.addrsig_sym VL_SplitWinding
.addrsig_sym DotProduct
.addrsig_sym VL_WindingAreaOutsideBrushes
.addrsig_sym dnodes
.addrsig_sym dplanes
.addrsig_sym SIDE_FRONT
.addrsig_sym SIDE_BACK
.addrsig_sym SIDE_ON
.addrsig_sym dleafs
.addrsig_sym dleafbrushes
|
../AnghaBench/Quake-III-Arena/q3map/extr_lightv.c_VL_R_WindingAreaOutsideSolid.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ bspbrush_t ;
struct TYPE_5__ {int* portalareas; int contents; int /*<<< orphan*/ brushnum; scalar_t__ entitynum; } ;
/* Variables and functions */
int CONTENTS_DETAIL ;
int CONTENTS_LAVA ;
int CONTENTS_SLIME ;
int CONTENTS_WATER ;
int /*<<< orphan*/ * FinishBrush () ;
int /*<<< orphan*/ FreeBrush (TYPE_1__*) ;
int /*<<< orphan*/ ParseRawBrush () ;
int /*<<< orphan*/ RemoveDuplicateBrushPlanes (TYPE_1__*) ;
int /*<<< orphan*/ SetBrushContents (TYPE_1__*) ;
TYPE_1__* buildBrush ;
int /*<<< orphan*/ entitySourceBrushes ;
scalar_t__ nodetail ;
scalar_t__ nowater ;
scalar_t__ num_entities ;
void ParseBrush (void) {
bspbrush_t *b;
ParseRawBrush();
buildBrush->portalareas[0] = -1;
buildBrush->portalareas[1] = -1;
buildBrush->entitynum = num_entities-1;
buildBrush->brushnum = entitySourceBrushes;
// if there are mirrored planes, the entire brush is invalid
if ( !RemoveDuplicateBrushPlanes( buildBrush ) ) {
return;
}
// get the content for the entire brush
SetBrushContents( buildBrush );
// allow detail brushes to be removed
if (nodetail && (buildBrush->contents & CONTENTS_DETAIL) ) {
FreeBrush( buildBrush );
return;
}
// allow water brushes to be removed
if (nowater && (buildBrush->contents & (CONTENTS_LAVA | CONTENTS_SLIME | CONTENTS_WATER)) ) {
FreeBrush( buildBrush );
return;
}
b = FinishBrush( );
if ( !b ) {
return;
}
}
|
.text
.file "extr_map.c_ParseBrush.c"
.globl ParseBrush // -- Begin function ParseBrush
.p2align 2
.type ParseBrush,@function
ParseBrush: // @ParseBrush
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
bl ParseRawBrush
adrp x8, buildBrush
ldr x9, [x8, :lo12:buildBrush]
ldr x10, [x9]
mov w9, #-1 // =0xffffffff
str w9, [x10]
ldr x10, [x8, :lo12:buildBrush]
ldr x10, [x10]
str w9, [x10, #4]
adrp x9, num_entities
ldr x9, [x9, :lo12:num_entities]
subs x9, x9, #1
ldr x10, [x8, :lo12:buildBrush]
str x9, [x10, #16]
adrp x9, entitySourceBrushes
ldr w9, [x9, :lo12:entitySourceBrushes]
ldr x10, [x8, :lo12:buildBrush]
str w9, [x10, #12]
ldr x0, [x8, :lo12:buildBrush]
bl RemoveDuplicateBrushPlanes
subs w8, w0, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_10
.LBB0_2:
adrp x8, buildBrush
ldr x0, [x8, :lo12:buildBrush]
bl SetBrushContents
adrp x8, nodetail
ldr x8, [x8, :lo12:nodetail]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_5
b .LBB0_3
.LBB0_3:
adrp x8, buildBrush
ldr x8, [x8, :lo12:buildBrush]
ldr w8, [x8, #8]
adrp x9, CONTENTS_DETAIL
ldr w9, [x9, :lo12:CONTENTS_DETAIL]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_5
b .LBB0_4
.LBB0_4:
adrp x8, buildBrush
ldr x0, [x8, :lo12:buildBrush]
bl FreeBrush
b .LBB0_10
.LBB0_5:
adrp x8, nowater
ldr x8, [x8, :lo12:nowater]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_6
.LBB0_6:
adrp x8, buildBrush
ldr x8, [x8, :lo12:buildBrush]
ldr w8, [x8, #8]
adrp x9, CONTENTS_LAVA
ldr w9, [x9, :lo12:CONTENTS_LAVA]
adrp x10, CONTENTS_SLIME
ldr w10, [x10, :lo12:CONTENTS_SLIME]
orr w9, w9, w10
adrp x10, CONTENTS_WATER
ldr w10, [x10, :lo12:CONTENTS_WATER]
orr w9, w9, w10
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7:
adrp x8, buildBrush
ldr x0, [x8, :lo12:buildBrush]
bl FreeBrush
b .LBB0_10
.LBB0_8:
bl FinishBrush
str x0, [sp, #8]
ldr x8, [sp, #8]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9:
b .LBB0_10
.LBB0_10:
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size ParseBrush, .Lfunc_end0-ParseBrush
.cfi_endproc
// -- End function
.type buildBrush,@object // @buildBrush
.bss
.globl buildBrush
.p2align 3, 0x0
buildBrush:
.xword 0
.size buildBrush, 8
.type num_entities,@object // @num_entities
.globl num_entities
.p2align 3, 0x0
num_entities:
.xword 0 // 0x0
.size num_entities, 8
.type entitySourceBrushes,@object // @entitySourceBrushes
.globl entitySourceBrushes
.p2align 2, 0x0
entitySourceBrushes:
.word 0 // 0x0
.size entitySourceBrushes, 4
.type nodetail,@object // @nodetail
.globl nodetail
.p2align 3, 0x0
nodetail:
.xword 0 // 0x0
.size nodetail, 8
.type CONTENTS_DETAIL,@object // @CONTENTS_DETAIL
.globl CONTENTS_DETAIL
.p2align 2, 0x0
CONTENTS_DETAIL:
.word 0 // 0x0
.size CONTENTS_DETAIL, 4
.type nowater,@object // @nowater
.globl nowater
.p2align 3, 0x0
nowater:
.xword 0 // 0x0
.size nowater, 8
.type CONTENTS_LAVA,@object // @CONTENTS_LAVA
.globl CONTENTS_LAVA
.p2align 2, 0x0
CONTENTS_LAVA:
.word 0 // 0x0
.size CONTENTS_LAVA, 4
.type CONTENTS_SLIME,@object // @CONTENTS_SLIME
.globl CONTENTS_SLIME
.p2align 2, 0x0
CONTENTS_SLIME:
.word 0 // 0x0
.size CONTENTS_SLIME, 4
.type CONTENTS_WATER,@object // @CONTENTS_WATER
.globl CONTENTS_WATER
.p2align 2, 0x0
CONTENTS_WATER:
.word 0 // 0x0
.size CONTENTS_WATER, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym ParseRawBrush
.addrsig_sym RemoveDuplicateBrushPlanes
.addrsig_sym SetBrushContents
.addrsig_sym FreeBrush
.addrsig_sym FinishBrush
.addrsig_sym buildBrush
.addrsig_sym num_entities
.addrsig_sym entitySourceBrushes
.addrsig_sym nodetail
.addrsig_sym CONTENTS_DETAIL
.addrsig_sym nowater
.addrsig_sym CONTENTS_LAVA
.addrsig_sym CONTENTS_SLIME
.addrsig_sym CONTENTS_WATER
|
../AnghaBench/Quake-III-Arena/q3map/extr_map.c_ParseBrush.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int numpoints; int /*<<< orphan*/ ** p; } ;
typedef TYPE_1__ winding_t ;
typedef int /*<<< orphan*/ * vec3_t ;
typedef scalar_t__ qboolean ;
/* Variables and functions */
int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
float DotProduct (int /*<<< orphan*/ * const,int /*<<< orphan*/ *) ;
int MAX_POINTS_ON_WINDING ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
double VectorNormalize (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ *,int /*<<< orphan*/ * const,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ _printf (char*,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float acos (float) ;
scalar_t__ qtrue ;
float PointToPolygonFormFactor( const vec3_t point, const vec3_t normal, const winding_t *w ) {
vec3_t triVector, triNormal;
int i, j;
vec3_t dirs[MAX_POINTS_ON_WINDING];
float total;
float dot, angle, facing;
for ( i = 0 ; i < w->numpoints ; i++ ) {
VectorSubtract( w->p[i], point, dirs[i] );
VectorNormalize( dirs[i], dirs[i] );
}
// duplicate first vertex to avoid mod operation
VectorCopy( dirs[0], dirs[i] );
total = 0;
for ( i = 0 ; i < w->numpoints ; i++ ) {
j = i+1;
dot = DotProduct( dirs[i], dirs[j] );
// roundoff can cause slight creep, which gives an IND from acos
if ( dot > 1.0 ) {
dot = 1.0;
} else if ( dot < -1.0 ) {
dot = -1.0;
}
angle = acos( dot );
CrossProduct( dirs[i], dirs[j], triVector );
if ( VectorNormalize( triVector, triNormal ) < 0.0001 ) {
continue;
}
facing = DotProduct( normal, triNormal );
total += facing * angle;
if ( total > 6.3 || total < -6.3 ) {
static qboolean printed;
if ( !printed ) {
printed = qtrue;
_printf( "WARNING: bad PointToPolygonFormFactor: %f at %1.1f %1.1f %1.1f from %1.1f %1.1f %1.1f\n", total,
w->p[i][0], w->p[i][1], w->p[i][2], point[0], point[1], point[2]);
}
return 0;
}
}
total /= 2*3.141592657; // now in the range of 0 to 1 over the entire incoming hemisphere
return total;
}
|
.text
.file "extr_light.c_PointToPolygonFormFactor.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function PointToPolygonFormFactor
.LCPI0_0:
.xword 0xc019333333333333 // double -6.2999999999999998
.LCPI0_1:
.xword 0x4019333333333333 // double 6.2999999999999998
.LCPI0_2:
.xword 0x3f1a36e2eb1c432d // double 1.0E-4
.LCPI0_3:
.xword 0x401921fb54b95997 // double 6.2831853139999998
.text
.globl PointToPolygonFormFactor
.p2align 2
.type PointToPolygonFormFactor,@function
PointToPolygonFormFactor: // @PointToPolygonFormFactor
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub sp, sp, #112
stur x0, [x29, #-16]
stur x1, [x29, #-24]
stur x2, [x29, #-32]
adrp x8, MAX_POINTS_ON_WINDING
ldr w8, [x8, :lo12:MAX_POINTS_ON_WINDING]
// kill: def $x8 killed $w8
mov x9, sp
stur x9, [x29, #-64]
lsl x9, x8, #3
add x9, x9, #15
and x10, x9, #0xfffffffffffffff0
mov x9, sp
subs x9, x9, x10
mov sp, x9
stur x9, [x29, #-104] // 8-byte Folded Spill
stur x8, [x29, #-72]
stur wzr, [x29, #-52]
b .LBB0_1
.LBB0_1: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-52]
ldur x9, [x29, #-32]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_4
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-104] // 8-byte Folded Reload
ldur x9, [x29, #-32]
ldr x9, [x9, #8]
ldursw x10, [x29, #-52]
ldr x0, [x9, x10, lsl #3]
ldur x1, [x29, #-16]
ldursw x9, [x29, #-52]
ldr x2, [x8, x9, lsl #3]
bl VectorSubtract
ldur x8, [x29, #-104] // 8-byte Folded Reload
ldursw x9, [x29, #-52]
ldr x0, [x8, x9, lsl #3]
ldursw x9, [x29, #-52]
ldr x1, [x8, x9, lsl #3]
bl VectorNormalize
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-52]
add w8, w8, #1
stur w8, [x29, #-52]
b .LBB0_1
.LBB0_4:
ldur x8, [x29, #-104] // 8-byte Folded Reload
ldr x0, [x8]
ldursw x9, [x29, #-52]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
movi d0, #0000000000000000
stur s0, [x29, #-76]
stur wzr, [x29, #-52]
b .LBB0_5
.LBB0_5: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-52]
ldur x9, [x29, #-32]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_20
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=1
ldur x8, [x29, #-104] // 8-byte Folded Reload
ldur w9, [x29, #-52]
add w9, w9, #1
stur w9, [x29, #-56]
ldursw x9, [x29, #-52]
ldr x0, [x8, x9, lsl #3]
ldursw x9, [x29, #-56]
ldr x1, [x8, x9, lsl #3]
bl DotProduct
stur s0, [x29, #-80]
ldur s0, [x29, #-80]
fcvt d0, s0
fmov d1, #1.00000000
fcmp d0, d1
cset w8, le
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=1
fmov s0, #1.00000000
stur s0, [x29, #-80]
b .LBB0_11
.LBB0_8: // in Loop: Header=BB0_5 Depth=1
ldur s0, [x29, #-80]
fcvt d0, s0
fmov d1, #-1.00000000
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_5 Depth=1
fmov s0, #-1.00000000
stur s0, [x29, #-80]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_5 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_5 Depth=1
ldur s0, [x29, #-80]
bl acos
ldur x8, [x29, #-104] // 8-byte Folded Reload
stur s0, [x29, #-84]
ldursw x9, [x29, #-52]
ldr x0, [x8, x9, lsl #3]
ldursw x9, [x29, #-56]
ldr x1, [x8, x9, lsl #3]
ldur x2, [x29, #-40]
bl CrossProduct
ldur x0, [x29, #-40]
ldur x1, [x29, #-48]
bl VectorNormalize
adrp x8, .LCPI0_2
ldr d1, [x8, :lo12:.LCPI0_2]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_5 Depth=1
b .LBB0_19
.LBB0_13: // in Loop: Header=BB0_5 Depth=1
ldur x0, [x29, #-24]
ldur x1, [x29, #-48]
bl DotProduct
stur s0, [x29, #-88]
ldur s0, [x29, #-88]
ldur s1, [x29, #-84]
ldur s2, [x29, #-76]
fmadd s0, s0, s1, s2
stur s0, [x29, #-76]
ldur s0, [x29, #-76]
fcvt d0, s0
adrp x8, .LCPI0_1
ldr d1, [x8, :lo12:.LCPI0_1]
fcmp d0, d1
cset w8, gt
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_5 Depth=1
ldur s0, [x29, #-76]
fcvt d0, s0
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fcmp d0, d1
cset w8, pl
tbnz w8, #0, .LBB0_18
b .LBB0_15
.LBB0_15:
adrp x8, PointToPolygonFormFactor.printed
ldr x8, [x8, :lo12:PointToPolygonFormFactor.printed]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
adrp x9, PointToPolygonFormFactor.printed
str x8, [x9, :lo12:PointToPolygonFormFactor.printed]
ldur s0, [x29, #-76]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldursw x9, [x29, #-52]
ldr x8, [x8, x9, lsl #3]
ldr w1, [x8]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldursw x9, [x29, #-52]
ldr x8, [x8, x9, lsl #3]
ldr w2, [x8, #4]
ldur x8, [x29, #-32]
ldr x8, [x8, #8]
ldursw x9, [x29, #-52]
ldr x8, [x8, x9, lsl #3]
ldr w3, [x8, #8]
ldur x8, [x29, #-16]
ldr w4, [x8]
ldur x8, [x29, #-16]
ldr w5, [x8, #4]
ldur x8, [x29, #-16]
ldr w6, [x8, #8]
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl _printf
b .LBB0_17
.LBB0_17:
movi d0, #0000000000000000
stur s0, [x29, #-4]
mov w8, #1 // =0x1
stur w8, [x29, #-92]
b .LBB0_21
.LBB0_18: // in Loop: Header=BB0_5 Depth=1
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_5 Depth=1
ldur w8, [x29, #-52]
add w8, w8, #1
stur w8, [x29, #-52]
b .LBB0_5
.LBB0_20:
ldur s0, [x29, #-76]
fcvt d0, s0
adrp x8, .LCPI0_3
ldr d1, [x8, :lo12:.LCPI0_3]
fdiv d0, d0, d1
fcvt s0, d0
stur s0, [x29, #-76]
ldur s0, [x29, #-76]
stur s0, [x29, #-4]
mov w8, #1 // =0x1
stur w8, [x29, #-92]
b .LBB0_21
.LBB0_21:
ldur x8, [x29, #-64]
mov sp, x8
ldur s0, [x29, #-4]
mov sp, x29
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size PointToPolygonFormFactor, .Lfunc_end0-PointToPolygonFormFactor
.cfi_endproc
// -- End function
.type MAX_POINTS_ON_WINDING,@object // @MAX_POINTS_ON_WINDING
.bss
.globl MAX_POINTS_ON_WINDING
.p2align 2, 0x0
MAX_POINTS_ON_WINDING:
.word 0 // 0x0
.size MAX_POINTS_ON_WINDING, 4
.type PointToPolygonFormFactor.printed,@object // @PointToPolygonFormFactor.printed
.local PointToPolygonFormFactor.printed
.comm PointToPolygonFormFactor.printed,8,8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0 // 0x0
.size qtrue, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "WARNING: bad PointToPolygonFormFactor: %f at %1.1f %1.1f %1.1f from %1.1f %1.1f %1.1f\n"
.size .L.str, 87
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorSubtract
.addrsig_sym VectorNormalize
.addrsig_sym VectorCopy
.addrsig_sym DotProduct
.addrsig_sym acos
.addrsig_sym CrossProduct
.addrsig_sym _printf
.addrsig_sym MAX_POINTS_ON_WINDING
.addrsig_sym PointToPolygonFormFactor.printed
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_light.c_PointToPolygonFormFactor.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_20__ TYPE_7__ ;
typedef struct TYPE_19__ TYPE_6__ ;
typedef struct TYPE_18__ TYPE_5__ ;
typedef struct TYPE_17__ TYPE_4__ ;
typedef struct TYPE_16__ TYPE_3__ ;
typedef struct TYPE_15__ TYPE_2__ ;
typedef struct TYPE_14__ TYPE_1__ ;
typedef struct TYPE_13__ TYPE_10__ ;
/* Type definitions */
struct TYPE_17__ {double photons; int /*<<< orphan*/ type; int /*<<< orphan*/ color; int /*<<< orphan*/ origin; } ;
typedef TYPE_4__ vsound_t ;
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ shaderInfo_t ;
struct TYPE_18__ {int width; TYPE_1__* verts; } ;
typedef TYPE_5__ mesh_t ;
struct TYPE_19__ {int /*<<< orphan*/ mutex; TYPE_3__* facets; TYPE_5__* detailMesh; } ;
typedef TYPE_6__ lsurfaceTest_t ;
struct TYPE_20__ {int lightmapNum; scalar_t__ surfaceType; size_t shaderNum; int lightmapWidth; int lightmapHeight; int lightmapY; int lightmapX; int /*<<< orphan*/ * lightmapVecs; int /*<<< orphan*/ lightmapOrigin; } ;
typedef TYPE_7__ dsurface_t ;
struct TYPE_15__ {int /*<<< orphan*/ normal; } ;
struct TYPE_16__ {TYPE_2__ plane; } ;
struct TYPE_14__ {int /*<<< orphan*/ normal; int /*<<< orphan*/ xyz; } ;
struct TYPE_13__ {int /*<<< orphan*/ shader; } ;
/* Variables and functions */
int /*<<< orphan*/ ColorNormalize (float*,int /*<<< orphan*/ ) ;
int LIGHTMAP_HEIGHT ;
int LIGHTMAP_WIDTH ;
int /*<<< orphan*/ LIGHT_POINTRADIAL ;
scalar_t__ MST_PATCH ;
scalar_t__ MST_TRIANGLE_SOUP ;
int /*<<< orphan*/ MutexLock (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MutexUnlock (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ * ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VS_FloodLight (TYPE_4__*) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
double VectorLength (float*) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_7__* drawSurfaces ;
TYPE_10__* dshaders ;
float* lightFloats ;
double lightPointScale ;
float* lightmappixelarea ;
TYPE_6__** lsurfaceTest ;
int /*<<< orphan*/ memset (TYPE_4__*,int /*<<< orphan*/ ,int) ;
float* oldLightFloats ;
float radiosity_scale ;
void VS_SurfaceRadiosity( int num ) {
dsurface_t *ds;
mesh_t *mesh;
shaderInfo_t *si;
lsurfaceTest_t *test;
int x, y, k;
vec3_t base, normal;
float *color, area;
vsound_t vsound;
ds = &drawSurfaces[num];
if ( ds->lightmapNum < 0 ) {
return; // doesn't have a lightmap
}
// vertex-lit triangle model
if ( ds->surfaceType == MST_TRIANGLE_SOUP ) {
return;
}
si = ShaderInfoForShader( dshaders[ ds->shaderNum].shader );
test = lsurfaceTest[ num ];
if (!test) {
return;
}
for (x = 0; x < ds->lightmapWidth; x++) {
for (y = 0; y < ds->lightmapHeight; y++) {
//
k = ( ds->lightmapNum * LIGHTMAP_HEIGHT + ds->lightmapY + y)
* LIGHTMAP_WIDTH + ds->lightmapX + x;
area = lightmappixelarea[k];
if (area <= 0)
continue;
//
if (ds->surfaceType == MST_PATCH)
{
mesh = test->detailMesh;
VectorCopy( mesh->verts[y*mesh->width+x].xyz, base);
VectorCopy( mesh->verts[y*mesh->width+x].normal, normal);
}
else
{
VectorMA(ds->lightmapOrigin, (float) x, ds->lightmapVecs[0], base);
VectorMA(base, (float) y, ds->lightmapVecs[1], base);
VectorCopy(test->facets[0].plane.normal, normal);
}
// create ligth from base
memset(&vsound, 0, sizeof(vsound_t));
color = &oldLightFloats[k*3];
// a few units away from the surface
VectorMA(base, 5, normal, vsound.origin);
ColorNormalize(color, vsound.color);
// ok this is crap
vsound.photons = VectorLength(color) * 0.05 * lightPointScale / (area * radiosity_scale);
// what about using a front facing light only ?
vsound.type = LIGHT_POINTRADIAL;
// flood the light from this lightmap pixel
VS_FloodLight(&vsound);
// only one thread at a time may write to the lightmap of this surface
MutexLock(test->mutex);
// don't light the lightmap pixel itself
lightFloats[k*3] = oldLightFloats[k*3];
lightFloats[k*3+1] = oldLightFloats[k*3+1];
lightFloats[k*3+2] = oldLightFloats[k*3+2];
//
MutexUnlock(test->mutex);
}
}
}
|
.text
.file "extr_soundv.c_VS_SurfaceRadiosity.c"
.section .rodata.cst8,"aM",@progbits,8
.p2align 3, 0x0 // -- Begin function VS_SurfaceRadiosity
.LCPI0_0:
.xword 0x3fa999999999999a // double 0.050000000000000003
.text
.globl VS_SurfaceRadiosity
.p2align 2
.type VS_SurfaceRadiosity,@function
VS_SurfaceRadiosity: // @VS_SurfaceRadiosity
.cfi_startproc
// %bb.0:
sub sp, sp, #144
.cfi_def_cfa_offset 144
stp x29, x30, [sp, #128] // 16-byte Folded Spill
add x29, sp, #128
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur w0, [x29, #-4]
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldursw x9, [x29, #-4]
mov x10, #56 // =0x38
mul x9, x9, x10
add x8, x8, x9
stur x8, [x29, #-16]
ldur x8, [x29, #-16]
ldr w8, [x8]
subs w8, w8, #0
cset w8, ge
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_19
.LBB0_2:
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
adrp x9, MST_TRIANGLE_SOUP
ldr x9, [x9, :lo12:MST_TRIANGLE_SOUP]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
b .LBB0_19
.LBB0_4:
adrp x8, dshaders
ldr x8, [x8, :lo12:dshaders]
ldur x9, [x29, #-16]
ldr x9, [x9, #16]
ldr w0, [x8, x9, lsl #2]
bl ShaderInfoForShader
stur x0, [x29, #-32]
adrp x8, lsurfaceTest
ldr x8, [x8, :lo12:lsurfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
stur x8, [x29, #-40]
ldur x8, [x29, #-40]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
b .LBB0_19
.LBB0_6:
stur wzr, [x29, #-44]
b .LBB0_7
.LBB0_7: // =>This Loop Header: Depth=1
// Child Loop BB0_9 Depth 2
ldur w8, [x29, #-44]
ldur x9, [x29, #-16]
ldr w9, [x9, #24]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_19
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_7 Depth=1
stur wzr, [x29, #-48]
b .LBB0_9
.LBB0_9: // Parent Loop BB0_7 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-48]
ldur x9, [x29, #-16]
ldr w9, [x9, #28]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_17
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_9 Depth=2
ldur x8, [x29, #-16]
ldr w8, [x8]
adrp x9, LIGHTMAP_HEIGHT
ldr w9, [x9, :lo12:LIGHTMAP_HEIGHT]
mul w8, w8, w9
ldur x9, [x29, #-16]
ldr w9, [x9, #32]
add w8, w8, w9
ldur w9, [x29, #-48]
add w8, w8, w9
adrp x9, LIGHTMAP_WIDTH
ldr w9, [x9, :lo12:LIGHTMAP_WIDTH]
mul w8, w8, w9
ldur x9, [x29, #-16]
ldr w9, [x9, #36]
add w8, w8, w9
ldur w9, [x29, #-44]
add w8, w8, w9
stur w8, [x29, #-52]
adrp x8, lightmappixelarea
ldr x8, [x8, :lo12:lightmappixelarea]
ldursw x9, [x29, #-52]
ldr s0, [x8, x9, lsl #2]
str s0, [sp, #52]
ldr s0, [sp, #52]
fcmp s0, #0.0
cset w8, hi
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_9 Depth=2
b .LBB0_16
.LBB0_12: // in Loop: Header=BB0_9 Depth=2
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
adrp x9, MST_PATCH
ldr x9, [x9, :lo12:MST_PATCH]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_9 Depth=2
ldur x8, [x29, #-40]
ldr x8, [x8, #16]
stur x8, [x29, #-24]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldur w9, [x29, #-48]
ldur x10, [x29, #-24]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-44]
add w9, w9, w10
add x8, x8, w9, sxtw #3
ldr w0, [x8, #4]
ldur w1, [x29, #-56]
bl VectorCopy
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldur w9, [x29, #-48]
ldur x10, [x29, #-24]
ldr w10, [x10]
mul w9, w9, w10
ldur w10, [x29, #-44]
add w10, w9, w10
// implicit-def: $x9
mov w9, w10
sxtw x9, w9
lsl x9, x9, #3
ldr w0, [x8, x9]
ldur w1, [x29, #-60]
bl VectorCopy
b .LBB0_15
.LBB0_14: // in Loop: Header=BB0_9 Depth=2
ldur x8, [x29, #-16]
ldr w0, [x8, #48]
ldur s0, [x29, #-44]
scvtf s0, s0
fcvtzs w1, s0
ldur x8, [x29, #-16]
ldr x8, [x8, #40]
ldr w2, [x8]
ldur w3, [x29, #-56]
bl VectorMA
ldur w0, [x29, #-56]
ldur s0, [x29, #-48]
scvtf s0, s0
fcvtzs w1, s0
ldur x8, [x29, #-16]
ldr x8, [x8, #40]
ldr w2, [x8, #4]
ldur w3, [x29, #-56]
bl VectorMA
ldur x8, [x29, #-40]
ldr x8, [x8, #8]
ldr w0, [x8]
ldur w1, [x29, #-60]
bl VectorCopy
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_9 Depth=2
add x0, sp, #24
str x0, [sp] // 8-byte Folded Spill
mov w1, wzr
mov w2, #24 // =0x18
bl memset
adrp x8, oldLightFloats
str x8, [sp, #8] // 8-byte Folded Spill
ldr x8, [x8, :lo12:oldLightFloats]
ldur w9, [x29, #-52]
mov w10, #3 // =0x3
str w10, [sp, #20] // 4-byte Folded Spill
mul w9, w9, w10
add x8, x8, w9, sxtw #2
str x8, [sp, #56]
ldur w0, [x29, #-56]
ldur w2, [x29, #-60]
ldr w3, [sp, #40]
mov w1, #5 // =0x5
bl VectorMA
ldr x0, [sp, #56]
ldr w1, [sp, #36]
bl ColorNormalize
ldr x0, [sp, #56]
bl VectorLength
ldr x0, [sp] // 8-byte Folded Reload
adrp x8, .LCPI0_0
ldr d1, [x8, :lo12:.LCPI0_0]
fmul d0, d0, d1
adrp x8, lightPointScale
ldr d1, [x8, :lo12:lightPointScale]
fmul d0, d0, d1
ldr s1, [sp, #52]
adrp x8, radiosity_scale
ldr s2, [x8, :lo12:radiosity_scale]
fmul s1, s1, s2
fcvt d1, s1
fdiv d0, d0, d1
str d0, [sp, #24]
adrp x8, LIGHT_POINTRADIAL
ldr w8, [x8, :lo12:LIGHT_POINTRADIAL]
str w8, [sp, #32]
bl VS_FloodLight
ldur x8, [x29, #-40]
ldr w0, [x8]
bl MutexLock
ldr x9, [sp, #8] // 8-byte Folded Reload
ldr w10, [sp, #20] // 4-byte Folded Reload
ldr x8, [x9, :lo12:oldLightFloats]
ldur w11, [x29, #-52]
mul w11, w11, w10
ldr s0, [x8, w11, sxtw #2]
adrp x8, lightFloats
ldr x11, [x8, :lo12:lightFloats]
ldur w12, [x29, #-52]
mul w12, w12, w10
str s0, [x11, w12, sxtw #2]
ldr x11, [x9, :lo12:oldLightFloats]
ldur w12, [x29, #-52]
mul w12, w12, w10
add w12, w12, #1
ldr s0, [x11, w12, sxtw #2]
ldr x11, [x8, :lo12:lightFloats]
ldur w12, [x29, #-52]
mul w12, w12, w10
add w12, w12, #1
str s0, [x11, w12, sxtw #2]
ldr x9, [x9, :lo12:oldLightFloats]
ldur w11, [x29, #-52]
mul w11, w11, w10
add w11, w11, #2
ldr s0, [x9, w11, sxtw #2]
ldr x8, [x8, :lo12:lightFloats]
ldur w9, [x29, #-52]
mul w9, w9, w10
add w9, w9, #2
str s0, [x8, w9, sxtw #2]
ldur x8, [x29, #-40]
ldr w0, [x8]
bl MutexUnlock
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_9 Depth=2
ldur w8, [x29, #-48]
add w8, w8, #1
stur w8, [x29, #-48]
b .LBB0_9
.LBB0_17: // in Loop: Header=BB0_7 Depth=1
b .LBB0_18
.LBB0_18: // in Loop: Header=BB0_7 Depth=1
ldur w8, [x29, #-44]
add w8, w8, #1
stur w8, [x29, #-44]
b .LBB0_7
.LBB0_19:
.cfi_def_cfa wsp, 144
ldp x29, x30, [sp, #128] // 16-byte Folded Reload
add sp, sp, #144
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_SurfaceRadiosity, .Lfunc_end0-VS_SurfaceRadiosity
.cfi_endproc
// -- End function
.type drawSurfaces,@object // @drawSurfaces
.bss
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type MST_TRIANGLE_SOUP,@object // @MST_TRIANGLE_SOUP
.globl MST_TRIANGLE_SOUP
.p2align 3, 0x0
MST_TRIANGLE_SOUP:
.xword 0 // 0x0
.size MST_TRIANGLE_SOUP, 8
.type dshaders,@object // @dshaders
.globl dshaders
.p2align 3, 0x0
dshaders:
.xword 0
.size dshaders, 8
.type lsurfaceTest,@object // @lsurfaceTest
.globl lsurfaceTest
.p2align 3, 0x0
lsurfaceTest:
.xword 0
.size lsurfaceTest, 8
.type LIGHTMAP_HEIGHT,@object // @LIGHTMAP_HEIGHT
.globl LIGHTMAP_HEIGHT
.p2align 2, 0x0
LIGHTMAP_HEIGHT:
.word 0 // 0x0
.size LIGHTMAP_HEIGHT, 4
.type LIGHTMAP_WIDTH,@object // @LIGHTMAP_WIDTH
.globl LIGHTMAP_WIDTH
.p2align 2, 0x0
LIGHTMAP_WIDTH:
.word 0 // 0x0
.size LIGHTMAP_WIDTH, 4
.type lightmappixelarea,@object // @lightmappixelarea
.globl lightmappixelarea
.p2align 3, 0x0
lightmappixelarea:
.xword 0
.size lightmappixelarea, 8
.type MST_PATCH,@object // @MST_PATCH
.globl MST_PATCH
.p2align 3, 0x0
MST_PATCH:
.xword 0 // 0x0
.size MST_PATCH, 8
.type oldLightFloats,@object // @oldLightFloats
.globl oldLightFloats
.p2align 3, 0x0
oldLightFloats:
.xword 0
.size oldLightFloats, 8
.type lightPointScale,@object // @lightPointScale
.globl lightPointScale
.p2align 3, 0x0
lightPointScale:
.xword 0x0000000000000000 // double 0
.size lightPointScale, 8
.type radiosity_scale,@object // @radiosity_scale
.globl radiosity_scale
.p2align 2, 0x0
radiosity_scale:
.word 0x00000000 // float 0
.size radiosity_scale, 4
.type LIGHT_POINTRADIAL,@object // @LIGHT_POINTRADIAL
.globl LIGHT_POINTRADIAL
.p2align 2, 0x0
LIGHT_POINTRADIAL:
.word 0 // 0x0
.size LIGHT_POINTRADIAL, 4
.type lightFloats,@object // @lightFloats
.globl lightFloats
.p2align 3, 0x0
lightFloats:
.xword 0
.size lightFloats, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym ShaderInfoForShader
.addrsig_sym VectorCopy
.addrsig_sym VectorMA
.addrsig_sym memset
.addrsig_sym ColorNormalize
.addrsig_sym VectorLength
.addrsig_sym VS_FloodLight
.addrsig_sym MutexLock
.addrsig_sym MutexUnlock
.addrsig_sym drawSurfaces
.addrsig_sym MST_TRIANGLE_SOUP
.addrsig_sym dshaders
.addrsig_sym lsurfaceTest
.addrsig_sym LIGHTMAP_HEIGHT
.addrsig_sym LIGHTMAP_WIDTH
.addrsig_sym lightmappixelarea
.addrsig_sym MST_PATCH
.addrsig_sym oldLightFloats
.addrsig_sym lightPointScale
.addrsig_sym radiosity_scale
.addrsig_sym LIGHT_POINTRADIAL
.addrsig_sym lightFloats
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_SurfaceRadiosity.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_7__ {int planenum; int surfaceFlags; int /*<<< orphan*/ * winding; } ;
typedef TYPE_1__ side_t ;
struct TYPE_8__ {int planenum; int /*<<< orphan*/ hint; struct TYPE_8__* next; int /*<<< orphan*/ w; } ;
typedef TYPE_2__ bspface_t ;
struct TYPE_9__ {int numsides; TYPE_1__* sides; scalar_t__ detail; struct TYPE_9__* next; } ;
typedef TYPE_3__ bspbrush_t ;
/* Variables and functions */
TYPE_2__* AllocBspFace () ;
int /*<<< orphan*/ CopyWinding (int /*<<< orphan*/ *) ;
int SURF_HINT ;
int /*<<< orphan*/ qtrue ;
bspface_t *MakeStructuralBspFaceList( bspbrush_t *list ) {
bspbrush_t *b;
int i;
side_t *s;
winding_t *w;
bspface_t *f, *flist;
flist = NULL;
for ( b = list ; b ; b = b->next ) {
if ( b->detail ) {
continue;
}
for ( i = 0 ; i < b->numsides ; i++ ) {
s = &b->sides[i];
w = s->winding;
if ( !w ) {
continue;
}
f = AllocBspFace();
f->w = CopyWinding( w );
f->planenum = s->planenum & ~1;
f->next = flist;
if (s->surfaceFlags & SURF_HINT) {
//f->priority = HINT_PRIORITY;
f->hint = qtrue;
}
flist = f;
}
}
return flist;
}
|
.text
.file "extr_facebsp.c_MakeStructuralBspFaceList.c"
.globl MakeStructuralBspFaceList // -- Begin function MakeStructuralBspFaceList
.p2align 2
.type MakeStructuralBspFaceList,@function
MakeStructuralBspFaceList: // @MakeStructuralBspFaceList
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
// kill: def $x8 killed $xzr
str xzr, [sp, #8]
ldur x8, [x29, #-8]
stur x8, [x29, #-16]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_5 Depth 2
ldur x8, [x29, #-16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-20]
b .LBB0_5
.LBB0_5: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-20]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_12
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=2
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-20]
add x8, x8, x9, lsl #4
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr x8, [x8, #8]
str x8, [sp, #24]
ldr x8, [sp, #24]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=2
b .LBB0_11
.LBB0_8: // in Loop: Header=BB0_5 Depth=2
bl AllocBspFace
str x0, [sp, #16]
ldr x0, [sp, #24]
bl CopyWinding
ldr x8, [sp, #16]
str w0, [x8, #16]
ldr x8, [sp, #32]
ldr w8, [x8]
and w8, w8, #0xfffffffe
ldr x9, [sp, #16]
str w8, [x9]
ldr x8, [sp, #8]
ldr x9, [sp, #16]
str x8, [x9, #8]
ldr x8, [sp, #32]
ldr w8, [x8, #4]
adrp x9, SURF_HINT
ldr w9, [x9, :lo12:SURF_HINT]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_5 Depth=2
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
ldr x9, [sp, #16]
str w8, [x9, #4]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp, #16]
str x8, [sp, #8]
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_5 Depth=2
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_5
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #24]
stur x8, [x29, #-16]
b .LBB0_1
.LBB0_14:
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size MakeStructuralBspFaceList, .Lfunc_end0-MakeStructuralBspFaceList
.cfi_endproc
// -- End function
.type SURF_HINT,@object // @SURF_HINT
.bss
.globl SURF_HINT
.p2align 2, 0x0
SURF_HINT:
.word 0 // 0x0
.size SURF_HINT, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym AllocBspFace
.addrsig_sym CopyWinding
.addrsig_sym SURF_HINT
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_facebsp.c_MakeStructuralBspFaceList.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ drawflag ;
int /*<<< orphan*/ glColor3f (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
void Draw_SetRed (void)
{
if (!drawflag)
return;
glColor3f (1,0,0);
}
|
.text
.file "extr_gldraw.c_Draw_SetRed.c"
.globl Draw_SetRed // -- Begin function Draw_SetRed
.p2align 2
.type Draw_SetRed,@function
Draw_SetRed: // @Draw_SetRed
.cfi_startproc
// %bb.0:
stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
.cfi_def_cfa_offset 16
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, drawflag
ldr w8, [x8, :lo12:drawflag]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
b .LBB0_3
.LBB0_2:
mov w0, #1 // =0x1
mov w2, wzr
mov w1, w2
bl glColor3f
b .LBB0_3
.LBB0_3:
.cfi_def_cfa wsp, 16
ldp x29, x30, [sp], #16 // 16-byte Folded Reload
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size Draw_SetRed, .Lfunc_end0-Draw_SetRed
.cfi_endproc
// -- End function
.type drawflag,@object // @drawflag
.bss
.globl drawflag
.p2align 2, 0x0
drawflag:
.word 0 // 0x0
.size drawflag, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym glColor3f
.addrsig_sym drawflag
|
../AnghaBench/Quake-III-Arena/q3map/extr_gldraw.c_Draw_SetRed.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ shaderInfo_t ;
struct TYPE_7__ {int numFacets; int /*<<< orphan*/ * facets; int /*<<< orphan*/ * shader; void* trisoup; void* patch; } ;
typedef TYPE_1__ lsurfaceTest_t ;
struct TYPE_8__ {scalar_t__ surfaceType; int numIndexes; int firstIndex; int firstVert; } ;
typedef TYPE_2__ dsurface_t ;
typedef int /*<<< orphan*/ drawVert_t ;
/* Variables and functions */
scalar_t__ MST_TRIANGLE_SOUP ;
scalar_t__ VS_GenerateFacetFor3Points (TYPE_2__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
scalar_t__ VS_GenerateFacetFor4Points (TYPE_2__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int* drawIndexes ;
int /*<<< orphan*/ * drawVerts ;
int /*<<< orphan*/ * malloc (int) ;
void* qfalse ;
void* qtrue ;
void VS_FacetsForTriangleSurface( dsurface_t *dsurf, shaderInfo_t *si, lsurfaceTest_t *test ) {
int i;
drawVert_t *v1, *v2, *v3, *v4;
int count;
int i1, i2, i3, i4, i5, i6;
test->patch = qfalse;
if (dsurf->surfaceType == MST_TRIANGLE_SOUP)
test->trisoup = qtrue;
else
test->trisoup = qfalse;
test->numFacets = dsurf->numIndexes / 3;
test->facets = malloc( sizeof( test->facets[0] ) * test->numFacets );
test->shader = si;
count = 0;
for ( i = 0 ; i < test->numFacets ; i++ ) {
i1 = drawIndexes[ dsurf->firstIndex + i*3 ];
i2 = drawIndexes[ dsurf->firstIndex + i*3 + 1 ];
i3 = drawIndexes[ dsurf->firstIndex + i*3 + 2 ];
v1 = &drawVerts[ dsurf->firstVert + i1 ];
v2 = &drawVerts[ dsurf->firstVert + i2 ];
v3 = &drawVerts[ dsurf->firstVert + i3 ];
// try and make a quad out of two triangles
if ( i != test->numFacets - 1 ) {
i4 = drawIndexes[ dsurf->firstIndex + i*3 + 3 ];
i5 = drawIndexes[ dsurf->firstIndex + i*3 + 4 ];
i6 = drawIndexes[ dsurf->firstIndex + i*3 + 5 ];
if ( i4 == i3 && i5 == i2 ) {
v4 = &drawVerts[ dsurf->firstVert + i6 ];
if ( VS_GenerateFacetFor4Points( dsurf, si, &test->facets[count], v1, v2, v4, v3 ) ) {
count++;
i++; // skip next tri
continue;
}
}
}
if (VS_GenerateFacetFor3Points( dsurf, si, &test->facets[count], v1, v2, v3 )) {
count++;
}
}
// we may have turned some pairs into quads
test->numFacets = count;
}
|
.text
.file "extr_soundv.c_VS_FacetsForTriangleSurface.c"
.globl VS_FacetsForTriangleSurface // -- Begin function VS_FacetsForTriangleSurface
.p2align 2
.type VS_FacetsForTriangleSurface,@function
VS_FacetsForTriangleSurface: // @VS_FacetsForTriangleSurface
.cfi_startproc
// %bb.0:
sub sp, sp, #112
.cfi_def_cfa_offset 112
stp x29, x30, [sp, #96] // 16-byte Folded Spill
add x29, sp, #96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
stur x1, [x29, #-16]
stur x2, [x29, #-24]
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
ldur x9, [x29, #-24]
str x8, [x9, #32]
ldur x8, [x29, #-8]
ldr x8, [x8]
adrp x9, MST_TRIANGLE_SOUP
ldr x9, [x9, :lo12:MST_TRIANGLE_SOUP]
subs x8, x8, x9
cset w8, ne
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, qtrue
ldr x8, [x8, :lo12:qtrue]
ldur x9, [x29, #-24]
str x8, [x9, #24]
b .LBB0_3
.LBB0_2:
adrp x8, qfalse
ldr x8, [x8, :lo12:qfalse]
ldur x9, [x29, #-24]
str x8, [x9, #24]
b .LBB0_3
.LBB0_3:
ldur x8, [x29, #-8]
ldr w8, [x8, #8]
mov w9, #3 // =0x3
sdiv w8, w8, w9
ldur x9, [x29, #-24]
str w8, [x9]
ldur x8, [x29, #-24]
ldrsw x9, [x8]
mov x8, #4 // =0x4
mul x8, x8, x9
mov w0, w8
bl malloc
ldur x8, [x29, #-24]
str x0, [x8, #8]
ldur x8, [x29, #-16]
ldur x9, [x29, #-24]
str x8, [x9, #16]
str wzr, [sp, #28]
stur wzr, [x29, #-28]
b .LBB0_4
.LBB0_4: // =>This Inner Loop Header: Depth=1
ldur w8, [x29, #-28]
ldur x9, [x29, #-24]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_16
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_4 Depth=1
adrp x8, drawIndexes
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mov w11, #3 // =0x3
mul w12, w12, w11
add w10, w10, w12
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #24]
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mul w12, w12, w11
add w10, w10, w12
add w10, w10, #1
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #20]
ldr x8, [x8, :lo12:drawIndexes]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
ldur w10, [x29, #-28]
mul w10, w10, w11
add w9, w9, w10
add w9, w9, #2
ldr w8, [x8, w9, sxtw #2]
str w8, [sp, #16]
adrp x8, drawVerts
ldr x9, [x8, :lo12:drawVerts]
ldur x10, [x29, #-8]
ldr w10, [x10, #16]
ldr w11, [sp, #24]
add w10, w10, w11
add x9, x9, w10, sxtw #2
stur x9, [x29, #-40]
ldr x9, [x8, :lo12:drawVerts]
ldur x10, [x29, #-8]
ldr w10, [x10, #16]
ldr w11, [sp, #20]
add w10, w10, w11
add x9, x9, w10, sxtw #2
str x9, [sp, #48]
ldr x8, [x8, :lo12:drawVerts]
ldur x9, [x29, #-8]
ldr w9, [x9, #16]
ldr w10, [sp, #16]
add w9, w9, w10
add x8, x8, w9, sxtw #2
str x8, [sp, #40]
ldur w8, [x29, #-28]
ldur x9, [x29, #-24]
ldr w9, [x9]
subs w9, w9, #1
subs w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_4 Depth=1
adrp x8, drawIndexes
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mov w11, #3 // =0x3
mul w12, w12, w11
add w10, w10, w12
add w10, w10, #3
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #12]
ldr x9, [x8, :lo12:drawIndexes]
ldur x10, [x29, #-8]
ldr w10, [x10, #12]
ldur w12, [x29, #-28]
mul w12, w12, w11
add w10, w10, w12
add w10, w10, #4
ldr w9, [x9, w10, sxtw #2]
str w9, [sp, #8]
ldr x8, [x8, :lo12:drawIndexes]
ldur x9, [x29, #-8]
ldr w9, [x9, #12]
ldur w10, [x29, #-28]
mul w10, w10, w11
add w9, w9, w10
add w9, w9, #5
ldr w8, [x8, w9, sxtw #2]
str w8, [sp, #4]
ldr w8, [sp, #12]
ldr w9, [sp, #16]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_4 Depth=1
ldr w8, [sp, #8]
ldr w9, [sp, #20]
subs w8, w8, w9
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_4 Depth=1
adrp x8, drawVerts
ldr x8, [x8, :lo12:drawVerts]
ldur x9, [x29, #-8]
ldr w9, [x9, #16]
ldr w10, [sp, #4]
add w9, w9, w10
add x8, x8, w9, sxtw #2
str x8, [sp, #32]
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldrsw x9, [sp, #28]
add x2, x8, x9, lsl #2
ldur x3, [x29, #-40]
ldr x4, [sp, #48]
ldr x5, [sp, #32]
ldr x6, [sp, #40]
bl VS_GenerateFacetFor4Points
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_4 Depth=1
ldr w8, [sp, #28]
add w8, w8, #1
str w8, [sp, #28]
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b .LBB0_15
.LBB0_10: // in Loop: Header=BB0_4 Depth=1
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_4 Depth=1
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_4 Depth=1
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
ldur x8, [x29, #-24]
ldr x8, [x8, #8]
ldrsw x9, [sp, #28]
add x2, x8, x9, lsl #2
ldur x3, [x29, #-40]
ldr x4, [sp, #48]
ldr x5, [sp, #40]
bl VS_GenerateFacetFor3Points
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_4 Depth=1
ldr w8, [sp, #28]
add w8, w8, #1
str w8, [sp, #28]
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_4 Depth=1
b .LBB0_15
.LBB0_15: // in Loop: Header=BB0_4 Depth=1
ldur w8, [x29, #-28]
add w8, w8, #1
stur w8, [x29, #-28]
b .LBB0_4
.LBB0_16:
ldr w8, [sp, #28]
ldur x9, [x29, #-24]
str w8, [x9]
.cfi_def_cfa wsp, 112
ldp x29, x30, [sp, #96] // 16-byte Folded Reload
add sp, sp, #112
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size VS_FacetsForTriangleSurface, .Lfunc_end0-VS_FacetsForTriangleSurface
.cfi_endproc
// -- End function
.type qfalse,@object // @qfalse
.bss
.globl qfalse
.p2align 3, 0x0
qfalse:
.xword 0
.size qfalse, 8
.type MST_TRIANGLE_SOUP,@object // @MST_TRIANGLE_SOUP
.globl MST_TRIANGLE_SOUP
.p2align 3, 0x0
MST_TRIANGLE_SOUP:
.xword 0 // 0x0
.size MST_TRIANGLE_SOUP, 8
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 3, 0x0
qtrue:
.xword 0
.size qtrue, 8
.type drawIndexes,@object // @drawIndexes
.globl drawIndexes
.p2align 3, 0x0
drawIndexes:
.xword 0
.size drawIndexes, 8
.type drawVerts,@object // @drawVerts
.globl drawVerts
.p2align 3, 0x0
drawVerts:
.xword 0
.size drawVerts, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym VS_GenerateFacetFor4Points
.addrsig_sym VS_GenerateFacetFor3Points
.addrsig_sym qfalse
.addrsig_sym MST_TRIANGLE_SOUP
.addrsig_sym qtrue
.addrsig_sym drawIndexes
.addrsig_sym drawVerts
|
../AnghaBench/Quake-III-Arena/q3map/extr_soundv.c_VS_FacetsForTriangleSurface.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_7__ {int planenum; int surfaceFlags; int /*<<< orphan*/ * visibleHull; } ;
typedef TYPE_1__ side_t ;
struct TYPE_8__ {int planenum; int /*<<< orphan*/ hint; struct TYPE_8__* next; int /*<<< orphan*/ w; } ;
typedef TYPE_2__ bspface_t ;
struct TYPE_9__ {int numsides; TYPE_1__* sides; scalar_t__ detail; struct TYPE_9__* next; } ;
typedef TYPE_3__ bspbrush_t ;
/* Variables and functions */
TYPE_2__* AllocBspFace () ;
int /*<<< orphan*/ CopyWinding (int /*<<< orphan*/ *) ;
int SURF_HINT ;
int /*<<< orphan*/ qtrue ;
bspface_t *MakeVisibleBspFaceList( bspbrush_t *list ) {
bspbrush_t *b;
int i;
side_t *s;
winding_t *w;
bspface_t *f, *flist;
flist = NULL;
for ( b = list ; b ; b = b->next ) {
if ( b->detail ) {
continue;
}
for ( i = 0 ; i < b->numsides ; i++ ) {
s = &b->sides[i];
w = s->visibleHull;
if ( !w ) {
continue;
}
f = AllocBspFace();
f->w = CopyWinding( w );
f->planenum = s->planenum & ~1;
f->next = flist;
if (s->surfaceFlags & SURF_HINT) {
//f->priority = HINT_PRIORITY;
f->hint = qtrue;
}
flist = f;
}
}
return flist;
}
|
.text
.file "extr_facebsp.c_MakeVisibleBspFaceList.c"
.globl MakeVisibleBspFaceList // -- Begin function MakeVisibleBspFaceList
.p2align 2
.type MakeVisibleBspFaceList,@function
MakeVisibleBspFaceList: // @MakeVisibleBspFaceList
.cfi_startproc
// %bb.0:
sub sp, sp, #80
.cfi_def_cfa_offset 80
stp x29, x30, [sp, #64] // 16-byte Folded Spill
add x29, sp, #64
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
stur x0, [x29, #-8]
// kill: def $x8 killed $xzr
str xzr, [sp, #8]
ldur x8, [x29, #-8]
stur x8, [x29, #-16]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_5 Depth 2
ldur x8, [x29, #-16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_14
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #16]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-20]
b .LBB0_5
.LBB0_5: // Parent Loop BB0_1 Depth=1
// => This Inner Loop Header: Depth=2
ldur w8, [x29, #-20]
ldur x9, [x29, #-16]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_12
b .LBB0_6
.LBB0_6: // in Loop: Header=BB0_5 Depth=2
ldur x8, [x29, #-16]
ldr x8, [x8, #8]
ldursw x9, [x29, #-20]
add x8, x8, x9, lsl #4
str x8, [sp, #32]
ldr x8, [sp, #32]
ldr x8, [x8, #8]
str x8, [sp, #24]
ldr x8, [sp, #24]
subs x8, x8, #0
cset w8, ne
tbnz w8, #0, .LBB0_8
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_5 Depth=2
b .LBB0_11
.LBB0_8: // in Loop: Header=BB0_5 Depth=2
bl AllocBspFace
str x0, [sp, #16]
ldr x0, [sp, #24]
bl CopyWinding
ldr x8, [sp, #16]
str w0, [x8, #16]
ldr x8, [sp, #32]
ldr w8, [x8]
and w8, w8, #0xfffffffe
ldr x9, [sp, #16]
str w8, [x9]
ldr x8, [sp, #8]
ldr x9, [sp, #16]
str x8, [x9, #8]
ldr x8, [sp, #32]
ldr w8, [x8, #4]
adrp x9, SURF_HINT
ldr w9, [x9, :lo12:SURF_HINT]
ands w8, w8, w9
cset w8, eq
tbnz w8, #0, .LBB0_10
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_5 Depth=2
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
ldr x9, [sp, #16]
str w8, [x9, #4]
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_5 Depth=2
ldr x8, [sp, #16]
str x8, [sp, #8]
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_5 Depth=2
ldur w8, [x29, #-20]
add w8, w8, #1
stur w8, [x29, #-20]
b .LBB0_5
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
b .LBB0_13
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-16]
ldr x8, [x8, #24]
stur x8, [x29, #-16]
b .LBB0_1
.LBB0_14:
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 80
ldp x29, x30, [sp, #64] // 16-byte Folded Reload
add sp, sp, #80
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size MakeVisibleBspFaceList, .Lfunc_end0-MakeVisibleBspFaceList
.cfi_endproc
// -- End function
.type SURF_HINT,@object // @SURF_HINT
.bss
.globl SURF_HINT
.p2align 2, 0x0
SURF_HINT:
.word 0 // 0x0
.size SURF_HINT, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym AllocBspFace
.addrsig_sym CopyWinding
.addrsig_sym SURF_HINT
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_facebsp.c_MakeVisibleBspFaceList.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ node_t ;
/* Variables and functions */
int /*<<< orphan*/ * malloc (int) ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
node_t *AllocNode (void)
{
node_t *node;
node = malloc(sizeof(*node));
memset (node, 0, sizeof(*node));
return node;
}
|
.text
.file "extr_brush.c_AllocNode.c"
.globl AllocNode // -- Begin function AllocNode
.p2align 2
.type AllocNode,@function
AllocNode: // @AllocNode
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
mov w0, #4 // =0x4
str w0, [sp, #4] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #4] // 4-byte Folded Reload
str x0, [sp, #8]
ldr x0, [sp, #8]
mov w1, wzr
bl memset
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size AllocNode, .Lfunc_end0-AllocNode
.cfi_endproc
// -- End function
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym malloc
.addrsig_sym memset
|
../AnghaBench/Quake-III-Arena/q3map/extr_brush.c_AllocNode.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
/* Variables and functions */
float DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float VectorNormalize (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean SphereCull( vec3_t start, vec3_t stop, vec3_t origin, float radius ) {
vec3_t v;
float d;
vec3_t dir;
float len;
vec3_t on;
VectorSubtract( stop, start, dir );
len = VectorNormalize( dir, dir );
VectorSubtract( origin, start, v );
d = DotProduct( v, dir );
if ( d > len + radius ) {
return qtrue; // too far ahead
}
if ( d < -radius ) {
return qtrue; // too far behind
}
VectorMA( start, d, dir, on );
VectorSubtract( on, origin, v );
len = VectorLength( v );
if ( len > radius ) {
return qtrue; // too far to the side
}
return qfalse; // must be traced against
}
|
.text
.file "extr_light_trace.c_SphereCull.c"
.globl SphereCull // -- Begin function SphereCull
.p2align 2
.type SphereCull,@function
SphereCull: // @SphereCull
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
stur w0, [x29, #-8]
stur w1, [x29, #-12]
stur w2, [x29, #-16]
stur s0, [x29, #-20]
ldur w0, [x29, #-12]
ldur w1, [x29, #-8]
ldr w2, [sp, #16]
bl VectorSubtract
ldr w0, [sp, #16]
ldr w1, [sp, #16]
bl VectorNormalize
str s0, [sp, #12]
ldur w0, [x29, #-16]
ldur w1, [x29, #-8]
ldr w2, [sp, #24]
bl VectorSubtract
ldr w0, [sp, #24]
ldr w1, [sp, #16]
bl DotProduct
str s0, [sp, #20]
ldr s0, [sp, #20]
ldr s1, [sp, #12]
ldur s2, [x29, #-20]
fadd s1, s1, s2
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_7
.LBB0_2:
ldr s0, [sp, #20]
ldur s1, [x29, #-20]
fneg s1, s1
fcmp s0, s1
cset w8, pl
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_7
.LBB0_4:
ldur w0, [x29, #-8]
ldr s0, [sp, #20]
ldr w1, [sp, #16]
ldr w2, [sp, #8]
bl VectorMA
ldr w0, [sp, #8]
ldur w1, [x29, #-16]
ldr w2, [sp, #24]
bl VectorSubtract
ldr w0, [sp, #24]
bl VectorLength
str s0, [sp, #12]
ldr s0, [sp, #12]
ldur s1, [x29, #-20]
fcmp s0, s1
cset w8, le
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
stur w8, [x29, #-4]
b .LBB0_7
.LBB0_6:
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
stur w8, [x29, #-4]
b .LBB0_7
.LBB0_7:
ldur w0, [x29, #-4]
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size SphereCull, .Lfunc_end0-SphereCull
.cfi_endproc
// -- End function
.type qtrue,@object // @qtrue
.bss
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym VectorSubtract
.addrsig_sym VectorNormalize
.addrsig_sym DotProduct
.addrsig_sym VectorMA
.addrsig_sym VectorLength
.addrsig_sym qtrue
.addrsig_sym qfalse
|
../AnghaBench/Quake-III-Arena/q3map/extr_light_trace.c_SphereCull.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ mapDrawSurface_t ;
/* Variables and functions */
int /*<<< orphan*/ Error (char*) ;
size_t MAX_MAP_DRAW_SURFS ;
int /*<<< orphan*/ * mapDrawSurfs ;
size_t numMapDrawSurfs ;
mapDrawSurface_t *AllocDrawSurf( void ) {
mapDrawSurface_t *ds;
if ( numMapDrawSurfs >= MAX_MAP_DRAW_SURFS ) {
Error( "MAX_MAP_DRAW_SURFS");
}
ds = &mapDrawSurfs[ numMapDrawSurfs ];
numMapDrawSurfs++;
return ds;
}
|
.text
.file "extr_surface.c_AllocDrawSurf.c"
.globl AllocDrawSurf // -- Begin function AllocDrawSurf
.p2align 2
.type AllocDrawSurf,@function
AllocDrawSurf: // @AllocDrawSurf
.cfi_startproc
// %bb.0:
sub sp, sp, #32
.cfi_def_cfa_offset 32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
adrp x8, numMapDrawSurfs
ldr x8, [x8, :lo12:numMapDrawSurfs]
adrp x9, MAX_MAP_DRAW_SURFS
ldr x9, [x9, :lo12:MAX_MAP_DRAW_SURFS]
subs x8, x8, x9
cset w8, lo
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl Error
b .LBB0_2
.LBB0_2:
adrp x8, mapDrawSurfs
ldr x8, [x8, :lo12:mapDrawSurfs]
adrp x9, numMapDrawSurfs
ldr x10, [x9, :lo12:numMapDrawSurfs]
add x8, x8, x10, lsl #2
str x8, [sp, #8]
ldr x8, [x9, :lo12:numMapDrawSurfs]
add x8, x8, #1
str x8, [x9, :lo12:numMapDrawSurfs]
ldr x0, [sp, #8]
.cfi_def_cfa wsp, 32
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size AllocDrawSurf, .Lfunc_end0-AllocDrawSurf
.cfi_endproc
// -- End function
.type numMapDrawSurfs,@object // @numMapDrawSurfs
.bss
.globl numMapDrawSurfs
.p2align 3, 0x0
numMapDrawSurfs:
.xword 0 // 0x0
.size numMapDrawSurfs, 8
.type MAX_MAP_DRAW_SURFS,@object // @MAX_MAP_DRAW_SURFS
.globl MAX_MAP_DRAW_SURFS
.p2align 3, 0x0
MAX_MAP_DRAW_SURFS:
.xword 0 // 0x0
.size MAX_MAP_DRAW_SURFS, 8
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "MAX_MAP_DRAW_SURFS"
.size .L.str, 19
.type mapDrawSurfs,@object // @mapDrawSurfs
.bss
.globl mapDrawSurfs
.p2align 3, 0x0
mapDrawSurfs:
.xword 0
.size mapDrawSurfs, 8
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym Error
.addrsig_sym numMapDrawSurfs
.addrsig_sym MAX_MAP_DRAW_SURFS
.addrsig_sym mapDrawSurfs
|
../AnghaBench/Quake-III-Arena/q3map/extr_surface.c_AllocDrawSurf.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_28__ TYPE_7__ ;
typedef struct TYPE_27__ TYPE_6__ ;
typedef struct TYPE_26__ TYPE_5__ ;
typedef struct TYPE_25__ TYPE_4__ ;
typedef struct TYPE_24__ TYPE_3__ ;
typedef struct TYPE_23__ TYPE_2__ ;
typedef struct TYPE_22__ TYPE_1__ ;
typedef struct TYPE_21__ TYPE_11__ ;
/* Type definitions */
struct TYPE_22__ {int numpoints; scalar_t__** p; } ;
typedef TYPE_1__ winding_t ;
typedef scalar_t__* vec3_t ;
struct TYPE_23__ {int value; float lightSubdivide; int twoSided; scalar_t__* color; scalar_t__ autosprite; } ;
typedef TYPE_2__ shaderInfo_t ;
struct TYPE_24__ {int photons; int /*<<< orphan*/ type; scalar_t__* color; scalar_t__* origin; struct TYPE_24__* next; } ;
typedef TYPE_3__ light_t ;
struct TYPE_25__ {size_t shaderNum; size_t firstVert; int numVerts; scalar_t__** lightmapVecs; } ;
typedef TYPE_4__ dsurface_t ;
struct TYPE_26__ {scalar_t__* xyz; } ;
typedef TYPE_5__ drawVert_t ;
struct TYPE_27__ {int numBoundaries; scalar_t__* surface; scalar_t__** points; } ;
typedef TYPE_6__ cFacet_t ;
struct TYPE_28__ {int numFacets; TYPE_6__* facets; } ;
struct TYPE_21__ {int /*<<< orphan*/ shader; } ;
/* Variables and functions */
TYPE_1__* AllocWinding (int) ;
int /*<<< orphan*/ FreeWinding (TYPE_1__*) ;
TYPE_1__* ReverseWinding (TYPE_1__*) ;
TYPE_2__* ShaderInfoForShader (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SubdivideAreaLight (TYPE_2__*,TYPE_1__*,scalar_t__*,float,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorAdd (scalar_t__*,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorScale (scalar_t__*,double,scalar_t__*) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ _printf (char*,int,...) ;
float defaultLightSubdivide ;
TYPE_4__* drawSurfaces ;
TYPE_5__* drawVerts ;
TYPE_11__* dshaders ;
int /*<<< orphan*/ emit_point ;
TYPE_3__* lights ;
TYPE_3__* malloc (int) ;
int /*<<< orphan*/ memcpy (scalar_t__**,scalar_t__**,int) ;
int /*<<< orphan*/ memset (TYPE_3__*,int /*<<< orphan*/ ,int) ;
int numDrawSurfaces ;
int /*<<< orphan*/ numPointLights ;
int pointScale ;
int /*<<< orphan*/ qprintf (char*) ;
int /*<<< orphan*/ qtrue ;
TYPE_7__** surfaceTest ;
int /*<<< orphan*/ vec3_origin ;
void CreateSurfaceLights( void ) {
int i, j, side;
dsurface_t *ds;
shaderInfo_t *ls;
winding_t *w;
cFacet_t *f;
light_t *dl;
vec3_t origin;
drawVert_t *dv;
int c_lightSurfaces;
float lightSubdivide;
vec3_t normal;
qprintf ("--- CreateSurfaceLights ---\n");
c_lightSurfaces = 0;
for ( i = 0 ; i < numDrawSurfaces ; i++ ) {
// see if this surface is light emiting
ds = &drawSurfaces[i];
ls = ShaderInfoForShader( dshaders[ ds->shaderNum].shader );
if ( ls->value == 0 ) {
continue;
}
// determine how much we need to chop up the surface
if ( ls->lightSubdivide ) {
lightSubdivide = ls->lightSubdivide;
} else {
lightSubdivide = defaultLightSubdivide;
}
c_lightSurfaces++;
// an autosprite shader will become
// a point light instead of an area light
if ( ls->autosprite ) {
// autosprite geometry should only have four vertexes
if ( surfaceTest[i] ) {
// curve or misc_model
f = surfaceTest[i]->facets;
if ( surfaceTest[i]->numFacets != 1 || f->numBoundaries != 4 ) {
_printf( "WARNING: surface at (%i %i %i) has autosprite shader but isn't a quad\n",
(int)f->points[0], (int)f->points[1], (int)f->points[2] );
}
VectorAdd( f->points[0], f->points[1], origin );
VectorAdd( f->points[2], origin, origin );
VectorAdd( f->points[3], origin, origin );
VectorScale( origin, 0.25, origin );
} else {
// normal polygon
dv = &drawVerts[ ds->firstVert ];
if ( ds->numVerts != 4 ) {
_printf( "WARNING: surface at (%i %i %i) has autosprite shader but %i verts\n",
(int)dv->xyz[0], (int)dv->xyz[1], (int)dv->xyz[2] );
continue;
}
VectorAdd( dv[0].xyz, dv[1].xyz, origin );
VectorAdd( dv[2].xyz, origin, origin );
VectorAdd( dv[3].xyz, origin, origin );
VectorScale( origin, 0.25, origin );
}
numPointLights++;
dl = malloc(sizeof(*dl));
memset (dl, 0, sizeof(*dl));
dl->next = lights;
lights = dl;
VectorCopy( origin, dl->origin );
VectorCopy( ls->color, dl->color );
dl->photons = ls->value * pointScale;
dl->type = emit_point;
continue;
}
// possibly create for both sides of the polygon
for ( side = 0 ; side <= ls->twoSided ; side++ ) {
// create area lights
if ( surfaceTest[i] ) {
// curve or misc_model
for ( j = 0 ; j < surfaceTest[i]->numFacets ; j++ ) {
f = surfaceTest[i]->facets + j;
w = AllocWinding( f->numBoundaries );
w->numpoints = f->numBoundaries;
memcpy( w->p, f->points, f->numBoundaries * 12 );
VectorCopy( f->surface, normal );
if ( side ) {
winding_t *t;
t = w;
w = ReverseWinding( t );
FreeWinding( t );
VectorSubtract( vec3_origin, normal, normal );
}
SubdivideAreaLight( ls, w, normal, lightSubdivide, qtrue );
}
} else {
// normal polygon
w = AllocWinding( ds->numVerts );
w->numpoints = ds->numVerts;
for ( j = 0 ; j < ds->numVerts ; j++ ) {
VectorCopy( drawVerts[ds->firstVert+j].xyz, w->p[j] );
}
VectorCopy( ds->lightmapVecs[2], normal );
if ( side ) {
winding_t *t;
t = w;
w = ReverseWinding( t );
FreeWinding( t );
VectorSubtract( vec3_origin, normal, normal );
}
SubdivideAreaLight( ls, w, normal, lightSubdivide, qtrue );
}
}
}
_printf( "%5i light emitting surfaces\n", c_lightSurfaces );
}
|
.text
.file "extr_light.c_CreateSurfaceLights.c"
.globl CreateSurfaceLights // -- Begin function CreateSurfaceLights
.p2align 2
.type CreateSurfaceLights,@function
CreateSurfaceLights: // @CreateSurfaceLights
.cfi_startproc
// %bb.0:
sub sp, sp, #128
.cfi_def_cfa_offset 128
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
adrp x0, .L.str
add x0, x0, :lo12:.L.str
bl qprintf
str wzr, [sp, #36]
stur wzr, [x29, #-4]
b .LBB0_1
.LBB0_1: // =>This Loop Header: Depth=1
// Child Loop BB0_18 Depth 2
// Child Loop BB0_28 Depth 3
// Child Loop BB0_21 Depth 3
ldur w8, [x29, #-4]
adrp x9, numDrawSurfaces
ldr w9, [x9, :lo12:numDrawSurfaces]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_38
b .LBB0_2
.LBB0_2: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawSurfaces
ldr x8, [x8, :lo12:drawSurfaces]
ldursw x9, [x29, #-4]
add x8, x8, x9, lsl #5
stur x8, [x29, #-24]
adrp x8, dshaders
ldr x8, [x8, :lo12:dshaders]
ldur x9, [x29, #-24]
ldr x9, [x9]
ldr w0, [x8, x9, lsl #2]
bl ShaderInfoForShader
stur x0, [x29, #-32]
ldur x8, [x29, #-32]
ldr w8, [x8]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3: // in Loop: Header=BB0_1 Depth=1
b .LBB0_37
.LBB0_4: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-32]
ldr s0, [x8, #4]
fcmp s0, #0.0
cset w8, eq
tbnz w8, #0, .LBB0_6
b .LBB0_5
.LBB0_5: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-32]
ldr s0, [x8, #4]
str s0, [sp, #32]
b .LBB0_7
.LBB0_6: // in Loop: Header=BB0_1 Depth=1
adrp x8, defaultLightSubdivide
ldr s0, [x8, :lo12:defaultLightSubdivide]
str s0, [sp, #32]
b .LBB0_7
.LBB0_7: // in Loop: Header=BB0_1 Depth=1
ldr w8, [sp, #36]
add w8, w8, #1
str w8, [sp, #36]
ldur x8, [x29, #-32]
ldr x8, [x8, #24]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_17
b .LBB0_8
.LBB0_8: // in Loop: Header=BB0_1 Depth=1
adrp x8, surfaceTest
ldr x8, [x8, :lo12:surfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_13
b .LBB0_9
.LBB0_9: // in Loop: Header=BB0_1 Depth=1
adrp x8, surfaceTest
ldr x9, [x8, :lo12:surfaceTest]
ldursw x10, [x29, #-4]
ldr x9, [x9, x10, lsl #3]
ldr x9, [x9, #8]
stur x9, [x29, #-48]
ldr x8, [x8, :lo12:surfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
ldr w8, [x8]
subs w8, w8, #1
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-48]
ldr w8, [x8]
subs w8, w8, #4
cset w8, eq
tbnz w8, #0, .LBB0_12
b .LBB0_11
.LBB0_11: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x8, [x8]
mov w1, w8
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x8, [x8, #8]
mov w2, w8
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x8, [x8, #16]
mov w3, w8
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
b .LBB0_12
.LBB0_12: // in Loop: Header=BB0_1 Depth=1
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x0, [x8]
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x1, [x8, #8]
ldr x2, [sp, #48]
bl VectorAdd
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x0, [x8, #16]
ldr x1, [sp, #48]
ldr x2, [sp, #48]
bl VectorAdd
ldur x8, [x29, #-48]
ldr x8, [x8, #16]
ldr x0, [x8, #24]
ldr x1, [sp, #48]
ldr x2, [sp, #48]
bl VectorAdd
ldr x0, [sp, #48]
ldr x1, [sp, #48]
fmov d0, #0.25000000
bl VectorScale
b .LBB0_16
.LBB0_13: // in Loop: Header=BB0_1 Depth=1
adrp x8, drawVerts
ldr x8, [x8, :lo12:drawVerts]
ldur x9, [x29, #-24]
ldr x9, [x9, #8]
add x8, x8, x9, lsl #3
str x8, [sp, #40]
ldur x8, [x29, #-24]
ldr w8, [x8, #16]
subs w8, w8, #4
cset w8, eq
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x8, [x8]
ldr x8, [x8]
mov w1, w8
ldr x8, [sp, #40]
ldr x8, [x8]
ldr x8, [x8, #8]
mov w2, w8
ldr x8, [sp, #40]
ldr x8, [x8]
ldr x8, [x8, #16]
mov w3, w8
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
b .LBB0_37
.LBB0_15: // in Loop: Header=BB0_1 Depth=1
ldr x8, [sp, #40]
ldr x0, [x8]
ldr x8, [sp, #40]
ldr x1, [x8, #8]
ldr x2, [sp, #48]
bl VectorAdd
ldr x8, [sp, #40]
ldr x0, [x8, #16]
ldr x1, [sp, #48]
ldr x2, [sp, #48]
bl VectorAdd
ldr x8, [sp, #40]
ldr x0, [x8, #24]
ldr x1, [sp, #48]
ldr x2, [sp, #48]
bl VectorAdd
ldr x0, [sp, #48]
ldr x1, [sp, #48]
fmov d0, #0.25000000
bl VectorScale
b .LBB0_16
.LBB0_16: // in Loop: Header=BB0_1 Depth=1
adrp x9, numPointLights
ldr w8, [x9, :lo12:numPointLights]
add w8, w8, #1
str w8, [x9, :lo12:numPointLights]
mov w0, #32 // =0x20
str w0, [sp, #4] // 4-byte Folded Spill
bl malloc
ldr w2, [sp, #4] // 4-byte Folded Reload
str x0, [sp, #56]
ldr x0, [sp, #56]
mov w1, wzr
bl memset
adrp x9, lights
ldr x8, [x9, :lo12:lights]
ldr x10, [sp, #56]
str x8, [x10, #24]
ldr x8, [sp, #56]
str x8, [x9, :lo12:lights]
ldr x0, [sp, #48]
ldr x8, [sp, #56]
ldr x1, [x8, #16]
bl VectorCopy
ldur x8, [x29, #-32]
ldr x0, [x8, #16]
ldr x8, [sp, #56]
ldr x1, [x8, #8]
bl VectorCopy
ldur x8, [x29, #-32]
ldr w8, [x8]
adrp x9, pointScale
ldr w9, [x9, :lo12:pointScale]
mul w8, w8, w9
ldr x9, [sp, #56]
str w8, [x9]
adrp x8, emit_point
ldr w8, [x8, :lo12:emit_point]
ldr x9, [sp, #56]
str w8, [x9, #4]
b .LBB0_37
.LBB0_17: // in Loop: Header=BB0_1 Depth=1
stur wzr, [x29, #-12]
b .LBB0_18
.LBB0_18: // Parent Loop BB0_1 Depth=1
// => This Loop Header: Depth=2
// Child Loop BB0_28 Depth 3
// Child Loop BB0_21 Depth 3
ldur w8, [x29, #-12]
ldur x9, [x29, #-32]
ldr w9, [x9, #8]
subs w8, w8, w9
cset w8, gt
tbnz w8, #0, .LBB0_36
b .LBB0_19
.LBB0_19: // in Loop: Header=BB0_18 Depth=2
adrp x8, surfaceTest
ldr x8, [x8, :lo12:surfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_27
b .LBB0_20
.LBB0_20: // in Loop: Header=BB0_18 Depth=2
stur wzr, [x29, #-8]
b .LBB0_21
.LBB0_21: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_18 Depth=2
// => This Inner Loop Header: Depth=3
ldur w8, [x29, #-8]
adrp x9, surfaceTest
ldr x9, [x9, :lo12:surfaceTest]
ldursw x10, [x29, #-4]
ldr x9, [x9, x10, lsl #3]
ldr w9, [x9]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_26
b .LBB0_22
.LBB0_22: // in Loop: Header=BB0_21 Depth=3
adrp x8, surfaceTest
ldr x8, [x8, :lo12:surfaceTest]
ldursw x9, [x29, #-4]
ldr x8, [x8, x9, lsl #3]
ldr x8, [x8, #8]
ldursw x9, [x29, #-8]
mov x10, #24 // =0x18
mul x9, x9, x10
add x8, x8, x9
stur x8, [x29, #-48]
ldur x8, [x29, #-48]
ldr w0, [x8]
bl AllocWinding
stur x0, [x29, #-40]
ldur x8, [x29, #-48]
ldr w8, [x8]
ldur x9, [x29, #-40]
str w8, [x9]
ldur x8, [x29, #-40]
ldr x0, [x8, #8]
ldur x8, [x29, #-48]
ldr x1, [x8, #16]
ldur x8, [x29, #-48]
ldr w8, [x8]
mov w9, #12 // =0xc
mul w2, w8, w9
bl memcpy
ldur x8, [x29, #-48]
ldr x0, [x8, #8]
ldr x1, [sp, #24]
bl VectorCopy
ldur w8, [x29, #-12]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, .LBB0_24
b .LBB0_23
.LBB0_23: // in Loop: Header=BB0_21 Depth=3
ldur x8, [x29, #-40]
str x8, [sp, #16]
ldr x0, [sp, #16]
bl ReverseWinding
stur x0, [x29, #-40]
ldr x0, [sp, #16]
bl FreeWinding
adrp x8, vec3_origin
ldr w0, [x8, :lo12:vec3_origin]
ldr x1, [sp, #24]
ldr x2, [sp, #24]
bl VectorSubtract
b .LBB0_24
.LBB0_24: // in Loop: Header=BB0_21 Depth=3
ldur x0, [x29, #-32]
ldur x1, [x29, #-40]
ldr x2, [sp, #24]
ldr s0, [sp, #32]
adrp x8, qtrue
ldr w3, [x8, :lo12:qtrue]
bl SubdivideAreaLight
b .LBB0_25
.LBB0_25: // in Loop: Header=BB0_21 Depth=3
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_21
.LBB0_26: // in Loop: Header=BB0_18 Depth=2
b .LBB0_34
.LBB0_27: // in Loop: Header=BB0_18 Depth=2
ldur x8, [x29, #-24]
ldr w0, [x8, #16]
bl AllocWinding
stur x0, [x29, #-40]
ldur x8, [x29, #-24]
ldr w8, [x8, #16]
ldur x9, [x29, #-40]
str w8, [x9]
stur wzr, [x29, #-8]
b .LBB0_28
.LBB0_28: // Parent Loop BB0_1 Depth=1
// Parent Loop BB0_18 Depth=2
// => This Inner Loop Header: Depth=3
ldur w8, [x29, #-8]
ldur x9, [x29, #-24]
ldr w9, [x9, #16]
subs w8, w8, w9
cset w8, ge
tbnz w8, #0, .LBB0_31
b .LBB0_29
.LBB0_29: // in Loop: Header=BB0_28 Depth=3
adrp x8, drawVerts
ldr x8, [x8, :lo12:drawVerts]
ldur x9, [x29, #-24]
ldr x9, [x9, #8]
ldursw x10, [x29, #-8]
add x9, x9, x10
ldr x0, [x8, x9, lsl #3]
ldur x8, [x29, #-40]
ldr x8, [x8, #8]
ldursw x9, [x29, #-8]
ldr x1, [x8, x9, lsl #3]
bl VectorCopy
b .LBB0_30
.LBB0_30: // in Loop: Header=BB0_28 Depth=3
ldur w8, [x29, #-8]
add w8, w8, #1
stur w8, [x29, #-8]
b .LBB0_28
.LBB0_31: // in Loop: Header=BB0_18 Depth=2
ldur x8, [x29, #-24]
ldr x8, [x8, #24]
ldr x0, [x8, #16]
ldr x1, [sp, #24]
bl VectorCopy
ldur w8, [x29, #-12]
subs w8, w8, #0
cset w8, eq
tbnz w8, #0, .LBB0_33
b .LBB0_32
.LBB0_32: // in Loop: Header=BB0_18 Depth=2
ldur x8, [x29, #-40]
str x8, [sp, #8]
ldr x0, [sp, #8]
bl ReverseWinding
stur x0, [x29, #-40]
ldr x0, [sp, #8]
bl FreeWinding
adrp x8, vec3_origin
ldr w0, [x8, :lo12:vec3_origin]
ldr x1, [sp, #24]
ldr x2, [sp, #24]
bl VectorSubtract
b .LBB0_33
.LBB0_33: // in Loop: Header=BB0_18 Depth=2
ldur x0, [x29, #-32]
ldur x1, [x29, #-40]
ldr x2, [sp, #24]
ldr s0, [sp, #32]
adrp x8, qtrue
ldr w3, [x8, :lo12:qtrue]
bl SubdivideAreaLight
b .LBB0_34
.LBB0_34: // in Loop: Header=BB0_18 Depth=2
b .LBB0_35
.LBB0_35: // in Loop: Header=BB0_18 Depth=2
ldur w8, [x29, #-12]
add w8, w8, #1
stur w8, [x29, #-12]
b .LBB0_18
.LBB0_36: // in Loop: Header=BB0_1 Depth=1
b .LBB0_37
.LBB0_37: // in Loop: Header=BB0_1 Depth=1
ldur w8, [x29, #-4]
add w8, w8, #1
stur w8, [x29, #-4]
b .LBB0_1
.LBB0_38:
ldr w1, [sp, #36]
adrp x0, .L.str.3
add x0, x0, :lo12:.L.str.3
bl _printf
.cfi_def_cfa wsp, 128
ldp x29, x30, [sp, #112] // 16-byte Folded Reload
add sp, sp, #128
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size CreateSurfaceLights, .Lfunc_end0-CreateSurfaceLights
.cfi_endproc
// -- End function
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "--- CreateSurfaceLights ---\n"
.size .L.str, 29
.type numDrawSurfaces,@object // @numDrawSurfaces
.bss
.globl numDrawSurfaces
.p2align 2, 0x0
numDrawSurfaces:
.word 0 // 0x0
.size numDrawSurfaces, 4
.type drawSurfaces,@object // @drawSurfaces
.globl drawSurfaces
.p2align 3, 0x0
drawSurfaces:
.xword 0
.size drawSurfaces, 8
.type dshaders,@object // @dshaders
.globl dshaders
.p2align 3, 0x0
dshaders:
.xword 0
.size dshaders, 8
.type defaultLightSubdivide,@object // @defaultLightSubdivide
.globl defaultLightSubdivide
.p2align 2, 0x0
defaultLightSubdivide:
.word 0x00000000 // float 0
.size defaultLightSubdivide, 4
.type surfaceTest,@object // @surfaceTest
.globl surfaceTest
.p2align 3, 0x0
surfaceTest:
.xword 0
.size surfaceTest, 8
.type .L.str.1,@object // @.str.1
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.1:
.asciz "WARNING: surface at (%i %i %i) has autosprite shader but isn't a quad\n"
.size .L.str.1, 71
.type drawVerts,@object // @drawVerts
.bss
.globl drawVerts
.p2align 3, 0x0
drawVerts:
.xword 0
.size drawVerts, 8
.type .L.str.2,@object // @.str.2
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.2:
.asciz "WARNING: surface at (%i %i %i) has autosprite shader but %i verts\n"
.size .L.str.2, 67
.type numPointLights,@object // @numPointLights
.bss
.globl numPointLights
.p2align 2, 0x0
numPointLights:
.word 0 // 0x0
.size numPointLights, 4
.type lights,@object // @lights
.globl lights
.p2align 3, 0x0
lights:
.xword 0
.size lights, 8
.type pointScale,@object // @pointScale
.globl pointScale
.p2align 2, 0x0
pointScale:
.word 0 // 0x0
.size pointScale, 4
.type emit_point,@object // @emit_point
.globl emit_point
.p2align 2, 0x0
emit_point:
.word 0 // 0x0
.size emit_point, 4
.type vec3_origin,@object // @vec3_origin
.globl vec3_origin
.p2align 2, 0x0
vec3_origin:
.word 0 // 0x0
.size vec3_origin, 4
.type qtrue,@object // @qtrue
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type .L.str.3,@object // @.str.3
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.3:
.asciz "%5i light emitting surfaces\n"
.size .L.str.3, 29
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym qprintf
.addrsig_sym ShaderInfoForShader
.addrsig_sym _printf
.addrsig_sym VectorAdd
.addrsig_sym VectorScale
.addrsig_sym malloc
.addrsig_sym memset
.addrsig_sym VectorCopy
.addrsig_sym AllocWinding
.addrsig_sym memcpy
.addrsig_sym ReverseWinding
.addrsig_sym FreeWinding
.addrsig_sym VectorSubtract
.addrsig_sym SubdivideAreaLight
.addrsig_sym numDrawSurfaces
.addrsig_sym drawSurfaces
.addrsig_sym dshaders
.addrsig_sym defaultLightSubdivide
.addrsig_sym surfaceTest
.addrsig_sym drawVerts
.addrsig_sym numPointLights
.addrsig_sym lights
.addrsig_sym pointScale
.addrsig_sym emit_point
.addrsig_sym vec3_origin
.addrsig_sym qtrue
|
../AnghaBench/Quake-III-Arena/q3map/extr_light.c_CreateSurfaceLights.c
|
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_30__ TYPE_2__ ;
typedef struct TYPE_29__ TYPE_1__ ;
/* Type definitions */
struct TYPE_29__ {int /*<<< orphan*/ headnode; } ;
typedef TYPE_1__ tree_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_30__ {int /*<<< orphan*/ brushes; scalar_t__ firstDrawSurf; } ;
typedef TYPE_2__ entity_t ;
typedef int /*<<< orphan*/ bspface_t ;
/* Variables and functions */
int /*<<< orphan*/ AddTriangleModels (TYPE_1__*) ;
int /*<<< orphan*/ AllocateLightmaps (TYPE_2__*) ;
int /*<<< orphan*/ BeginModel () ;
int /*<<< orphan*/ ClipSidesIntoTree (TYPE_2__*,TYPE_1__*) ;
int /*<<< orphan*/ EndModel (int /*<<< orphan*/ ) ;
TYPE_1__* FaceBSP (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ FillOutside (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ FilterDetailBrushesIntoTree (TYPE_2__*,TYPE_1__*) ;
int /*<<< orphan*/ FilterDrawsurfsIntoTree (TYPE_2__*,TYPE_1__*) ;
int /*<<< orphan*/ FilterStructuralBrushesIntoTree (TYPE_2__*,TYPE_1__*) ;
int /*<<< orphan*/ FixTJunctions (TYPE_2__*) ;
int /*<<< orphan*/ FloodAreas (TYPE_1__*) ;
scalar_t__ FloodEntities (TYPE_1__*) ;
int /*<<< orphan*/ FogDrawSurfs () ;
int /*<<< orphan*/ FreeTree (TYPE_1__*) ;
int /*<<< orphan*/ LeakFile (TYPE_1__*) ;
int /*<<< orphan*/ * MakeStructuralBspFaceList (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MakeTreePortals (TYPE_1__*) ;
int /*<<< orphan*/ * MakeVisibleBspFaceList (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ MergeSides (TYPE_2__*,TYPE_1__*) ;
int /*<<< orphan*/ NumberClusters (TYPE_1__*) ;
int /*<<< orphan*/ PatchMapDrawSurfs (TYPE_2__*) ;
int /*<<< orphan*/ SubdivideDrawSurfs (TYPE_2__*,TYPE_1__*) ;
int /*<<< orphan*/ WriteGLView (TYPE_1__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ WritePortalFile (TYPE_1__*) ;
int /*<<< orphan*/ _printf (char*) ;
TYPE_2__* entities ;
int /*<<< orphan*/ exit (int /*<<< orphan*/ ) ;
scalar_t__ glview ;
scalar_t__ leaktest ;
int /*<<< orphan*/ nofog ;
int /*<<< orphan*/ nomerge ;
int /*<<< orphan*/ nosubdivide ;
int /*<<< orphan*/ notjunc ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ source ;
void ProcessWorldModel( void ) {
entity_t *e;
tree_t *tree;
bspface_t *faces;
qboolean leaked;
BeginModel();
e = &entities[0];
e->firstDrawSurf = 0;//numMapDrawSurfs;
// check for patches with adjacent edges that need to LOD together
PatchMapDrawSurfs( e );
// build an initial bsp tree using all of the sides
// of all of the structural brushes
faces = MakeStructuralBspFaceList ( entities[0].brushes );
tree = FaceBSP( faces );
MakeTreePortals (tree);
FilterStructuralBrushesIntoTree( e, tree );
// see if the bsp is completely enclosed
if ( FloodEntities (tree) ) {
// rebuild a better bsp tree using only the
// sides that are visible from the inside
FillOutside (tree->headnode);
// chop the sides to the convex hull of
// their visible fragments, giving us the smallest
// polygons
ClipSidesIntoTree( e, tree );
faces = MakeVisibleBspFaceList( entities[0].brushes );
FreeTree (tree);
tree = FaceBSP( faces );
MakeTreePortals( tree );
FilterStructuralBrushesIntoTree( e, tree );
leaked = qfalse;
} else {
_printf ("**********************\n");
_printf ("******* leaked *******\n");
_printf ("**********************\n");
LeakFile (tree);
if ( leaktest ) {
_printf ("--- MAP LEAKED, ABORTING LEAKTEST ---\n");
exit (0);
}
leaked = qtrue;
// chop the sides to the convex hull of
// their visible fragments, giving us the smallest
// polygons
ClipSidesIntoTree( e, tree );
}
// save out information for visibility processing
NumberClusters( tree );
if ( !leaked ) {
WritePortalFile( tree );
}
if ( glview ) {
// dump the portals for debugging
WriteGLView( tree, source );
}
FloodAreas (tree);
// add references to the detail brushes
FilterDetailBrushesIntoTree( e, tree );
// create drawsurfs for triangle models
AddTriangleModels( tree );
// drawsurfs that cross fog boundaries will need to
// be split along the bound
if ( !nofog ) {
FogDrawSurfs(); // may fragment drawsurfs
}
// subdivide each drawsurf as required by shader tesselation
if ( !nosubdivide ) {
SubdivideDrawSurfs( e, tree );
}
// merge together all common shaders on the same plane and remove
// all colinear points, so extra tjunctions won't be generated
if ( !nomerge ) {
MergeSides( e, tree ); // !@# testing
}
// add in any vertexes required to fix tjunctions
if ( !notjunc ) {
FixTJunctions( e );
}
// allocate lightmaps for faces and patches
AllocateLightmaps( e );
// add references to the final drawsurfs in the apropriate clusters
FilterDrawsurfsIntoTree( e, tree );
EndModel( tree->headnode );
FreeTree (tree);
}
|
.text
.file "extr_bsp.c_ProcessWorldModel.c"
.globl ProcessWorldModel // -- Begin function ProcessWorldModel
.p2align 2
.type ProcessWorldModel,@function
ProcessWorldModel: // @ProcessWorldModel
.cfi_startproc
// %bb.0:
sub sp, sp, #64
.cfi_def_cfa_offset 64
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
bl BeginModel
adrp x8, entities
str x8, [sp, #8] // 8-byte Folded Spill
ldr x8, [x8, :lo12:entities]
stur x8, [x29, #-8]
ldur x8, [x29, #-8]
str xzr, [x8, #8]
ldur x0, [x29, #-8]
bl PatchMapDrawSurfs
ldr x8, [sp, #8] // 8-byte Folded Reload
ldr x8, [x8, :lo12:entities]
ldr w0, [x8]
bl MakeStructuralBspFaceList
str x0, [sp, #24]
ldr x0, [sp, #24]
bl FaceBSP
stur x0, [x29, #-16]
ldur x0, [x29, #-16]
bl MakeTreePortals
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl FilterStructuralBrushesIntoTree
ldur x0, [x29, #-16]
bl FloodEntities
subs x8, x0, #0
cset w8, eq
tbnz w8, #0, .LBB0_2
b .LBB0_1
.LBB0_1:
ldur x8, [x29, #-16]
ldr w0, [x8]
bl FillOutside
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl ClipSidesIntoTree
adrp x8, entities
ldr x8, [x8, :lo12:entities]
ldr w0, [x8]
bl MakeVisibleBspFaceList
str x0, [sp, #24]
ldur x0, [x29, #-16]
bl FreeTree
ldr x0, [sp, #24]
bl FaceBSP
stur x0, [x29, #-16]
ldur x0, [x29, #-16]
bl MakeTreePortals
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl FilterStructuralBrushesIntoTree
adrp x8, qfalse
ldr w8, [x8, :lo12:qfalse]
str w8, [sp, #20]
b .LBB0_5
.LBB0_2:
adrp x0, .L.str
add x0, x0, :lo12:.L.str
str x0, [sp] // 8-byte Folded Spill
bl _printf
adrp x0, .L.str.1
add x0, x0, :lo12:.L.str.1
bl _printf
ldr x0, [sp] // 8-byte Folded Reload
bl _printf
ldur x0, [x29, #-16]
bl LeakFile
adrp x8, leaktest
ldr x8, [x8, :lo12:leaktest]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_4
b .LBB0_3
.LBB0_3:
adrp x0, .L.str.2
add x0, x0, :lo12:.L.str.2
bl _printf
mov w0, wzr
bl exit
.LBB0_4:
adrp x8, qtrue
ldr w8, [x8, :lo12:qtrue]
str w8, [sp, #20]
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl ClipSidesIntoTree
b .LBB0_5
.LBB0_5:
ldur x0, [x29, #-16]
bl NumberClusters
ldr w8, [sp, #20]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_7
b .LBB0_6
.LBB0_6:
ldur x0, [x29, #-16]
bl WritePortalFile
b .LBB0_7
.LBB0_7:
adrp x8, glview
ldr x8, [x8, :lo12:glview]
subs x8, x8, #0
cset w8, eq
tbnz w8, #0, .LBB0_9
b .LBB0_8
.LBB0_8:
ldur x0, [x29, #-16]
adrp x8, source
ldr w1, [x8, :lo12:source]
bl WriteGLView
b .LBB0_9
.LBB0_9:
ldur x0, [x29, #-16]
bl FloodAreas
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl FilterDetailBrushesIntoTree
ldur x0, [x29, #-16]
bl AddTriangleModels
adrp x8, nofog
ldr w8, [x8, :lo12:nofog]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_11
b .LBB0_10
.LBB0_10:
bl FogDrawSurfs
b .LBB0_11
.LBB0_11:
adrp x8, nosubdivide
ldr w8, [x8, :lo12:nosubdivide]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_13
b .LBB0_12
.LBB0_12:
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl SubdivideDrawSurfs
b .LBB0_13
.LBB0_13:
adrp x8, nomerge
ldr w8, [x8, :lo12:nomerge]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_15
b .LBB0_14
.LBB0_14:
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl MergeSides
b .LBB0_15
.LBB0_15:
adrp x8, notjunc
ldr w8, [x8, :lo12:notjunc]
subs w8, w8, #0
cset w8, ne
tbnz w8, #0, .LBB0_17
b .LBB0_16
.LBB0_16:
ldur x0, [x29, #-8]
bl FixTJunctions
b .LBB0_17
.LBB0_17:
ldur x0, [x29, #-8]
bl AllocateLightmaps
ldur x0, [x29, #-8]
ldur x1, [x29, #-16]
bl FilterDrawsurfsIntoTree
ldur x8, [x29, #-16]
ldr w0, [x8]
bl EndModel
ldur x0, [x29, #-16]
bl FreeTree
.cfi_def_cfa wsp, 64
ldp x29, x30, [sp, #48] // 16-byte Folded Reload
add sp, sp, #64
.cfi_def_cfa_offset 0
.cfi_restore w30
.cfi_restore w29
ret
.Lfunc_end0:
.size ProcessWorldModel, .Lfunc_end0-ProcessWorldModel
.cfi_endproc
// -- End function
.type entities,@object // @entities
.bss
.globl entities
.p2align 3, 0x0
entities:
.xword 0
.size entities, 8
.type qfalse,@object // @qfalse
.globl qfalse
.p2align 2, 0x0
qfalse:
.word 0 // 0x0
.size qfalse, 4
.type .L.str,@object // @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "**********************\n"
.size .L.str, 24
.type .L.str.1,@object // @.str.1
.L.str.1:
.asciz "******* leaked *******\n"
.size .L.str.1, 24
.type leaktest,@object // @leaktest
.bss
.globl leaktest
.p2align 3, 0x0
leaktest:
.xword 0 // 0x0
.size leaktest, 8
.type .L.str.2,@object // @.str.2
.section .rodata.str1.1,"aMS",@progbits,1
.L.str.2:
.asciz "--- MAP LEAKED, ABORTING LEAKTEST ---\n"
.size .L.str.2, 39
.type qtrue,@object // @qtrue
.bss
.globl qtrue
.p2align 2, 0x0
qtrue:
.word 0 // 0x0
.size qtrue, 4
.type glview,@object // @glview
.globl glview
.p2align 3, 0x0
glview:
.xword 0 // 0x0
.size glview, 8
.type source,@object // @source
.globl source
.p2align 2, 0x0
source:
.word 0 // 0x0
.size source, 4
.type nofog,@object // @nofog
.globl nofog
.p2align 2, 0x0
nofog:
.word 0 // 0x0
.size nofog, 4
.type nosubdivide,@object // @nosubdivide
.globl nosubdivide
.p2align 2, 0x0
nosubdivide:
.word 0 // 0x0
.size nosubdivide, 4
.type nomerge,@object // @nomerge
.globl nomerge
.p2align 2, 0x0
nomerge:
.word 0 // 0x0
.size nomerge, 4
.type notjunc,@object // @notjunc
.globl notjunc
.p2align 2, 0x0
notjunc:
.word 0 // 0x0
.size notjunc, 4
.ident "Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym BeginModel
.addrsig_sym PatchMapDrawSurfs
.addrsig_sym MakeStructuralBspFaceList
.addrsig_sym FaceBSP
.addrsig_sym MakeTreePortals
.addrsig_sym FilterStructuralBrushesIntoTree
.addrsig_sym FloodEntities
.addrsig_sym FillOutside
.addrsig_sym ClipSidesIntoTree
.addrsig_sym MakeVisibleBspFaceList
.addrsig_sym FreeTree
.addrsig_sym _printf
.addrsig_sym LeakFile
.addrsig_sym exit
.addrsig_sym NumberClusters
.addrsig_sym WritePortalFile
.addrsig_sym WriteGLView
.addrsig_sym FloodAreas
.addrsig_sym FilterDetailBrushesIntoTree
.addrsig_sym AddTriangleModels
.addrsig_sym FogDrawSurfs
.addrsig_sym SubdivideDrawSurfs
.addrsig_sym MergeSides
.addrsig_sym FixTJunctions
.addrsig_sym AllocateLightmaps
.addrsig_sym FilterDrawsurfsIntoTree
.addrsig_sym EndModel
.addrsig_sym entities
.addrsig_sym qfalse
.addrsig_sym leaktest
.addrsig_sym qtrue
.addrsig_sym glview
.addrsig_sym source
.addrsig_sym nofog
.addrsig_sym nosubdivide
.addrsig_sym nomerge
.addrsig_sym notjunc
|
../AnghaBench/Quake-III-Arena/q3map/extr_bsp.c_ProcessWorldModel.c
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.