bit_vector
Module0x0000…0001
- Move path
- 0x0000…0001::bit_vector
- Functions
- 77 public, 0 entry
- Structs
- 1
- Friend modules
- None
bit_vector
Bytecode318 lines
The on-chain disassembly. Offsets are bytecode positions within each function.
// Move bytecode v7
module 1.bit_vector {
struct BitVector has copy, drop, store {
length: u64,
bit_field: vector<bool>
}
public new(Arg0: u64): BitVector {
L1: loc0: vector<bool>
L2: loc1: u64
B0:
0CopyLoc[0](Arg0: u64)
1LdU64(0)
2Gt
3BrFalse(5)
B1:
4Branch(7)
B2:
5LdConst[1](u64: 131073)
6Abort
B3:
7CopyLoc[0](Arg0: u64)
8LdConst[3](u64: 1024)
9Lt
10BrFalse(12)
B4:
11Branch(14)
B5:
12LdConst[1](u64: 131073)
13Abort
B6:
14LdU64(0)
15StLoc[2](loc1: u64)
16LdConst[4](vector<bool>: 00)
17StLoc[1](loc0: vector<bool>)
B7:
18CopyLoc[2](loc1: u64)
19CopyLoc[0](Arg0: u64)
20Lt
21BrFalse(30)
B8:
22MutBorrowLoc[1](loc0: vector<bool>)
23LdFalse
24VecPushBack(5)
25MoveLoc[2](loc1: u64)
26LdU64(1)
27Add
28StLoc[2](loc1: u64)
29Branch(18)
B9:
30MoveLoc[0](Arg0: u64)
31MoveLoc[1](loc0: vector<bool>)
32Pack[0](BitVector)
33Ret
}
public set(Arg0: &mut BitVector, Arg1: u64) {
L2: loc0: &mut bool
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &mut BitVector)
2ImmBorrowField[0](BitVector.bit_field: vector<bool>)
3VecLen(5)
4Lt
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &mut BitVector)
8Pop
9LdConst[0](u64: 131072)
10Abort
B3:
11MoveLoc[0](Arg0: &mut BitVector)
12MutBorrowField[0](BitVector.bit_field: vector<bool>)
13MoveLoc[1](Arg1: u64)
14VecMutBorrow(5)
15StLoc[2](loc0: &mut bool)
16LdTrue
17MoveLoc[2](loc0: &mut bool)
18WriteRef
19Ret
}
public unset(Arg0: &mut BitVector, Arg1: u64) {
L2: loc0: &mut bool
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &mut BitVector)
2ImmBorrowField[0](BitVector.bit_field: vector<bool>)
3VecLen(5)
4Lt
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &mut BitVector)
8Pop
9LdConst[0](u64: 131072)
10Abort
B3:
11MoveLoc[0](Arg0: &mut BitVector)
12MutBorrowField[0](BitVector.bit_field: vector<bool>)
13MoveLoc[1](Arg1: u64)
14VecMutBorrow(5)
15StLoc[2](loc0: &mut bool)
16LdFalse
17MoveLoc[2](loc0: &mut bool)
18WriteRef
19Ret
}
public shift_left(Arg0: &mut BitVector, Arg1: u64) {
L2: loc0: &mut bool
L3: loc1: u64
L4: loc2: u64
L5: loc3: u64
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &mut BitVector)
2ImmBorrowField[1](BitVector.length: u64)
3ReadRef
4Ge
5BrFalse(33)
B1:
6CopyLoc[0](Arg0: &mut BitVector)
7ImmBorrowField[0](BitVector.bit_field: vector<bool>)
8VecLen(5)
9StLoc[5](loc3: u64)
10LdU64(0)
11StLoc[3](loc1: u64)
B2:
12CopyLoc[3](loc1: u64)
13CopyLoc[5](loc3: u64)
14Lt
15BrFalse(30)
B3:
16Branch(17)
B4:
17CopyLoc[0](Arg0: &mut BitVector)
18MutBorrowField[0](BitVector.bit_field: vector<bool>)
19CopyLoc[3](loc1: u64)
20VecMutBorrow(5)
21StLoc[2](loc0: &mut bool)
22LdFalse
23MoveLoc[2](loc0: &mut bool)
24WriteRef
25MoveLoc[3](loc1: u64)
26LdU64(1)
27Add
28StLoc[3](loc1: u64)
29Branch(12)
B5:
30MoveLoc[0](Arg0: &mut BitVector)
31Pop
32Branch(86)
B6:
33CopyLoc[1](Arg1: u64)
34StLoc[4](loc2: u64)
B7:
35CopyLoc[4](loc2: u64)
36CopyLoc[0](Arg0: &mut BitVector)
37ImmBorrowField[1](BitVector.length: u64)
38ReadRef
39Lt
40BrFalse(63)
B8:
41Branch(42)
B9:
42CopyLoc[0](Arg0: &mut BitVector)
43FreezeRef
44CopyLoc[4](loc2: u64)
45Call is_index_set(&BitVector, u64): bool
46BrFalse(53)
B10:
47CopyLoc[0](Arg0: &mut BitVector)
48CopyLoc[4](loc2: u64)
49CopyLoc[1](Arg1: u64)
50Sub
51Call set(&mut BitVector, u64)
52Branch(58)
B11:
53CopyLoc[0](Arg0: &mut BitVector)
54CopyLoc[4](loc2: u64)
55CopyLoc[1](Arg1: u64)
56Sub
57Call unset(&mut BitVector, u64)
B12:
58MoveLoc[4](loc2: u64)
59LdU64(1)
60Add
61StLoc[4](loc2: u64)
62Branch(35)
B13:
63CopyLoc[0](Arg0: &mut BitVector)
64ImmBorrowField[1](BitVector.length: u64)
65ReadRef
66MoveLoc[1](Arg1: u64)
67Sub
68StLoc[4](loc2: u64)
B14:
69CopyLoc[4](loc2: u64)
70CopyLoc[0](Arg0: &mut BitVector)
71ImmBorrowField[1](BitVector.length: u64)
72ReadRef
73Lt
74BrFalse(84)
B15:
75Branch(76)
B16:
76CopyLoc[0](Arg0: &mut BitVector)
77CopyLoc[4](loc2: u64)
78Call unset(&mut BitVector, u64)
79MoveLoc[4](loc2: u64)
80LdU64(1)
81Add
82StLoc[4](loc2: u64)
83Branch(69)
B17:
84MoveLoc[0](Arg0: &mut BitVector)
85Pop
B18:
86Ret
}
public is_index_set(Arg0: &BitVector, Arg1: u64): bool {
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &BitVector)
2ImmBorrowField[0](BitVector.bit_field: vector<bool>)
3VecLen(5)
4Lt
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &BitVector)
8Pop
9LdConst[0](u64: 131072)
10Abort
B3:
11MoveLoc[0](Arg0: &BitVector)
12ImmBorrowField[0](BitVector.bit_field: vector<bool>)
13MoveLoc[1](Arg1: u64)
14VecImmBorrow(5)
15ReadRef
16Ret
}
public length(Arg0: &BitVector): u64 {
B0:
0MoveLoc[0](Arg0: &BitVector)
1ImmBorrowField[0](BitVector.bit_field: vector<bool>)
2VecLen(5)
3Ret
}
public longest_set_sequence_starting_at(Arg0: &BitVector, Arg1: u64): u64 {
L2: loc0: u64
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &BitVector)
2ImmBorrowField[1](BitVector.length: u64)
3ReadRef
4Lt
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &BitVector)
8Pop
9LdConst[0](u64: 131072)
10Abort
B3:
11CopyLoc[1](Arg1: u64)
12StLoc[2](loc0: u64)
B4:
13CopyLoc[2](loc0: u64)
14CopyLoc[0](Arg0: &BitVector)
15ImmBorrowField[1](BitVector.length: u64)
16ReadRef
17Lt
18BrFalse(33)
B5:
19CopyLoc[0](Arg0: &BitVector)
20CopyLoc[2](loc0: u64)
21Call is_index_set(&BitVector, u64): bool
22Not
23BrFalse(28)
B6:
24Branch(25)
B7:
25MoveLoc[0](Arg0: &BitVector)
26Pop
27Branch(33)
B8:
28MoveLoc[2](loc0: u64)
29LdU64(1)
30Add
31StLoc[2](loc0: u64)
32Branch(13)
B9:
33MoveLoc[2](loc0: u64)
34MoveLoc[1](Arg1: u64)
35Sub
36Ret
}
Constants [
0 => u64: 131072
1 => u64: 131073
2 => u64: 1
3 => u64: 1024
4 => vector<bool>: 00
]
}