Dataset Viewer
Auto-converted to Parquet Duplicate
index
int64
6
13.3k
sol_idx
int64
6
13.3k
problem_name
stringlengths
8
91
func_name
stringlengths
1
42
opt
stringclasses
4 values
num_lines
int64
5
163
container_labels
listlengths
0
5
func
stringlengths
43
4.65k
stripped_asm
stringlengths
80
235k
cfg_dot
stringlengths
62
301k
ghidra_pseudo
stringlengths
41
98.6k
ghidra_target_mangled
stringlengths
5
138
8,136
8,136
1195_C. Basketball Exercise
solve
O0
19
[ "vector" ]
void solve() { int n; cin >> n; vector<long long> h1(n), h2(n); for (int i = 0; i < n; i++) { cin >> h1[i]; } for (int i = 0; i < n; i++) { cin >> h2[i]; } vector<vector<long long>> dp(n + 1, vector<long long>(2, 0)); dp[1][0] = h1[0]; dp[1][1] = h2[0]; for (int i = 2; i <= n; i++) { d...
1389: f3 0f 1e fa endbr64 138d: 55 push %rbp 138e: 48 89 e5 mov %rsp,%rbp 1391: 53 push %rbx 1392: 48 81 ec a8 00 00 00 sub $0xa8,%rsp 1399: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax 13a0: 00 00 13a2: 48 89 45 e8 ...
digraph G { "401389_56" [label="endbr64\lpush rbp\lmov rbp, rsp\lpush rbx\lsub rsp, 0xa8\lmov rax, qword ptr fs:[0x28]\lmov qword ptr [rbp - 0x18], rax\lxor eax, eax\llea rax, [rbp - 0xa8]\lmov rsi, rax\llea rax, [rip + 0x5da7]\lmov rdi, rax\lcall 0x4011c0\l", shape=box]; "4013c1_12" [label="lea rax, [rbp - 0x30]\lmov ...
void FUN_00101389(void) { long lVar1; undefined8 *puVar2; undefined8 uVar3; long *plVar4; undefined8 uVar5; longlong *plVar6; ostream *poVar7; long in_FS_OFFSET; undefined1 local_b2; undefined1 local_b1; int local_b0; int local_ac; int local_a8; int local_a4; long local_a0; undefined1 ...
_Z5solvev
8,136
8,136
1195_C. Basketball Exercise
solve
O1
19
[ "vector" ]
void solve() { int n; cin >> n; vector<long long> h1(n), h2(n); for (int i = 0; i < n; i++) { cin >> h1[i]; } for (int i = 0; i < n; i++) { cin >> h2[i]; } vector<vector<long long>> dp(n + 1, vector<long long>(2, 0)); dp[1][0] = h1[0]; dp[1][1] = h2[0]; for (int i = 2; i <= n; i++) { d...
1369: f3 0f 1e fa endbr64 136d: 41 57 push %r15 136f: 41 56 push %r14 1371: 41 55 push %r13 1373: 41 54 push %r12 1375: 55 push %rbp 1376: 53 push %rbx 1377: 48 81...
digraph G { "401369_57" [label="endbr64\lpush r15\lpush r14\lpush r13\lpush r12\lpush rbp\lpush rbx\lsub rsp, 0xa8\lmov rax, qword ptr fs:[0x28]\lmov qword ptr [rsp + 0x98], rax\lxor eax, eax\llea rsi, [rsp + 0x1c]\llea rdi, [rip + 0x2dc3]\lcall 0x4011b0\l", shape=box]; "4013a2_14" [label="movsxd rbx, dword ptr [rsp + ...
void FUN_00101369(void) { long lVar1; void *pvVar2; undefined8 *puVar3; undefined8 uVar4; long *plVar5; ostream *poVar6; long lVar7; int iVar8; ulong uVar9; undefined8 *unaff_R13; undefined8 *puVar10; long in_FS_OFFSET; undefined8 *local_d0; undefined1 local_bd; int local_bc; undefined...
_Z5solvev
8,136
8,136
1195_C. Basketball Exercise
solve
O2
19
[ "vector" ]
void solve() { int n; cin >> n; vector<long long> h1(n), h2(n); for (int i = 0; i < n; i++) { cin >> h1[i]; } for (int i = 0; i < n; i++) { cin >> h2[i]; } vector<vector<long long>> dp(n + 1, vector<long long>(2, 0)); dp[1][0] = h1[0]; dp[1][1] = h2[0]; for (int i = 2; i <= n; i++) { d...
1450: f3 0f 1e fa endbr64 1454: 41 57 push %r15 1456: 41 56 push %r14 1458: 41 55 push %r13 145a: 41 54 push %r12 145c: 4c 8d 25 fd 2c 00 00 lea 0x2cfd(%rip),%r12 # 4160 <_ZSt3cin@GLIBCXX_3.4> 1463:...
digraph G { "401450_60" [label="endbr64\lpush r15\lpush r14\lpush r13\lpush r12\llea r12, [rip + 0x2cfd]\lpush rbp\lmov rdi, r12\lpush rbx\lsub rsp, 0x98\lmov rax, qword ptr fs:[0x28]\lmov qword ptr [rsp + 0x88], rax\lxor eax, eax\llea rsi, [rsp + 0x2c]\lcall 0x401190\l", shape=box]; "40148c_18" [label="movsxd rbx, dwo...
void FUN_00101450(void) { long *plVar1; long *plVar2; long lVar3; long lVar4; long *plVar5; void *pvVar6; code *pcVar7; undefined8 uVar8; long lVar9; undefined8 *puVar10; undefined8 *puVar11; undefined8 *puVar12; long *plVar13; undefined8 *puVar14; ostream *poVar15; undefined8 uVar16; ...
_Z5solvev
8,136
8,136
1195_C. Basketball Exercise
solve
O3
19
[ "vector" ]
void solve() { int n; cin >> n; vector<long long> h1(n), h2(n); for (int i = 0; i < n; i++) { cin >> h1[i]; } for (int i = 0; i < n; i++) { cin >> h2[i]; } vector<vector<long long>> dp(n + 1, vector<long long>(2, 0)); dp[1][0] = h1[0]; dp[1][1] = h2[0]; for (int i = 2; i <= n; i++) { d...
1490: f3 0f 1e fa endbr64 1494: 41 57 push %r15 1496: 41 56 push %r14 1498: 4c 8d 35 c1 2c 00 00 lea 0x2cc1(%rip),%r14 # 4160 <_ZSt3cin@GLIBCXX_3.4> 149f: 41 55 push %r13 14a1: 4c 89 f7 mov %r14,%rdi ...
digraph G { "401490_54" [label="endbr64\lpush r15\lpush r14\llea r14, [rip + 0x2cc1]\lpush r13\lmov rdi, r14\lpush r12\lpush rbp\lpush rbx\lsub rsp, 0x38\lmov rax, qword ptr fs:[0x28]\lmov qword ptr [rsp + 0x28], rax\lxor eax, eax\llea rsi, [rsp + 0x24]\lcall 0x401190\l", shape=box]; "4014c6_18" [label="movsxd rbx, dwo...
void FUN_00101490(void) { long *plVar1; long *plVar2; long lVar3; long lVar4; long *plVar5; void *pvVar6; code *pcVar7; undefined8 uVar8; long lVar9; undefined8 *puVar10; undefined8 *puVar11; undefined1 (*pauVar12) [16]; ulong uVar13; undefined1 (*pauVar14) [16]; undefined8 *puVar15; o...
_Z5solvev
115
115
1136_D. Nastya Is Buying Lunch
logic
O0
33
[ "map", "set" ]
"void logic() {\n int n, k;\n cin >> n >> k;\n int arr[n];\n int count = 0;\n for (int i = 0; i(...TRUNCATED)
" 13b8:\tf3 0f 1e fa \tendbr64 \n 13bc:\t55 \tpush %rbp\n 13bd(...TRUNCATED)
"digraph G {\n\"4013b8_70\" [label=\"endbr64\\lpush rbp\\lmov rbp, rsp\\lpush r15\\lpush r14\\lpush (...TRUNCATED)
"\nvoid FUN_001013b8(void)\n\n{\n long lVar1;\n int iVar2;\n char cVar3;\n istream *piVar4;\n u(...TRUNCATED)
_Z5logicv
115
115
1136_D. Nastya Is Buying Lunch
logic
O1
33
[ "map", "set" ]
"void logic() {\n int n, k;\n cin >> n >> k;\n int arr[n];\n int count = 0;\n for (int i = 0; i(...TRUNCATED)
" 12ee:\tf3 0f 1e fa \tendbr64 \n 12f2:\t55 \tpush %rbp\n 12f3(...TRUNCATED)
"digraph G {\n\"4012ee_58\" [label=\"endbr64\\lpush rbp\\lmov rbp, rsp\\lpush r15\\lpush r14\\lpush (...TRUNCATED)
"\nvoid FUN_001012ee(void)\n\n{\n undefined1 *puVar1;\n int iVar2;\n long lVar3;\n int iVar4;\n (...TRUNCATED)
_Z5logicv
115
115
1136_D. Nastya Is Buying Lunch
logic
O2
33
[ "map", "set" ]
"void logic() {\n int n, k;\n cin >> n >> k;\n int arr[n];\n int count = 0;\n for (int i = 0; i(...TRUNCATED)
" 17f0:\tf3 0f 1e fa \tendbr64 \n 17f4:\t55 \tpush %rbp\n 17f5(...TRUNCATED)
"digraph G {\n\"4017f0_61\" [label=\"endbr64\\lpush rbp\\lmov rbp, rsp\\lpush r15\\lpush r14\\llea r(...TRUNCATED)
"\nvoid FUN_001017f0(void)\n\n{\n long *plVar1;\n int iVar2;\n undefined8 uVar3;\n void *pvVar4;(...TRUNCATED)
_Z5logicv
115
115
1136_D. Nastya Is Buying Lunch
logic
O3
33
[ "map", "set" ]
"void logic() {\n int n, k;\n cin >> n >> k;\n int arr[n];\n int count = 0;\n for (int i = 0; i(...TRUNCATED)
" 1940:\tf3 0f 1e fa \tendbr64 \n 1944:\t55 \tpush %rbp\n 1945(...TRUNCATED)
"digraph G {\n\"401940_61\" [label=\"endbr64\\lpush rbp\\lmov rbp, rsp\\lpush r15\\lpush r14\\llea r(...TRUNCATED)
"\nvoid FUN_00101940(void)\n\n{\n long *plVar1;\n undefined8 uVar2;\n void *pvVar3;\n long lVar4(...TRUNCATED)
_Z5logicv
1,049
1,049
1003_E. Tree Constructing
build
O0
8
[ "pair" ]
"void build() {\n for (int i = 1; i <= D; i++) {\n edges.insert(make_pair(i, i + 1));\n degre(...TRUNCATED)
" 14b6:\tf3 0f 1e fa \tendbr64 \n 14ba:\t55 \tpush %rbp\n 14bb(...TRUNCATED)
"digraph G {\n\"4014b6_39\" [label=\"endbr64\\lpush rbp\\lmov rbp, rsp\\lsub rsp, 0x20\\lmov rax, qw(...TRUNCATED)
"\nvoid FUN_001014b6(void)\n\n{\n long in_FS_OFFSET;\n int local_20;\n int local_1c;\n undefined(...TRUNCATED)
_Z5buildv
1,049
1,049
1003_E. Tree Constructing
build
O1
8
[ "pair" ]
"void build() {\n for (int i = 1; i <= D; i++) {\n edges.insert(make_pair(i, i + 1));\n degre(...TRUNCATED)
" 24e3:\tf3 0f 1e fa \tendbr64 \n 24e7:\t41 55 \tpush %r13\n 24e9(...TRUNCATED)
"digraph G {\n\"4024e3_39\" [label=\"endbr64\\lpush r13\\lpush r12\\lpush rbp\\lpush rbx\\lsub rsp, (...TRUNCATED)
"\nvoid FUN_001024e3(void)\n\n{\n int *piVar1;\n int iVar2;\n int iVar3;\n int *piVar4;\n long (...TRUNCATED)
_Z5buildv
End of preview. Expand in Data Studio

STLBench

STLBench is a function-level dataset for C++ STL container type recovery from stripped binaries. Each record pairs a function's ground-truth C++ source with its stripped-binary disassembly, control-flow graph (CFG), Ghidra pseudo-code, and a multi-label set of STL container types used by the function.

Anonymous release for double-blind review. Authors and project repository will be revealed after the review period.

Summary

  • Records: 14,884 (3,894 unique source functions × 4 optimization levels, with per-opt extraction failures)
  • Source pool: 4,600 selected solutions from CodeContests (DeepMind, CC BY 4.0)
  • Toolchain: g++ + libstdc++, x86-64 Linux ELF
  • Optimization levels: O0, O1, O2, O3
  • Label space (6 classes): vector, map, pair, set, string, queue (multi-label; array excluded as it is undetectable post-compilation)
  • Splits: train / validation / test = 11,914 / 1,487 / 1,483 records, partitioned by problem_name (no problem leakage across splits)

Schema

Field Type Nullable Description
index int no Original record index in the upstream JSONL
sol_idx int no Solution index within the CodeContests problem
problem_name string no CodeContests problem identifier (e.g. 1195_C. Basketball Exercise) — split key
func_name string no Source-level function name (e.g. solve, func0)
opt string no Compiler optimization level: O0 / O1 / O2 / O3
num_lines int no Source-line count of the target function
container_labels list[string] no Multi-label set drawn from the 6-class space; empty list = no STL container used
func string no Ground-truth C++ source of the target function
stripped_asm string no objdump -d of the stripped binary, address range sliced to the target function
cfg_dot string no angr CFGFast control-flow graph in Graphviz DOT format
ghidra_pseudo string yes Ghidra decompiled pseudo-code for the binary (~3% of records null where Ghidra failed)
ghidra_target_mangled string yes Itanium-mangled name of the target function in ghidra_pseudo (use to locate the function within the pseudo)

Loading

from datasets import load_dataset

ds = load_dataset("STLBench/STLBench")
print(ds)
# DatasetDict({
#   train:      Dataset({features: [...], num_rows: 11914})
#   validation: Dataset({features: [...], num_rows: 1487})
#   test:       Dataset({features: [...], num_rows: 1483})
# })

ex = ds["train"][0]
print(ex["container_labels"], ex["opt"], len(ex["stripped_asm"]))

Construction Pipeline

The corpus is built by a stripped-binary extraction pipeline that, for each selected solution:

  1. Source filtering — pick the longest function in the solution that (a) is not main, (b) does not call any other user-defined function in the same source file, and (c) has at least 5 source lines.
  2. Compileg++ -g -O{0,1,2,3} against libstdc++, producing four binaries per solution.
  3. Address resolutionnm -n on the unstripped binary recovers [start, next_sym) for the target function.
  4. Strip — copy and strip the binary to remove symbol tables.
  5. CFG extractionangr.CFGFast on the stripped binary, anchored at the rebased start address.
  6. Disassemblyobjdump -d on the stripped binary, sliced to the target's address range.
  7. Ghidra pseudo-code — Ghidra headless analyzer on the stripped binary, with the target function located via a multi-fallback resolver.
  8. Multi-label assignment — source-level clang-AST parse identifies STL container types appearing in the target function body.

Records that fail at any stage are dropped (overall pipeline retention 81%; per-opt success 93.5–98.6%).

The construction pipeline source code will be released after de-anonymization.

Splits

Splits are made at the problem level (problem_name), not at the function or record level. This matches the leakage-prevention protocol used in our experiments and prevents near-duplicate solutions of the same problem from spanning train/val/test.

  • Seed: 44
  • Ratio: 80 / 10 / 10 (train / validation / test) over unique problem_name values
  • Determinism: random.Random(seed).shuffle(sorted(problem_names))

Intended Uses

  • Function-level STL container type recovery from stripped C++ binaries (multi-label classification)
  • Pseudo-code refinement with type-grounded hints (LLM input: ghidra_pseudo + label hints; LLM target: func)
  • Binary-to-source code generation (input: stripped_asm or ghidra_pseudo; target: func)
  • Cross-optimization-level transfer studies (the four opt levels are aligned per problem_name)

Limitations

  • Single toolchain: g++ / libstdc++ / x86-64 only. Cross-compiler (clang++/libc++) and cross-architecture (ARM, RISC-V) generalization is not covered.
  • array excluded: std::array of POD types compiles to indistinguishable stack memory and cannot be recovered from binary alone.
  • Class imbalance: map, pair, set, queue have far fewer positive records than string and vector.
  • Ghidra coverage: ~3% of records have null ghidra_pseudo due to upstream Ghidra failures.
  • No runtime tests: unlike HumanEval-C++, CodeContests problems are not paired with executable unit tests in this release.

License & Attribution

This dataset is released under CC BY 4.0, inheriting the license of the upstream CodeContests source code (DeepMind, CC BY 4.0). Users must preserve attribution to CodeContests when redistributing.

The compiled artifacts (stripped_asm, cfg_dot, ghidra_pseudo) are derivative works of CodeContests source under the same license.

Citation

@misc{stlbench2026,
  title  = {{STLBench}: A Stripped-Binary Dataset for {STL} Container Type Recovery},
  author = {Anonymous},
  year   = {2026},
  note   = {Anonymized for review.}
}

Contact

Anonymous during the review period.

Downloads last month
-