blob: b21198397a4a7082fe8829f88e92adc0bd19a0d4 [file] [log] [blame]
Tobin Ehlis12076fc2014-10-22 09:06:33 -06001#!/usr/bin/env python3
2#
3# XGL
4#
5# Copyright (C) 2014 LunarG, Inc.
6#
7# Permission is hereby granted, free of charge, to any person obtaining a
8# copy of this software and associated documentation files (the "Software"),
9# to deal in the Software without restriction, including without limitation
10# the rights to use, copy, modify, merge, publish, distribute, sublicense,
11# and/or sell copies of the Software, and to permit persons to whom the
12# Software is furnished to do so, subject to the following conditions:
13#
14# The above copyright notice and this permission notice shall be included
15# in all copies or substantial portions of the Software.
16#
17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23# DEALINGS IN THE SOFTWARE.
24#
25# Authors:
26# Chia-I Wu <olv@lunarg.com>
27
28import sys
29
30import xgl
31
32class Subcommand(object):
33 def __init__(self, argv):
34 self.argv = argv
35 self.protos = ()
36 self.headers = ()
37
38 def run(self):
39 self.protos = xgl.core + xgl.ext_wsi_x11
40 self.headers = xgl.core_headers + xgl.ext_wsi_x11_headers
41 print(self.generate())
42
43 def generate(self):
44 copyright = self.generate_copyright()
45 header = self.generate_header()
46 body = self.generate_body()
47 footer = self.generate_footer()
48
49 contents = []
50 if copyright:
51 contents.append(copyright)
52 if header:
53 contents.append(header)
54 if body:
55 contents.append(body)
56 if footer:
57 contents.append(footer)
58
59 return "\n\n".join(contents)
60
61 def generate_copyright(self):
62 return """/* THIS FILE IS GENERATED. DO NOT EDIT. */
63
64/*
65 * XGL
66 *
67 * Copyright (C) 2014 LunarG, Inc.
68 *
69 * Permission is hereby granted, free of charge, to any person obtaining a
70 * copy of this software and associated documentation files (the "Software"),
71 * to deal in the Software without restriction, including without limitation
72 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
73 * and/or sell copies of the Software, and to permit persons to whom the
74 * Software is furnished to do so, subject to the following conditions:
75 *
76 * The above copyright notice and this permission notice shall be included
77 * in all copies or substantial portions of the Software.
78 *
79 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
80 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
82 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
83 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
84 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
85 * DEALINGS IN THE SOFTWARE.
86 */"""
87
88 def generate_header(self):
89 return "\n".join(["#include <" + h + ">" for h in self.headers])
90
91 def generate_body(self):
92 pass
93
94 def generate_footer(self):
95 pass
96
97 # Return set of printf '%' qualifier and input to that qualifier
98 def _get_printf_params(self, xgl_type, name, last_create):
99 # TODO : Need ENUM and STRUCT checks here
100 if "_TYPE" in xgl_type: # TODO : This should be generic ENUM check
101 return ("%s", "string_%s(%s)" % (xgl_type.strip('const ').strip('*'), name))
102 if "XGL_CHAR*" == xgl_type:
103 return ("%s", name)
104 if "UINT64" in xgl_type:
105 if '*' in xgl_type:
106 return ("%lu", "*%s" % name)
107 return ("%lu", name)
108 if "FLOAT" in xgl_type:
109 if '[' in xgl_type: # handle array, current hard-coded to 4 (TODO: Make this dynamic)
110 return ("[%f, %f, %f, %f]", "%s[0], %s[1], %s[2], %s[3]" % (name, name, name, name))
111 return ("%f", name)
112 if "BOOL" in xgl_type:
113 return ("%u", name)
114 if True in [t in xgl_type for t in ["INT", "SIZE", "FLAGS", "MASK"]]:
115 if '[' in xgl_type: # handle array, current hard-coded to 4 (TODO: Make this dynamic)
116 return ("[%i, %i, %i, %i]", "%s[0], %s[1], %s[2], %s[3]" % (name, name, name, name))
117 if '*' in xgl_type:
118 return ("%i", "*%s" % name)
119 return ("%i", name)
120 if last_create:
121 return ("%p", "(void*)*%s" % name)
122 return ("%p", "(void*)%s" % name)
123
124 def _generate_icd_dispatch_table(self):
125 proto_map = {}
126 for proto in self.protos:
127 proto_map[proto.name] = proto
128
129 entries = []
130 for name in xgl.icd_dispatch_table:
131 proto = proto_map[name]
132 entries.append(proto.c_typedef(attr="XGLAPI"))
133
134 return """struct icd_dispatch_table {
135 %s;
136};""" % ";\n ".join(entries)
137
138 def _generate_dispatch_entrypoints(self, qual="", layer="generic"):
139 if qual:
140 qual += " "
141
142 funcs = []
143 for proto in self.protos:
144 if proto.name != "GetProcAddr" and proto.name != "InitAndEnumerateGpus":
145 if "generic" == layer:
146 decl = proto.c_func(prefix="xgl", attr="XGLAPI")
147 param0_name = proto.params[0].name
148 ret_val = ''
149 stmt = ''
150 if proto.ret != "XGL_VOID":
151 ret_val = "XGL_RESULT result = "
152 stmt = " return result;\n"
153 if proto.params[0].ty != "XGL_PHYSICAL_GPU":
154 funcs.append('%s%s\n'
155 '{\n'
156 ' %snextTable.%s;\n'
157 '%s'
158 '}' % (qual, decl, ret_val, proto.c_call(), stmt))
159 else:
160 c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
161 funcs.append('%s%s\n'
162 '{\n'
163 ' XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) %s;\n'
164 ' printf("At start of layered %s\\n");\n'
165 ' pCurObj = gpuw;\n'
166 ' pthread_once(&tabOnce, initLayerTable);\n'
167 ' %snextTable.%s;\n'
168 ' printf("Completed layered %s\\n");\n'
169 '%s'
170 '}' % (qual, decl, proto.params[0].name, proto.name, ret_val, c_call, proto.name, stmt))
171 elif "apidump" == layer:
172 decl = proto.c_func(prefix="xgl", attr="XGLAPI")
173 param0_name = proto.params[0].name
174 ret_val = ''
175 stmt = ''
Tobin Ehlis083e9062014-10-23 08:19:47 -0600176 cis_param_index = [] # Store list of indices when func has struct params
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600177 create_func = False
178 if 'Create' in proto.name:
179 create_func = True
180 if proto.ret != "XGL_VOID":
181 ret_val = "XGL_RESULT result = "
182 stmt = " return result;\n"
183 log_func = 'printf("xgl%s(' % proto.name
184 print_vals = ''
185 pindex = 0
186 for p in proto.params:
187 if p.name == proto.params[-1].name and create_func: # last param of create func
188 (pft, pfi) = self._get_printf_params(p.ty, p.name, True)
189 else:
190 (pft, pfi) = self._get_printf_params(p.ty, p.name, False)
191 log_func += '%s = %s, ' % (p.name, pft)
192 print_vals += ', %s' % (pfi)
Tobin Ehlis083e9062014-10-23 08:19:47 -0600193 # TODO : Just want this to be simple check for params of STRUCT type
194 if "pCreateInfo" in p.name or ('const' in p.ty and '*' in p.ty and False not in [tmp_ty not in p.ty for tmp_ty in ['XGL_CHAR', 'XGL_VOID', 'XGL_CMD_BUFFER', 'XGL_QUEUE_SEMAPHORE', 'XGL_FENCE', 'XGL_SAMPLER', 'XGL_UINT32']]):
195 cis_param_index.append(pindex)
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600196 pindex += 1
197 log_func = log_func.strip(', ')
198 if proto.ret != "XGL_VOID":
199 log_func += ') = %s\\n"'
200 print_vals += ', string_XGL_RESULT(result)'
201 else:
202 log_func += ')\\n"'
203 log_func = '%s%s);' % (log_func, print_vals)
Tobin Ehlis083e9062014-10-23 08:19:47 -0600204 if len(cis_param_index) > 0:
205 log_func += '\n char *pTmpStr;'
206 for sp_index in cis_param_index:
207 cis_print_func = 'xgl_print_%s' % (proto.params[sp_index].ty.strip('const ').strip('*').lower())
208 log_func += '\n if (%s) {' % (proto.params[sp_index].name)
209 log_func += '\n pTmpStr = %s(%s, " ");' % (cis_print_func, proto.params[sp_index].name)
210 log_func += '\n printf(" %s (%%p)\\n%%s\\n", (void*)%s, pTmpStr);' % (proto.params[sp_index].name, proto.params[sp_index].name)
211 log_func += '\n free(pTmpStr);\n }'
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600212 if proto.params[0].ty != "XGL_PHYSICAL_GPU":
213 funcs.append('%s%s\n'
214 '{\n'
215 ' %snextTable.%s;\n'
216 ' %s\n'
217 '%s'
218 '}' % (qual, decl, ret_val, proto.c_call(), log_func, stmt))
219 else:
220 c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
221 funcs.append('%s%s\n'
222 '{\n'
223 ' XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) %s;\n'
224 ' pCurObj = gpuw;\n'
225 ' pthread_once(&tabOnce, initLayerTable);\n'
226 ' %snextTable.%s;\n'
227 ' %s\n'
228 '%s'
229 '}' % (qual, decl, proto.params[0].name, ret_val, c_call, log_func, stmt))
230 elif "objecttracker" == layer:
231 decl = proto.c_func(prefix="xgl", attr="XGLAPI")
232 param0_name = proto.params[0].name
233 create_line = ''
234 destroy_line = ''
235 using_line = ' ll_increment_use_count((XGL_VOID*)%s);\n printf("OBJ[%%llu] : USING %s object %%p (%%lu total uses)\\n", object_track_index++, (void*)%s, ll_get_obj_uses((XGL_VOID*)%s));\n' % (param0_name, param0_name, param0_name, param0_name)
Tobin Ehlis92804f92014-10-28 09:19:13 -0600236 if 'Create' in proto.name or 'Alloc' in proto.name:
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600237 create_line = ' printf("OBJ[%%llu] : CREATE %s object %%p\\n", object_track_index++, (void*)*%s);\n ll_insert_obj((XGL_VOID*)*%s, "%s");\n' % (proto.params[-1].ty.strip('*'), proto.params[-1].name, proto.params[-1].name, proto.params[-1].ty.strip('*'))
Tobin Ehlis92804f92014-10-28 09:19:13 -0600238 if 'Destroy' in proto.name or 'Free' in proto.name:
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600239 destroy_line = ' printf("OBJ[%%llu] : DESTROY %s object %%p\\n", object_track_index++, (void*)%s);\n ll_remove_obj((XGL_VOID*)%s);\n' % (param0_name, param0_name, param0_name)
240 using_line = ''
Tobin Ehlis92804f92014-10-28 09:19:13 -0600241 if 'DestroyDevice' in proto.name:
242 destroy_line += ' // Report any remaining objects in LL\n objNode *pTrav = pObjLLHead;\n while (pTrav) {\n'
243 destroy_line += ' printf("OBJ ERROR : %s object %p has not been destroyed (was used %lu times).\\n", pTrav->objType, pTrav->pObj, pTrav->numUses);\n'
244 destroy_line += ' pTrav = pTrav->pNext;\n }\n'
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600245 ret_val = ''
246 stmt = ''
247 if proto.ret != "XGL_VOID":
248 ret_val = "XGL_RESULT result = "
249 stmt = " return result;\n"
250 if proto.params[0].ty != "XGL_PHYSICAL_GPU":
251 funcs.append('%s%s\n'
252 '{\n'
253 '%s'
254 ' %snextTable.%s;\n'
255 '%s%s'
256 '%s'
257 '}' % (qual, decl, using_line, ret_val, proto.c_call(), create_line, destroy_line, stmt))
258 else:
259 c_call = proto.c_call().replace("(" + proto.params[0].name, "((XGL_PHYSICAL_GPU)gpuw->nextObject", 1)
260 funcs.append('%s%s\n'
261 '{\n'
262 ' XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) %s;\n'
263 '%s'
264 ' pCurObj = gpuw;\n'
265 ' pthread_once(&tabOnce, initLayerTable);\n'
266 ' %snextTable.%s;\n'
267 '%s%s'
268 '%s'
269 '}' % (qual, decl, proto.params[0].name, using_line, ret_val, c_call, create_line, destroy_line, stmt))
270
271 # TODO : Put this code somewhere so it gets called at the end if objects not deleted :
272 # // Report any remaining objects in LL
273 # objNode *pTrav = pObjLLHead;
274 # while (pTrav) {
275 # printf("WARN : %s object %p has not been destroyed.\n", pTrav->objType, pTrav->pObj);
276 # }
277
278 return "\n\n".join(funcs)
279
280 def _generate_layer_gpa_function(self, prefix="xgl"):
281 func_body = []
282 func_body.append("XGL_LAYER_EXPORT XGL_VOID* XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* funcName)\n"
283 "{\n"
284 " XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;\n"
285 " if (gpu == NULL)\n"
286 " return NULL;\n"
287 " pCurObj = gpuw;\n"
288 " pthread_once(&tabOnce, initLayerTable);\n\n"
289 ' if (!strncmp("xglGetProcAddr", (const char *) funcName, sizeof("xglGetProcAddr")))\n'
290 ' return xglGetProcAddr;')
291 for name in xgl.icd_dispatch_table:
292 if name == "GetProcAddr":
293 continue
294 if name == "InitAndEnumerateGpus":
295 func_body.append(' else if (!strncmp("%s%s", (const char *) funcName, sizeof("%s%s")))\n'
296 ' return nextTable.%s;' % (prefix, name, prefix, name, name))
297 else:
298 func_body.append(' else if (!strncmp("%s%s", (const char *) funcName, sizeof("%s%s")))\n'
299 ' return %s%s;' % (prefix, name, prefix, name, prefix, name))
300
301 func_body.append(" else {\n"
302 " XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu;\n"
303 " if (gpuw->pGPA == NULL)\n"
304 " return NULL;\n"
305 " return gpuw->pGPA(gpuw->nextObject, funcName);\n"
306 " }\n"
307 "}\n")
308 return "\n".join(func_body)
309
310 def _generate_layer_dispatch_table(self, prefix='xgl'):
311 func_body = []
312 func_body.append('static void initLayerTable()\n'
313 '{\n'
314 ' GetProcAddrType fpNextGPA;\n'
315 ' fpNextGPA = pCurObj->pGPA;\n'
316 ' assert(fpNextGPA);\n');
317
318 for name in xgl.icd_dispatch_table:
319 func_body.append(' %sType fp%s = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "%s%s");\n'
320 ' nextTable.%s = fp%s;' % (name, name, prefix, name, name, name))
321
322 func_body.append("}\n")
323 return "\n".join(func_body)
324
325class LayerFuncsSubcommand(Subcommand):
326 def generate_header(self):
327 return '#include <xglLayer.h>\n#include "loader.h"'
328
329 def generate_body(self):
330 return self._generate_dispatch_entrypoints("static", True)
331
332class LayerDispatchSubcommand(Subcommand):
333 def generate_header(self):
334 return '#include "layer_wrappers.h"'
335
336 def generate_body(self):
337 return self._generate_layer_dispatch_table()
338
339class GenericLayerSubcommand(Subcommand):
340 def generate_header(self):
341 return '#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <assert.h>\n#include <pthread.h>\n#include "xglLayer.h"\n\nstatic XGL_LAYER_DISPATCH_TABLE nextTable;\nstatic XGL_BASE_LAYER_OBJECT *pCurObj;\nstatic pthread_once_t tabOnce = PTHREAD_ONCE_INIT;\n'
342
343 def generate_body(self):
344 body = [self._generate_layer_dispatch_table(),
345 self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "generic"),
346 self._generate_layer_gpa_function()]
347
348 return "\n\n".join(body)
349
350class ApiDumpSubcommand(Subcommand):
351 def generate_header(self):
352 return '#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <assert.h>\n#include <pthread.h>\n#include "xglLayer.h"\n#include "xgl_string_helper.h"\n#include "xgl_struct_string_helper.h"\n\nstatic XGL_LAYER_DISPATCH_TABLE nextTable;\nstatic XGL_BASE_LAYER_OBJECT *pCurObj;\nstatic pthread_once_t tabOnce = PTHREAD_ONCE_INIT;\n'
353
354 def generate_body(self):
355 body = [self._generate_layer_dispatch_table(),
356 self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "apidump"),
357 self._generate_layer_gpa_function()]
358
359 return "\n\n".join(body)
360
361class ObjectTrackerSubcommand(Subcommand):
362 def generate_header(self):
363 header_txt = []
364 header_txt.append('#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <assert.h>\n#include <pthread.h>')
365 header_txt.append('#include "xglLayer.h"\n\nstatic XGL_LAYER_DISPATCH_TABLE nextTable;\nstatic XGL_BASE_LAYER_OBJECT *pCurObj;')
366 header_txt.append('static pthread_once_t tabOnce = PTHREAD_ONCE_INIT;\nstatic long long unsigned int object_track_index = 0;\n')
367 header_txt.append('typedef struct _objNode {')
368 header_txt.append(' XGL_VOID *pObj;')
369 header_txt.append(' const char *objType;')
370 header_txt.append(' uint64_t numUses;')
371 header_txt.append(' struct _objNode *pNext;')
372 header_txt.append('} objNode;\n')
373 header_txt.append('static objNode *pObjLLHead = NULL;\n')
374 header_txt.append('static void ll_insert_obj(XGL_VOID* pObj, const char* type) {')
375 header_txt.append(' objNode* pNewObjNode = (objNode*)malloc(sizeof(objNode));')
376 header_txt.append(' pNewObjNode->pObj = pObj;')
377 header_txt.append(' pNewObjNode->objType = type;')
378 header_txt.append(' pNewObjNode->numUses = 0;')
379 header_txt.append(' pNewObjNode->pNext = pObjLLHead;')
380 header_txt.append(' pObjLLHead = pNewObjNode;')
381 header_txt.append('}\n')
382 header_txt.append('static void ll_increment_use_count(XGL_VOID* pObj) {')
383 header_txt.append(' objNode *pTrav = pObjLLHead;')
384 header_txt.append(' while (pTrav) {')
385 header_txt.append(' if (pTrav->pObj == pObj) {')
386 header_txt.append(' pTrav->numUses++;')
387 header_txt.append(' return;')
388 header_txt.append(' }')
389 header_txt.append(' pTrav = pTrav->pNext;')
390 header_txt.append(' }')
391 header_txt.append(' // If we do not find obj, insert it and then intrement count')
Tobin Ehlis92804f92014-10-28 09:19:13 -0600392 header_txt.append(' printf("OBJ WARN : Unable to increment count for obj %p, will add to list as UNKNOWN type and increment count\\n", pObj);')
Tobin Ehlis12076fc2014-10-22 09:06:33 -0600393 header_txt.append(' ll_insert_obj(pObj, "UNKNOWN");')
394 header_txt.append(' ll_increment_use_count(pObj);')
395 header_txt.append('}')
396 header_txt.append('static uint64_t ll_get_obj_uses(XGL_VOID* pObj) {')
397 header_txt.append(' objNode *pTrav = pObjLLHead;')
398 header_txt.append(' while (pTrav) {')
399 header_txt.append(' if (pTrav->pObj == pObj) {')
400 header_txt.append(' return pTrav->numUses;')
401 header_txt.append(' }')
402 header_txt.append(' pTrav = pTrav->pNext;')
403 header_txt.append(' }')
404 header_txt.append(' return 0;')
405 header_txt.append('}')
406 header_txt.append('static void ll_remove_obj(XGL_VOID* pObj) {')
407 header_txt.append(' objNode *pTrav = pObjLLHead;')
408 header_txt.append(' objNode *pPrev = pObjLLHead;')
409 header_txt.append(' while (pTrav) {')
410 header_txt.append(' if (pTrav->pObj == pObj) {')
411 header_txt.append(' pPrev->pNext = pTrav->pNext;')
412 header_txt.append(' if (pObjLLHead == pTrav)')
413 header_txt.append(' pObjLLHead = pTrav->pNext;')
414 header_txt.append(' printf("OBJ_STAT Removed %s obj %p that was used %lu times.\\n", pTrav->objType, pTrav->pObj, pTrav->numUses);')
415 header_txt.append(' free(pTrav);')
416 header_txt.append(' return;')
417 header_txt.append(' }')
418 header_txt.append(' pPrev = pTrav;')
419 header_txt.append(' pTrav = pTrav->pNext;')
420 header_txt.append(' }')
421 header_txt.append(' printf("ERROR : Unable to remove obj %p\\n", pObj);')
422 header_txt.append('}')
423
424 return "\n".join(header_txt)
425
426 def generate_body(self):
427 body = [self._generate_layer_dispatch_table(),
428 self._generate_dispatch_entrypoints("XGL_LAYER_EXPORT", "objecttracker"),
429 self._generate_layer_gpa_function()]
430
431 return "\n\n".join(body)
432
433def main():
434 subcommands = {
435 "layer-funcs" : LayerFuncsSubcommand,
436 "layer-dispatch" : LayerDispatchSubcommand,
437 "generic-layer" : GenericLayerSubcommand,
438 "api-dump" : ApiDumpSubcommand,
439 "object-tracker" : ObjectTrackerSubcommand,
440 }
441
442 if len(sys.argv) < 2 or sys.argv[1] not in subcommands:
443 print("Usage: %s <subcommand> [options]" % sys.argv[0])
444 print
445 print("Available sucommands are: %s" % " ".join(subcommands))
446 exit(1)
447
448 subcmd = subcommands[sys.argv[1]](sys.argv[2:])
449 subcmd.run()
450
451if __name__ == "__main__":
452 main()