MCPcopy
hub / github.com/sql-js/sql.js / _replicateFunc

Function _replicateFunc

js/sql-debug.js:7396–7481  ·  view source on GitHub ↗
($0,$1,$2)

Source from the content-addressed store, hash-verified

7394 return;
7395}
7396function _replicateFunc($0,$1,$2) {
7397 $0 = $0|0;
7398 $1 = $1|0;
7399 $2 = $2|0;
7400 var $10 = 0, $11 = 0, $12 = 0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $18 = 0, $19 = 0, $20 = 0, $21 = 0, $22 = 0, $23 = 0, $24 = 0, $25 = 0, $26 = 0, $27 = 0, $28 = 0, $29 = 0;
7401 var $3 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $34 = 0, $35 = 0, $36 = 0, $37 = 0, $38 = 0, $39 = 0, $4 = 0, $40 = 0, $41 = 0, $42 = 0, $43 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0;
7402 var $9 = 0, $or$cond = 0, label = 0, sp = 0;
7403 sp = STACKTOP;
7404 $3 = ($1|0)==(2);
7405 if (!($3)) {
7406 return;
7407 }
7408 $4 = HEAP32[$2>>2]|0;
7409 $5 = (_sqlite3_value_type($4)|0);
7410 $6 = ($5|0)==(5);
7411 if ($6) {
7412 return;
7413 }
7414 $7 = ((($2)) + 4|0);
7415 $8 = HEAP32[$7>>2]|0;
7416 $9 = (_sqlite3_value_int64($8)|0);
7417 $10 = tempRet0;
7418 $11 = ($10|0)<(0);
7419 if ($11) {
7420 _sqlite3_result_error($0,16835,-1);
7421 return;
7422 }
7423 $12 = HEAP32[$2>>2]|0;
7424 $13 = (_sqlite3_value_bytes($12)|0);
7425 $14 = ($13|0)<(0);
7426 $15 = $14 << 31 >> 31;
7427 $16 = (___muldi3(($13|0),($15|0),($9|0),($10|0))|0);
7428 $17 = tempRet0;
7429 $18 = (_i64Add(($16|0),($17|0),1,0)|0);
7430 $19 = tempRet0;
7431 $20 = (_sqlite3_malloc($18)|0);
7432 $21 = (($13) + 1)|0;
7433 $22 = (_sqlite3_malloc($21)|0);
7434 $23 = ($20|0)!=(0|0);
7435 $24 = ($22|0)!=(0|0);
7436 $or$cond = $23 & $24;
7437 if ($or$cond) {
7438 $25 = HEAP32[$2>>2]|0;
7439 $26 = (_sqlite3_value_text($25)|0);
7440 (_strcpy($22,$26)|0);
7441 $27 = ($10|0)>(0);
7442 $28 = ($9>>>0)>(0);
7443 $29 = ($10|0)==(0);
7444 $30 = $29 & $28;
7445 $31 = $27 | $30;
7446 if ($31) {
7447 $32 = 0;$33 = 0;
7448 while(1) {
7449 $34 = (___muldi3(($32|0),($33|0),($13|0),($15|0))|0);
7450 $35 = tempRet0;
7451 $36 = (($20) + ($34)|0);
7452 (_strcpy($36,$22)|0);
7453 $37 = (_i64Add(($32|0),($33|0),1,0)|0);

Callers

nothing calls this directly

Calls 12

_sqlite3_value_typeFunction · 0.85
_sqlite3_value_int64Function · 0.85
_sqlite3_result_errorFunction · 0.85
_sqlite3_value_bytesFunction · 0.85
___muldi3Function · 0.85
_i64AddFunction · 0.85
_sqlite3_mallocFunction · 0.85
_sqlite3_value_textFunction · 0.85
_strcpyFunction · 0.85
_sqlite3_result_textFunction · 0.85
_sqlite3_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…