MCPcopy Index your code
hub / github.com/sql-js/sql.js / _unixWrite

Function _unixWrite

js/sql-debug.js:17087–17169  ·  view source on GitHub ↗
($0,$1,$2,$3,$4)

Source from the content-addressed store, hash-verified

17085 return ($$0|0);
17086}
17087function _unixWrite($0,$1,$2,$3,$4) {
17088 $0 = $0|0;
17089 $1 = $1|0;
17090 $2 = $2|0;
17091 $3 = $3|0;
17092 $4 = $4|0;
17093 var $$0 = 0, $$0151719$i$i = 0, $$022 = 0, $$023 = 0, $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;
17094 var $26 = 0, $27 = 0, $28 = 0, $29 = 0, $30 = 0, $31 = 0, $32 = 0, $33 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
17095 sp = STACKTOP;
17096 $5 = ((($0)) + 12|0);
17097 $$022 = $2;$$023 = $1;$27 = $4;$8 = $3;
17098 L1: while(1) {
17099 $6 = HEAP32[$5>>2]|0;
17100 $7 = $$022 & 131071;
17101 while(1) {
17102 $9 = (_lseek($6,$8,0)|0);
17103 $10 = ($9|0)<(0);
17104 if ($10) {
17105 $$0151719$i$i = -1;
17106 label = 6;
17107 break L1;
17108 }
17109 $11 = HEAP32[(3556)>>2]|0;
17110 $12 = (FUNCTION_TABLE_iiii[$11 & 255]($6,$$023,$7)|0);
17111 $13 = ($12|0)<(0);
17112 if (!($13)) {
17113 break;
17114 }
17115 $14 = (___errno_location()|0);
17116 $15 = HEAP32[$14>>2]|0;
17117 $16 = ($15|0)==(4);
17118 if (!($16)) {
17119 $$0151719$i$i = $12;
17120 label = 6;
17121 break L1;
17122 }
17123 }
17124 $21 = ($$022|0)>($12|0);
17125 $22 = ($12|0)!=(0);
17126 $23 = $21 & $22;
17127 if (!($23)) {
17128 label = 9;
17129 break;
17130 }
17131 $24 = (($$022) - ($12))|0;
17132 $25 = ($12|0)<(0);
17133 $26 = $25 << 31 >> 31;
17134 $28 = (_i64Add(($12|0),($26|0),($8|0),($27|0))|0);
17135 $29 = tempRet0;
17136 $30 = (($$023) + ($12)|0);
17137 $$022 = $24;$$023 = $30;$27 = $29;$8 = $28;
17138 }
17139 if ((label|0) == 6) {
17140 $17 = ((($0)) + 20|0);
17141 $18 = (___errno_location()|0);
17142 $19 = HEAP32[$18>>2]|0;
17143 HEAP32[$17>>2] = $19;
17144 $20 = ($$022|0)>($$0151719$i$i|0);

Callers

nothing calls this directly

Calls 3

_lseekFunction · 0.85
___errno_locationFunction · 0.85
_i64AddFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…