decompiled_code:
void __fastcall delete_list(void *ptr)
{
_QWORD *i; // rdi

for ( i = *(_QWORD **)ptr; i; i = (_QWORD *)*((_QWORD *)ptr + 1) )
{
*((_QWORD *)ptr + 1) = i[25];
free(i);
}
free(ptr);
}

canonical_decompiled_code:
void __fastcall func1(void *ptr)
{
_QWORD *i; // rdi

for ( i = *(_QWORD **)ptr; i; i = (_QWORD *)*((_QWORD *)ptr + 1) )
{
*((_QWORD *)ptr + 1) = i[25];
free(i);
}
free(ptr);
}

original_code:
void delete_list(instlist* list)
{
    instnode *temp = ((void *)0);
    if (list->head != ((void *)0))
    {
        list->cur = list->head;
        while (list->cur != ((void *)0))
        {
            temp = list->cur;
            list->cur = list->cur->next;
            free(temp);
        }
    }
    free(list);
}

canonical_original_code:
void delete_list(struct instlist_s *list)
{
    struct instnode_s *temp = ((void *)0);
    if (list->head != ((void *)0))
    {
        list->cur = list->head;
        while (list->cur != ((void *)0))
        {
            temp = list->cur;
            list->cur = list->cur->next;
            free(temp);
        }
    }
    free(list);
}

variable_types: struct instnode_s { int address; int lineno; char label[32]; int inst_type; char opcode_name[8]; char opcode_bin[8]; char bin_inst[33]; char hex_inst[33]; char rs1[6]; char rs2[6]; char rt[6]; char sa[6]; char imm[17]; char symbol[32]; struct instnode_s *next; } *


repo: mattstevens/dmap-parser

decompiled_code:
__int16 __fastcall dmap_read_u16(_WORD *a1)
{
return __ROL2__(*a1, 8);
}

canonical_decompiled_code:
__int16 __fastcall func0(_WORD *a1)
{
return __ROL2__(*a1, 8);
}

original_code:
static uint16_t dmap_read_u16(const char *buf) {
 return (uint16_t)(((buf[0] & 0xff) << 8) | (buf[1] & 0xff));
}

canonical_original_code:
static unsigned short dmap_read_u16(char *buf) {
 return (unsigned short)(((buf[0] & 0xff) << 8) | (buf[1] & 0xff));
}

variable_types:
buf
char *

return_type: unsigned short


decompiled_code:
// attributes: thunk
__int16 __fastcall dmap_read_i16(_WORD *a1)
{
return dmap_read_u16(a1);
}

canonical_decompiled_code:
__int16 __fastcall func1(_WORD *a1)
{
return func0(a1);
}

original_code:
static int16_t dmap_read_i16(const char *buf) {
 return (int16_t)dmap_read_u16(buf);
}

canonical_original_code:
static short dmap_read_i16(char *buf) {
 return (short)dmap_read_u16(buf);
}

return_type: short


decompiled_code:
__int64 __fastcall dmap_read_u32(unsigned int *a1)
{
return _byteswap_ulong(*a1);
}

canonical_decompiled_code:
__int64 __fastcall func2(unsigned int *a1)
{
return _byteswap_ulong(*a1);
}

canonical_original_code:
static unsigned int dmap_read_u32(char *buf) {
 return ((unsigned int)(buf[0] & 0xff) << 24) |
 ((unsigned int)(buf[1] & 0xff) << 16) |
 ((unsigned int)(buf[2] & 0xff) << 8) |
 ((unsigned int)(buf[3] & 0xff));
}

return_type: unsigned int


decompiled_code:
// attributes: thunk
__int64 __fastcall dmap_read_i32(unsigned int *a1)
{
return dmap_read_u32(a1);
}

canonical_decompiled_code:
__int64 __fastcall func3(unsigned int *a1)
{
return func2(a1);
}

original_code:
static int32_t dmap_read_i32(const char *buf) {
 return (int32_t)dmap_read_u32(buf);
}

canonical_original_code:
static int dmap_read_i32(char *buf) {
 return (int)dmap_read_u32(buf);
}

return_type: int


decompiled_code:
unsigned __int64 __fastcall dmap_read_u64(unsigned __int64 *a1)
{
return _byteswap_uint64(*a1);
}

canonical_decompiled_code:
unsigned __int64 __fastcall func4(unsigned __int64 *a1)
{
return _byteswap_uint64(*a1);
}

canonical_original_code:
static unsigned long dmap_read_u64(char *buf) {
 return ((unsigned long)(buf[0] & 0xff) << 56) |
 ((unsigned long)(buf[1] & 0xff) << 48) |
 ((unsigned long)(buf[2] & 0xff) << 40) |
 ((unsigned long)(buf[3] & 0xff) << 32) |
 ((unsigned long)(buf[4] & 0xff) << 24) |
 ((unsigned long)(buf[5] & 0xff) << 16) |
 ((unsigned long)(buf[6] & 0xff) << 8) |
 ((unsigned long)(buf[7] & 0xff));
}

return_type: unsigned long


decompiled_code:
// attributes: thunk
unsigned __int64 __fastcall dmap_read_i64(unsigned __int64 *a1)
{
return dmap_read_u64(a1);
}

canonical_decompiled_code:
unsigned __int64 __fastcall func5(unsigned __int64 *a1)
{
return func4(a1);
}

original_code:
static int64_t dmap_read_i64(const char *buf) {
 return (int64_t)dmap_read_u64(buf);
}

canonical_original_code:
static long dmap_read_i64(char *buf) {
 return (long)dmap_read_u64(buf);
}

return_type: long


decompiled_code:
void *__fastcall dmap_field_from_code(__int64 a1)
{
__int64 v2[5]; // [rsp+0h] [rbp-28h] BYREF

v2[0] = a1;
return bsearch(v2, &dmap_fields, 0x10CuLL, 0x18uLL, dmap_field_sort);
}

canonical_decompiled_code:
void *__fastcall func6(__int64 a1)
{
__int64 v2[5]; // [rsp+0h] [rbp-28h] BYREF

v2[0] = a1;
return bsearch(v2, &dmap_fields, 0x10CuLL, 0x18uLL, dmap_field_sort);
}

original_code:
static const dmap_field *dmap_field_from_code(const char *code) {
 dmap_field key;
 key.code = code;
 return bsearch(&key, dmap_fields, dmap_field_count, sizeof(dmap_field), (sort_func)dmap_field_sort);
}

canonical_original_code:
static struct dmap_field *dmap_field_from_code(char *code) {
 struct dmap_field key;
 key.code = code;
 return bsearch(&key, dmap_fields, dmap_field_count, sizeof(dmap_field), (int (*)(void *, void *))dmap_field_sort);
}

variable_types:
code
char *

return_type: struct dmap_field { char *code; enum DMAP_TYPE { DMAP_UNKNOWN=0, DMAP_UINT=1, DMAP_INT=2, DMAP_STR=3, DMAP_DATA=4, DMAP_DATE=5, DMAP_VERS=6, DMAP_DICT=7, DMAP_ITEM=8 } type; enum DMAP_TYPE { DMAP_UNKNOWN=0, DMAP_UINT=1, DMAP_INT=2, DMAP_STR=3, DMAP_DATA=4, DMAP_DATE=5, DMAP_VERS=6, DMAP_DICT=7, DMAP_ITEM=8 } list_item_type; char *name; } *

user_defined_types: struct dmap_field { char *code; enum DMAP_TYPE type; enum DMAP_TYPE list_item_type; char *name; }


decompiled_code:
int __fastcall dmap_field_sort(const void *a1, const void *a2)
{
return memcmp(*(const void **)a1, *(const void **)a2, 4uLL);
}

canonical_decompiled_code:
int __fastcall func7(const void *a1, const void *a2)
{
return memcmp(*(const void **)a1, *(const void **)a2, 4uLL);
}

original_code:
static int dmap_field_sort(const dmap_field *a, const dmap_field *b) {
 return memcmp(a->code, b->code, 4);
}

canonical_original_code:
static int dmap_field_sort(struct dmap_field *a, struct dmap_field *b) {
 return memcmp(a->code, b->code, 4);
}

variable_types: struct dmap_field { char *code; enum DMAP_TYPE { DMAP_UNKNOWN=0, DMAP_UINT=1, DMAP_INT=2, DMAP_STR=3, DMAP_DATA=4, DMAP_DATE=5, DMAP_VERS=6, DMAP_DICT=7, DMAP_ITEM=8 } type; enum DMAP_TYPE { DMAP_UNKNOWN=0, DMAP_UINT=1, DMAP_INT=2, DMAP_STR=3, DMAP_DATA=4, DMAP_DATE=5, DMAP_VERS=6, DMAP_DICT=7, DMAP_ITEM=8 } list_item_type; char *name; } *

variable_types:
b
struct dmap_field *


decompiled_code:
__int64 __fastcall dmap_parse_internal(__int64 a1, unsigned int *a2, __int64 a3, __int64 a4)
{
char *v4; // r13
unsigned int *v5; // rbx
void *v6; // r12
unsigned int v7; // eax
__int64 v8; // rcx
unsigned int *v9; // r9
unsigned __int64 v10; // r8
unsigned int v11; // er15
int v12; // eax
int *v13; // r14
void (__fastcall *v14)(_QWORD, unsigned int *, int *); // rax
const unsigned __int16 **v16; // rax
const unsigned __int16 *v17; // rsi
__int64 v18; // rax
void (__fastcall *v19)(_QWORD, unsigned int *, int *, unsigned int *); // rax
__int16 v20; // ax
__int64 v21; // rdx
void (__fastcall *v22)(_QWORD, unsigned int *, __int64, _QWORD); // r8
_WORD *v23; // r9
unsigned __int16 v24; // ax
__int64 v25; // rcx
size_t v26; // rax
unsigned int v27; // eax
void (__fastcall *v28)(_QWORD, unsigned int *, int *, _QWORD); // r8
unsigned __int16 v29; // ax
__int64 v30; // rdx
void (__fastcall *v31)(_QWORD, unsigned int *, __int64, _QWORD); // r8
unsigned __int64 v32; // rax
void (__fastcall *v33)(_QWORD, unsigned int *, int *, unsigned __int64); // r8
const unsigned __int16 **v34; // rax
void (__fastcall *v35)(_QWORD, unsigned int *, _QWORD, _QWORD); // rax
void (__fastcall *v36)(_QWORD, unsigned int *, int *, _QWORD); // rax
unsigned __int64 v37; // [rsp+0h] [rbp-88h]
__int64 v38; // [rsp+0h] [rbp-88h]
unsigned __int64 v39; // [rsp+0h] [rbp-88h]
unsigned int *v40; // [rsp+8h] [rbp-80h]
unsigned __int64 v41; // [rsp+8h] [rbp-80h]
unsigned int *v42; // [rsp+8h] [rbp-80h]
unsigned int *v43; // [rsp+10h] [rbp-78h]
__int64 v44; // [rsp+10h] [rbp-78h]
unsigned int v46; // [rsp+2Bh] [rbp-5Dh] BYREF
char v47; // [rsp+2Fh] [rbp-59h]
char s[88]; // [rsp+30h] [rbp-58h] BYREF

v4 = (char *)a2 + a3;
v46 = 0;
v47 = 0;
if ( !a1 )
return 0xFFFFFFFFLL;
v5 = a2;
if ( !a2 )
return 0xFFFFFFFFLL;
if ( a3 > 7 )
{
while ( 1 )
{
v46 = *v5;
v6 = dmap_field_from_code((__int64)&v46);
v7 = dmap_read_u32(v5 + 1);
v10 = v7;
v5 = (unsigned int *)((char *)v9 + v7);
v11 = v7;
if ( v5 > (unsigned int *)v4 )
return 0xFFFFFFFFLL;
if ( v6 )
break;
if ( v7 <= 7uLL )
{
v38 = v8;
if ( !v7 )
{
LABEL_28:
v13 = (int *)&v46;
LABEL_29:
v19 = *(void (__fastcall **)(_QWORD, unsigned int *, int *, unsigned int *))(a1 + 56);
if ( !v19 )
goto LABEL_15;
LABEL_27:
v19(*(_QWORD *)(a1 + 72), &v46, v13, v9);
goto LABEL_15;
}
v43 = v9;
v41 = v7;
v16 = _ctype_b_loc();
v10 = v41;
v9 = v43;
v17 = *v16;
v8 = v38;
}
else
{
v44 = v8;
v42 = v9;
v39 = v7;
v34 = _ctype_b_loc();
v8 = v44;
v10 = v39;
v17 = *v34;
v9 = v42;
if ( ((*v34)[*(unsigned __int8 *)(v44 + 8)] & 0x400) != 0
&& (v17[*(unsigned __int8 *)(v44 + 9)] & 0x400) != 0
&& (v17[*(unsigned __int8 *)(v44 + 10)] & 0x400) != 0
&& (v17[*(unsigned __int8 *)(v44 + 11)] & 0x400) != 0 )
{
v13 = (int *)&v46;
if ( v11 > (unsigned int)dmap_read_u32((unsigned int *)(v44 + 12)) )
goto LABEL_10;
}
}
v18 = 0LL;
while ( (v17[*(unsigned __int8 *)(v8 + v18 + 8)] & 0x4000) != 0 )
{
if ( v10 <= ++v18 )
goto LABEL_28;
}
v13 = (int *)&v46;
LABEL_23:
if ( v11 == 4 )
{
if ( !*(_QWORD *)(a1 + 32) )
goto LABEL_15;
LABEL_41:
v27 = dmap_read_u32(v9);
goto LABEL_42;
}
if ( v11 <= 4 )
{
if ( v11 == 1 )
{
v36 = *(void (__fastcall **)(_QWORD, unsigned int *, int *, _QWORD))(a1 + 32);
if ( v36 )
v36(*(_QWORD *)(a1 + 72), &v46, v13, *(unsigned __int8 *)(v8 + 8));
goto LABEL_15;
}
if ( v11 == 2 )
{
if ( *(_QWORD *)(a1 + 32) )
{
v29 = dmap_read_u16(v9);
v31(*(_QWORD *)(a1 + 72), &v46, v30, v29);
}
goto LABEL_15;
}
}
else if ( v11 == 8 )
{
if ( *(_QWORD *)(a1 + 40) )
{
v32 = dmap_read_u64((unsigned __int64 *)v9);
LABEL_50:
v33(*(_QWORD *)(a1 + 72), &v46, v13, v32);
}
goto LABEL_15;
}
LABEL_26:
v19 = *(void (__fastcall **)(_QWORD, unsigned int *, int *, unsigned int *))(a1 + 64);
if ( v19 )
goto LABEL_27;
LABEL_15:
if ( v4 - (char *)v5 <= 7 )
return (unsigned int)-(v4 != (char *)v5);
}
v12 = *((_DWORD *)v6 + 2);
v13 = (int *)*((_QWORD *)v6 + 2);
if ( v12 != 8 || a4 && (v12 = *(_DWORD *)(a4 + 12)) != 0 )
{
switch ( v12 )
{
case 1:
goto LABEL_23;
case 2:
if ( v11 != 4 )
{
if ( v11 > 4 )
{
if ( v11 != 8 )
goto LABEL_26;
if ( *(_QWORD *)(a1 + 24) )
{
v32 = dmap_read_i64((unsigned __int64 *)v9);
goto LABEL_50;
}
}
else if ( v11 == 1 )
{
v35 = *(void (__fastcall **)(_QWORD, unsigned int *, _QWORD, _QWORD))(a1 + 16);
if ( v35 )
v35(*(_QWORD *)(a1 + 72), &v46, *((_QWORD *)v6 + 2), (unsigned int)*(char *)(v8 + 8));
}
else
{
if ( v11 != 2 )
goto LABEL_26;
if ( *(_QWORD *)(a1 + 16) )
{
v20 = dmap_read_i16(v9);
v22(*(_QWORD *)(a1 + 72), &v46, v21, (unsigned int)v20);
}
}
goto LABEL_15;
}
if ( !*(_QWORD *)(a1 + 16) )
goto LABEL_15;
v27 = dmap_read_i32(v9);
break;
case 3:
goto LABEL_29;
case 4:
goto LABEL_26;
case 5:
if ( *(_QWORD *)(a1 + 48) )
goto LABEL_41;
goto LABEL_15;
case 6:
if ( *(_QWORD *)(a1 + 56) && v10 > 3 )
{
dmap_read_u16((_WORD *)(v8 + 10));
v24 = dmap_read_u16(v23);
sprintf(s, "%u.%u", v24, v25);
v26 = strlen(s);
(*(void (__fastcall **)(_QWORD, unsigned int *, int *, char *, size_t))(a1 + 56))(
*(_QWORD *)(a1 + 72),
&v46,
v13,
s,
v26);
}
goto LABEL_15;
case 7:
goto LABEL_10;
case 8:
abort();
default:
goto LABEL_15;
}
LABEL_42:
v28(*(_QWORD *)(a1 + 72), &v46, v13, v27);
goto LABEL_15;
}
LABEL_10:
if ( *(_QWORD *)a1 )
{
v37 = v10;
v40 = v9;
(*(void (__fastcall **)(_QWORD, unsigned int *, int *))a1)(*(_QWORD *)(a1 + 72), &v46, v13);
v9 = v40;
v10 = v37;
}
if ( (unsigned int)dmap_parse_internal(a1, v9, v10, v6) )
return 0xFFFFFFFFLL;
v14 = *(void (__fastcall **)(_QWORD, unsigned int *, int *))(a1 + 8);
if ( v14 )
v14(*(_QWORD *)(a1 + 72), &v46, v13);
goto LABEL_15;
}
return (unsigned int)-(v4 != (char *)v5);
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, unsigned int *a2, __int64 a3, __int64 a4)
{
char *v4; // r13
unsigned int *v5; // rbx
void *v6; // r12
unsigned int v7; // eax
__int64 v8; // rcx
unsigned int *v9; // r9
unsigned __int64 v10; // r8
unsigned int v11; // er15
int v12; // eax
int *v13; // r14
void (__fastcall *v14)(_QWORD, unsigned int *, int *); // rax
const unsigned __int16 **v16; // rax
const unsigned __int16 *v17; // rsi
__int64 v18; // rax
void (__fastcall *v19)(_QWORD, unsigned int *, int *, unsigned int *); // rax
__int16 v20; // ax
__int64 v21; // rdx
void (__fastcall *v22)(_QWORD, unsigned int *, __int64, _QWORD); // r8
_WORD *v23; // r9
unsigned __int16 v24; // ax
__int64 v25; // rcx
size_t v26; // rax
unsigned int v27; // eax
void (__fastcall *v28)(_QWORD, unsigned int *, int *, _QWORD); // r8
unsigned __int16 v29; // ax
__int64 v30; // rdx
void (__fastcall *v31)(_QWORD, unsigned int *, __int64, _QWORD); // r8
unsigned __int64 v32; // rax
void (__fastcall *v33)(_QWORD, unsigned int *, int *, unsigned __int64); // r8
const unsigned __int16 **v34; // rax
void (__fastcall *v35)(_QWORD, unsigned int *, _QWORD, _QWORD); // rax
void (__fastcall *v36)(_QWORD, unsigned int *, int *, _QWORD); // rax
unsigned __int64 v37; // [rsp+0h] [rbp-88h]
__int64 v38; // [rsp+0h] [rbp-88h]
unsigned __int64 v39; // [rsp+0h] [rbp-88h]
unsigned int *v40; // [rsp+8h] [rbp-80h]
unsigned __int64 v41; // [rsp+8h] [rbp-80h]
unsigned int *v42; // [rsp+8h] [rbp-80h]
unsigned int *v43; // [rsp+10h] [rbp-78h]
__int64 v44; // [rsp+10h] [rbp-78h]
unsigned int v46; // [rsp+2Bh] [rbp-5Dh] BYREF
char v47; // [rsp+2Fh] [rbp-59h]
char s[88]; // [rsp+30h] [rbp-58h] BYREF

v4 = (char *)a2 + a3;
v46 = 0;
v47 = 0;
if ( !a1 )
return 0xFFFFFFFFLL;
v5 = a2;
if ( !a2 )
return 0xFFFFFFFFLL;
if ( a3 > 7 )
{
while ( 1 )
{
v46 = *v5;
v6 = func6((__int64)&v46);
v7 = func2(v5 + 1);
v10 = v7;
v5 = (unsigned int *)((char *)v9 + v7);
v11 = v7;
if ( v5 > (unsigned int *)v4 )
return 0xFFFFFFFFLL;
if ( v6 )
break;
if ( v7 <= 7uLL )
{
v38 = v8;
if ( !v7 )
{
LABEL_28:
v13 = (int *)&v46;
LABEL_29:
v19 = *(void (__fastcall **)(_QWORD, unsigned int *, int *, unsigned int *))(a1 + 56);
if ( !v19 )
goto LABEL_15;
LABEL_27:
v19(*(_QWORD *)(a1 + 72), &v46, v13, v9);
goto LABEL_15;
}
v43 = v9;
v41 = v7;
v16 = _ctype_b_loc();
v10 = v41;
v9 = v43;
v17 = *v16;
v8 = v38;
}
else
{
v44 = v8;
v42 = v9;
v39 = v7;
v34 = _ctype_b_loc();
v8 = v44;
v10 = v39;
v17 = *v34;
v9 = v42;
if ( ((*v34)[*(unsigned __int8 *)(v44 + 8)] & 0x400) != 0
&& (v17[*(unsigned __int8 *)(v44 + 9)] & 0x400) != 0
&& (v17[*(unsigned __int8 *)(v44 + 10)] & 0x400) != 0
&& (v17[*(unsigned __int8 *)(v44 + 11)] & 0x400) != 0 )
{
v13 = (int *)&v46;
if ( v11 > (unsigned int)func2((unsigned int *)(v44 + 12)) )
goto LABEL_10;
}
}
v18 = 0LL;
while ( (v17[*(unsigned __int8 *)(v8 + v18 + 8)] & 0x4000) != 0 )
{
if ( v10 <= ++v18 )
goto LABEL_28;
}
v13 = (int *)&v46;
LABEL_23:
if ( v11 == 4 )
{
if ( !*(_QWORD *)(a1 + 32) )
goto LABEL_15;
LABEL_41:
v27 = func2(v9);
goto LABEL_42;
}
if ( v11 <= 4 )
{
if ( v11 == 1 )
{
v36 = *(void (__fastcall **)(_QWORD, unsigned int *, int *, _QWORD))(a1 + 32);
if ( v36 )
v36(*(_QWORD *)(a1 + 72), &v46, v13, *(unsigned __int8 *)(v8 + 8));
goto LABEL_15;
}
if ( v11 == 2 )
{
if ( *(_QWORD *)(a1 + 32) )
{
v29 = func0(v9);
v31(*(_QWORD *)(a1 + 72), &v46, v30, v29);
}
goto LABEL_15;
}
}
else if ( v11 == 8 )
{
if ( *(_QWORD *)(a1 + 40) )
{
v32 = func4((unsigned __int64 *)v9);
LABEL_50:
v33(*(_QWORD *)(a1 + 72), &v46, v13, v32);
}
goto LABEL_15;
}
LABEL_26:
v19 = *(void (__fastcall **)(_QWORD, unsigned int *, int *, unsigned int *))(a1 + 64);
if ( v19 )
goto LABEL_27;
LABEL_15:
if ( v4 - (char *)v5 <= 7 )
return (unsigned int)-(v4 != (char *)v5);
}
v12 = *((_DWORD *)v6 + 2);
v13 = (int *)*((_QWORD *)v6 + 2);
if ( v12 != 8 || a4 && (v12 = *(_DWORD *)(a4 + 12)) != 0 )
{
switch ( v12 )
{
case 1:
goto LABEL_23;
case 2:
if ( v11 != 4 )
{
if ( v11 > 4 )
{
if ( v11 != 8 )
goto LABEL_26;
if ( *(_QWORD *)(a1 + 24) )
{
v32 = func5((unsigned __int64 *)v9);
goto LABEL_50;
}
}
else if ( v11 == 1 )
{
v35 = *(void (__fastcall **)(_QWORD, unsigned int *, _QWORD, _QWORD))(a1 + 16);
if ( v35 )
v35(*(_QWORD *)(a1 + 72), &v46, *((_QWORD *)v6 + 2), (unsigned int)*(char *)(v8 + 8));
}
else
{
if ( v11 != 2 )
goto LABEL_26;
if ( *(_QWORD *)(a1 + 16) )
{
v20 = func1(v9);
v22(*(_QWORD *)(a1 + 72), &v46, v21, (unsigned int)v20);
}
}
goto LABEL_15;
}
if ( !*(_QWORD *)(a1 + 16) )
goto LABEL_15;
v27 = func3(v9);
break;
case 3:
goto LABEL_29;
case 4:
goto LABEL_26;
case 5:
if ( *(_QWORD *)(a1 + 48) )
goto LABEL_41;
goto LABEL_15;
case 6:
if ( *(_QWORD *)(a1 + 56) && v10 > 3 )
{
func0((_WORD *)(v8 + 10));
v24 = func0(v23);
sprintf(s, "%u.%u", v24, v25);
v26 = strlen(s);
(*(void (__fastcall **)(_QWORD, unsigned int *, int *, char *, size_t))(a1 + 56))(
*(_QWORD *)(a1 + 72),
&v46,
v13,
s,
v26);
}
goto LABEL_15;
case 7:
goto LABEL_10;
case 8:
abort();
default:
goto LABEL_15;
}
LABEL_42:
v28(*(_QWORD *)(a1 + 72), &v46, v13, v27);
goto LABEL_15;
}
LABEL_10:
if ( *(_QWORD *)a1 )
{
v37 = v10;
v40 = v9;
(*(void (__fastcall **)(_QWORD, unsigned int *, int *))a1)(*(_QWORD *)(a1 + 72), &v46, v13);
v9 = v40;
v10 = v37;
}
if ( (unsigned int)func8(a1, v9, v10, v6) )
return 0xFFFFFFFFLL;
v14 = *(void (__fastcall **)(_QWORD, unsigned int *, int *))(a1 + 8);
if ( v14 )
v14(*(_QWORD *)(a1 + 72), &v46, v13);
goto LABEL_15;
}
return (unsigned int)-(v4 != (char *)v5);
}

original_code:
static int dmap_parse_internal(const dmap_settings *settings, const char *buf, size_t len, const dmap_field *parent) {
 const dmap_field *field;
 DMAP_TYPE field_type;
 size_t field_len;
 const char *field_name;
 const char *p = buf;
 const char *end = buf + len;
 char code[5] = {0};
 if (!settings || !buf)
  return -1;
 while (end - p >= 8) {
  memcpy(code, p, 4);
  field = dmap_field_from_code(code);
  p += 4;
  field_len = dmap_read_u32(p);
  p += 4;
  if (p + field_len > end)
   return -1;
  if (field) {
   field_type = field->type;
   field_name = field->name;
   if (field_type == DMAP_ITEM) {
    if (parent != ((void *)0) && parent->list_item_type) {
     field_type = parent->list_item_type;
    } else {
     field_type = DMAP_DICT;
    }
   }
  } else {
   field_type = DMAP_UNKNOWN;
   field_name = code;
   if (field_len >= 8) {
    if (((*__ctype_b_loc ())[(int) ((p[0] & 0xff))] & (unsigned short int) _ISalpha) &&
        ((*__ctype_b_loc ())[(int) ((p[1] & 0xff))] & (unsigned short int) _ISalpha) &&
        ((*__ctype_b_loc ())[(int) ((p[2] & 0xff))] & (unsigned short int) _ISalpha) &&
        ((*__ctype_b_loc ())[(int) ((p[3] & 0xff))] & (unsigned short int) _ISalpha)) {
     if (dmap_read_u32(p + 4) < field_len)
      field_type = DMAP_DICT;
    }
   }
   if (field_type == DMAP_UNKNOWN) {
    size_t i;
    int is_string = 1;
    for (i=0; i < field_len; i++) {
     if (!((*__ctype_b_loc ())[(int) ((p[i] & 0xff))] & (unsigned short int) _ISprint)) {
      is_string = 0;
      break;
     }
    }
    field_type = is_string ? DMAP_STR : DMAP_UINT;
   }
  }
  switch (field_type) {
   case DMAP_UINT:
    switch (field_len) {
     case 1:
      if (settings->on_uint32)
       settings->on_uint32(settings->ctx, code, field_name, (unsigned char)*p);
      break;
     case 2:
      if (settings->on_uint32)
       settings->on_uint32(settings->ctx, code, field_name, dmap_read_u16(p));
      break;
     case 4:
      if (settings->on_uint32)
       settings->on_uint32(settings->ctx, code, field_name, dmap_read_u32(p));
      break;
     case 8:
      if (settings->on_uint64)
       settings->on_uint64(settings->ctx, code, field_name, dmap_read_u64(p));
      break;
     default:
      if (settings->on_data)
       settings->on_data(settings->ctx, code, field_name, p, field_len);
      break;
    }
    break;
   case DMAP_INT:
    switch (field_len) {
     case 1:
      if (settings->on_int32)
       settings->on_int32(settings->ctx, code, field_name, *p);
      break;
     case 2:
      if (settings->on_int32)
       settings->on_int32(settings->ctx, code, field_name, dmap_read_i16(p));
      break;
     case 4:
      if (settings->on_int32)
       settings->on_int32(settings->ctx, code, field_name, dmap_read_i32(p));
      break;
     case 8:
      if (settings->on_int64)
       settings->on_int64(settings->ctx, code, field_name, dmap_read_i64(p));
      break;
     default:
      if (settings->on_data)
       settings->on_data(settings->ctx, code, field_name, p, field_len);
      break;
    }
    break;
   case DMAP_STR:
    if (settings->on_string)
     settings->on_string(settings->ctx, code, field_name, p, field_len);
    break;
   case DMAP_DATA:
    if (settings->on_data)
     settings->on_data(settings->ctx, code, field_name, p, field_len);
    break;
   case DMAP_DATE:
    if (settings->on_date)
     settings->on_date(settings->ctx, code, field_name, dmap_read_u32(p));
    break;
   case DMAP_VERS:
    if (settings->on_string && field_len >= 4) {
     char version[20];
     sprintf(version, "%u.%u", dmap_read_u16(p), dmap_read_u16(p+2));
     settings->on_string(settings->ctx, code, field_name, version, strlen(version));
    }
    break;
   case DMAP_DICT:
    if (settings->on_dict_start)
     settings->on_dict_start(settings->ctx, code, field_name);
    if (dmap_parse_internal(settings, p, field_len, field) != 0)
     return -1;
    if (settings->on_dict_end)
     settings->on_dict_end(settings->ctx, code, field_name);
    break;
   case DMAP_ITEM:
    abort();
   case DMAP_UNKNOWN:
    break;
  }
  p += field_len;
 }
 if (p != end)
  return -1;
 return 0;
}

canonical_original_code:
static int dmap_parse_internal(struct dmap_settings *settings, char *buf, unsigned long len, struct dmap_field *parent) {
 struct dmap_field *field;
 enum DMAP_TYPE field_type;
 unsigned long field_len;
 char *field_name;
 char *p = buf;
 char *end = buf + len;
 char code[5] = {0};
 if (!settings || !buf)
  return -1;
 while (end - p >= 8) {
  memcpy(code, p, 4);
  field = dmap_field_from_code(code);
  p += 4;
  field_len = dmap_read_u32(p);
  p += 4;
  if (p + field_len > end)
   return -1;
  if (field) {
   field_type = field->type;
   field_name = field->name;
   if (field_type == DMAP_ITEM) {
    if (parent != ((void *)0) && parent->list_item_type) {
     field_type = parent->list_item_type;
    } else {
     field_type = DMAP_DICT;
    }
   }
  } else {
   field_type = DMAP_UNKNOWN;
   field_name = code;
   if (field_len >= 8) {
    if (((*__ctype_b_loc ())[(int) ((p[0] & 0xff))] & (unsigned short) _ISalpha) &&
        ((*__ctype_b_loc ())[(int) ((p[1] & 0xff))] & (unsigned short) _ISalpha) &&
        ((*__ctype_b_loc ())[(int) ((p[2] & 0xff))] & (unsigned short) _ISalpha) &&
        ((*__ctype_b_loc ())[(int) ((p[3] & 0xff))] & (unsigned short) _ISalpha)) {
     if (dmap_read_u32(p + 4) < field_len)
      field_type = DMAP_DICT;
    }
   }
   if (field_type == DMAP_UNKNOWN) {
    unsigned long i;
    int is_string = 1;
    for (i=0; i < field_len; i++) {
     if (!((*__ctype_b_loc ())[(int) ((p[i] & 0xff))] & (unsigned short) _ISprint)) {
      is_string = 0;
      break;
     }
    }
    field_type = is_string ? DMAP_STR : DMAP_UINT;
   }
  }
  switch (field_type) {
   case DMAP_UINT:
    switch (field_len) {
     case 1:
      if (settings->on_uint32)
       settings->on_uint32(settings->ctx, code, field_name, (unsigned char)*p);
      break;
     case 2:
      if (settings->on_uint32)
       settings->on_uint32(settings->ctx, code, field_name, dmap_read_u16(p));
      break;
     case 4:
      if (settings->on_uint32)
       settings->on_uint32(settings->ctx, code, field_name, dmap_read_u32(p));
      break;
     case 8:
      if (settings->on_uint64)
       settings->on_uint64(settings->ctx, code, field_name, dmap_read_u64(p));
      break;
     default:
      if (settings->on_data)
       settings->on_data(settings->ctx, code, field_name, p, field_len);
      break;
    }
    break;
   case DMAP_INT:
    switch (field_len) {
     case 1:
      if (settings->on_int32)
       settings->on_int32(settings->ctx, code, field_name, *p);
      break;
     case 2:
      if (settings->on_int32)
       settings->on_int32(settings->ctx, code, field_name, dmap_read_i16(p));
      break;
     case 4:
      if (settings->on_int32)
       settings->on_int32(settings->ctx, code, field_name, dmap_read_i32(p));
      break;
     case 8:
      if (settings->on_int64)
       settings->on_int64(settings->ctx, code, field_name, dmap_read_i64(p));
      break;
     default:
      if (settings->on_data)
       settings->on_data(settings->ctx, code, field_name, p, field_len);
      break;
    }
    break;
   case DMAP_STR:
    if (settings->on_string)
     settings->on_string(settings->ctx, code, field_name, p, field_len);
    break;
   case DMAP_DATA:
    if (settings->on_data)
     settings->on_data(settings->ctx, code, field_name, p, field_len);
    break;
   case DMAP_DATE:
    if (settings->on_date)
     settings->on_date(settings->ctx, code, field_name, dmap_read_u32(p));
    break;
   case DMAP_VERS:
    if (settings->on_string && field_len >= 4) {
     char version[20];
     sprintf(version, "%u.%u", dmap_read_u16(p), dmap_read_u16(p+2));
     settings->on_string(settings->ctx, code, field_name, version, strlen(version));
    }
    break;
   case DMAP_DICT:
    if (settings->on_dict_start)
     settings->on_dict_start(settings->ctx, code, field_name);
    if (dmap_parse_internal(settings, p, field_len, field) != 0)
     return -1;
    if (settings->on_dict_end)
     settings->on_dict_end(settings->ctx, code, field_name);
    break;
   case DMAP_ITEM:
    abort();
   case DMAP_UNKNOWN:
    break;
  }
  p += field_len;
 }
 if (p != end)
  return -1;
 return 0;
}

variable_types: struct dmap_settings { void (*on_dict_start)(void *ctx, char *code, char *name); void (*on_dict_end)(void *ctx, char *code, char *name); void (*on_int32)(void *ctx, char *code, char *name, int value); void (*on_int64)(void *ctx, char *code, char *name, long value); void (*on_uint32)(void *ctx, char *code, char *name, unsigned int value); void (*on_uint64)(void *ctx, char *code, char *name, unsigned long value); void (*on_date)(void *ctx, char *code, char *name, unsigned int value); void (*on_string)(void *ctx, char *code, char *name, char *buf, unsigned long len); void (*on_data)(void *ctx, char *code, char *name, char *buf, unsigned long len); void *ctx; } *

variable_types:
len
unsigned long

variable_types: enum DMAP_TYPE { DMAP_UNKNOWN=0, DMAP_UINT=1, DMAP_INT=2, DMAP_STR=3, DMAP_DATA=4, DMAP_DATE=5, DMAP_VERS=6, DMAP_DICT=7, DMAP_ITEM=8 }

variable_types:
p
char *

variable_types:
end
char *

variable_types:
code
char [5]

variable_types:
i
unsigned long

variable_types:
version
char [20]


decompiled_code:
__int64 dmap_version()
{
return 1002001LL;
}


decompiled_code:
const char *dmap_version_string()
{
return "1.2.1";
}

canonical_decompiled_code:
const char *func10()
{
return "1.2.1";
}

original_code:
const char *dmap_version_string(void) {
 return "1" "."
        "2" "."
        "1";
}

canonical_original_code:
char *dmap_version_string() {
 return "1" "."
        "2" "."
        "1";
}

return_type: char *


decompiled_code:
__int64 __fastcall dmap_parse(__int64 a1, unsigned int *a2, __int64 a3)
{
return dmap_parse_internal(a1, a2, a3, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1, unsigned int *a2, __int64 a3)
{
return func8(a1, a2, a3, 0LL);
}

original_code:
int dmap_parse(const dmap_settings *settings, const char *buf, size_t len) {
 return dmap_parse_internal(settings, buf, len, ((void *)0));
}

canonical_original_code:
int dmap_parse(struct dmap_settings *settings, char *buf, unsigned long len) {
 return dmap_parse_internal(settings, buf, len, ((void *)0));
}

user_defined_types: struct dmap_settings { void (*on_dict_start)(void *ctx, char *code, char *name); void (*on_dict_end)(void *ctx, char *code, char *name); void (*on_int32)(void *ctx, char *code, char *name, int value); void (*on_int64)(void *ctx, char *code, char *name, long value); void (*on_uint32)(void *ctx, char *code, char *name, unsigned int value); void (*on_uint64)(void *ctx, char *code, char *name, unsigned long value); void (*on_date)(void *ctx, char *code, char *name, unsigned int value); void (*on_string)(void *ctx, char *code, char *name, char *buf, unsigned long len); void (*on_data)(void *ctx, char *code, char *name, char *buf, unsigned long len); void *ctx; }


repo: mauricesvay/Routino

decompiled_code:
__int64 __fastcall osmType_function(const char *a1, int a2)
{
const char *v3; // rsi
__int64 result; // rax

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
printf("%s>\n", (const char *)&unk_F79);
result = 0LL;
}
else
{
printf("<%s%s", (const char *)&unk_F79, a1);
v3 = (const char *)&unk_F7A;
if ( a2 != 3 )
v3 = (const char *)&unk_F79;
printf("%s>\n", v3);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1, int a2)
{
const char *v3; // rsi
__int64 result; // rax

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
printf("%s>\n", (const char *)&unk_F79);
result = 0LL;
}
else
{
printf("<%s%s", (const char *)&unk_F79, a1);
v3 = (const char *)&unk_F7A;
if ( a2 != 3 )
v3 = (const char *)&unk_F79;
printf("%s>\n", v3);
result = 0LL;
}
return result;
}

original_code:
static int osmType_function(const char *_tag_,int _type_,const char *version,const char *generator)
{
 printf("<%s%s",(_type_==2)?"/":"",_tag_);
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(generator) printf(" generator=\"%s\"",ParseXML_Encode_Safe_XML(generator));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int osmType_function(char *_tag_, int _type_, char *version, char *generator)
{
 printf("<%s%s",(_type_==2)?"/":"",_tag_);
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(generator) printf(" generator=\"%s\"",ParseXML_Encode_Safe_XML(generator));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
version
char *

variable_types:
generator
char *


decompiled_code:
// attributes: thunk
__int64 __fastcall boundType_function(const char *a1, int a2)
{
return osmType_function(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func1(const char *a1, int a2)
{
return func0(a1, a2);
}

original_code:
static int boundType_function(const char *_tag_,int _type_,const char *box,const char *origin)
{
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(box) printf(" box=\"%s\"",ParseXML_Encode_Safe_XML(box));
 if(origin) printf(" origin=\"%s\"",ParseXML_Encode_Safe_XML(origin));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int boundType_function(char *_tag_, int _type_, char *box, char *origin)
{
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(box) printf(" box=\"%s\"",ParseXML_Encode_Safe_XML(box));
 if(origin) printf(" origin=\"%s\"",ParseXML_Encode_Safe_XML(origin));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
box
char *

variable_types:
origin
char *


decompiled_code:
// attributes: thunk
__int64 __fastcall boundsType_function(const char *a1, int a2)
{
return osmType_function(a1, a2);
}

canonical_decompiled_code:
__int64 __fastcall func2(const char *a1, int a2)
{
return func0(a1, a2);
}

original_code:
static int boundsType_function(const char *_tag_,int _type_,const char *minlat,const char *minlon,const char *maxlat,const char *maxlon,const char *origin)
{
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(minlat) printf(" minlat=\"%s\"",ParseXML_Encode_Safe_XML(minlat));
 if(minlon) printf(" minlon=\"%s\"",ParseXML_Encode_Safe_XML(minlon));
 if(maxlat) printf(" maxlat=\"%s\"",ParseXML_Encode_Safe_XML(maxlat));
 if(maxlon) printf(" maxlon=\"%s\"",ParseXML_Encode_Safe_XML(maxlon));
 if(origin) printf(" origin=\"%s\"",ParseXML_Encode_Safe_XML(origin));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int boundsType_function(char *_tag_, int _type_, char *minlat, char *minlon, char *maxlat, char *maxlon, char *origin)
{
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(minlat) printf(" minlat=\"%s\"",ParseXML_Encode_Safe_XML(minlat));
 if(minlon) printf(" minlon=\"%s\"",ParseXML_Encode_Safe_XML(minlon));
 if(maxlat) printf(" maxlat=\"%s\"",ParseXML_Encode_Safe_XML(maxlat));
 if(maxlon) printf(" maxlon=\"%s\"",ParseXML_Encode_Safe_XML(maxlon));
 if(origin) printf(" origin=\"%s\"",ParseXML_Encode_Safe_XML(origin));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
minlat
char *

variable_types:
minlon
char *

variable_types:
maxlat
char *

variable_types:
maxlon
char *


decompiled_code:
__int64 __fastcall tagType_function(__int64 a1, int a2, __int64 a3, __int64 a4)
{
bool v4; // zf
const char *v8; // rsi
const char *v9; // rax
const char *v10; // rax
void *v11; // rsi

v4 = a2 == 2;
v8 = "/";
if ( !v4 )
v8 = (const char *)&unk_F79;
printf("<%s%s", v8, a1);
if ( a3 )
{
v9 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" k=\"%s\"", v9);
}
if ( a4 )
{
v10 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" v=\"%s\"", v10);
}
v11 = &unk_F7A;
if ( a2 != 3 )
v11 = &unk_F79;
printf("%s>\n", v11);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, int a2, __int64 a3, __int64 a4)
{
bool v4; // zf
const char *v8; // rsi
const char *v9; // rax
const char *v10; // rax
void *v11; // rsi

v4 = a2 == 2;
v8 = "/";
if ( !v4 )
v8 = (const char *)&unk_F79;
printf("<%s%s", v8, a1);
if ( a3 )
{
v9 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" k=\"%s\"", v9);
}
if ( a4 )
{
v10 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" v=\"%s\"", v10);
}
v11 = &unk_F7A;
if ( a2 != 3 )
v11 = &unk_F79;
printf("%s>\n", v11);
return 0LL;
}

original_code:
static int tagType_function(const char *_tag_,int _type_,const char *k,const char *v)
{
 if(_type_&1)
   {
    do { if(!k) { fprintf(stderr,"XML Parser: Error on line %llu: '" "k" "' attribute must be specified in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0);
    do { if(!v) { fprintf(stderr,"XML Parser: Error on line %llu: '" "v" "' attribute must be specified in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0);
    AppendTag(current_tags,k,v);
   }
 return(0);
}

canonical_original_code:
static int tagType_function(char *_tag_, int _type_, char *k, char *v)
{
 if(_type_&1)
   {
    do { if(!k) { fprintf(stderr,"XML Parser: Error on line %llu: '" "k" "' attribute must be specified in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0);
    do { if(!v) { fprintf(stderr,"XML Parser: Error on line %llu: '" "v" "' attribute must be specified in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0);
    AppendTag(current_tags,k,v);
   }
 return(0);
}

variable_types:
k
char *

variable_types:
v
char *


decompiled_code:
__int64 __fastcall memberType_function(__int64 a1, int a2, __int64 a3, __int64 a4, __int64 a5)
{
bool v9; // zf
const char *v10; // rsi
const char *v11; // rax
const char *v12; // rax
const char *v13; // rax
void *v14; // rsi

v9 = a2 == 2;
v10 = "/";
if ( !v9 )
v10 = (const char *)&unk_F79;
printf("<%s%s", v10, a1);
if ( a3 )
{
v11 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" type=\"%s\"", v11);
}
if ( a4 )
{
v12 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" ref=\"%s\"", v12);
}
if ( a5 )
{
v13 = (const char *)ParseXML_Encode_Safe_XML(a5);
printf(" role=\"%s\"", v13);
}
v14 = &unk_F7A;
if ( a2 != 3 )
v14 = &unk_F79;
printf("%s>\n", v14);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, int a2, __int64 a3, __int64 a4, __int64 a5)
{
bool v9; // zf
const char *v10; // rsi
const char *v11; // rax
const char *v12; // rax
const char *v13; // rax
void *v14; // rsi

v9 = a2 == 2;
v10 = "/";
if ( !v9 )
v10 = (const char *)&unk_F79;
printf("<%s%s", v10, a1);
if ( a3 )
{
v11 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" type=\"%s\"", v11);
}
if ( a4 )
{
v12 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" ref=\"%s\"", v12);
}
if ( a5 )
{
v13 = (const char *)ParseXML_Encode_Safe_XML(a5);
printf(" role=\"%s\"", v13);
}
v14 = &unk_F7A;
if ( a2 != 3 )
v14 = &unk_F79;
printf("%s>\n", v14);
return 0LL;
}

original_code:
static int memberType_function(const char *_tag_,int _type_,const char *type,const char *ref,const char *role)
{
 printf("    <%s%s",(_type_==2)?"/":"",_tag_);
 if(type) printf(" type=\"%s\"",ParseXML_Encode_Safe_XML(type));
 if(ref) printf(" ref=\"%s\"",ParseXML_Encode_Safe_XML(ref));
 if(role) printf(" role=\"%s\"",ParseXML_Encode_Safe_XML(role));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int memberType_function(char *_tag_, int _type_, char *type, char *ref, char *role)
{
 printf("    <%s%s",(_type_==2)?"/":"",_tag_);
 if(type) printf(" type=\"%s\"",ParseXML_Encode_Safe_XML(type));
 if(ref) printf(" ref=\"%s\"",ParseXML_Encode_Safe_XML(ref));
 if(role) printf(" role=\"%s\"",ParseXML_Encode_Safe_XML(role));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
type
char *

variable_types:
ref
char *

variable_types:
role
char *


decompiled_code:
__int64 __fastcall relationType_function(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_F79, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" id=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_F7A;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_F79;
printf("%s>\n", v6);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func5(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_F79, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" id=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_F7A;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_F79;
printf("%s>\n", v6);
return 0LL;
}

original_code:
static int relationType_function(const char *_tag_,int _type_,const char *id,const char *timestamp,const char *uid,const char *user,const char *visible,const char *version,const char *action)
{
 static relation_t relation_id;
 if(_type_&1)
   {
    long long llid;
    nrelations++;
    if(!(nrelations%1000))
       fprintf_middle(stderr,"Reading: Lines=%llu Nodes=%lu Ways=%lu Relations=%lu",ParseXML_LineNumber(),nnodes,nways,nrelations);
    current_tags=NewTagList();
    do { if(!id || !*id || !ParseXML_IsInteger(id)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "id" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); llid=atoll(id);
    relation_id=(relation_t)llid;
    (((long long)relation_id==llid) ? (void) (0) : __assert_fail ("(long long)relation_id==llid", "tagmodifier.c", 479, __extension__ __PRETTY_FUNCTION__));
   }
 if(_type_&2)
   {
    TagList *result=ApplyTaggingRules(&RelationRules,current_tags,relation_id);
    int i;
    for(i=0;i<result->ntags;i++)
      {
       printf("    <tag");
       printf(" k=\"%s\"",ParseXML_Encode_Safe_XML(result->k[i]));
       printf(" v=\"%s\"",ParseXML_Encode_Safe_XML(result->v[i]));
       printf(" />\n");
      }
    DeleteTagList(current_tags);
    DeleteTagList(result);
   }
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(id) printf(" id=\"%s\"",ParseXML_Encode_Safe_XML(id));
 if(timestamp) printf(" timestamp=\"%s\"",ParseXML_Encode_Safe_XML(timestamp));
 if(uid) printf(" uid=\"%s\"",ParseXML_Encode_Safe_XML(uid));
 if(user) printf(" user=\"%s\"",ParseXML_Encode_Safe_XML(user));
 if(visible) printf(" visible=\"%s\"",ParseXML_Encode_Safe_XML(visible));
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(action) printf(" action=\"%s\"",ParseXML_Encode_Safe_XML(action));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int relationType_function(char *_tag_, int _type_, char *id, char *timestamp, char *uid, char *user, char *visible, char *version, char *action)
{
 static unsigned int relation_id;
 if(_type_&1)
   {
    long long llid;
    nrelations++;
    if(!(nrelations%1000))
       fprintf_middle(stderr,"Reading: Lines=%llu Nodes=%lu Ways=%lu Relations=%lu",ParseXML_LineNumber(),nnodes,nways,nrelations);
    current_tags=NewTagList();
    do { if(!id || !*id || !ParseXML_IsInteger(id)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "id" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); llid=atoll(id);
    relation_id=(unsigned int)llid;
    (((long long)relation_id==llid) ? (void) (0) : __assert_fail ("(long long)relation_id==llid", "tagmodifier.c", 479, __extension__ __PRETTY_FUNCTION__));
   }
 if(_type_&2)
   {
    struct _TagList *result = ApplyTaggingRules(&RelationRules,current_tags,relation_id);
    int i;
    for(i=0;i<result->ntags;i++)
      {
       printf("    <tag");
       printf(" k=\"%s\"",ParseXML_Encode_Safe_XML(result->k[i]));
       printf(" v=\"%s\"",ParseXML_Encode_Safe_XML(result->v[i]));
       printf(" />\n");
      }
    DeleteTagList(current_tags);
    DeleteTagList(result);
   }
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(id) printf(" id=\"%s\"",ParseXML_Encode_Safe_XML(id));
 if(timestamp) printf(" timestamp=\"%s\"",ParseXML_Encode_Safe_XML(timestamp));
 if(uid) printf(" uid=\"%s\"",ParseXML_Encode_Safe_XML(uid));
 if(user) printf(" user=\"%s\"",ParseXML_Encode_Safe_XML(user));
 if(visible) printf(" visible=\"%s\"",ParseXML_Encode_Safe_XML(visible));
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(action) printf(" action=\"%s\"",ParseXML_Encode_Safe_XML(action));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
id
char *

variable_types:
timestamp
char *

variable_types:
uid
char *

variable_types:
user
char *

variable_types:
visible
char *

variable_types:
action
char *

variable_types:
llid
long long

variable_types: struct _TagList { int ntags; char **k; char **v; } *

variable_types: i int


decompiled_code:
// attributes: thunk
__int64 __fastcall wayType_function(const char *a1, int a2, __int64 a3)
{
return relationType_function(a1, a2, a3);
}

canonical_decompiled_code:
__int64 __fastcall func6(const char *a1, int a2, __int64 a3)
{
return func5(a1, a2, a3);
}

original_code:
static int wayType_function(const char *_tag_,int _type_,const char *id,const char *timestamp,const char *uid,const char *user,const char *visible,const char *version,const char *action)
{
 static way_t way_id;
 if(_type_&1)
   {
    long long llid;
    nways++;
    if(!(nways%1000))
       fprintf_middle(stderr,"Reading: Lines=%llu Nodes=%lu Ways=%lu Relations=%lu",ParseXML_LineNumber(),nnodes,nways,nrelations);
    current_tags=NewTagList();
    do { if(!id || !*id || !ParseXML_IsInteger(id)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "id" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); llid=atoll(id);
    way_id=(way_t)llid;
    (((long long)way_id==llid) ? (void) (0) : __assert_fail ("(long long)way_id==llid", "tagmodifier.c", 402, __extension__ __PRETTY_FUNCTION__));
   }
 if(_type_&2)
   {
    TagList *result=ApplyTaggingRules(&WayRules,current_tags,way_id);
    int i;
    for(i=0;i<result->ntags;i++)
      {
       printf("    <tag");
       printf(" k=\"%s\"",ParseXML_Encode_Safe_XML(result->k[i]));
       printf(" v=\"%s\"",ParseXML_Encode_Safe_XML(result->v[i]));
       printf(" />\n");
      }
    DeleteTagList(current_tags);
    DeleteTagList(result);
   }
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(id) printf(" id=\"%s\"",ParseXML_Encode_Safe_XML(id));
 if(timestamp) printf(" timestamp=\"%s\"",ParseXML_Encode_Safe_XML(timestamp));
 if(uid) printf(" uid=\"%s\"",ParseXML_Encode_Safe_XML(uid));
 if(user) printf(" user=\"%s\"",ParseXML_Encode_Safe_XML(user));
 if(visible) printf(" visible=\"%s\"",ParseXML_Encode_Safe_XML(visible));
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(action) printf(" action=\"%s\"",ParseXML_Encode_Safe_XML(action));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int wayType_function(char *_tag_, int _type_, char *id, char *timestamp, char *uid, char *user, char *visible, char *version, char *action)
{
 static unsigned int way_id;
 if(_type_&1)
   {
    long long llid;
    nways++;
    if(!(nways%1000))
       fprintf_middle(stderr,"Reading: Lines=%llu Nodes=%lu Ways=%lu Relations=%lu",ParseXML_LineNumber(),nnodes,nways,nrelations);
    current_tags=NewTagList();
    do { if(!id || !*id || !ParseXML_IsInteger(id)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "id" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); llid=atoll(id);
    way_id=(unsigned int)llid;
    (((long long)way_id==llid) ? (void) (0) : __assert_fail ("(long long)way_id==llid", "tagmodifier.c", 402, __extension__ __PRETTY_FUNCTION__));
   }
 if(_type_&2)
   {
    struct _TagList *result = ApplyTaggingRules(&WayRules,current_tags,way_id);
    int i;
    for(i=0;i<result->ntags;i++)
      {
       printf("    <tag");
       printf(" k=\"%s\"",ParseXML_Encode_Safe_XML(result->k[i]));
       printf(" v=\"%s\"",ParseXML_Encode_Safe_XML(result->v[i]));
       printf(" />\n");
      }
    DeleteTagList(current_tags);
    DeleteTagList(result);
   }
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(id) printf(" id=\"%s\"",ParseXML_Encode_Safe_XML(id));
 if(timestamp) printf(" timestamp=\"%s\"",ParseXML_Encode_Safe_XML(timestamp));
 if(uid) printf(" uid=\"%s\"",ParseXML_Encode_Safe_XML(uid));
 if(user) printf(" user=\"%s\"",ParseXML_Encode_Safe_XML(user));
 if(visible) printf(" visible=\"%s\"",ParseXML_Encode_Safe_XML(visible));
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(action) printf(" action=\"%s\"",ParseXML_Encode_Safe_XML(action));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
version
char *

user_defined_types: struct _TagList { int ntags; char **k; char **v; }


decompiled_code:
__int64 __fastcall ndType_function(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_F79, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" ref=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_F7A;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_F79;
printf("%s>\n", v6);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func7(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_F79, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" ref=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_F7A;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_F79;
printf("%s>\n", v6);
return 0LL;
}

original_code:
static int ndType_function(const char *_tag_,int _type_,const char *ref)
{
 printf("    <%s%s",(_type_==2)?"/":"",_tag_);
 if(ref) printf(" ref=\"%s\"",ParseXML_Encode_Safe_XML(ref));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int ndType_function(char *_tag_, int _type_, char *ref)
{
 printf("    <%s%s",(_type_==2)?"/":"",_tag_);
 if(ref) printf(" ref=\"%s\"",ParseXML_Encode_Safe_XML(ref));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}


decompiled_code:
__int64 __fastcall nodeType_function(__int64 a1, int a2, __int64 a3, __int64 a4, __int64 a5)
{
bool v9; // zf
const char *v10; // rsi
const char *v11; // rax
const char *v12; // rax
const char *v13; // rax
void *v14; // rsi

v9 = a2 == 2;
v10 = "/";
if ( !v9 )
v10 = (const char *)&unk_F79;
printf("<%s%s", v10, a1);
if ( a3 )
{
v11 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" id=\"%s\"", v11);
}
if ( a4 )
{
v12 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" lat=\"%s\"", v12);
}
if ( a5 )
{
v13 = (const char *)ParseXML_Encode_Safe_XML(a5);
printf(" lon=\"%s\"", v13);
}
v14 = &unk_F7A;
if ( a2 != 3 )
v14 = &unk_F79;
printf("%s>\n", v14);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, int a2, __int64 a3, __int64 a4, __int64 a5)
{
bool v9; // zf
const char *v10; // rsi
const char *v11; // rax
const char *v12; // rax
const char *v13; // rax
void *v14; // rsi

v9 = a2 == 2;
v10 = "/";
if ( !v9 )
v10 = (const char *)&unk_F79;
printf("<%s%s", v10, a1);
if ( a3 )
{
v11 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" id=\"%s\"", v11);
}
if ( a4 )
{
v12 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" lat=\"%s\"", v12);
}
if ( a5 )
{
v13 = (const char *)ParseXML_Encode_Safe_XML(a5);
printf(" lon=\"%s\"", v13);
}
v14 = &unk_F7A;
if ( a2 != 3 )
v14 = &unk_F79;
printf("%s>\n", v14);
return 0LL;
}

original_code:
static int nodeType_function(const char *_tag_,int _type_,const char *id,const char *lat,const char *lon,const char *timestamp,const char *uid,const char *user,const char *visible,const char *version,const char *action)
{
 static node_t node_id;
 if(_type_&1)
   {
    long long llid;
    nnodes++;
    if(!(nnodes%10000))
       fprintf_middle(stderr,"Reading: Lines=%llu Nodes=%lu Ways=%lu Relations=%lu",ParseXML_LineNumber(),nnodes,nways,nrelations);
    current_tags=NewTagList();
    do { if(!id || !*id || !ParseXML_IsInteger(id)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "id" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); llid=atoll(id);
    node_id=(node_t)llid;
    (((long long)node_id==llid) ? (void) (0) : __assert_fail ("(long long)node_id==llid", "tagmodifier.c", 275, __extension__ __PRETTY_FUNCTION__));
   }
 if(_type_&2)
   {
    TagList *result=ApplyTaggingRules(&NodeRules,current_tags,node_id);
    int i;
    for(i=0;i<result->ntags;i++)
      {
       printf("    <tag");
       printf(" k=\"%s\"",ParseXML_Encode_Safe_XML(result->k[i]));
       printf(" v=\"%s\"",ParseXML_Encode_Safe_XML(result->v[i]));
       printf(" />\n");
      }
    DeleteTagList(current_tags);
    DeleteTagList(result);
   }
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(id) printf(" id=\"%s\"",ParseXML_Encode_Safe_XML(id));
 if(lat) printf(" lat=\"%s\"",ParseXML_Encode_Safe_XML(lat));
 if(lon) printf(" lon=\"%s\"",ParseXML_Encode_Safe_XML(lon));
 if(timestamp) printf(" timestamp=\"%s\"",ParseXML_Encode_Safe_XML(timestamp));
 if(uid) printf(" uid=\"%s\"",ParseXML_Encode_Safe_XML(uid));
 if(user) printf(" user=\"%s\"",ParseXML_Encode_Safe_XML(user));
 if(visible) printf(" visible=\"%s\"",ParseXML_Encode_Safe_XML(visible));
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(action) printf(" action=\"%s\"",ParseXML_Encode_Safe_XML(action));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

canonical_original_code:
static int nodeType_function(char *_tag_, int _type_, char *id, char *lat, char *lon, char *timestamp, char *uid, char *user, char *visible, char *version, char *action)
{
 static unsigned int node_id;
 if(_type_&1)
   {
    long long llid;
    nnodes++;
    if(!(nnodes%10000))
       fprintf_middle(stderr,"Reading: Lines=%llu Nodes=%lu Ways=%lu Relations=%lu",ParseXML_LineNumber(),nnodes,nways,nrelations);
    current_tags=NewTagList();
    do { if(!id || !*id || !ParseXML_IsInteger(id)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "id" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); llid=atoll(id);
    node_id=(unsigned int)llid;
    (((long long)node_id==llid) ? (void) (0) : __assert_fail ("(long long)node_id==llid", "tagmodifier.c", 275, __extension__ __PRETTY_FUNCTION__));
   }
 if(_type_&2)
   {
    struct _TagList *result = ApplyTaggingRules(&NodeRules,current_tags,node_id);
    int i;
    for(i=0;i<result->ntags;i++)
      {
       printf("    <tag");
       printf(" k=\"%s\"",ParseXML_Encode_Safe_XML(result->k[i]));
       printf(" v=\"%s\"",ParseXML_Encode_Safe_XML(result->v[i]));
       printf(" />\n");
      }
    DeleteTagList(current_tags);
    DeleteTagList(result);
   }
 printf("  <%s%s",(_type_==2)?"/":"",_tag_);
 if(id) printf(" id=\"%s\"",ParseXML_Encode_Safe_XML(id));
 if(lat) printf(" lat=\"%s\"",ParseXML_Encode_Safe_XML(lat));
 if(lon) printf(" lon=\"%s\"",ParseXML_Encode_Safe_XML(lon));
 if(timestamp) printf(" timestamp=\"%s\"",ParseXML_Encode_Safe_XML(timestamp));
 if(uid) printf(" uid=\"%s\"",ParseXML_Encode_Safe_XML(uid));
 if(user) printf(" user=\"%s\"",ParseXML_Encode_Safe_XML(user));
 if(visible) printf(" visible=\"%s\"",ParseXML_Encode_Safe_XML(visible));
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(action) printf(" action=\"%s\"",ParseXML_Encode_Safe_XML(action));
 printf("%s>\n",(_type_==(1|2))?" /":"");
 return(0);
}

variable_types:
lat
char *

variable_types:
lon
char *


decompiled_code:
__int64 __fastcall xmlDeclaration_function(const char *a1, __int64 a2, __int64 a3, __int64 a4)
{
const char *v6; // rax
const char *v7; // rax

printf("<?%s", a1);
if ( a3 )
{
v6 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" version=\"%s\"", v6);
}
if ( a4 )
{
v7 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" encoding=\"%s\"", v7);
}
puts(" ?>");
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func9(const char *a1, __int64 a2, __int64 a3, __int64 a4)
{
const char *v6; // rax
const char *v7; // rax

printf("<?%s", a1);
if ( a3 )
{
v6 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" version=\"%s\"", v6);
}
if ( a4 )
{
v7 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" encoding=\"%s\"", v7);
}
puts(" ?>");
return 0LL;
}

original_code:
static int xmlDeclaration_function(const char *_tag_,int _type_,const char *version,const char *encoding)
{
 printf("<?%s",_tag_);
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(encoding) printf(" encoding=\"%s\"",ParseXML_Encode_Safe_XML(encoding));
 printf(" ?>\n");
 return(0);
}

canonical_original_code:
static int xmlDeclaration_function(char *_tag_, int _type_, char *version, char *encoding)
{
 printf("<?%s",_tag_);
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(encoding) printf(" encoding=\"%s\"",ParseXML_Encode_Safe_XML(encoding));
 printf(" ?>\n");
 return(0);
}

variable_types:
encoding
char *


HighwayType

decompiled_code:
__int64 __fastcall HighwayType(const char *a1)
{
__int64 result; // rax

switch ( *a1 )
{
case 'c':
result = strcmp(a1, "cycleway") == 0 ? 10 : 14;
break;
case 'f':
result = 13 - ((unsigned int)(strcmp(a1, "ferry") == 0) - 1);
break;
case 'm':
result = strcmp(a1, "motorway") == 0 ? 1 : 14;
break;
case 'p':
result = 3LL;
if ( strcmp(a1, "primary") )
result = strcmp(a1, "path") == 0 ? 11 : 14;
break;
case 'r':
result = strcmp(a1, "residential") == 0 ? 7 : 14;
break;
case 's':
result = 4LL;
if ( strcmp(a1, "secondary") )
{
result = 8LL;
if ( strcmp(a1, "service") )
result = strcmp(a1, "steps") == 0 ? 12 : 14;
}
break;
case 't':
result = 2LL;
if ( strcmp(a1, "trunk") )
{
result = 5LL;
if ( strcmp(a1, "tertiary") )
result = strcmp(a1, "track") == 0 ? 9 : 14;
}
break;
case 'u':
result = strcmp(a1, "unclassified") == 0 ? 6 : 14;
break;
default:
result = 14LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(const char *a1)
{
__int64 result; // rax

switch ( *a1 )
{
case 'c':
result = strcmp(a1, "cycleway") == 0 ? 10 : 14;
break;
case 'f':
result = 13 - ((unsigned int)(strcmp(a1, "ferry") == 0) - 1);
break;
case 'm':
result = strcmp(a1, "motorway") == 0 ? 1 : 14;
break;
case 'p':
result = 3LL;
if ( strcmp(a1, "primary") )
result = strcmp(a1, "path") == 0 ? 11 : 14;
break;
case 'r':
result = strcmp(a1, "residential") == 0 ? 7 : 14;
break;
case 's':
result = 4LL;
if ( strcmp(a1, "secondary") )
{
result = 8LL;
if ( strcmp(a1, "service") )
result = strcmp(a1, "steps") == 0 ? 12 : 14;
}
break;
case 't':
result = 2LL;
if ( strcmp(a1, "trunk") )
{
result = 5LL;
if ( strcmp(a1, "tertiary") )
result = strcmp(a1, "track") == 0 ? 9 : 14;
}
break;
case 'u':
result = strcmp(a1, "unclassified") == 0 ? 6 : 14;
break;
default:
result = 14LL;
break;
}
return result;
}

original_code:
Highway HighwayType(const char *highway)
{
 switch(*highway)
   {
   case 'c':
    if(!strcmp(highway,"cycleway")) return(Way_Cycleway);
    return(Way_Count);
   case 'f':
    if(!strcmp(highway,"ferry")) return(Way_Ferry);
    return(Way_Count);
   case 'm':
    if(!strcmp(highway,"motorway")) return(Way_Motorway);
    return(Way_Count);
   case 'p':
    if(!strcmp(highway,"primary")) return(Way_Primary);
    if(!strcmp(highway,"path")) return(Way_Path);
    return(Way_Count);
   case 'r':
    if(!strcmp(highway,"residential")) return(Way_Residential);
    return(Way_Count);
   case 's':
    if(!strcmp(highway,"secondary")) return(Way_Secondary);
    if(!strcmp(highway,"service")) return(Way_Service);
    if(!strcmp(highway,"steps")) return(Way_Steps);
    return(Way_Count);
   case 't':
    if(!strcmp(highway,"trunk")) return(Way_Trunk);
    if(!strcmp(highway,"tertiary")) return(Way_Tertiary);
    if(!strcmp(highway,"track")) return(Way_Track);
    return(Way_Count);
   case 'u':
    if(!strcmp(highway,"unclassified")) return(Way_Unclassified);
    return(Way_Count);
   default:
    ;
   }
 return(Way_Count);
}

canonical_original_code:
enum _Highway HighwayType(char *highway)
{
 switch(*highway)
   {
   case 'c':
    if(!strcmp(highway,"cycleway")) return(Way_Cycleway);
    return(Way_Count);
   case 'f':
    if(!strcmp(highway,"ferry")) return(Way_Ferry);
    return(Way_Count);
   case 'm':
    if(!strcmp(highway,"motorway")) return(Way_Motorway);
    return(Way_Count);
   case 'p':
    if(!strcmp(highway,"primary")) return(Way_Primary);
    if(!strcmp(highway,"path")) return(Way_Path);
    return(Way_Count);
   case 'r':
    if(!strcmp(highway,"residential")) return(Way_Residential);
    return(Way_Count);
   case 's':
    if(!strcmp(highway,"secondary")) return(Way_Secondary);
    if(!strcmp(highway,"service")) return(Way_Service);
    if(!strcmp(highway,"steps")) return(Way_Steps);
    return(Way_Count);
   case 't':
    if(!strcmp(highway,"trunk")) return(Way_Trunk);
    if(!strcmp(highway,"tertiary")) return(Way_Tertiary);
    if(!strcmp(highway,"track")) return(Way_Track);
    return(Way_Count);
   case 'u':
    if(!strcmp(highway,"unclassified")) return(Way_Unclassified);
    return(Way_Count);
   default:
    ;
   }
 return(Way_Count);
}

variable_types:
highway
char *

return_type: enum _Highway { Way_Motorway=1, Way_Trunk=2, Way_Primary=3, Way_Secondary=4, Way_Tertiary=5, Way_Unclassified=6, Way_Residential=7, Way_Service=8, Way_Track=9, Way_Cycleway=10, Way_Path=11, Way_Steps=12, Way_Ferry=13, Way_Count=14, Way_OneWay=32 }


TransportType

decompiled_code:
__int64 __fastcall TransportType(const char *a1)
{
__int64 result; // rax

switch ( *a1 )
{
case 'b':
result = 4 * (unsigned int)(strcmp(a1, "bicycle") == 0);
break;
case 'f':
result = strcmp(a1, "foot") == 0;
break;
case 'g':
result = 8 * (unsigned int)(strcmp(a1, "goods") == 0);
break;
case 'h':
result = 2LL;
if ( strcmp(a1, "horse") )
result = strcmp(a1, "hgv") == 0 ? 9 : 0;
break;
case 'm':
result = 5LL;
if ( strcmp(a1, "moped") )
{
result = 6LL;
if ( strcmp(a1, "motorbike") )
result = strcmp(a1, "motorcar") == 0 ? 7 : 0;
}
break;
case 'p':
result = strcmp(a1, "psv") == 0 ? 0xA : 0;
break;
case 'w':
result = strcmp(a1, "wheelchair") == 0 ? 3 : 0;
break;
default:
result = 0LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(const char *a1)
{
__int64 result; // rax

switch ( *a1 )
{
case 'b':
result = 4 * (unsigned int)(strcmp(a1, "bicycle") == 0);
break;
case 'f':
result = strcmp(a1, "foot") == 0;
break;
case 'g':
result = 8 * (unsigned int)(strcmp(a1, "goods") == 0);
break;
case 'h':
result = 2LL;
if ( strcmp(a1, "horse") )
result = strcmp(a1, "hgv") == 0 ? 9 : 0;
break;
case 'm':
result = 5LL;
if ( strcmp(a1, "moped") )
{
result = 6LL;
if ( strcmp(a1, "motorbike") )
result = strcmp(a1, "motorcar") == 0 ? 7 : 0;
}
break;
case 'p':
result = strcmp(a1, "psv") == 0 ? 0xA : 0;
break;
case 'w':
result = strcmp(a1, "wheelchair") == 0 ? 3 : 0;
break;
default:
result = 0LL;
break;
}
return result;
}

original_code:
Transport TransportType(const char *transport)
{
 switch(*transport)
   {
   case 'b':
    if(!strcmp(transport,"bicycle"))
       return(Transport_Bicycle);
    break;
   case 'f':
    if(!strcmp(transport,"foot"))
       return(Transport_Foot);
    break;
   case 'g':
    if(!strcmp(transport,"goods"))
       return(Transport_Goods);
    break;
   case 'h':
    if(!strcmp(transport,"horse"))
       return(Transport_Horse);
    if(!strcmp(transport,"hgv"))
       return(Transport_HGV);
    break;
   case 'm':
    if(!strcmp(transport,"moped"))
       return(Transport_Moped);
    if(!strcmp(transport,"motorbike"))
       return(Transport_Motorbike);
    if(!strcmp(transport,"motorcar"))
       return(Transport_Motorcar);
    break;
   case 'p':
    if(!strcmp(transport,"psv"))
       return(Transport_PSV);
    break;
   case 'w':
    if(!strcmp(transport,"wheelchair"))
       return(Transport_Wheelchair);
    break;
   default:
    return(Transport_None);
   }
 return(Transport_None);
}

canonical_original_code:
enum _Transport TransportType(char *transport)
{
 switch(*transport)
   {
   case 'b':
    if(!strcmp(transport,"bicycle"))
       return(Transport_Bicycle);
    break;
   case 'f':
    if(!strcmp(transport,"foot"))
       return(Transport_Foot);
    break;
   case 'g':
    if(!strcmp(transport,"goods"))
       return(Transport_Goods);
    break;
   case 'h':
    if(!strcmp(transport,"horse"))
       return(Transport_Horse);
    if(!strcmp(transport,"hgv"))
       return(Transport_HGV);
    break;
   case 'm':
    if(!strcmp(transport,"moped"))
       return(Transport_Moped);
    if(!strcmp(transport,"motorbike"))
       return(Transport_Motorbike);
    if(!strcmp(transport,"motorcar"))
       return(Transport_Motorcar);
    break;
   case 'p':
    if(!strcmp(transport,"psv"))
       return(Transport_PSV);
    break;
   case 'w':
    if(!strcmp(transport,"wheelchair"))
       return(Transport_Wheelchair);
    break;
   default:
    return(Transport_None);
   }
 return(Transport_None);
}

variable_types:
transport
char *

return_type: enum _Transport { Transport_None=0, Transport_Foot=1, Transport_Horse=2, Transport_Wheelchair=3, Transport_Bicycle=4, Transport_Moped=5, Transport_Motorbike=6, Transport_Motorcar=7, Transport_Goods=8, Transport_HGV=9, Transport_PSV=10, Transport_Count=11 }


PropertyType

decompiled_code:
__int64 __fastcall PropertyType(const char *a1)
{
__int64 result; // rax

switch ( *a1 )
{
case 'b':
result = 6LL;
if ( strcmp(a1, "bicycleroute") )
result = strcmp(a1, "bridge") == 0 ? 3 : 0;
break;
case 'f':
result = strcmp(a1, "footroute") == 0 ? 5 : 0;
break;
case 'm':
result = 2 * (unsigned int)(strcmp(a1, "multilane") == 0);
break;
case 'p':
result = strcmp(a1, "paved") == 0;
break;
case 't':
result = 4 * (unsigned int)(strcmp(a1, "tunnel") == 0);
break;
default:
result = 0LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(const char *a1)
{
__int64 result; // rax

switch ( *a1 )
{
case 'b':
result = 6LL;
if ( strcmp(a1, "bicycleroute") )
result = strcmp(a1, "bridge") == 0 ? 3 : 0;
break;
case 'f':
result = strcmp(a1, "footroute") == 0 ? 5 : 0;
break;
case 'm':
result = 2 * (unsigned int)(strcmp(a1, "multilane") == 0);
break;
case 'p':
result = strcmp(a1, "paved") == 0;
break;
case 't':
result = 4 * (unsigned int)(strcmp(a1, "tunnel") == 0);
break;
default:
result = 0LL;
break;
}
return result;
}

original_code:
Property PropertyType(const char *property)
{
 switch(*property)
   {
   case 'b':
    if(!strcmp(property,"bicycleroute"))
       return(Property_BicycleRoute);
    if(!strcmp(property,"bridge"))
       return(Property_Bridge);
    break;
   case 'f':
    if(!strcmp(property,"footroute"))
       return(Property_FootRoute);
    break;
   case 'm':
    if(!strcmp(property,"multilane"))
       return(Property_Multilane);
    break;
   case 'p':
    if(!strcmp(property,"paved"))
       return(Property_Paved);
    break;
   case 't':
    if(!strcmp(property,"tunnel"))
       return(Property_Tunnel);
    break;
   default:
    return(Property_None);
   }
 return(Property_None);
}

canonical_original_code:
enum _Property PropertyType(char *property)
{
 switch(*property)
   {
   case 'b':
    if(!strcmp(property,"bicycleroute"))
       return(Property_BicycleRoute);
    if(!strcmp(property,"bridge"))
       return(Property_Bridge);
    break;
   case 'f':
    if(!strcmp(property,"footroute"))
       return(Property_FootRoute);
    break;
   case 'm':
    if(!strcmp(property,"multilane"))
       return(Property_Multilane);
    break;
   case 'p':
    if(!strcmp(property,"paved"))
       return(Property_Paved);
    break;
   case 't':
    if(!strcmp(property,"tunnel"))
       return(Property_Tunnel);
    break;
   default:
    return(Property_None);
   }
 return(Property_None);
}

variable_types:
property
char *

return_type: enum _Property { Property_None=0, Property_Paved=1, Property_Multilane=2, Property_Bridge=3, Property_Tunnel=4, Property_FootRoute=5, Property_BicycleRoute=6, Property_Count=7 }


HighwayName

decompiled_code:
char *__fastcall HighwayName(int a1)
{
__int64 v1; // rdi
char *result; // rax

v1 = (unsigned int)(a1 - 1);
result = 0LL;
if ( (unsigned int)v1 <= 0xC )
result = CSWTCH_4[v1];
return result;
}

canonical_decompiled_code:
char *__fastcall func3(int a1)
{
__int64 v1; // rdi
char *result; // rax

v1 = (unsigned int)(a1 - 1);
result = 0LL;
if ( (unsigned int)v1 <= 0xC )
result = CSWTCH_4[v1];
return result;
}

original_code:
const char *HighwayName(Highway highway)
{
 switch(highway)
   {
   case Way_Motorway:
    return("motorway");
   case Way_Trunk:
    return("trunk");
   case Way_Primary:
    return("primary");
   case Way_Secondary:
    return("secondary");
   case Way_Tertiary:
    return("tertiary");
   case Way_Unclassified:
    return("unclassified");
   case Way_Residential:
    return("residential");
   case Way_Service:
    return("service");
   case Way_Track:
    return("track");
   case Way_Cycleway:
    return("cycleway");
   case Way_Path:
    return("path");
   case Way_Steps:
    return("steps");
   case Way_Ferry:
    return("ferry");
   case Way_Count:
    ;
   case Way_OneWay:
    ;
   }
 return(((void *)0));
}

canonical_original_code:
char *HighwayName(enum _Highway highway)
{
 switch(highway)
   {
   case Way_Motorway:
    return("motorway");
   case Way_Trunk:
    return("trunk");
   case Way_Primary:
    return("primary");
   case Way_Secondary:
    return("secondary");
   case Way_Tertiary:
    return("tertiary");
   case Way_Unclassified:
    return("unclassified");
   case Way_Residential:
    return("residential");
   case Way_Service:
    return("service");
   case Way_Track:
    return("track");
   case Way_Cycleway:
    return("cycleway");
   case Way_Path:
    return("path");
   case Way_Steps:
    return("steps");
   case Way_Ferry:
    return("ferry");
   case Way_Count:
    ;
   case Way_OneWay:
    ;
   }
 return(((void *)0));
}

variable_types: enum _Highway { Way_Motorway=1, Way_Trunk=2, Way_Primary=3, Way_Secondary=4, Way_Tertiary=5, Way_Unclassified=6, Way_Residential=7, Way_Service=8, Way_Track=9, Way_Cycleway=10, Way_Path=11, Way_Steps=12, Way_Ferry=13, Way_Count=14, Way_OneWay=32 }


TransportName

decompiled_code:
char *__fastcall TransportName(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 0xA )
result = CSWTCH_6[a1];
return result;
}

canonical_decompiled_code:
char *__fastcall func4(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 0xA )
result = CSWTCH_6[a1];
return result;
}

original_code:
const char *TransportName(Transport transport)
{
 switch(transport)
   {
   case Transport_None:
    return("NONE");
   case Transport_Foot:
    return("foot");
   case Transport_Horse:
    return("horse");
   case Transport_Wheelchair:
    return("wheelchair");
   case Transport_Bicycle:
    return("bicycle");
   case Transport_Moped:
    return("moped");
   case Transport_Motorbike:
    return("motorbike");
   case Transport_Motorcar:
    return("motorcar");
   case Transport_Goods:
    return("goods");
   case Transport_HGV:
    return("hgv");
   case Transport_PSV:
    return("psv");
   case Transport_Count:
    ;
  }
 return(((void *)0));
}

canonical_original_code:
char *TransportName(enum _Transport transport)
{
 switch(transport)
   {
   case Transport_None:
    return("NONE");
   case Transport_Foot:
    return("foot");
   case Transport_Horse:
    return("horse");
   case Transport_Wheelchair:
    return("wheelchair");
   case Transport_Bicycle:
    return("bicycle");
   case Transport_Moped:
    return("moped");
   case Transport_Motorbike:
    return("motorbike");
   case Transport_Motorcar:
    return("motorcar");
   case Transport_Goods:
    return("goods");
   case Transport_HGV:
    return("hgv");
   case Transport_PSV:
    return("psv");
   case Transport_Count:
    ;
  }
 return(((void *)0));
}

variable_types: enum _Transport { Transport_None=0, Transport_Foot=1, Transport_Horse=2, Transport_Wheelchair=3, Transport_Bicycle=4, Transport_Moped=5, Transport_Motorbike=6, Transport_Motorcar=7, Transport_Goods=8, Transport_HGV=9, Transport_PSV=10, Transport_Count=11 }


PropertyName

decompiled_code:
char *__fastcall PropertyName(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 6 )
result = CSWTCH_8[a1];
return result;
}

canonical_decompiled_code:
char *__fastcall func5(unsigned int a1)
{
char *result; // rax

result = 0LL;
if ( a1 <= 6 )
result = CSWTCH_8[a1];
return result;
}

original_code:
const char *PropertyName(Property property)
{
 switch(property)
   {
   case Property_None:
    return("NONE");
   case Property_Paved:
    return("paved");
   case Property_Multilane:
    return("multilane");
   case Property_Bridge:
    return("bridge");
   case Property_Tunnel:
    return("tunnel");
   case Property_FootRoute:
    return("footroute");
   case Property_BicycleRoute:
    return("bicycleroute");
   case Property_Count:
    ;
  }
 return(((void *)0));
}

canonical_original_code:
char *PropertyName(enum _Property property)
{
 switch(property)
   {
   case Property_None:
    return("NONE");
   case Property_Paved:
    return("paved");
   case Property_Multilane:
    return("multilane");
   case Property_Bridge:
    return("bridge");
   case Property_Tunnel:
    return("tunnel");
   case Property_FootRoute:
    return("footroute");
   case Property_BicycleRoute:
    return("bicycleroute");
   case Property_Count:
    ;
  }
 return(((void *)0));
}

variable_types: enum _Property { Property_None=0, Property_Paved=1, Property_Multilane=2, Property_Bridge=3, Property_Tunnel=4, Property_FootRoute=5, Property_BicycleRoute=6, Property_Count=7 }


HighwaysNameList

original_code:
const char *HighwaysNameList(highways_t highways)
{
 static char string[256];
 string[0]=0;
 if(highways & Highways_Motorway)
    strcat(string,"motorway");
 if(highways & Highways_Trunk)
   {
    if(*string) strcat(string,", ");
    strcat(string,"trunk");
   }
 if(highways & Highways_Primary)
   {
    if(*string) strcat(string,", ");
    strcat(string,"primary");
   }
 if(highways & Highways_Tertiary)
   {
    if(*string) strcat(string,", ");
    strcat(string,"tertiary");
   }
 if(highways & Highways_Unclassified)
   {
    if(*string) strcat(string,", ");
    strcat(string,"unclassified");
   }
 if(highways & Highways_Residential)
   {
    if(*string) strcat(string,", ");
    strcat(string,"residential");
   }
 if(highways & Highways_Service)
   {
    if(*string) strcat(string,", ");
    strcat(string,"service");
   }
 if(highways & Highways_Track)
   {
    if(*string) strcat(string,", ");
    strcat(string,"track");
   }
 if(highways & Highways_Cycleway)
   {
    if(*string) strcat(string,", ");
    strcat(string,"cycleway");
   }
 if(highways & Highways_Path)
   {
    if(*string) strcat(string,", ");
    strcat(string,"path");
   }
 if(highways & Highways_Steps)
   {
    if(*string) strcat(string,", ");
    strcat(string,"steps");
   }
 if(highways & Highways_Ferry)
   {
    if(*string) strcat(string,", ");
    strcat(string,"ferry");
   }
 return(string);
}

canonical_original_code:
char *HighwaysNameList(unsigned short highways)
{
 static char string[256];
 string[0]=0;
 if(highways & Highways_Motorway)
    strcat(string,"motorway");
 if(highways & Highways_Trunk)
   {
    if(*string) strcat(string,", ");
    strcat(string,"trunk");
   }
 if(highways & Highways_Primary)
   {
    if(*string) strcat(string,", ");
    strcat(string,"primary");
   }
 if(highways & Highways_Tertiary)
   {
    if(*string) strcat(string,", ");
    strcat(string,"tertiary");
   }
 if(highways & Highways_Unclassified)
   {
    if(*string) strcat(string,", ");
    strcat(string,"unclassified");
   }
 if(highways & Highways_Residential)
   {
    if(*string) strcat(string,", ");
    strcat(string,"residential");
   }
 if(highways & Highways_Service)
   {
    if(*string) strcat(string,", ");
    strcat(string,"service");
   }
 if(highways & Highways_Track)
   {
    if(*string) strcat(string,", ");
    strcat(string,"track");
   }
 if(highways & Highways_Cycleway)
   {
    if(*string) strcat(string,", ");
    strcat(string,"cycleway");
   }
 if(highways & Highways_Path)
   {
    if(*string) strcat(string,", ");
    strcat(string,"path");
   }
 if(highways & Highways_Steps)
   {
    if(*string) strcat(string,", ");
    strcat(string,"steps");
   }
 if(highways & Highways_Ferry)
   {
    if(*string) strcat(string,", ");
    strcat(string,"ferry");
   }
 return(string);
}

variable_types:
highways
unsigned short

variable_types:
string
char [256]


AllowedNameList

original_code:
const char *AllowedNameList(transports_t allowed)
{
 static char string[256];
 string[0]=0;
 if(allowed & Transports_Foot)
    strcat(string,"foot");
 if(allowed & Transports_Horse)
   {
    if(*string) strcat(string,", ");
    strcat(string,"horse");
   }
 if(allowed & Transports_Wheelchair)
   {
    if(*string) strcat(string,", ");
    strcat(string,"wheelchair");
   }
 if(allowed & Transports_Bicycle)
   {
    if(*string) strcat(string,", ");
    strcat(string,"bicycle");
   }
 if(allowed & Transports_Moped)
   {
    if(*string) strcat(string,", ");
    strcat(string,"moped");
   }
 if(allowed & Transports_Motorbike)
   {
    if(*string) strcat(string,", ");
    strcat(string,"motorbike");
   }
 if(allowed & Transports_Motorcar)
   {
    if(*string) strcat(string,", ");
    strcat(string,"motorcar");
   }
 if(allowed & Transports_Goods)
   {
    if(*string) strcat(string,", ");
    strcat(string,"goods");
   }
 if(allowed & Transports_HGV)
   {
    if(*string) strcat(string,", ");
    strcat(string,"hgv");
   }
 if(allowed & Transports_PSV)
   {
    if(*string) strcat(string,", ");
    strcat(string,"psv");
   }
 return(string);
}

canonical_original_code:
char *AllowedNameList(unsigned short allowed)
{
 static char string[256];
 string[0]=0;
 if(allowed & Transports_Foot)
    strcat(string,"foot");
 if(allowed & Transports_Horse)
   {
    if(*string) strcat(string,", ");
    strcat(string,"horse");
   }
 if(allowed & Transports_Wheelchair)
   {
    if(*string) strcat(string,", ");
    strcat(string,"wheelchair");
   }
 if(allowed & Transports_Bicycle)
   {
    if(*string) strcat(string,", ");
    strcat(string,"bicycle");
   }
 if(allowed & Transports_Moped)
   {
    if(*string) strcat(string,", ");
    strcat(string,"moped");
   }
 if(allowed & Transports_Motorbike)
   {
    if(*string) strcat(string,", ");
    strcat(string,"motorbike");
   }
 if(allowed & Transports_Motorcar)
   {
    if(*string) strcat(string,", ");
    strcat(string,"motorcar");
   }
 if(allowed & Transports_Goods)
   {
    if(*string) strcat(string,", ");
    strcat(string,"goods");
   }
 if(allowed & Transports_HGV)
   {
    if(*string) strcat(string,", ");
    strcat(string,"hgv");
   }
 if(allowed & Transports_PSV)
   {
    if(*string) strcat(string,", ");
    strcat(string,"psv");
   }
 return(string);
}

variable_types:
allowed
unsigned short


PropertiesNameList

original_code:
const char *PropertiesNameList(properties_t properties)
{
 static char string[256];
 string[0]=0;
 if(properties & Properties_Paved)
   {
    if(*string) strcat(string,", ");
    strcat(string,"paved");
   }
 if(properties & Properties_Multilane)
   {
    if(*string) strcat(string,", ");
    strcat(string,"multilane");
   }
 if(properties & Properties_Bridge)
   {
    if(*string) strcat(string,", ");
    strcat(string,"bridge");
   }
 if(properties & Properties_Tunnel)
   {
    if(*string) strcat(string,", ");
    strcat(string,"tunnel");
   }
 if(properties & Properties_FootRoute)
   {
    if(*string) strcat(string,", ");
    strcat(string,"footroute");
   }
 if(properties & Properties_BicycleRoute)
   {
    if(*string) strcat(string,", ");
    strcat(string,"bicycleroute");
   }
 return(string);
}

canonical_original_code:
char *PropertiesNameList(unsigned char properties)
{
 static char string[256];
 string[0]=0;
 if(properties & Properties_Paved)
   {
    if(*string) strcat(string,", ");
    strcat(string,"paved");
   }
 if(properties & Properties_Multilane)
   {
    if(*string) strcat(string,", ");
    strcat(string,"multilane");
   }
 if(properties & Properties_Bridge)
   {
    if(*string) strcat(string,", ");
    strcat(string,"bridge");
   }
 if(properties & Properties_Tunnel)
   {
    if(*string) strcat(string,", ");
    strcat(string,"tunnel");
   }
 if(properties & Properties_FootRoute)
   {
    if(*string) strcat(string,", ");
    strcat(string,"footroute");
   }
 if(properties & Properties_BicycleRoute)
   {
    if(*string) strcat(string,", ");
    strcat(string,"bicycleroute");
   }
 return(string);
}

variable_types:
properties
unsigned char


HighwayList

decompiled_code:
const char *HighwayList()
{
return " motorway = Motorway\n"
" trunk = Trunk\n"
" primary = Primary\n"
" secondary = Secondary\n"
" tertiary = Tertiary\n"
" unclassified = Unclassified\n"
" residential = Residential\n"
" service = Service\n"
" track = Track\n"
" cycleway = Cycleway\n"
" path = Path\n"
" steps = Steps\n"
" ferry = Ferry\n";
}

canonical_decompiled_code:
const char *func9()
{
return " motorway = Motorway\n"
" trunk = Trunk\n"
" primary = Primary\n"
" secondary = Secondary\n"
" tertiary = Tertiary\n"
" unclassified = Unclassified\n"
" residential = Residential\n"
" service = Service\n"
" track = Track\n"
" cycleway = Cycleway\n"
" path = Path\n"
" steps = Steps\n"
" ferry = Ferry\n";
}

original_code:
const char *HighwayList(void)
{
 return "    motorway     = Motorway\n"
        "    trunk        = Trunk\n"
        "    primary      = Primary\n"
        "    secondary    = Secondary\n"
        "    tertiary     = Tertiary\n"
        "    unclassified = Unclassified\n"
        "    residential  = Residential\n"
        "    service      = Service\n"
        "    track        = Track\n"
        "    cycleway     = Cycleway\n"
        "    path         = Path\n"
        "    steps        = Steps\n"
        "    ferry        = Ferry\n"
        ;
}

canonical_original_code:
char *HighwayList()
{
 return "    motorway     = Motorway\n"
        "    trunk        = Trunk\n"
        "    primary      = Primary\n"
        "    secondary    = Secondary\n"
        "    tertiary     = Tertiary\n"
        "    unclassified = Unclassified\n"
        "    residential  = Residential\n"
        "    service      = Service\n"
        "    track        = Track\n"
        "    cycleway     = Cycleway\n"
        "    path         = Path\n"
        "    steps        = Steps\n"
        "    ferry        = Ferry\n"
        ;
}


TransportList

decompiled_code:
const char *TransportList()
{
return " foot = Foot\n"
" bicycle = Bicycle\n"
" wheelchair = Wheelchair\n"
" horse = Horse\n"
" moped = Moped (Small motorbike, limited speed)\n"
" motorbike = Motorbike\n"
" motorcar = Motorcar\n"
" goods = Goods (Small lorry, van)\n"
" hgv = HGV (Heavy Goods Vehicle - large lorry)\n"
" psv = PSV (Public Service Vehicle - bus, coach)\n";
}

canonical_decompiled_code:
const char *func10()
{
return " foot = Foot\n"
" bicycle = Bicycle\n"
" wheelchair = Wheelchair\n"
" horse = Horse\n"
" moped = Moped (Small motorbike, limited speed)\n"
" motorbike = Motorbike\n"
" motorcar = Motorcar\n"
" goods = Goods (Small lorry, van)\n"
" hgv = HGV (Heavy Goods Vehicle - large lorry)\n"
" psv = PSV (Public Service Vehicle - bus, coach)\n";
}

original_code:
const char *TransportList(void)
{
 return "    foot       = Foot\n"
        "    bicycle    = Bicycle\n"
        "    wheelchair = Wheelchair\n"
        "    horse      = Horse\n"
        "    moped      = Moped     (Small motorbike, limited speed)\n"
        "    motorbike  = Motorbike\n"
        "    motorcar   = Motorcar\n"
        "    goods      = Goods     (Small lorry, van)\n"
        "    hgv        = HGV       (Heavy Goods Vehicle - large lorry)\n"
        "    psv        = PSV       (Public Service Vehicle - bus, coach)\n"
        ;
}

canonical_original_code:
char *TransportList()
{
 return "    foot       = Foot\n"
        "    bicycle    = Bicycle\n"
        "    wheelchair = Wheelchair\n"
        "    horse      = Horse\n"
        "    moped      = Moped     (Small motorbike, limited speed)\n"
        "    motorbike  = Motorbike\n"
        "    motorcar   = Motorcar\n"
        "    goods      = Goods     (Small lorry, van)\n"
        "    hgv        = HGV       (Heavy Goods Vehicle - large lorry)\n"
        "    psv        = PSV       (Public Service Vehicle - bus, coach)\n"
        ;
}


PropertyList

decompiled_code:
const char *PropertyList()
{
return " paved = Paved (suitable for normal wheels)\n"
" multilane = Multiple lanes\n"
" bridge = Bridge\n"
" tunnel = Tunnel\n"
" footroute = A route marked for foot travel\n"
" bicycleroute = A route marked for bicycle travel\n";
}

canonical_decompiled_code:
const char *func11()
{
return " paved = Paved (suitable for normal wheels)\n"
" multilane = Multiple lanes\n"
" bridge = Bridge\n"
" tunnel = Tunnel\n"
" footroute = A route marked for foot travel\n"
" bicycleroute = A route marked for bicycle travel\n";
}

original_code:
const char *PropertyList(void)
{
 return "    paved        = Paved (suitable for normal wheels)\n"
        "    multilane    = Multiple lanes\n"
        "    bridge       = Bridge\n"
        "    tunnel       = Tunnel\n"
        "    footroute    = A route marked for foot travel\n"
        "    bicycleroute = A route marked for bicycle travel\n"
        ;
}

canonical_original_code:
char *PropertyList()
{
 return "    paved        = Paved (suitable for normal wheels)\n"
        "    multilane    = Multiple lanes\n"
        "    bridge       = Bridge\n"
        "    tunnel       = Tunnel\n"
        "    footroute    = A route marked for foot travel\n"
        "    bicycleroute = A route marked for bicycle travel\n"
        ;
}


decompiled_code:
int printf_first(const char *a1, ...)
{
int result; // eax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

result = option_loggable;
if ( !option_loggable )
{
va_start(va, a1);
result = vfprintf_first(stdout, a1, va);
}
return result;
}

canonical_decompiled_code:
int func3(const char *a1, ...)
{
int result; // eax
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

result = option_loggable;
if ( !option_loggable )
{
va_start(va, a1);
result = func0(stdout, a1, va);
}
return result;
}

original_code:
void printf_first(const char *format, ...)
{
 va_list ap;
 if(option_loggable)
    return;
 __builtin_va_start(ap,format);
 vfprintf_first(stdout,format,ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void printf_first(char *format, ...)
{
 __builtin_va_list ap;
 if(option_loggable)
    return;
 __builtin_va_start(ap,format);
 vfprintf_first(stdout,format,ap);
 __builtin_va_end(ap);
}

variable_types:
format
char *

return_type: void


decompiled_code:
int printf_middle(char *format, ...)
{
int result; // eax
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

result = option_loggable;
if ( !option_loggable )
{
va_start(arg, format);
result = vfprintf_middle(stdout, format, arg);
}
return result;
}

canonical_decompiled_code:
int func4(char *format, ...)
{
int result; // eax
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

result = option_loggable;
if ( !option_loggable )
{
va_start(arg, format);
result = func1(stdout, format, arg);
}
return result;
}

original_code:
void printf_middle(const char *format, ...)
{
 va_list ap;
 if(option_loggable)
    return;
 __builtin_va_start(ap,format);
 vfprintf_middle(stdout,format,ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void printf_middle(char *format, ...)
{
 __builtin_va_list ap;
 if(option_loggable)
    return;
 __builtin_va_start(ap,format);
 vfprintf_middle(stdout,format,ap);
 __builtin_va_end(ap);
}


decompiled_code:
int printf_last(const char *a1, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
return vfprintf_last(stdout, a1, va);
}

canonical_decompiled_code:
int func5(const char *a1, ...)
{
gcc_va_list va; // [rsp+8h] [rbp-D0h] BYREF

va_start(va, a1);
return func2(stdout, a1, va);
}

original_code:
void printf_last(const char *format, ...)
{
 va_list ap;
 __builtin_va_start(ap,format);
 vfprintf_last(stdout,format,ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void printf_last(char *format, ...)
{
 __builtin_va_list ap;
 __builtin_va_start(ap,format);
 vfprintf_last(stdout,format,ap);
 __builtin_va_end(ap);
}


decompiled_code:
int close_errorlog()
{
int result; // eax

if ( errorlogfile )
result = fclose(errorlogfile);
return result;
}

canonical_decompiled_code:
int func9()
{
int result; // eax

if ( errorlogfile )
result = fclose(errorlogfile);
return result;
}

original_code:
void close_errorlog(void)
{
 if(errorlogfile)
    fclose(errorlogfile);
}

canonical_original_code:
void close_errorlog()
{
 if(errorlogfile)
    fclose(errorlogfile);
}


logerror

decompiled_code:
int logerror(char *format, ...)
{
int result; // eax
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

if ( errorlogfile )
{
va_start(arg, format);
result = vfprintf(errorlogfile, format, arg);
}
return result;
}

canonical_decompiled_code:
int func10(char *format, ...)
{
int result; // eax
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

if ( errorlogfile )
{
va_start(arg, format);
result = vfprintf(errorlogfile, format, arg);
}
return result;
}

original_code:
void logerror(const char *format, ...)
{
 va_list ap;
 if(!errorlogfile)
    return;
 __builtin_va_start(ap,format);
 vfprintf(errorlogfile,format,ap);
 __builtin_va_end(ap);
}

canonical_original_code:
void logerror(char *format, ...)
{
 __builtin_va_list ap;
 if(!errorlogfile)
    return;
 __builtin_va_start(ap,format);
 vfprintf(errorlogfile,format,ap);
 __builtin_va_end(ap);
}


decompiled_code:
__int64 __fastcall lengthType_function(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_16B9, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" limit=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_16BA;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_16B9;
printf("%s>\n", v6);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func5(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_16B9, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" limit=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_16BA;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_16B9;
printf("%s>\n", v6);
return 0LL;
}

original_code:
static int lengthType_function(const char *_tag_,int _type_,const char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->length=(length_t)((l)*10);
   }
 return(0);
}

canonical_original_code:
static int lengthType_function(char *_tag_, int _type_, char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->length=(length_t)((l)*10);
   }
 return(0);
}

variable_types:
limit
char *

variable_types: l double


decompiled_code:
// attributes: thunk
__int64 __fastcall widthType_function(const char *a1, int a2, __int64 a3)
{
return lengthType_function(a1, a2, a3);
}

canonical_decompiled_code:
__int64 __fastcall func6(const char *a1, int a2, __int64 a3)
{
return func5(a1, a2, a3);
}

original_code:
static int widthType_function(const char *_tag_,int _type_,const char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->width=(width_t)((l)*10);
   }
 return(0);
}

canonical_original_code:
static int widthType_function(char *_tag_, int _type_, char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->width=(width_t)((l)*10);
   }
 return(0);
}


decompiled_code:
// attributes: thunk
__int64 __fastcall heightType_function(const char *a1, int a2, __int64 a3)
{
return lengthType_function(a1, a2, a3);
}

canonical_decompiled_code:
__int64 __fastcall func7(const char *a1, int a2, __int64 a3)
{
return func5(a1, a2, a3);
}

original_code:
static int heightType_function(const char *_tag_,int _type_,const char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->height=(height_t)((l)*10);
   }
 return(0);
}

canonical_original_code:
static int heightType_function(char *_tag_, int _type_, char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->height=(height_t)((l)*10);
   }
 return(0);
}


decompiled_code:
// attributes: thunk
__int64 __fastcall weightType_function(const char *a1, int a2, __int64 a3)
{
return lengthType_function(a1, a2, a3);
}

canonical_decompiled_code:
__int64 __fastcall func8(const char *a1, int a2, __int64 a3)
{
return func5(a1, a2, a3);
}

original_code:
static int weightType_function(const char *_tag_,int _type_,const char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->weight=(weight_t)((l)*5);
   }
 return(0);
}

canonical_original_code:
static int weightType_function(char *_tag_, int _type_, char *limit)
{
 if(_type_&1)
   {
    double l;
    do { if(!limit || !*limit || !ParseXML_IsFloating(limit)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "limit" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); l=atof(limit);
    loaded_profiles[nloaded_profiles-1]->weight=(weight_t)((l)*5);
   }
 return(0);
}


decompiled_code:
__int64 __fastcall turnsType_function(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_16B9, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" obey=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_16BA;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_16B9;
printf("%s>\n", v6);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func9(const char *a1, int a2, __int64 a3)
{
const char *v5; // rax
const char *v6; // rsi

if ( a2 == 2 )
{
printf("<%s%s", "/", a1);
if ( !a3 )
goto LABEL_5;
}
else
{
printf("<%s%s", (const char *)&unk_16B9, a1);
if ( !a3 )
goto LABEL_4;
}
v5 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" obey=\"%s\"", v5);
LABEL_4:
v6 = (const char *)&unk_16BA;
if ( a2 != 3 )
LABEL_5:
v6 = (const char *)&unk_16B9;
printf("%s>\n", v6);
return 0LL;
}

original_code:
static int turnsType_function(const char *_tag_,int _type_,const char *obey)
{
 if(_type_&1)
   {
    int o;
    do { if(!obey || !*obey || !ParseXML_IsInteger(obey)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "obey" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); o=atoi(obey);
    loaded_profiles[nloaded_profiles-1]->turns=!!o;
   }
 return(0);
}

canonical_original_code:
static int turnsType_function(char *_tag_, int _type_, char *obey)
{
 if(_type_&1)
   {
    int o;
    do { if(!obey || !*obey || !ParseXML_IsInteger(obey)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "obey" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); o=atoi(obey);
    loaded_profiles[nloaded_profiles-1]->turns=!!o;
   }
 return(0);
}

variable_types:
obey
char *

variable_types: o int


decompiled_code:
// attributes: thunk
__int64 __fastcall onewayType_function(const char *a1, int a2, __int64 a3)
{
return turnsType_function(a1, a2, a3);
}

canonical_decompiled_code:
__int64 __fastcall func10(const char *a1, int a2, __int64 a3)
{
return func9(a1, a2, a3);
}

original_code:
static int onewayType_function(const char *_tag_,int _type_,const char *obey)
{
 if(_type_&1)
   {
    int o;
    do { if(!obey || !*obey || !ParseXML_IsInteger(obey)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "obey" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); o=atoi(obey);
    loaded_profiles[nloaded_profiles-1]->oneway=!!o;
   }
 return(0);
}

canonical_original_code:
static int onewayType_function(char *_tag_, int _type_, char *obey)
{
 if(_type_&1)
   {
    int o;
    do { if(!obey || !*obey || !ParseXML_IsInteger(obey)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "obey" "' attribute must be a integer in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); o=atoi(obey);
    loaded_profiles[nloaded_profiles-1]->oneway=!!o;
   }
 return(0);
}


decompiled_code:
__int64 __fastcall propertyType_function(__int64 a1, int a2, __int64 a3, __int64 a4)
{
bool v4; // zf
const char *v8; // rsi
const char *v9; // rax
const char *v10; // rax
void *v11; // rsi

v4 = a2 == 2;
v8 = "/";
if ( !v4 )
v8 = (const char *)&unk_16B9;
printf("<%s%s", v8, a1);
if ( a3 )
{
v9 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" type=\"%s\"", v9);
}
if ( a4 )
{
v10 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" percent=\"%s\"", v10);
}
v11 = &unk_16BA;
if ( a2 != 3 )
v11 = &unk_16B9;
printf("%s>\n", v11);
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1, int a2, __int64 a3, __int64 a4)
{
bool v4; // zf
const char *v8; // rsi
const char *v9; // rax
const char *v10; // rax
void *v11; // rsi

v4 = a2 == 2;
v8 = "/";
if ( !v4 )
v8 = (const char *)&unk_16B9;
printf("<%s%s", v8, a1);
if ( a3 )
{
v9 = (const char *)ParseXML_Encode_Safe_XML(a3);
printf(" type=\"%s\"", v9);
}
if ( a4 )
{
v10 = (const char *)ParseXML_Encode_Safe_XML(a4);
printf(" percent=\"%s\"", v10);
}
v11 = &unk_16BA;
if ( a2 != 3 )
v11 = &unk_16B9;
printf("%s>\n", v11);
return 0LL;
}

original_code:
static int propertyType_function(const char *_tag_,int _type_,const char *type,const char *percent)
{
 if(_type_&1)
   {
    Property property;
    double p;
    do { if(!type) { fprintf(stderr,"XML Parser: Error on line %llu: '" "type" "' attribute must be specified in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0);
    property=PropertyType(type);
    if(property==Property_Count)
       do { fprintf(stderr,"XML Parser: Error on line %llu: Invalid value for '" "type" "' attribute in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } while(0);
    do { if(!percent || !*percent || !ParseXML_IsFloating(percent)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "percent" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); p=atof(percent);
    loaded_profiles[nloaded_profiles-1]->props_yes[property]=p;
   }
 return(0);
}

canonical_original_code:
static int propertyType_function(char *_tag_, int _type_, char *type, char *percent)
{
 if(_type_&1)
   {
    enum _Property property;
    double p;
    do { if(!type) { fprintf(stderr,"XML Parser: Error on line %llu: '" "type" "' attribute must be specified in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0);
    property=PropertyType(type);
    if(property==Property_Count)
       do { fprintf(stderr,"XML Parser: Error on line %llu: Invalid value for '" "type" "' attribute in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } while(0);
    do { if(!percent || !*percent || !ParseXML_IsFloating(percent)) { fprintf(stderr,"XML Parser: Error on line %llu: '" "percent" "' attribute must be a number in <%s> tag.\n",ParseXML_LineNumber(),_tag_); return(1); } } while(0); p=atof(percent);
    loaded_profiles[nloaded_profiles-1]->props_yes[property]=p;
   }
 return(0);
}

variable_types:
type
char *

variable_types:
percent
char *

variable_types: p double

user_defined_types: enum _Property { Property_None=0, Property_Paved=1, Property_Multilane=2, Property_Bridge=3, Property_Tunnel=4, Property_FootRoute=5, Property_BicycleRoute=6, Property_Count=7 }