Dataset Viewer
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
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 16