task_id
stringlengths
5
7
prompt
stringlengths
133
1.35k
declaration
stringlengths
111
411
canonical_solution
stringlengths
18
1.4k
test
stringlengths
148
1.76k
example_test
stringlengths
0
679
llvm_ir
stringlengths
920
153k
wat
stringlengths
321
66.1k
number_of_lines
int64
2
37
number_of_chars
int64
18
1.4k
wat_number_of_chars
int64
321
66.1k
wat_number_of_lines
int64
11
2.51k
CPP/0
/* Check if in given vector of numbers, are any two numbers closer to each other than given threshold. >>> has_close_elements({1.0, 2.0, 3.0}, 0.5) false >>> has_close_elements({1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3) true */ #include<stdio.h> #include<vector> #include<math.h> using namespace std; bool has_close_elements(vector<float> numbers, float threshold){
#include<stdio.h> #include<vector> #include<math.h> using namespace std; #include<algorithm> #include<stdlib.h> bool has_close_elements(vector<float> numbers, float threshold){
int i,j; for (i=0;i<numbers.size();i++) for (j=i+1;j<numbers.size();j++) if (abs(numbers[i]-numbers[j])<threshold) return true; return false; }
#undef NDEBUG #include<assert.h> int main(){ vector<float> a={1.0, 2.0, 3.9, 4.0, 5.0, 2.2}; assert (has_close_elements(a, 0.3)==true); assert (has_close_elements(a, 0.05) == false); assert (has_close_elements({1.0, 2.0, 5.9, 4.0, 5.0}, 0.95) == true); assert (has_close_elements({1.0, 2.0, 5.9, 4.0, 5.0}, 0.8) ==false); assert (has_close_elements({1.0, 2.0, 3.0, 4.0, 5.0}, 2.0) == true); assert (has_close_elements({1.1, 2.2, 3.1, 4.1, 5.1}, 1.0) == true); assert (has_close_elements({1.1, 2.2, 3.1, 4.1, 5.1}, 0.5) == false); }
#undef NDEBUG #include<assert.h> int main(){ assert (has_close_elements({1.0, 2.0, 3.0}, 0.5) == false && "failure 1"); assert (has_close_elements({1.0, 2.8, 3.0, 4.0, 5.0, 2.0}, 0.3) && "failure 2") ; }
; ModuleID = 'c_code_test/code_0.cpp' source_filename = "c_code_test/code_0.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" %"class.std::__2::vector" = type { ptr, ptr, %"class.std::__2::__compressed_pair" } %"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" } %"struct.std::__2::__compressed_pair_elem" = type { ptr } ; Function Attrs: minsize mustprogress nofree nosync nounwind optsize willreturn memory(read, inaccessiblemem: none) define noundef zeroext i1 @_Z18has_close_elementsNSt3__26vectorIfNS_9allocatorIfEEEEf(ptr nocapture noundef readonly %0, float noundef %1) local_unnamed_addr #0 { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !3 %5 = load ptr, ptr %0, align 4, !tbaa !10 %6 = ptrtoint ptr %4 to i32 %7 = ptrtoint ptr %5 to i32 %8 = sub i32 %6, %7 %9 = ashr exact i32 %8, 2 br label %10 10: ; preds = %16, %2 %11 = phi i32 [ 0, %2 ], [ %14, %16 ] %12 = icmp eq i32 %11, %9 br i1 %12, label %27, label %13 13: ; preds = %10 %14 = add nuw i32 %11, 1 %15 = getelementptr inbounds float, ptr %5, i32 %11 br label %16 16: ; preds = %19, %13 %17 = phi i32 [ %14, %13 ], [ %26, %19 ] %18 = icmp eq i32 %17, %9 br i1 %18, label %10, label %19, !llvm.loop !11 19: ; preds = %16 %20 = load float, ptr %15, align 4, !tbaa !13 %21 = getelementptr inbounds float, ptr %5, i32 %17 %22 = load float, ptr %21, align 4, !tbaa !13 %23 = fsub float %20, %22 %24 = tail call float @llvm.fabs.f32(float %23) %25 = fcmp olt float %24, %1 %26 = add i32 %17, 1 br i1 %25, label %27, label %16, !llvm.loop !15 27: ; preds = %10, %19 %28 = icmp ult i32 %11, %9 ret i1 %28 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare float @llvm.fabs.f32(float) #1 attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(read, inaccessiblemem: none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"} !3 = !{!4, !5, i64 4} !4 = !{!"_ZTSNSt3__26vectorIfNS_9allocatorIfEEEE", !5, i64 0, !5, i64 4, !8, i64 8} !5 = !{!"any pointer", !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C++ TBAA"} !8 = !{!"_ZTSNSt3__217__compressed_pairIPfNS_9allocatorIfEEEE", !9, i64 0} !9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPfLi0ELb0EEE", !5, i64 0} !10 = !{!4, !5, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14, !14, i64 0} !14 = !{!"float", !6, i64 0} !15 = distinct !{!15, !12}
(module (type (;0;) (func)) (type (;1;) (func (param i32 f32) (result i32))) (import "env" "memory" (memory (;0;) 0)) (func (;0;) (type 0)) (func (;1;) (type 1) (param i32 f32) (result i32) (local i32 i32 i32 i32 i32 i32) local.get 0 i32.load offset=4 local.get 0 i32.load local.tee 4 i32.sub i32.const 2 i32.shr_s local.set 3 loop ;; label = @1 block ;; label = @2 local.get 2 local.get 3 i32.eq if ;; label = @3 local.get 3 local.set 2 br 1 (;@2;) end local.get 4 local.get 2 i32.const 2 i32.shl i32.add local.set 5 local.get 2 i32.const 1 i32.add local.tee 6 local.set 0 loop ;; label = @3 local.get 0 local.get 3 i32.eq if ;; label = @4 local.get 6 local.set 2 br 3 (;@1;) end local.get 0 i32.const 2 i32.shl local.set 7 local.get 0 i32.const 1 i32.add local.set 0 local.get 5 f32.load local.get 4 local.get 7 i32.add f32.load f32.sub f32.abs local.get 1 f32.lt i32.eqz br_if 0 (;@3;) end end end local.get 2 local.get 3 i32.lt_u) (export "__wasm_call_ctors" (func 0)) (export "__wasm_apply_data_relocs" (func 0)) (export "_Z18has_close_elementsNSt3__26vectorIfNS_9allocatorIfEEEEf" (func 1)))
10
175
1,651
75
CPP/1
/* Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the vector of those. Separate groups are balanced (each open brace is properly closed) and not nested within each other Ignore any spaces in the input string. >>> separate_paren_groups("( ) (( )) (( )( ))") {"()", "(())", "(()())"} */ #include<stdio.h> #include<vector> #include<string> using namespace std; vector<string> separate_paren_groups(string paren_string){
#include<stdio.h> #include<vector> #include<string> using namespace std; #include<algorithm> #include<math.h> #include<stdlib.h> vector<string> separate_paren_groups(string paren_string){
vector<string> all_parens; string current_paren; int level=0; char chr; int i; for (i=0;i<paren_string.length();i++) { chr=paren_string[i]; if (chr=='(') { level+=1; current_paren+=chr; } if (chr==')') { level-=1; current_paren+=chr; if (level==0){ all_parens.push_back(current_paren); current_paren=""; } } } return all_parens; }
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(separate_paren_groups("(()()) ((())) () ((())()())"),{"(()())", "((()))", "()", "((())()())"})); assert (issame(separate_paren_groups("() (()) ((())) (((())))"), {"()", "(())", "((()))", "(((())))" })); assert (issame(separate_paren_groups("(()(())((())))") ,{ "(()(())((())))" })); assert (issame(separate_paren_groups("( ) (( )) (( )( ))") ,{"()", "(())", "(()())"})); }
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(separate_paren_groups("( ) (( )) (( )( ))") ,{"()", "(())", "(()())"})); }
; ModuleID = 'c_code_test/code_1.cpp' source_filename = "c_code_test/code_1.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" %"class.std::__2::vector" = type { ptr, ptr, %"class.std::__2::__compressed_pair" } %"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" } %"struct.std::__2::__compressed_pair_elem" = type { ptr } %"class.std::__2::basic_string" = type { %"class.std::__2::__compressed_pair.1" } %"class.std::__2::__compressed_pair.1" = type { %"struct.std::__2::__compressed_pair_elem.2" } %"struct.std::__2::__compressed_pair_elem.2" = type { %"struct.std::__2::basic_string<char>::__rep" } %"struct.std::__2::basic_string<char>::__rep" = type { %union.anon } %union.anon = type { %"struct.std::__2::basic_string<char>::__long" } %"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 } %"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 } %"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.7" } %"class.std::__2::__compressed_pair.7" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.8" } %"struct.std::__2::__compressed_pair_elem.8" = type { ptr } %"class.std::__2::reverse_iterator" = type { ptr } %"struct.std::__2::__exception_guard_exceptions" = type <{ %"class.std::__2::_AllocatorDestroyRangeReverse", i8, [3 x i8] }> %"class.std::__2::_AllocatorDestroyRangeReverse" = type { ptr, ptr, ptr } $_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006ERKS6_ = comdat any $_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_ = comdat any $_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_ = comdat any $_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ = comdat any $_ZNKSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE11__recommendB7v160006Em = comdat any $_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEC2EmmS8_ = comdat any $_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE = comdat any $_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEED2Ev = comdat any $_ZNKSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE20__throw_length_errorB7v160006Ev = comdat any $_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any $_ZNSt12length_errorC2B7v160006EPKc = comdat any $_ZNSt3__29allocatorINS_12basic_stringIcNS_11char_traitsIcEENS0_IcEEEEE8allocateB7v160006Em = comdat any $_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any $_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EESA_SA_EET2_RT_T0_T1_SB_ = comdat any $_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEED2B7v160006Ev = comdat any $_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEclB7v160006Ev = comdat any $_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorINS8_IPS6_EEEESB_EEvRT_T0_T1_ = comdat any $_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE5clearB7v160006Ev = comdat any $_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE17__destruct_at_endB7v160006EPS6_NS_17integral_constantIbLb0EEE = comdat any $_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc = comdat any @.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"vector\00", align 1 @_ZTISt12length_error = external constant ptr @_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4 @_ZTISt20bad_array_new_length = external constant ptr ; Function Attrs: minsize optsize define void @_Z21separate_paren_groupsNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 { %3 = alloca %"class.std::__2::basic_string", align 4 store ptr null, ptr %0, align 4, !tbaa !3 %4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 store ptr null, ptr %4, align 4, !tbaa !10 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 store ptr null, ptr %5, align 4, !tbaa !11 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #16 call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 0, i32 12, i1 false) %6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2 %7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1 br label %8 8: ; preds = %29, %2 %9 = phi i32 [ 0, %2 ], [ %30, %29 ] %10 = phi i32 [ 0, %2 ], [ %31, %29 ] %11 = load i8, ptr %6, align 1 %12 = icmp slt i8 %11, 0 %13 = load i32, ptr %7, align 4 %14 = zext i8 %11 to i32 %15 = select i1 %12, i32 %13, i32 %14 %16 = icmp ult i32 %10, %15 br i1 %16, label %17, label %32 17: ; preds = %8 %18 = load ptr, ptr %1, align 4 %19 = select i1 %12, ptr %18, ptr %1 %20 = getelementptr inbounds i8, ptr %19, i32 %10 %21 = load i8, ptr %20, align 1, !tbaa !12 switch i8 %21, label %29 [ i8 40, label %22 i8 41, label %24 ] 22: ; preds = %17 %23 = add nsw i32 %9, 1 call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext 40) #17 br label %29 24: ; preds = %17 %25 = add nsw i32 %9, -1 call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext 41) #17 %26 = icmp eq i32 %25, 0 br i1 %26, label %27, label %29 27: ; preds = %24 call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006ERKS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #17 %28 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #17 br label %29 29: ; preds = %17, %22, %27, %24 %30 = phi i32 [ 0, %27 ], [ %25, %24 ], [ %23, %22 ], [ %9, %17 ] %31 = add nuw nsw i32 %10, 1 br label %8, !llvm.loop !13 32: ; preds = %8 %33 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #18 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #16 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr hidden void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006ERKS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !10 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %6 = load ptr, ptr %5, align 4, !tbaa !15 %7 = icmp eq ptr %4, %6 br i1 %7, label %9, label %8 8: ; preds = %2 tail call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #17 br label %10 9: ; preds = %2 tail call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #17 br label %10 10: ; preds = %9, %8 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: inlinehint minsize nounwind optsize declare noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(12)) unnamed_addr #3 ; Function Attrs: minsize nobuiltin nounwind optsize declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #5 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #6 ; Function Attrs: minsize optsize declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef signext) local_unnamed_addr #0 ; Function Attrs: minsize optsize define linkonce_odr void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #0 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !10 %5 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %1) #17 %6 = getelementptr inbounds %"class.std::__2::basic_string", ptr %4, i32 1 store ptr %6, ptr %3, align 4, !tbaa !10 ret void } ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat { %3 = alloca %"struct.std::__2::__split_buffer", align 4 %4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #16 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %6 = load ptr, ptr %5, align 4, !tbaa !10 %7 = load ptr, ptr %0, align 4, !tbaa !3 %8 = ptrtoint ptr %6 to i32 %9 = ptrtoint ptr %7 to i32 %10 = sub i32 %8, %9 %11 = sdiv exact i32 %10, 12 %12 = add nsw i32 %11, 1 %13 = tail call noundef i32 @_ZNKSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #17 %14 = load ptr, ptr %5, align 4, !tbaa !10 %15 = load ptr, ptr %0, align 4, !tbaa !3 %16 = ptrtoint ptr %14 to i32 %17 = ptrtoint ptr %15 to i32 %18 = sub i32 %16, %17 %19 = sdiv exact i32 %18, 12 %20 = call noundef ptr @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEC2EmmS8_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %13, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #17 %21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2 %22 = load ptr, ptr %21, align 4, !tbaa !16 %23 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %1) #17 %24 = load ptr, ptr %21, align 4, !tbaa !16 %25 = getelementptr inbounds %"class.std::__2::basic_string", ptr %24, i32 1 store ptr %25, ptr %21, align 4, !tbaa !16 call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #17 %26 = call noundef ptr @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #18 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #16 ret void } ; Function Attrs: minsize optsize define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #0 comdat { %3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2 %4 = load i8, ptr %3, align 1 %5 = icmp slt i8 %4, 0 br i1 %5, label %7, label %6 6: ; preds = %2 tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 12, i1 false), !tbaa.struct !20 br label %11 7: ; preds = %2 %8 = load ptr, ptr %1, align 4, !tbaa !12 %9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1 %10 = load i32, ptr %9, align 4, !tbaa !12 tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %8, i32 noundef %10) #17 br label %11 11: ; preds = %7, %6 ret ptr %0 } ; Function Attrs: minsize optsize declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #0 ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #2 comdat { %3 = icmp ugt i32 %1, 357913941 br i1 %3, label %4, label %5 4: ; preds = %2 tail call void @_ZNKSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #19 unreachable 5: ; preds = %2 %6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %7 = load ptr, ptr %6, align 4, !tbaa !15 %8 = load ptr, ptr %0, align 4, !tbaa !3 %9 = ptrtoint ptr %7 to i32 %10 = ptrtoint ptr %8 to i32 %11 = sub i32 %9, %10 %12 = sdiv exact i32 %11, 12 %13 = icmp ult i32 %12, 178956970 %14 = shl nuw nsw i32 %12, 1 %15 = tail call i32 @llvm.umax.i32(i32 %14, i32 %1) %16 = select i1 %13, i32 %15, i32 357913941 ret i32 %16 } ; Function Attrs: minsize optsize define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEC2EmmS8_(ptr noundef nonnull returned align 4 dereferenceable(20) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 1 dereferenceable(1) %3) unnamed_addr #0 comdat { %5 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3 store ptr null, ptr %5, align 4, !tbaa !11 %6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3, i32 1 store ptr %3, ptr %6, align 4, !tbaa !15 %7 = icmp eq i32 %1, 0 br i1 %7, label %10, label %8 8: ; preds = %4 %9 = tail call noundef ptr @_ZNSt3__29allocatorINS_12basic_stringIcNS_11char_traitsIcEENS0_IcEEEEE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #17, !noalias !23 br label %10 10: ; preds = %4, %8 %11 = phi ptr [ %9, %8 ], [ null, %4 ] store ptr %11, ptr %0, align 4, !tbaa !26 %12 = getelementptr inbounds %"class.std::__2::basic_string", ptr %11, i32 %2 %13 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2 store ptr %12, ptr %13, align 4, !tbaa !16 %14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1 store ptr %12, ptr %14, align 4, !tbaa !27 %15 = getelementptr inbounds %"class.std::__2::basic_string", ptr %11, i32 %1 store ptr %15, ptr %5, align 4, !tbaa !15 ret ptr %0 } ; Function Attrs: minsize optsize define linkonce_odr hidden void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS6_RS7_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %1) local_unnamed_addr #0 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %5 = load ptr, ptr %4, align 4, !tbaa !10 %6 = load ptr, ptr %0, align 4, !tbaa !3 %7 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 1 %8 = load ptr, ptr %7, align 4, !tbaa !27 %9 = tail call ptr @_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EESA_SA_EET2_RT_T0_T1_SB_(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr %5, ptr %6, ptr %8) #17 store ptr %9, ptr %7, align 4, !tbaa !27 %10 = load ptr, ptr %0, align 4, !tbaa !15 store ptr %9, ptr %0, align 4, !tbaa !15 store ptr %10, ptr %7, align 4, !tbaa !15 %11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2 %12 = load ptr, ptr %4, align 4, !tbaa !15 %13 = load ptr, ptr %11, align 4, !tbaa !15 store ptr %13, ptr %4, align 4, !tbaa !15 store ptr %12, ptr %11, align 4, !tbaa !15 %14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3 %15 = load ptr, ptr %3, align 4, !tbaa !15 %16 = load ptr, ptr %14, align 4, !tbaa !15 store ptr %16, ptr %3, align 4, !tbaa !15 store ptr %15, ptr %14, align 4, !tbaa !15 %17 = load ptr, ptr %7, align 4, !tbaa !27 store ptr %17, ptr %1, align 4, !tbaa !26 ret void } ; Function Attrs: minsize nounwind optsize define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #7 comdat { tail call void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #18 %2 = load ptr, ptr %0, align 4, !tbaa !26 %3 = icmp eq ptr %2, null br i1 %3, label %5, label %4 4: ; preds = %1 tail call void @_ZdlPv(ptr noundef nonnull %2) #20 br label %5 5: ; preds = %4, %1 ret ptr %0 } ; Function Attrs: minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZNKSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #8 comdat { tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.1) #19 unreachable } ; Function Attrs: inlinehint minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #9 comdat { %2 = tail call ptr @__cxa_allocate_exception(i32 8) #16 %3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #17 tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #21 unreachable } declare ptr @__cxa_allocate_exception(i32) local_unnamed_addr ; Function Attrs: minsize optsize define linkonce_odr hidden noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull returned align 4 dereferenceable(8) %0, ptr noundef %1) unnamed_addr #0 comdat { %3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #17 store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !28 ret ptr %0 } ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #7 declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr ; Function Attrs: minsize optsize declare noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull returned align 4 dereferenceable(8), ptr noundef) unnamed_addr #0 ; Function Attrs: minsize mustprogress optsize define linkonce_odr hidden noundef ptr @_ZNSt3__29allocatorINS_12basic_stringIcNS_11char_traitsIcEENS0_IcEEEEE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #10 comdat { %3 = icmp ugt i32 %1, 357913941 br i1 %3, label %4, label %5 4: ; preds = %2 tail call void @_ZSt28__throw_bad_array_new_lengthB7v160006v() #19 unreachable 5: ; preds = %2 %6 = mul nuw i32 %1, 12 %7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #22 ret ptr %7 } ; Function Attrs: inlinehint minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #9 comdat { %1 = tail call ptr @__cxa_allocate_exception(i32 4) #16 %2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #18 tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #21 unreachable } ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #7 ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #7 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #11 ; Function Attrs: minsize nobuiltin optsize allocsize(0) declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #12 ; Function Attrs: minsize optsize define linkonce_odr hidden ptr @_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EESA_SA_EET2_RT_T0_T1_SB_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr %1, ptr %2, ptr %3) local_unnamed_addr #0 comdat { %5 = alloca %"class.std::__2::reverse_iterator", align 4 %6 = alloca %"class.std::__2::reverse_iterator", align 4 %7 = alloca %"struct.std::__2::__exception_guard_exceptions", align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #16 %8 = ptrtoint ptr %3 to i32 store i32 %8, ptr %6, align 4, !tbaa !15 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #16 store ptr %0, ptr %7, align 4 %9 = getelementptr inbounds i8, ptr %7, i32 4 store ptr %6, ptr %9, align 4 %10 = getelementptr inbounds i8, ptr %7, i32 8 store ptr %5, ptr %10, align 4 br label %11 11: ; preds = %15, %4 %12 = phi ptr [ %3, %4 ], [ %16, %15 ] %13 = phi ptr [ %1, %4 ], [ %17, %15 ] %14 = icmp eq ptr %13, %2 br i1 %14, label %18, label %15 15: ; preds = %11 %16 = getelementptr inbounds %"class.std::__2::basic_string", ptr %12, i32 -1 %17 = getelementptr inbounds %"class.std::__2::basic_string", ptr %13, i32 -1 call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %17, i32 12, i1 false) call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %17, i8 0, i32 12, i1 false) br label %11, !llvm.loop !30 18: ; preds = %11 %19 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %7, i32 0, i32 1 store ptr %12, ptr %5, align 4, !tbaa !31 store i8 1, ptr %19, align 4, !tbaa !33 %20 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(13) %7) #18 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #16 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #16 ret ptr %12 } ; Function Attrs: minsize nounwind optsize define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(13) %0) unnamed_addr #7 comdat { %2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1 %3 = load i8, ptr %2, align 4, !tbaa !33, !range !37, !noundef !38 %4 = icmp eq i8 %3, 0 br i1 %4, label %5, label %6 5: ; preds = %1 tail call void @_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18 br label %6 6: ; preds = %5, %1 ret ptr %0 } ; Function Attrs: minsize optsize define linkonce_odr hidden void @_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #0 comdat { %2 = load ptr, ptr %0, align 4, !tbaa !39 %3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2 %4 = load ptr, ptr %3, align 4, !tbaa !40 %5 = load ptr, ptr %4, align 4, !tbaa.struct !41 %6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1 %7 = load ptr, ptr %6, align 4, !tbaa !42 %8 = load ptr, ptr %7, align 4, !tbaa.struct !41 tail call void @_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorINS8_IPS6_EEEESB_EEvRT_T0_T1_(ptr noundef nonnull align 1 dereferenceable(1) %2, ptr %5, ptr %8) #17 ret void } ; Function Attrs: minsize mustprogress optsize define linkonce_odr hidden void @_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorINS8_IPS6_EEEESB_EEvRT_T0_T1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr %1, ptr %2) local_unnamed_addr #10 comdat { br label %4 4: ; preds = %7, %3 %5 = phi ptr [ %1, %3 ], [ %9, %7 ] %6 = icmp eq ptr %5, %2 br i1 %6, label %10, label %7 7: ; preds = %4 %8 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #18 %9 = getelementptr inbounds %"class.std::__2::basic_string", ptr %5, i32 1 br label %4, !llvm.loop !43 10: ; preds = %4 ret void } ; Function Attrs: minsize mustprogress nounwind optsize define linkonce_odr hidden void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #13 comdat { %2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1 %3 = load ptr, ptr %2, align 4, !tbaa !27 tail call void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE17__destruct_at_endB7v160006EPS6_NS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #18 ret void } ; Function Attrs: inlinehint minsize mustprogress nounwind optsize define linkonce_odr hidden void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE17__destruct_at_endB7v160006EPS6_NS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %1) local_unnamed_addr #14 comdat { %3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2 br label %4 4: ; preds = %7, %2 %5 = load ptr, ptr %3, align 4, !tbaa !16 %6 = icmp eq ptr %5, %1 br i1 %6, label %10, label %7 7: ; preds = %4 %8 = getelementptr inbounds %"class.std::__2::basic_string", ptr %5, i32 -1 store ptr %8, ptr %3, align 4, !tbaa !16 %9 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #18 br label %4, !llvm.loop !44 10: ; preds = %4 ret void } ; Function Attrs: minsize mustprogress optsize define linkonce_odr noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #10 comdat { %3 = icmp ne ptr %1, null tail call void @llvm.assume(i1 %3) %4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1) #17 ret ptr %4 } ; Function Attrs: minsize optsize declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) local_unnamed_addr #0 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #15 attributes #0 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #3 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #4 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #7 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #8 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #9 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #10 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #11 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #12 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #13 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #14 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nounwind } attributes #17 = { minsize optsize } attributes #18 = { minsize nounwind optsize } attributes #19 = { minsize noreturn optsize } attributes #20 = { builtin minsize nounwind optsize } attributes #21 = { noreturn } attributes #22 = { builtin minsize optsize allocsize(0) } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"} !3 = !{!4, !5, i64 0} !4 = !{!"_ZTSNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE", !5, i64 0, !5, i64 4, !8, i64 8} !5 = !{!"any pointer", !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C++ TBAA"} !8 = !{!"_ZTSNSt3__217__compressed_pairIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE", !9, i64 0} !9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEELi0ELb0EEE", !5, i64 0} !10 = !{!4, !5, i64 4} !11 = !{!9, !5, i64 0} !12 = !{!6, !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = !{!5, !5, i64 0} !16 = !{!17, !5, i64 8} !17 = !{!"_ZTSNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !18, i64 12} !18 = !{!"_ZTSNSt3__217__compressed_pairIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !9, i64 0, !19, i64 4} !19 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEELi1ELb0EEE", !5, i64 0} !20 = !{i64 0, i64 4, !15, i64 4, i64 4, !21, i64 8, i64 4, !21, i64 11, i64 4, !21, i64 0, i64 11, !12, i64 11, i64 0, !12, i64 11, i64 1, !12, i64 11, i64 1, !12, i64 0, i64 12, !12} !21 = !{!22, !22, i64 0} !22 = !{!"long", !6, i64 0} !23 = !{!24} !24 = distinct !{!24, !25, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m: argument 0"} !25 = distinct !{!25, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m"} !26 = !{!17, !5, i64 0} !27 = !{!17, !5, i64 4} !28 = !{!29, !29, i64 0} !29 = !{!"vtable pointer", !7, i64 0} !30 = distinct !{!30, !14} !31 = !{!32, !5, i64 0} !32 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEE", !5, i64 0} !33 = !{!34, !36, i64 12} !34 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEEE", !35, i64 0, !36, i64 12} !35 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8} !36 = !{!"bool", !6, i64 0} !37 = !{i8 0, i8 2} !38 = !{} !39 = !{!35, !5, i64 0} !40 = !{!35, !5, i64 8} !41 = !{i64 0, i64 4, !15} !42 = !{!35, !5, i64 4} !43 = distinct !{!43, !14} !44 = distinct !{!44, !14}
(module (type (;0;) (func (param i32 i32))) (type (;1;) (func (param i32 i32) (result i32))) (type (;2;) (func (param i32) (result i32))) (type (;3;) (func (param i32 i32 i32))) (type (;4;) (func (param i32))) (type (;5;) (func)) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc" (func (;0;) (type 0))) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc" (func (;1;) (type 1))) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;2;) (type 2))) (import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func (;3;) (type 0))) (import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func (;4;) (type 0))) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;5;) (type 1))) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;6;) (type 3))) (import "env" "_ZdlPv" (func (;7;) (type 4))) (import "env" "__cxa_allocate_exception" (func (;8;) (type 2))) (import "env" "__cxa_throw" (func (;9;) (type 3))) (import "env" "_ZNSt11logic_errorC2EPKc" (func (;10;) (type 1))) (import "env" "_Znwm" (func (;11;) (type 2))) (import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;12;) (type 2))) (import "env" "__stack_pointer" (global (;0;) (mut i32))) (import "env" "__memory_base" (global (;1;) i32)) (import "GOT.func" "_ZNSt12length_errorD1Ev" (global (;2;) (mut i32))) (import "GOT.mem" "_ZTISt12length_error" (global (;3;) (mut i32))) (import "GOT.mem" "_ZTVSt12length_error" (global (;4;) (mut i32))) (import "GOT.func" "_ZNSt20bad_array_new_lengthD1Ev" (global (;5;) (mut i32))) (import "GOT.mem" "_ZTISt20bad_array_new_length" (global (;6;) (mut i32))) (import "env" "memory" (memory (;0;) 1)) (func (;13;) (type 5)) (func (;14;) (type 0) (param i32 i32) (local i32 i32 i32 i32) global.get 0 i32.const 16 i32.sub local.tee 2 global.set 0 local.get 0 i32.const 0 i32.store offset=8 local.get 0 i64.const 0 i64.store align=4 local.get 2 i32.const 0 i32.store offset=8 local.get 2 i64.const 0 i64.store loop ;; label = @1 local.get 1 i32.load offset=4 local.get 1 i32.load8_u offset=11 local.tee 5 local.get 5 i32.extend8_s i32.const 0 i32.lt_s local.tee 5 select local.get 4 i32.gt_u if ;; label = @2 block ;; label = @3 block ;; label = @4 block ;; label = @5 local.get 1 i32.load local.get 1 local.get 5 select local.get 4 i32.add i32.load8_u i32.const 40 i32.sub br_table 0 (;@5;) 1 (;@4;) 2 (;@3;) end local.get 2 i32.const 40 call 0 local.get 3 i32.const 1 i32.add local.set 3 br 1 (;@3;) end local.get 2 i32.const 41 call 0 local.get 3 i32.const 1 i32.sub local.tee 3 br_if 0 (;@3;) block ;; label = @4 local.get 0 i32.load offset=4 local.get 0 i32.load offset=8 i32.ne if ;; label = @5 local.get 0 local.get 2 call 3 br 1 (;@4;) end local.get 0 local.get 2 call 4 end local.get 2 global.get 1 i32.const 6 i32.add call 1 drop i32.const 0 local.set 3 end local.get 4 i32.const 1 i32.add local.set 4 br 1 (;@1;) end end local.get 2 call 2 drop local.get 2 i32.const 16 i32.add global.set 0) (func (;15;) (type 0) (param i32 i32) local.get 0 local.get 0 i32.load offset=4 local.get 1 call 5 i32.const 12 i32.add i32.store offset=4) (func (;16;) (type 0) (param i32 i32) (local i32 i32 i32 i32) global.get 0 i32.const 32 i32.sub local.tee 2 global.set 0 local.get 0 i32.load offset=4 local.get 0 i32.load i32.sub i32.const 12 i32.div_s i32.const 1 i32.add local.tee 3 i32.const 357913942 i32.ge_u if ;; label = @1 global.get 2 local.set 0 global.get 3 local.set 1 i32.const 8 call 8 global.get 4 local.set 3 global.get 1 call 10 local.tee 2 local.get 3 i32.const 8 i32.add i32.store local.get 2 local.get 1 local.get 0 call 9 unreachable end i32.const 357913941 local.get 0 i32.load offset=8 local.get 0 i32.load i32.sub i32.const 12 i32.div_s local.tee 4 i32.const 1 i32.shl local.tee 5 local.get 3 local.get 3 local.get 5 i32.lt_u select local.get 4 i32.const 178956970 i32.ge_u select local.set 4 local.get 0 i32.load offset=4 local.get 0 i32.load i32.sub i32.const 12 i32.div_s local.set 5 i32.const 0 local.set 3 local.get 2 i32.const 0 i32.store offset=24 local.get 2 local.get 0 i32.const 8 i32.add i32.store offset=28 local.get 4 if ;; label = @1 local.get 4 i32.const 357913942 i32.ge_u if ;; label = @2 global.get 5 local.set 0 global.get 6 local.set 1 i32.const 4 call 8 call 12 local.get 1 local.get 0 call 9 unreachable end local.get 4 i32.const 12 i32.mul call 11 local.set 3 end local.get 2 local.get 3 i32.store offset=12 local.get 2 local.get 3 local.get 5 i32.const 12 i32.mul i32.add local.tee 5 i32.store offset=20 local.get 2 local.get 3 local.get 4 i32.const 12 i32.mul i32.add i32.store offset=24 local.get 2 local.get 5 i32.store offset=16 local.get 2 i32.load offset=20 local.get 1 call 5 drop local.get 2 local.get 2 i32.load offset=20 i32.const 12 i32.add i32.store offset=20 local.get 0 i32.load offset=4 local.set 3 local.get 0 i32.load local.set 1 local.get 2 i32.load offset=16 local.set 5 global.get 0 i32.const 32 i32.sub local.tee 4 global.set 0 local.get 4 local.get 5 i32.store offset=24 local.get 4 local.get 0 i32.const 8 i32.add i32.store offset=8 local.get 4 local.get 4 i32.const 28 i32.add i32.store offset=16 local.get 4 local.get 4 i32.const 24 i32.add i32.store offset=12 loop ;; label = @1 local.get 1 local.get 3 i32.ne if ;; label = @2 local.get 5 i32.const 12 i32.sub local.tee 5 local.get 3 i32.const 12 i32.sub local.tee 3 i64.load align=4 i64.store align=4 local.get 5 local.get 3 i32.load offset=8 i32.store offset=8 local.get 3 i64.const 0 i64.store align=4 local.get 3 i32.const 0 i32.store offset=8 br 1 (;@1;) end end local.get 4 i32.const 1 i32.store8 offset=20 local.get 4 local.get 5 i32.store offset=28 local.get 4 i32.const 8 i32.add local.tee 1 i32.load8_u offset=12 i32.eqz if ;; label = @1 local.get 1 i32.load drop local.get 1 i32.load offset=8 i32.load local.set 3 local.get 1 i32.load offset=4 i32.load local.set 1 loop ;; label = @2 local.get 1 local.get 3 i32.ne if ;; label = @3 local.get 3 call 2 i32.const 12 i32.add local.set 3 br 1 (;@2;) end end end local.get 4 i32.const 32 i32.add global.set 0 local.get 2 local.get 5 i32.store offset=16 local.get 0 i32.load local.set 1 local.get 0 local.get 5 i32.store local.get 2 local.get 1 i32.store offset=16 local.get 0 i32.load offset=4 local.set 1 local.get 0 local.get 2 i32.load offset=20 i32.store offset=4 local.get 2 local.get 1 i32.store offset=20 local.get 0 i32.load offset=8 local.set 1 local.get 0 local.get 2 i32.load offset=24 i32.store offset=8 local.get 2 local.get 1 i32.store offset=24 local.get 2 local.get 2 i32.load offset=16 i32.store offset=12 local.get 2 i32.load offset=16 local.set 0 loop ;; label = @1 local.get 0 local.get 2 i32.load offset=20 local.tee 1 i32.ne if ;; label = @2 local.get 2 local.get 1 i32.const 12 i32.sub local.tee 1 i32.store offset=20 local.get 1 call 2 drop br 1 (;@1;) end end local.get 2 i32.load offset=12 local.tee 0 if ;; label = @1 local.get 0 call 7 end local.get 2 i32.const 32 i32.add global.set 0) (func (;17;) (type 1) (param i32 i32) (result i32) local.get 1 i32.load8_s offset=11 i32.const 0 i32.ge_s if ;; label = @1 local.get 0 local.get 1 i64.load align=4 i64.store align=4 local.get 0 local.get 1 i32.load offset=8 i32.store offset=8 local.get 0 return end local.get 0 local.get 1 i32.load local.get 1 i32.load offset=4 call 6 local.get 0) (export "__wasm_call_ctors" (func 13)) (export "__wasm_apply_data_relocs" (func 13)) (export "_Z21separate_paren_groupsNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 14)) (export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func 15)) (export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func 16)) (export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 17)) (data (;0;) (global.get 1) "vector\00"))
25
519
10,984
482
CPP/2
/* Given a positive floating point number, it can be decomposed into and integer part (largest integer smaller than given number) and decimals (leftover part always smaller than 1). Return the decimal part of the number. >>> truncate_number(3.5) 0.5 */ #include<stdio.h> #include<math.h> using namespace std; float truncate_number(float number){
#include<stdio.h> #include<math.h> using namespace std; #include<algorithm> #include<stdlib.h> float truncate_number(float number){
return number-int(number); }
#undef NDEBUG #include<assert.h> int main(){ assert (truncate_number(3.5) == 0.5); assert (abs(truncate_number(1.33) - 0.33) < 1e-4); assert (abs(truncate_number(123.456) - 0.456) < 1e-4); }
#undef NDEBUG #include<assert.h> int main(){ assert (truncate_number(3.5) == 0.5); }
; ModuleID = 'c_code_test/code_2.cpp' source_filename = "c_code_test/code_2.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" ; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(none) define noundef float @_Z15truncate_numberf(float noundef %0) local_unnamed_addr #0 { %2 = fptosi float %0 to i32 %3 = sitofp i32 %2 to float %4 = fsub float %0, %3 ret float %4 } attributes #0 = { minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"}
(module (type (;0;) (func)) (type (;1;) (func (param f32) (result f32))) (func (;0;) (type 0)) (func (;1;) (type 1) (param f32) (result f32) local.get 0 block (result i32) ;; label = @1 local.get 0 f32.abs f32.const 0x1p+31 (;=2.14748e+09;) f32.lt if ;; label = @2 local.get 0 i32.trunc_f32_s br 1 (;@1;) end i32.const -2147483648 end f32.convert_i32_s f32.sub) (export "__wasm_call_ctors" (func 0)) (export "__wasm_apply_data_relocs" (func 0)) (export "_Z15truncate_numberf" (func 1)))
2
33
589
23
CPP/3
/* You"re given a vector of deposit and withdrawal operations on a bank account that starts with zero balance. Your task is to detect if at any point the balance of account falls below zero, and at that point function should return true. Otherwise it should return false. >>> below_zero({1, 2, 3}) false >>> below_zero({1, 2, -4, 5}) true */ #include<stdio.h> #include<vector> using namespace std; bool below_zero(vector<int> operations){
#include<stdio.h> #include<vector> using namespace std; #include<algorithm> #include<math.h> #include<stdlib.h> bool below_zero(vector<int> operations){
int num=0; for (int i=0;i<operations.size();i++) { num+=operations[i]; if (num<0) return true; } return false; }
#undef NDEBUG #include<assert.h> int main(){ assert (below_zero({}) == false); assert (below_zero({1, 2, -3, 1, 2, -3}) == false); assert (below_zero({1, 2, -4, 5, 6}) == true); assert (below_zero({1, -1, 2, -2, 5, -5, 4, -4}) == false); assert (below_zero({1, -1, 2, -2, 5, -5, 4, -5}) == true); assert (below_zero({1, -2, 2, -2, 5, -5, 4, -4}) == true); }
#undef NDEBUG #include<assert.h> int main(){ assert (below_zero({1, 2, 3}) == false); assert (below_zero({1, 2, -4, 5}) == true); }
; ModuleID = 'c_code_test/code_3.cpp' source_filename = "c_code_test/code_3.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" %"class.std::__2::vector" = type { ptr, ptr, %"class.std::__2::__compressed_pair" } %"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" } %"struct.std::__2::__compressed_pair_elem" = type { ptr } ; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none) define noundef zeroext i1 @_Z10below_zeroNSt3__26vectorIiNS_9allocatorIiEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 { %2 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %3 = load ptr, ptr %2, align 4, !tbaa !3 %4 = load ptr, ptr %0, align 4, !tbaa !10 %5 = ptrtoint ptr %3 to i32 %6 = ptrtoint ptr %4 to i32 %7 = sub i32 %5, %6 %8 = ashr exact i32 %7, 2 br label %9 9: ; preds = %13, %1 %10 = phi i32 [ 0, %1 ], [ %16, %13 ] %11 = phi i32 [ 0, %1 ], [ %18, %13 ] %12 = icmp eq i32 %11, %8 br i1 %12, label %19, label %13 13: ; preds = %9 %14 = getelementptr inbounds i32, ptr %4, i32 %11 %15 = load i32, ptr %14, align 4, !tbaa !11 %16 = add nsw i32 %15, %10 %17 = icmp slt i32 %16, 0 %18 = add nuw i32 %11, 1 br i1 %17, label %19, label %9, !llvm.loop !13 19: ; preds = %9, %13 %20 = icmp ult i32 %11, %8 ret i1 %20 } attributes #0 = { minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"} !3 = !{!4, !5, i64 4} !4 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !8, i64 8} !5 = !{!"any pointer", !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C++ TBAA"} !8 = !{!"_ZTSNSt3__217__compressed_pairIPiNS_9allocatorIiEEEE", !9, i64 0} !9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPiLi0ELb0EEE", !5, i64 0} !10 = !{!4, !5, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"}
(module (type (;0;) (func)) (type (;1;) (func (param i32) (result i32))) (import "env" "memory" (memory (;0;) 0)) (func (;0;) (type 0)) (func (;1;) (type 1) (param i32) (result i32) (local i32 i32 i32 i32) local.get 0 i32.load offset=4 local.get 0 i32.load local.tee 4 i32.sub i32.const 2 i32.shr_s local.set 1 loop ;; label = @1 block ;; label = @2 local.get 1 local.get 3 local.tee 0 i32.eq if ;; label = @3 local.get 1 local.set 0 br 1 (;@2;) end local.get 0 i32.const 1 i32.add local.set 3 local.get 4 local.get 0 i32.const 2 i32.shl i32.add i32.load local.get 2 i32.add local.tee 2 i32.const 0 i32.ge_s br_if 1 (;@1;) end end local.get 0 local.get 1 i32.lt_u) (export "__wasm_call_ctors" (func 0)) (export "__wasm_apply_data_relocs" (func 0)) (export "_Z10below_zeroNSt3__26vectorIiNS_9allocatorIiEEEE" (func 1)))
8
149
1,116
51
CPP/4
/* For a given vector of input numbers, calculate Mean Absolute Deviation around the mean of this dataset. Mean Absolute Deviation is the average absolute difference between each element and a centerpoint (mean in this case): MAD = average | x - x_mean | >>> mean_absolute_deviation({1.0, 2.0, 3.0, 4.0}) 1.0 */ #include<stdio.h> #include<math.h> #include<vector> using namespace std; float mean_absolute_deviation(vector<float> numbers){
#include<stdio.h> #include<math.h> #include<vector> using namespace std; #include<algorithm> #include<stdlib.h> float mean_absolute_deviation(vector<float> numbers){
float sum=0; float avg,msum,mavg; int i=0; for (i=0;i<numbers.size();i++) sum+=numbers[i]; avg=sum/numbers.size(); msum=0; for (i=0;i<numbers.size();i++) msum+=abs(numbers[i]-avg); return msum/numbers.size(); }
#undef NDEBUG #include<assert.h> int main(){ assert (abs(mean_absolute_deviation({1.0, 2.0, 3.0}) - 2.0/3.0) < 1e-4); assert (abs(mean_absolute_deviation({1.0, 2.0, 3.0, 4.0}) - 1.0) < 1e-4); assert (abs(mean_absolute_deviation({1.0, 2.0, 3.0, 4.0, 5.0}) - 6.0/5.0) < 1e-4); }
#undef NDEBUG #include<assert.h> int main(){ assert (abs(mean_absolute_deviation({1.0, 2.0, 3.0, 4.0}) - 1.0) < 1e-4); }
; ModuleID = 'c_code_test/code_4.cpp' source_filename = "c_code_test/code_4.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" %"class.std::__2::vector" = type { ptr, ptr, %"class.std::__2::__compressed_pair" } %"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" } %"struct.std::__2::__compressed_pair_elem" = type { ptr } ; Function Attrs: minsize mustprogress nofree nosync nounwind optsize willreturn memory(read, inaccessiblemem: none) define noundef float @_Z23mean_absolute_deviationNSt3__26vectorIfNS_9allocatorIfEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 { %2 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %3 = load ptr, ptr %2, align 4, !tbaa !3 %4 = load ptr, ptr %0, align 4, !tbaa !10 %5 = ptrtoint ptr %3 to i32 %6 = ptrtoint ptr %4 to i32 %7 = sub i32 %5, %6 %8 = ashr exact i32 %7, 2 br label %9 9: ; preds = %13, %1 %10 = phi float [ 0.000000e+00, %1 ], [ %16, %13 ] %11 = phi i32 [ 0, %1 ], [ %17, %13 ] %12 = icmp eq i32 %11, %8 br i1 %12, label %18, label %13 13: ; preds = %9 %14 = getelementptr inbounds float, ptr %4, i32 %11 %15 = load float, ptr %14, align 4, !tbaa !11 %16 = fadd float %10, %15 %17 = add nuw i32 %11, 1 br label %9, !llvm.loop !13 18: ; preds = %9 %19 = uitofp i32 %8 to float %20 = fdiv float %10, %19 br label %21 21: ; preds = %25, %18 %22 = phi float [ 0.000000e+00, %18 ], [ %30, %25 ] %23 = phi i32 [ 0, %18 ], [ %31, %25 ] %24 = icmp eq i32 %23, %8 br i1 %24, label %32, label %25 25: ; preds = %21 %26 = getelementptr inbounds float, ptr %4, i32 %23 %27 = load float, ptr %26, align 4, !tbaa !11 %28 = fsub float %27, %20 %29 = tail call float @llvm.fabs.f32(float %28) %30 = fadd float %22, %29 %31 = add nuw i32 %23, 1 br label %21, !llvm.loop !15 32: ; preds = %21 %33 = fdiv float %22, %19 ret float %33 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare float @llvm.fabs.f32(float) #1 attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(read, inaccessiblemem: none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"} !3 = !{!4, !5, i64 4} !4 = !{!"_ZTSNSt3__26vectorIfNS_9allocatorIfEEEE", !5, i64 0, !5, i64 4, !8, i64 8} !5 = !{!"any pointer", !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C++ TBAA"} !8 = !{!"_ZTSNSt3__217__compressed_pairIPfNS_9allocatorIfEEEE", !9, i64 0} !9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPfLi0ELb0EEE", !5, i64 0} !10 = !{!4, !5, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"float", !6, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14}
(module (type (;0;) (func)) (type (;1;) (func (param i32) (result f32))) (import "env" "memory" (memory (;0;) 0)) (func (;0;) (type 0)) (func (;1;) (type 1) (param i32) (result f32) (local f32 f32 f32 i32 i32) local.get 0 i32.load offset=4 local.get 0 i32.load local.tee 5 i32.sub i32.const 2 i32.shr_s local.set 4 i32.const 0 local.set 0 loop ;; label = @1 local.get 0 local.get 4 i32.eq i32.eqz if ;; label = @2 local.get 1 local.get 5 local.get 0 i32.const 2 i32.shl i32.add f32.load f32.add local.set 1 local.get 0 i32.const 1 i32.add local.set 0 br 1 (;@1;) end end local.get 1 local.get 4 f32.convert_i32_u local.tee 2 f32.div local.set 3 i32.const 0 local.set 0 f32.const 0x0p+0 (;=0;) local.set 1 loop ;; label = @1 local.get 0 local.get 4 i32.eq i32.eqz if ;; label = @2 local.get 1 local.get 5 local.get 0 i32.const 2 i32.shl i32.add f32.load local.get 3 f32.sub f32.abs f32.add local.set 1 local.get 0 i32.const 1 i32.add local.set 0 br 1 (;@1;) end end local.get 1 local.get 2 f32.div) (export "__wasm_call_ctors" (func 0)) (export "__wasm_apply_data_relocs" (func 0)) (export "_Z23mean_absolute_deviationNSt3__26vectorIfNS_9allocatorIfEEEE" (func 1)))
11
259
1,621
81
CPP/5
/* Insert a number "delimeter" between every two consecutive elements of input vector `numbers" >>> intersperse({}, 4) {} >>> intersperse({1, 2, 3}, 4) {1, 4, 2, 4, 3} */ #include<stdio.h> #include<vector> using namespace std; vector<int> intersperse(vector<int> numbers, int delimeter){
#include<stdio.h> #include<vector> using namespace std; #include<algorithm> #include<math.h> #include<stdlib.h> vector<int> intersperse(vector<int> numbers, int delimeter){
vector<int> out={}; if (numbers.size()>0) out.push_back(numbers[0]); for (int i=1;i<numbers.size();i++) { out.push_back(delimeter); out.push_back(numbers[i]); } return out; }
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(intersperse({}, 7), {})); assert (issame(intersperse({5, 6, 3, 2}, 8),{5, 8, 6, 8, 3, 8, 2})); assert (issame(intersperse({2, 2, 2}, 2),{2, 2, 2, 2, 2})); }
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(intersperse({}, 4), {})); assert (issame(intersperse({1, 2, 3}, 4),{1, 4, 2, 4, 3})); }
; ModuleID = 'c_code_test/code_5.cpp' source_filename = "c_code_test/code_5.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" %"class.std::__2::vector" = type { ptr, ptr, %"class.std::__2::__compressed_pair" } %"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" } %"struct.std::__2::__compressed_pair_elem" = type { ptr } %"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.1" } %"class.std::__2::__compressed_pair.1" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.2" } %"struct.std::__2::__compressed_pair_elem.2" = type { ptr } $_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi = comdat any $_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_ = comdat any $_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_ = comdat any $_ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev = comdat any $_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev = comdat any $_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any $_ZNSt12length_errorC2B7v160006EPKc = comdat any $_ZNSt3__29allocatorIiE8allocateB7v160006Em = comdat any $_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE = comdat any @.str = private unnamed_addr constant [7 x i8] c"vector\00", align 1 @_ZTISt12length_error = external constant ptr @_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4 @_ZTISt20bad_array_new_length = external constant ptr ; Function Attrs: minsize optsize define void @_Z11intersperseNSt3__26vectorIiNS_9allocatorIiEEEEi(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 { %4 = alloca i32, align 4 store i32 %2, ptr %4, align 4, !tbaa !3 store ptr null, ptr %0, align 4, !tbaa !7 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 store ptr null, ptr %5, align 4, !tbaa !12 %6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 store ptr null, ptr %6, align 4, !tbaa !13 %7 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1 %8 = load ptr, ptr %7, align 4, !tbaa !12 %9 = load ptr, ptr %1, align 4, !tbaa !7 %10 = icmp eq ptr %8, %9 br i1 %10, label %12, label %11 11: ; preds = %3 tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %9) #13 br label %12 12: ; preds = %11, %3 br label %13 13: ; preds = %12, %22 %14 = phi i32 [ %25, %22 ], [ 1, %12 ] %15 = load ptr, ptr %7, align 4, !tbaa !12 %16 = load ptr, ptr %1, align 4, !tbaa !7 %17 = ptrtoint ptr %15 to i32 %18 = ptrtoint ptr %16 to i32 %19 = sub i32 %17, %18 %20 = ashr exact i32 %19, 2 %21 = icmp ult i32 %14, %20 br i1 %21, label %22, label %26 22: ; preds = %13 call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %4) #13 %23 = load ptr, ptr %1, align 4, !tbaa !7 %24 = getelementptr inbounds i32, ptr %23, i32 %14 call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %24) #13 %25 = add nuw nsw i32 %14, 1 br label %13, !llvm.loop !14 26: ; preds = %13 ret void } ; Function Attrs: inlinehint minsize optsize define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #1 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !12 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %6 = load ptr, ptr %5, align 4, !tbaa !16 %7 = icmp eq ptr %4, %6 br i1 %7, label %11, label %8 8: ; preds = %2 %9 = load i32, ptr %1, align 4, !tbaa !3 store i32 %9, ptr %4, align 4, !tbaa !3 %10 = getelementptr inbounds i32, ptr %4, i32 1 store ptr %10, ptr %3, align 4, !tbaa !12 br label %12 11: ; preds = %2 tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #13 br label %12 12: ; preds = %11, %8 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: minsize nobuiltin nounwind optsize declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3 ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr void @_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #4 comdat { %3 = alloca %"struct.std::__2::__split_buffer", align 4 %4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #14 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %6 = load ptr, ptr %5, align 4, !tbaa !12 %7 = load ptr, ptr %0, align 4, !tbaa !7 %8 = ptrtoint ptr %6 to i32 %9 = ptrtoint ptr %7 to i32 %10 = sub i32 %8, %9 %11 = ashr exact i32 %10, 2 %12 = add nsw i32 %11, 1 %13 = tail call noundef i32 @_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #13 %14 = load ptr, ptr %5, align 4, !tbaa !12 %15 = load ptr, ptr %0, align 4, !tbaa !7 %16 = ptrtoint ptr %14 to i32 %17 = ptrtoint ptr %15 to i32 %18 = sub i32 %16, %17 %19 = ashr exact i32 %18, 2 %20 = call noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %13, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #13 %21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2 %22 = load ptr, ptr %21, align 4, !tbaa !17 %23 = load i32, ptr %1, align 4, !tbaa !3 store i32 %23, ptr %22, align 4, !tbaa !3 %24 = getelementptr inbounds i32, ptr %22, i32 1 store ptr %24, ptr %21, align 4, !tbaa !17 call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #13 %25 = call noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #15 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #14 ret void } ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #4 comdat { %3 = icmp ugt i32 %1, 1073741823 br i1 %3, label %4, label %5 4: ; preds = %2 tail call void @_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #16 unreachable 5: ; preds = %2 %6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %7 = load ptr, ptr %6, align 4, !tbaa !16 %8 = load ptr, ptr %0, align 4, !tbaa !7 %9 = ptrtoint ptr %7 to i32 %10 = ptrtoint ptr %8 to i32 %11 = sub i32 %9, %10 %12 = icmp ult i32 %11, 2147483644 %13 = ashr exact i32 %11, 1 %14 = tail call i32 @llvm.umax.i32(i32 %13, i32 %1) %15 = select i1 %12, i32 %14, i32 1073741823 ret i32 %15 } ; Function Attrs: minsize optsize define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_(ptr noundef nonnull returned align 4 dereferenceable(20) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 1 dereferenceable(1) %3) unnamed_addr #0 comdat { %5 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3 store ptr null, ptr %5, align 4, !tbaa !13 %6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3, i32 1 store ptr %3, ptr %6, align 4, !tbaa !16 %7 = icmp eq i32 %1, 0 br i1 %7, label %10, label %8 8: ; preds = %4 %9 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #13, !noalias !21 br label %10 10: ; preds = %4, %8 %11 = phi ptr [ %9, %8 ], [ null, %4 ] store ptr %11, ptr %0, align 4, !tbaa !24 %12 = getelementptr inbounds i32, ptr %11, i32 %2 %13 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2 store ptr %12, ptr %13, align 4, !tbaa !17 %14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1 store ptr %12, ptr %14, align 4, !tbaa !25 %15 = getelementptr inbounds i32, ptr %11, i32 %1 store ptr %15, ptr %5, align 4, !tbaa !16 ret ptr %0 } ; Function Attrs: minsize optsize define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %1) local_unnamed_addr #0 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !12 %5 = load ptr, ptr %0, align 4, !tbaa !7 %6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 1 %7 = load ptr, ptr %6, align 4, !tbaa !25 br label %8 8: ; preds = %12, %2 %9 = phi ptr [ %4, %2 ], [ %13, %12 ] %10 = phi ptr [ %7, %2 ], [ %15, %12 ] %11 = icmp eq ptr %9, %5 br i1 %11, label %16, label %12 12: ; preds = %8 %13 = getelementptr inbounds i32, ptr %9, i32 -1 %14 = load i32, ptr %13, align 4, !tbaa !3, !noalias !26 %15 = getelementptr inbounds i32, ptr %10, i32 -1 store i32 %14, ptr %15, align 4, !tbaa !3, !noalias !26 br label %8, !llvm.loop !31 16: ; preds = %8 store ptr %10, ptr %6, align 4, !tbaa !25 %17 = load ptr, ptr %0, align 4, !tbaa !16 store ptr %10, ptr %0, align 4, !tbaa !16 store ptr %17, ptr %6, align 4, !tbaa !16 %18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2 %19 = load ptr, ptr %3, align 4, !tbaa !16 %20 = load ptr, ptr %18, align 4, !tbaa !16 store ptr %20, ptr %3, align 4, !tbaa !16 store ptr %19, ptr %18, align 4, !tbaa !16 %21 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %22 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3 %23 = load ptr, ptr %21, align 4, !tbaa !16 %24 = load ptr, ptr %22, align 4, !tbaa !16 store ptr %24, ptr %21, align 4, !tbaa !16 store ptr %23, ptr %22, align 4, !tbaa !16 %25 = load ptr, ptr %6, align 4, !tbaa !25 store ptr %25, ptr %1, align 4, !tbaa !24 ret void } ; Function Attrs: minsize nounwind optsize define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #5 comdat { tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #15 %2 = load ptr, ptr %0, align 4, !tbaa !24 %3 = icmp eq ptr %2, null br i1 %3, label %5, label %4 4: ; preds = %1 tail call void @_ZdlPv(ptr noundef nonnull %2) #17 br label %5 5: ; preds = %4, %1 ret ptr %0 } ; Function Attrs: minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #6 comdat { tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #16 unreachable } ; Function Attrs: inlinehint minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #7 comdat { %2 = tail call ptr @__cxa_allocate_exception(i32 8) #14 %3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #13 tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #18 unreachable } declare ptr @__cxa_allocate_exception(i32) local_unnamed_addr ; Function Attrs: minsize optsize define linkonce_odr hidden noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull returned align 4 dereferenceable(8) %0, ptr noundef %1) unnamed_addr #0 comdat { %3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #13 store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !32 ret ptr %0 } ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #5 declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr ; Function Attrs: minsize optsize declare noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull returned align 4 dereferenceable(8), ptr noundef) unnamed_addr #0 ; Function Attrs: minsize mustprogress optsize define linkonce_odr hidden noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #8 comdat { %3 = icmp ugt i32 %1, 1073741823 br i1 %3, label %4, label %5 4: ; preds = %2 tail call void @_ZSt28__throw_bad_array_new_lengthB7v160006v() #16 unreachable 5: ; preds = %2 %6 = shl nuw i32 %1, 2 %7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #19 ret ptr %7 } ; Function Attrs: inlinehint minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #7 comdat { %1 = tail call ptr @__cxa_allocate_exception(i32 4) #14 %2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #15 tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #18 unreachable } ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #5 ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #5 ; Function Attrs: minsize nobuiltin optsize allocsize(0) declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #9 ; Function Attrs: minsize mustprogress nounwind optsize define linkonce_odr hidden void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #10 comdat { %2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1 %3 = load ptr, ptr %2, align 4, !tbaa !25 tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #15 ret void } ; Function Attrs: inlinehint minsize mustprogress nounwind optsize define linkonce_odr hidden void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %1) local_unnamed_addr #11 comdat { %3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2 %4 = load ptr, ptr %3, align 4, !tbaa !17 br label %5 5: ; preds = %8, %2 %6 = phi ptr [ %9, %8 ], [ %4, %2 ] %7 = icmp eq ptr %6, %1 br i1 %7, label %10, label %8 8: ; preds = %5 %9 = getelementptr inbounds i32, ptr %6, i32 -1 store ptr %9, ptr %3, align 4, !tbaa !17 br label %5, !llvm.loop !34 10: ; preds = %5 ret void } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #12 attributes #0 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #1 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #4 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #5 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #6 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #7 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #8 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #9 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #10 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #11 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { minsize optsize } attributes #14 = { nounwind } attributes #15 = { minsize nounwind optsize } attributes #16 = { minsize noreturn optsize } attributes #17 = { builtin minsize nounwind optsize } attributes #18 = { noreturn } attributes #19 = { builtin minsize optsize allocsize(0) } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"} !3 = !{!4, !4, i64 0} !4 = !{!"int", !5, i64 0} !5 = !{!"omnipotent char", !6, i64 0} !6 = !{!"Simple C++ TBAA"} !7 = !{!8, !9, i64 0} !8 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEEE", !9, i64 0, !9, i64 4, !10, i64 8} !9 = !{!"any pointer", !5, i64 0} !10 = !{!"_ZTSNSt3__217__compressed_pairIPiNS_9allocatorIiEEEE", !11, i64 0} !11 = !{!"_ZTSNSt3__222__compressed_pair_elemIPiLi0ELb0EEE", !9, i64 0} !12 = !{!8, !9, i64 4} !13 = !{!11, !9, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = !{!9, !9, i64 0} !17 = !{!18, !9, i64 8} !18 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !9, i64 0, !9, i64 4, !9, i64 8, !19, i64 12} !19 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !11, i64 0, !20, i64 4} !20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !9, i64 0} !21 = !{!22} !22 = distinct !{!22, !23, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"} !23 = distinct !{!23, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"} !24 = !{!18, !9, i64 0} !25 = !{!18, !9, i64 4} !26 = !{!27, !29} !27 = distinct !{!27, !28, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"} !28 = distinct !{!28, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"} !29 = distinct !{!29, !30, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"} !30 = distinct !{!30, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"} !31 = distinct !{!31, !15} !32 = !{!33, !33, i64 0} !33 = !{!"vtable pointer", !6, i64 0} !34 = distinct !{!34, !15}
(module (type (;0;) (func (param i32 i32))) (type (;1;) (func (param i32) (result i32))) (type (;2;) (func (param i32 i32 i32))) (type (;3;) (func (param i32))) (type (;4;) (func (param i32 i32) (result i32))) (type (;5;) (func)) (import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func (;0;) (type 0))) (import "env" "_ZdlPv" (func (;1;) (type 3))) (import "env" "__cxa_allocate_exception" (func (;2;) (type 1))) (import "env" "__cxa_throw" (func (;3;) (type 2))) (import "env" "_ZNSt11logic_errorC2EPKc" (func (;4;) (type 4))) (import "env" "_Znwm" (func (;5;) (type 1))) (import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;6;) (type 1))) (import "env" "__stack_pointer" (global (;0;) (mut i32))) (import "env" "__memory_base" (global (;1;) i32)) (import "GOT.func" "_ZNSt12length_errorD1Ev" (global (;2;) (mut i32))) (import "GOT.mem" "_ZTISt12length_error" (global (;3;) (mut i32))) (import "GOT.mem" "_ZTVSt12length_error" (global (;4;) (mut i32))) (import "GOT.func" "_ZNSt20bad_array_new_lengthD1Ev" (global (;5;) (mut i32))) (import "GOT.mem" "_ZTISt20bad_array_new_length" (global (;6;) (mut i32))) (import "env" "memory" (memory (;0;) 1)) (func (;7;) (type 5)) (func (;8;) (type 2) (param i32 i32 i32) (local i32) global.get 0 i32.const 16 i32.sub local.tee 3 global.set 0 local.get 3 local.get 2 i32.store offset=12 local.get 0 i32.const 0 i32.store offset=8 local.get 0 i64.const 0 i64.store align=4 local.get 1 i32.load local.tee 2 local.get 1 i32.load offset=4 i32.ne if ;; label = @1 local.get 0 local.get 2 call 9 end i32.const 1 local.set 2 loop ;; label = @1 local.get 2 local.get 1 i32.load offset=4 local.get 1 i32.load i32.sub i32.const 2 i32.shr_s i32.ge_u i32.eqz if ;; label = @2 local.get 0 local.get 3 i32.const 12 i32.add call 9 local.get 0 local.get 1 i32.load local.get 2 i32.const 2 i32.shl i32.add call 9 local.get 2 i32.const 1 i32.add local.set 2 br 1 (;@1;) end end local.get 3 i32.const 16 i32.add global.set 0) (func (;9;) (type 0) (param i32 i32) (local i32) local.get 0 i32.load offset=4 local.tee 2 local.get 0 i32.load offset=8 i32.ne if ;; label = @1 local.get 2 local.get 1 i32.load i32.store local.get 0 local.get 2 i32.const 4 i32.add i32.store offset=4 return end local.get 0 local.get 1 call 0) (func (;10;) (type 0) (param i32 i32) (local i32 i32 i32 i32) global.get 0 i32.const 32 i32.sub local.tee 2 global.set 0 local.get 0 i32.load offset=4 local.get 0 i32.load i32.sub i32.const 2 i32.shr_s i32.const 1 i32.add local.tee 3 i32.const 1073741824 i32.ge_u if ;; label = @1 global.get 2 local.set 0 global.get 3 local.set 1 i32.const 8 call 2 global.get 4 local.set 3 global.get 1 call 4 local.tee 2 local.get 3 i32.const 8 i32.add i32.store local.get 2 local.get 1 local.get 0 call 3 unreachable end i32.const 1073741823 local.get 0 i32.load offset=8 local.get 0 i32.load i32.sub local.tee 4 i32.const 1 i32.shr_s local.tee 5 local.get 3 local.get 3 local.get 5 i32.lt_u select local.get 4 i32.const 2147483644 i32.ge_u select local.set 4 local.get 0 i32.load offset=4 local.get 0 i32.load i32.sub i32.const 2 i32.shr_s local.set 5 i32.const 0 local.set 3 local.get 2 i32.const 0 i32.store offset=24 local.get 2 local.get 0 i32.const 8 i32.add i32.store offset=28 local.get 4 if ;; label = @1 local.get 4 i32.const 1073741824 i32.ge_u if ;; label = @2 global.get 5 local.set 0 global.get 6 local.set 1 i32.const 4 call 2 call 6 local.get 1 local.get 0 call 3 unreachable end local.get 4 i32.const 2 i32.shl call 5 local.set 3 end local.get 2 local.get 3 i32.store offset=12 local.get 2 local.get 3 local.get 5 i32.const 2 i32.shl i32.add local.tee 5 i32.store offset=20 local.get 2 local.get 3 local.get 4 i32.const 2 i32.shl i32.add i32.store offset=24 local.get 2 local.get 5 i32.store offset=16 local.get 2 i32.load offset=20 local.tee 3 local.get 1 i32.load i32.store local.get 2 local.get 3 i32.const 4 i32.add i32.store offset=20 local.get 2 i32.load offset=16 local.set 1 local.get 0 i32.load local.set 4 local.get 0 i32.load offset=4 local.set 3 loop ;; label = @1 local.get 3 local.get 4 i32.ne if ;; label = @2 local.get 1 i32.const 4 i32.sub local.tee 1 local.get 3 i32.const 4 i32.sub local.tee 3 i32.load i32.store br 1 (;@1;) end end local.get 2 local.get 1 i32.store offset=16 local.get 0 i32.load local.set 3 local.get 0 local.get 1 i32.store local.get 2 local.get 3 i32.store offset=16 local.get 0 i32.load offset=4 local.set 1 local.get 0 local.get 2 i32.load offset=20 i32.store offset=4 local.get 2 local.get 1 i32.store offset=20 local.get 0 i32.load offset=8 local.set 1 local.get 0 local.get 2 i32.load offset=24 i32.store offset=8 local.get 2 local.get 1 i32.store offset=24 local.get 2 local.get 2 i32.load offset=16 i32.store offset=12 local.get 2 i32.load offset=16 local.set 1 local.get 2 i32.load offset=20 local.set 0 loop ;; label = @1 local.get 0 local.get 1 i32.ne if ;; label = @2 local.get 2 local.get 0 i32.const 4 i32.sub local.tee 0 i32.store offset=20 br 1 (;@1;) end end local.get 2 i32.load offset=12 local.tee 0 if ;; label = @1 local.get 0 call 1 end local.get 2 i32.const 32 i32.add global.set 0) (export "__wasm_call_ctors" (func 7)) (export "__wasm_apply_data_relocs" (func 7)) (export "_Z11intersperseNSt3__26vectorIiNS_9allocatorIiEEEEi" (func 8)) (export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 10)) (data (;0;) (global.get 1) "vector\00"))
10
216
7,066
345
CPP/6
/* Input to this function is a string represented multiple groups for nested parentheses separated by spaces. For each of the group, output the deepest level of nesting of parentheses. E.g. (()()) has maximum two levels of nesting while ((())) has three. >>> parse_nested_parens("(()()) ((())) () ((())()())") {2, 3, 1, 3} */ #include<stdio.h> #include<vector> #include<string> using namespace std; vector<int> parse_nested_parens(string paren_string){
#include<stdio.h> #include<vector> #include<string> using namespace std; #include<algorithm> #include<math.h> #include<stdlib.h> vector<int> parse_nested_parens(string paren_string){
vector<int> all_levels; string current_paren; int level=0,max_level=0; char chr; int i; for (i=0;i<paren_string.length();i++) { chr=paren_string[i]; if (chr=='(') { level+=1; if (level>max_level) max_level=level; current_paren+=chr; } if (chr==')') { level-=1; current_paren+=chr; if (level==0){ all_levels.push_back(max_level); current_paren=""; max_level=0; } } } return all_levels; }
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(parse_nested_parens("(()()) ((())) () ((())()())"),{2, 3, 1, 3})); assert (issame(parse_nested_parens("() (()) ((())) (((())))") , {1, 2, 3, 4})); assert (issame(parse_nested_parens("(()(())((())))") ,{4})); }
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(parse_nested_parens("(()()) ((())) () ((())()())"),{2, 3, 1, 3})); }
; ModuleID = 'c_code_test/code_6.cpp' source_filename = "c_code_test/code_6.cpp" target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20" target triple = "wasm32-unknown-emscripten" %"class.std::__2::vector" = type { ptr, ptr, %"class.std::__2::__compressed_pair" } %"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" } %"struct.std::__2::__compressed_pair_elem" = type { ptr } %"class.std::__2::basic_string" = type { %"class.std::__2::__compressed_pair.1" } %"class.std::__2::__compressed_pair.1" = type { %"struct.std::__2::__compressed_pair_elem.2" } %"struct.std::__2::__compressed_pair_elem.2" = type { %"struct.std::__2::basic_string<char>::__rep" } %"struct.std::__2::basic_string<char>::__rep" = type { %union.anon } %union.anon = type { %"struct.std::__2::basic_string<char>::__long" } %"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 } %"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 } %"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.7" } %"class.std::__2::__compressed_pair.7" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.8" } %"struct.std::__2::__compressed_pair_elem.8" = type { ptr } $_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi = comdat any $_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_ = comdat any $_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_ = comdat any $_ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev = comdat any $_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev = comdat any $_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any $_ZNSt12length_errorC2B7v160006EPKc = comdat any $_ZNSt3__29allocatorIiE8allocateB7v160006Em = comdat any $_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev = comdat any $_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE = comdat any $_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc = comdat any @.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"vector\00", align 1 @_ZTISt12length_error = external constant ptr @_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4 @_ZTISt20bad_array_new_length = external constant ptr ; Function Attrs: minsize optsize define void @_Z19parse_nested_parensNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 { %3 = alloca %"class.std::__2::basic_string", align 4 %4 = alloca i32, align 4 store ptr null, ptr %0, align 4, !tbaa !3 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 store ptr null, ptr %5, align 4, !tbaa !10 %6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 store ptr null, ptr %6, align 4, !tbaa !11 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #16 call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 0, i32 12, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #16 store i32 0, ptr %4, align 4, !tbaa !12 %7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2 %8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1 br label %9 9: ; preds = %34, %2 %10 = phi i32 [ 0, %2 ], [ %35, %34 ] %11 = phi i32 [ 0, %2 ], [ %36, %34 ] %12 = load i8, ptr %7, align 1 %13 = icmp slt i8 %12, 0 %14 = load i32, ptr %8, align 4 %15 = zext i8 %12 to i32 %16 = select i1 %13, i32 %14, i32 %15 %17 = icmp ult i32 %11, %16 br i1 %17, label %18, label %37 18: ; preds = %9 %19 = load ptr, ptr %1, align 4 %20 = select i1 %13, ptr %19, ptr %1 %21 = getelementptr inbounds i8, ptr %20, i32 %11 %22 = load i8, ptr %21, align 1, !tbaa !14 switch i8 %22, label %34 [ i8 40, label %23 i8 41, label %29 ] 23: ; preds = %18 %24 = add nsw i32 %10, 1 %25 = load i32, ptr %4, align 4, !tbaa !12 %26 = icmp slt i32 %10, %25 br i1 %26, label %28, label %27 27: ; preds = %23 store i32 %24, ptr %4, align 4, !tbaa !12 br label %28 28: ; preds = %23, %27 call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext 40) #17 br label %34 29: ; preds = %18 %30 = add nsw i32 %10, -1 call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext 41) #17 %31 = icmp eq i32 %30, 0 br i1 %31, label %32, label %34 32: ; preds = %29 call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %4) #17 %33 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #17 store i32 0, ptr %4, align 4, !tbaa !12 br label %34 34: ; preds = %18, %28, %32, %29 %35 = phi i32 [ 0, %32 ], [ %30, %29 ], [ %24, %28 ], [ %10, %18 ] %36 = add nuw nsw i32 %11, 1 br label %9, !llvm.loop !15 37: ; preds = %9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #16 %38 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #18 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #16 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: inlinehint minsize optsize define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #2 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !10 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %6 = load ptr, ptr %5, align 4, !tbaa !17 %7 = icmp eq ptr %4, %6 br i1 %7, label %11, label %8 8: ; preds = %2 %9 = load i32, ptr %1, align 4, !tbaa !12 store i32 %9, ptr %4, align 4, !tbaa !12 %10 = getelementptr inbounds i32, ptr %4, i32 1 store ptr %10, ptr %3, align 4, !tbaa !10 br label %12 11: ; preds = %2 tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #17 br label %12 12: ; preds = %11, %8 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: inlinehint minsize nounwind optsize declare noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(12)) unnamed_addr #3 ; Function Attrs: minsize nobuiltin nounwind optsize declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #5 ; Function Attrs: minsize optsize declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef signext) local_unnamed_addr #0 ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr void @_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #6 comdat { %3 = alloca %"struct.std::__2::__split_buffer", align 4 %4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #16 %5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %6 = load ptr, ptr %5, align 4, !tbaa !10 %7 = load ptr, ptr %0, align 4, !tbaa !3 %8 = ptrtoint ptr %6 to i32 %9 = ptrtoint ptr %7 to i32 %10 = sub i32 %8, %9 %11 = ashr exact i32 %10, 2 %12 = add nsw i32 %11, 1 %13 = tail call noundef i32 @_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #17 %14 = load ptr, ptr %5, align 4, !tbaa !10 %15 = load ptr, ptr %0, align 4, !tbaa !3 %16 = ptrtoint ptr %14 to i32 %17 = ptrtoint ptr %15 to i32 %18 = sub i32 %16, %17 %19 = ashr exact i32 %18, 2 %20 = call noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %13, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #17 %21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2 %22 = load ptr, ptr %21, align 4, !tbaa !18 %23 = load i32, ptr %1, align 4, !tbaa !12 store i32 %23, ptr %22, align 4, !tbaa !12 %24 = getelementptr inbounds i32, ptr %22, i32 1 store ptr %24, ptr %21, align 4, !tbaa !18 call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #17 %25 = call noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #18 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #16 ret void } ; Function Attrs: inlinehint minsize mustprogress optsize define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #6 comdat { %3 = icmp ugt i32 %1, 1073741823 br i1 %3, label %4, label %5 4: ; preds = %2 tail call void @_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #19 unreachable 5: ; preds = %2 %6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %7 = load ptr, ptr %6, align 4, !tbaa !17 %8 = load ptr, ptr %0, align 4, !tbaa !3 %9 = ptrtoint ptr %7 to i32 %10 = ptrtoint ptr %8 to i32 %11 = sub i32 %9, %10 %12 = icmp ult i32 %11, 2147483644 %13 = ashr exact i32 %11, 1 %14 = tail call i32 @llvm.umax.i32(i32 %13, i32 %1) %15 = select i1 %12, i32 %14, i32 1073741823 ret i32 %15 } ; Function Attrs: minsize optsize define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEEC2EmmS3_(ptr noundef nonnull returned align 4 dereferenceable(20) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 1 dereferenceable(1) %3) unnamed_addr #0 comdat { %5 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3 store ptr null, ptr %5, align 4, !tbaa !11 %6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3, i32 1 store ptr %3, ptr %6, align 4, !tbaa !17 %7 = icmp eq i32 %1, 0 br i1 %7, label %10, label %8 8: ; preds = %4 %9 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #17, !noalias !22 br label %10 10: ; preds = %4, %8 %11 = phi ptr [ %9, %8 ], [ null, %4 ] store ptr %11, ptr %0, align 4, !tbaa !25 %12 = getelementptr inbounds i32, ptr %11, i32 %2 %13 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2 store ptr %12, ptr %13, align 4, !tbaa !18 %14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1 store ptr %12, ptr %14, align 4, !tbaa !26 %15 = getelementptr inbounds i32, ptr %11, i32 %1 store ptr %15, ptr %5, align 4, !tbaa !17 ret ptr %0 } ; Function Attrs: minsize optsize define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE26__swap_out_circular_bufferERNS_14__split_bufferIiRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %1) local_unnamed_addr #0 comdat { %3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1 %4 = load ptr, ptr %3, align 4, !tbaa !10 %5 = load ptr, ptr %0, align 4, !tbaa !3 %6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 1 %7 = load ptr, ptr %6, align 4, !tbaa !26 br label %8 8: ; preds = %12, %2 %9 = phi ptr [ %4, %2 ], [ %13, %12 ] %10 = phi ptr [ %7, %2 ], [ %15, %12 ] %11 = icmp eq ptr %9, %5 br i1 %11, label %16, label %12 12: ; preds = %8 %13 = getelementptr inbounds i32, ptr %9, i32 -1 %14 = load i32, ptr %13, align 4, !tbaa !12, !noalias !27 %15 = getelementptr inbounds i32, ptr %10, i32 -1 store i32 %14, ptr %15, align 4, !tbaa !12, !noalias !27 br label %8, !llvm.loop !32 16: ; preds = %8 store ptr %10, ptr %6, align 4, !tbaa !26 %17 = load ptr, ptr %0, align 4, !tbaa !17 store ptr %10, ptr %0, align 4, !tbaa !17 store ptr %17, ptr %6, align 4, !tbaa !17 %18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2 %19 = load ptr, ptr %3, align 4, !tbaa !17 %20 = load ptr, ptr %18, align 4, !tbaa !17 store ptr %20, ptr %3, align 4, !tbaa !17 store ptr %19, ptr %18, align 4, !tbaa !17 %21 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2 %22 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3 %23 = load ptr, ptr %21, align 4, !tbaa !17 %24 = load ptr, ptr %22, align 4, !tbaa !17 store ptr %24, ptr %21, align 4, !tbaa !17 store ptr %23, ptr %22, align 4, !tbaa !17 %25 = load ptr, ptr %6, align 4, !tbaa !26 store ptr %25, ptr %1, align 4, !tbaa !25 ret void } ; Function Attrs: minsize nounwind optsize define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #7 comdat { tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #18 %2 = load ptr, ptr %0, align 4, !tbaa !25 %3 = icmp eq ptr %2, null br i1 %3, label %5, label %4 4: ; preds = %1 tail call void @_ZdlPv(ptr noundef nonnull %2) #20 br label %5 5: ; preds = %4, %1 ret ptr %0 } ; Function Attrs: minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #8 comdat { tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.1) #19 unreachable } ; Function Attrs: inlinehint minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #9 comdat { %2 = tail call ptr @__cxa_allocate_exception(i32 8) #16 %3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #17 tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #21 unreachable } declare ptr @__cxa_allocate_exception(i32) local_unnamed_addr ; Function Attrs: minsize optsize define linkonce_odr hidden noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull returned align 4 dereferenceable(8) %0, ptr noundef %1) unnamed_addr #0 comdat { %3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #17 store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !33 ret ptr %0 } ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #7 declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr ; Function Attrs: minsize optsize declare noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull returned align 4 dereferenceable(8), ptr noundef) unnamed_addr #0 ; Function Attrs: minsize mustprogress optsize define linkonce_odr hidden noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #10 comdat { %3 = icmp ugt i32 %1, 1073741823 br i1 %3, label %4, label %5 4: ; preds = %2 tail call void @_ZSt28__throw_bad_array_new_lengthB7v160006v() #19 unreachable 5: ; preds = %2 %6 = shl nuw i32 %1, 2 %7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #22 ret ptr %7 } ; Function Attrs: inlinehint minsize mustprogress noreturn optsize define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #9 comdat { %1 = tail call ptr @__cxa_allocate_exception(i32 4) #16 %2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #18 tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #21 unreachable } ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #7 ; Function Attrs: minsize nounwind optsize declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #7 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #11 ; Function Attrs: minsize nobuiltin optsize allocsize(0) declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #12 ; Function Attrs: minsize mustprogress nounwind optsize define linkonce_odr hidden void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #13 comdat { %2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1 %3 = load ptr, ptr %2, align 4, !tbaa !26 tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #18 ret void } ; Function Attrs: inlinehint minsize mustprogress nounwind optsize define linkonce_odr hidden void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %1) local_unnamed_addr #14 comdat { %3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2 %4 = load ptr, ptr %3, align 4, !tbaa !18 br label %5 5: ; preds = %8, %2 %6 = phi ptr [ %9, %8 ], [ %4, %2 ] %7 = icmp eq ptr %6, %1 br i1 %7, label %10, label %8 8: ; preds = %5 %9 = getelementptr inbounds i32, ptr %6, i32 -1 store ptr %9, ptr %3, align 4, !tbaa !18 br label %5, !llvm.loop !35 10: ; preds = %5 ret void } ; Function Attrs: minsize mustprogress optsize define linkonce_odr noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #10 comdat { %3 = icmp ne ptr %1, null tail call void @llvm.assume(i1 %3) %4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1) #17 ret ptr %4 } ; Function Attrs: minsize optsize declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) local_unnamed_addr #0 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #15 attributes #0 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #3 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #4 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #7 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #8 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #9 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #10 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #11 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #12 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #13 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #14 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" } attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nounwind } attributes #17 = { minsize optsize } attributes #18 = { minsize nounwind optsize } attributes #19 = { minsize noreturn optsize } attributes #20 = { builtin minsize nounwind optsize } attributes #21 = { noreturn } attributes #22 = { builtin minsize optsize allocsize(0) } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{!"clang version 18.0.0 (https://github.com/llvm/llvm-project 75501f53624de92aafce2f1da698b249a7293dc7)"} !3 = !{!4, !5, i64 0} !4 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !8, i64 8} !5 = !{!"any pointer", !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C++ TBAA"} !8 = !{!"_ZTSNSt3__217__compressed_pairIPiNS_9allocatorIiEEEE", !9, i64 0} !9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPiLi0ELb0EEE", !5, i64 0} !10 = !{!4, !5, i64 4} !11 = !{!9, !5, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"int", !6, i64 0} !14 = !{!6, !6, i64 0} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = !{!5, !5, i64 0} !18 = !{!19, !5, i64 8} !19 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !20, i64 12} !20 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !21, i64 4} !21 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, i64 0} !22 = !{!23} !23 = distinct !{!23, !24, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"} !24 = distinct !{!24, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"} !25 = !{!19, !5, i64 0} !26 = !{!19, !5, i64 4} !27 = !{!28, !30} !28 = distinct !{!28, !29, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"} !29 = distinct !{!29, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"} !30 = distinct !{!30, !31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"} !31 = distinct !{!31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"} !32 = distinct !{!32, !16} !33 = !{!34, !34, i64 0} !34 = !{!"vtable pointer", !7, i64 0} !35 = distinct !{!35, !16}
(module (type (;0;) (func (param i32 i32))) (type (;1;) (func (param i32) (result i32))) (type (;2;) (func (param i32 i32) (result i32))) (type (;3;) (func (param i32))) (type (;4;) (func (param i32 i32 i32))) (type (;5;) (func)) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc" (func (;0;) (type 0))) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc" (func (;1;) (type 2))) (import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;2;) (type 1))) (import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func (;3;) (type 0))) (import "env" "_ZdlPv" (func (;4;) (type 3))) (import "env" "__cxa_allocate_exception" (func (;5;) (type 1))) (import "env" "__cxa_throw" (func (;6;) (type 4))) (import "env" "_ZNSt11logic_errorC2EPKc" (func (;7;) (type 2))) (import "env" "_Znwm" (func (;8;) (type 1))) (import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;9;) (type 1))) (import "env" "__stack_pointer" (global (;0;) (mut i32))) (import "env" "__memory_base" (global (;1;) i32)) (import "GOT.func" "_ZNSt12length_errorD1Ev" (global (;2;) (mut i32))) (import "GOT.mem" "_ZTISt12length_error" (global (;3;) (mut i32))) (import "GOT.mem" "_ZTVSt12length_error" (global (;4;) (mut i32))) (import "GOT.func" "_ZNSt20bad_array_new_lengthD1Ev" (global (;5;) (mut i32))) (import "GOT.mem" "_ZTISt20bad_array_new_length" (global (;6;) (mut i32))) (import "env" "memory" (memory (;0;) 1)) (func (;10;) (type 5)) (func (;11;) (type 0) (param i32 i32) (local i32 i32 i32 i32 i32) global.get 0 i32.const 32 i32.sub local.tee 2 global.set 0 local.get 0 i32.const 0 i32.store offset=8 local.get 0 i64.const 0 i64.store align=4 local.get 2 i32.const 0 i32.store offset=24 local.get 2 i64.const 0 i64.store offset=16 local.get 2 i32.const 0 i32.store offset=12 loop ;; label = @1 local.get 1 i32.load offset=4 local.get 1 i32.load8_u offset=11 local.tee 3 local.get 3 i32.extend8_s i32.const 0 i32.lt_s local.tee 3 select local.get 5 i32.gt_u if ;; label = @2 block ;; label = @3 block ;; label = @4 block ;; label = @5 local.get 1 i32.load local.get 1 local.get 3 select local.get 5 i32.add i32.load8_u i32.const 40 i32.sub br_table 0 (;@5;) 1 (;@4;) 2 (;@3;) end local.get 4 i32.const 1 i32.add local.set 3 local.get 2 i32.load offset=12 local.get 4 i32.le_s if ;; label = @5 local.get 2 local.get 3 i32.store offset=12 end local.get 2 i32.const 16 i32.add i32.const 40 call 0 local.get 3 local.set 4 br 1 (;@3;) end local.get 2 i32.const 16 i32.add local.tee 6 i32.const 41 call 0 local.get 4 i32.const 1 i32.sub local.tee 4 br_if 0 (;@3;) local.get 2 i32.const 12 i32.add local.set 4 block ;; label = @4 local.get 0 i32.load offset=4 local.tee 3 local.get 0 i32.load offset=8 i32.ne if ;; label = @5 local.get 3 local.get 4 i32.load i32.store local.get 0 local.get 3 i32.const 4 i32.add i32.store offset=4 br 1 (;@4;) end local.get 0 local.get 4 call 3 end local.get 6 global.get 1 i32.const 6 i32.add call 1 drop i32.const 0 local.set 4 local.get 2 i32.const 0 i32.store offset=12 end local.get 5 i32.const 1 i32.add local.set 5 br 1 (;@1;) end end local.get 2 i32.const 16 i32.add call 2 drop local.get 2 i32.const 32 i32.add global.set 0) (func (;12;) (type 0) (param i32 i32) (local i32 i32 i32 i32) global.get 0 i32.const 32 i32.sub local.tee 2 global.set 0 local.get 0 i32.load offset=4 local.get 0 i32.load i32.sub i32.const 2 i32.shr_s i32.const 1 i32.add local.tee 3 i32.const 1073741824 i32.ge_u if ;; label = @1 global.get 2 local.set 0 global.get 3 local.set 1 i32.const 8 call 5 global.get 4 local.set 3 global.get 1 call 7 local.tee 2 local.get 3 i32.const 8 i32.add i32.store local.get 2 local.get 1 local.get 0 call 6 unreachable end i32.const 1073741823 local.get 0 i32.load offset=8 local.get 0 i32.load i32.sub local.tee 4 i32.const 1 i32.shr_s local.tee 5 local.get 3 local.get 3 local.get 5 i32.lt_u select local.get 4 i32.const 2147483644 i32.ge_u select local.set 4 local.get 0 i32.load offset=4 local.get 0 i32.load i32.sub i32.const 2 i32.shr_s local.set 5 i32.const 0 local.set 3 local.get 2 i32.const 0 i32.store offset=24 local.get 2 local.get 0 i32.const 8 i32.add i32.store offset=28 local.get 4 if ;; label = @1 local.get 4 i32.const 1073741824 i32.ge_u if ;; label = @2 global.get 5 local.set 0 global.get 6 local.set 1 i32.const 4 call 5 call 9 local.get 1 local.get 0 call 6 unreachable end local.get 4 i32.const 2 i32.shl call 8 local.set 3 end local.get 2 local.get 3 i32.store offset=12 local.get 2 local.get 3 local.get 5 i32.const 2 i32.shl i32.add local.tee 5 i32.store offset=20 local.get 2 local.get 3 local.get 4 i32.const 2 i32.shl i32.add i32.store offset=24 local.get 2 local.get 5 i32.store offset=16 local.get 2 i32.load offset=20 local.tee 3 local.get 1 i32.load i32.store local.get 2 local.get 3 i32.const 4 i32.add i32.store offset=20 local.get 2 i32.load offset=16 local.set 1 local.get 0 i32.load local.set 4 local.get 0 i32.load offset=4 local.set 3 loop ;; label = @1 local.get 3 local.get 4 i32.ne if ;; label = @2 local.get 1 i32.const 4 i32.sub local.tee 1 local.get 3 i32.const 4 i32.sub local.tee 3 i32.load i32.store br 1 (;@1;) end end local.get 2 local.get 1 i32.store offset=16 local.get 0 i32.load local.set 3 local.get 0 local.get 1 i32.store local.get 2 local.get 3 i32.store offset=16 local.get 0 i32.load offset=4 local.set 1 local.get 0 local.get 2 i32.load offset=20 i32.store offset=4 local.get 2 local.get 1 i32.store offset=20 local.get 0 i32.load offset=8 local.set 1 local.get 0 local.get 2 i32.load offset=24 i32.store offset=8 local.get 2 local.get 1 i32.store offset=24 local.get 2 local.get 2 i32.load offset=16 i32.store offset=12 local.get 2 i32.load offset=16 local.set 1 local.get 2 i32.load offset=20 local.set 0 loop ;; label = @1 local.get 0 local.get 1 i32.ne if ;; label = @2 local.get 2 local.get 0 i32.const 4 i32.sub local.tee 0 i32.store offset=20 br 1 (;@1;) end end local.get 2 i32.load offset=12 local.tee 0 if ;; label = @1 local.get 0 call 4 end local.get 2 i32.const 32 i32.add global.set 0) (export "__wasm_call_ctors" (func 10)) (export "__wasm_apply_data_relocs" (func 10)) (export "_Z19parse_nested_parensNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 11)) (export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 12)) (data (;0;) (global.get 1) "vector\00"))
27
599
8,933
400
CPP/7
"/*\nFilter an input vector of strings only for ones that contain given substring\n>>> filter_by_sub(...TRUNCATED)
"#include<stdio.h>\n#include<vector>\n#include<string>\nusing namespace std;\n#include<algorithm>\n#(...TRUNCATED)
" vector<string> out;\n for (int i=0;i<strings.size();i++)\n {\n if (strings[i].find(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<string> a,vector<string>b){\n if (a.size()(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<string> a,vector<string>b){\n if (a.size()(...TRUNCATED)
"; ModuleID = 'c_code_test/code_7.cpp'\nsource_filename = \"c_code_test/code_7.cpp\"\ntarget datalay(...TRUNCATED)
"(module\n (type (;0;) (func (param i32 i32 i32) (result i32)))\n (type (;1;) (func (param i32 i32(...TRUNCATED)
8
185
13,614
588
CPP/8
"/*\nFor a given vector of integers, return a vector consisting of a sum and a product of all the in(...TRUNCATED)
"#include<stdio.h>\n#include<vector>\nusing namespace std;\n#include<algorithm>\n#include<math.h>\n#(...TRUNCATED)
" int sum=0,product=1;\n for (int i=0;i<numbers.size();i++)\n {\n sum+=numbers[i];\n(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<int> a,vector<int>b){\n if (a.size()!=b.si(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<int> a,vector<int>b){\n if (a.size()!=b.si(...TRUNCATED)
"; ModuleID = 'c_code_test/code_8.cpp'\nsource_filename = \"c_code_test/code_8.cpp\"\ntarget datalay(...TRUNCATED)
"(module\n (type (;0;) (func (param i32) (result i32)))\n (type (;1;) (func (param i32 i32 i32) (r(...TRUNCATED)
8
158
5,237
207
CPP/9
"/*\nFrom a given vector of integers, generate a vector of rolling maximum element found until given(...TRUNCATED)
"#include<stdio.h>\n#include<vector>\nusing namespace std;\n#include<algorithm>\n#include<math.h>\n#(...TRUNCATED)
" vector<int> out;\n int max=0;\n for (int i=0;i<numbers.size();i++)\n {\n if (nu(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<int> a,vector<int>b){\n if (a.size()!=b.si(...TRUNCATED)
"#undef NDEBUG\n#include<assert.h>\nbool issame(vector<int> a,vector<int>b){\n if (a.size()!=b.si(...TRUNCATED)
"; ModuleID = 'c_code_test/code_9.cpp'\nsource_filename = \"c_code_test/code_9.cpp\"\ntarget datalay(...TRUNCATED)
"(module\n (type (;0;) (func (param i32 i32)))\n (type (;1;) (func (param i32) (result i32)))\n ((...TRUNCATED)
9
177
7,132
338

Dataset Card for "humaneval_x_with_stats"

More Information needed

Downloads last month
34
Edit dataset card