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 | /*
Filter an input vector of strings only for ones that contain given substring
>>> filter_by_substring({}, "a")
{}
>>> filter_by_substring({"abc", "bacd", "cde", "vector"}, "a")
{"abc", "bacd", "vector"}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<string> filter_by_substring(vector<string> strings, string substring){
| #include<stdio.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
vector<string> filter_by_substring(vector<string> strings, string substring){
| vector<string> out;
for (int i=0;i<strings.size();i++)
{
if (strings[i].find(substring)!=strings[i].npos)
out.push_back(strings[i]);
}
return out;
}
| #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(filter_by_substring({}, "john"),{}));
assert (issame(filter_by_substring({"xxx", "asd", "xxy", "john doe", "xxxAAA", "xxx"}, "xxx"), {"xxx", "xxxAAA", "xxx"}));
assert (issame(filter_by_substring({"xxx", "asd", "aaaxxy", "john doe", "xxxAAA", "xxx"}, "xx"),{"xxx", "aaaxxy", "xxxAAA", "xxx"}));
assert (issame(filter_by_substring({"grunt", "trumpet", "prune", "gruesome"}, "run") ,{"grunt", "prune"}));
}
| #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(filter_by_substring({}, "a"),{}));
assert (issame(filter_by_substring({"abc", "bacd", "cde", "array"}, "a"), {"abc", "bacd", "array"}));
}
| ; ModuleID = 'c_code_test/code_7.cpp'
source_filename = "c_code_test/code_7.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 }
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB7v160006ERKS5_m = comdat any
$_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006ERKS6_ = comdat any
$_ZNSt3__210__str_findB7v160006IcmNS_11char_traitsIcEELm4294967295EEET0_PKT_S3_S6_S3_S3_ = comdat any
$_ZNSt3__218__search_substringB7v160006IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_ = comdat any
$_ZNSt3__211char_traitsIcE4findEPKcmRS2_ = comdat any
$_ZNSt3__211char_traitsIcE7compareEPKcS3_m = 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
@.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 @_Z19filter_by_substringNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEES6_(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #0 {
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
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %7
7: ; preds = %23, %3
%8 = phi i32 [ 0, %3 ], [ %24, %23 ]
%9 = load ptr, ptr %6, align 4, !tbaa !10
%10 = load ptr, ptr %1, align 4, !tbaa !3
%11 = ptrtoint ptr %9 to i32
%12 = ptrtoint ptr %10 to i32
%13 = sub i32 %11, %12
%14 = sdiv exact i32 %13, 12
%15 = icmp ult i32 %8, %14
br i1 %15, label %16, label %25
16: ; preds = %7
%17 = getelementptr inbounds %"class.std::__2::basic_string", ptr %10, i32 %8
%18 = tail call noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB7v160006ERKS5_m(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %2, i32 noundef 0) #16
%19 = icmp eq i32 %18, -1
br i1 %19, label %23, label %20
20: ; preds = %16
%21 = load ptr, ptr %1, align 4, !tbaa !3
%22 = getelementptr inbounds %"class.std::__2::basic_string", ptr %21, i32 %8
tail 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) %22) #17
br label %23
23: ; preds = %16, %20
%24 = add nuw nsw i32 %8, 1
br label %7, !llvm.loop !12
25: ; preds = %7
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 nounwind optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB7v160006ERKS5_m(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2) local_unnamed_addr #2 comdat {
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%5 = load i8, ptr %4, align 1
%6 = icmp slt i8 %5, 0
%7 = load ptr, ptr %0, align 4
%8 = select i1 %6, ptr %7, ptr %0
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%10 = load i32, ptr %9, align 4
%11 = zext i8 %5 to i32
%12 = select i1 %6, i32 %10, i32 %11
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%14 = load i8, ptr %13, align 1
%15 = icmp slt i8 %14, 0
%16 = load ptr, ptr %1, align 4
%17 = select i1 %15, ptr %16, ptr %1
%18 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%19 = load i32, ptr %18, align 4
%20 = zext i8 %14 to i32
%21 = select i1 %15, i32 %19, i32 %20
%22 = tail call noundef i32 @_ZNSt3__210__str_findB7v160006IcmNS_11char_traitsIcEELm4294967295EEET0_PKT_S3_S6_S3_S3_(ptr noundef %8, i32 noundef %12, ptr noundef %17, i32 noundef %2, i32 noundef %21) #16
ret i32 %22
}
; 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 #3 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 !14
%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 #4
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef i32 @_ZNSt3__210__str_findB7v160006IcmNS_11char_traitsIcEELm4294967295EEET0_PKT_S3_S6_S3_S3_(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 comdat {
%6 = icmp ugt i32 %3, %1
br i1 %6, label %19, label %7
7: ; preds = %5
%8 = icmp eq i32 %4, 0
br i1 %8, label %19, label %9
9: ; preds = %7
%10 = getelementptr inbounds i8, ptr %0, i32 %3
%11 = getelementptr inbounds i8, ptr %0, i32 %1
%12 = getelementptr inbounds i8, ptr %2, i32 %4
%13 = tail call noundef ptr @_ZNSt3__218__search_substringB7v160006IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_(ptr noundef %10, ptr noundef %11, ptr noundef %2, ptr noundef nonnull %12) #16
%14 = icmp eq ptr %13, %11
%15 = ptrtoint ptr %13 to i32
%16 = ptrtoint ptr %0 to i32
%17 = sub i32 %15, %16
%18 = select i1 %14, i32 -1, i32 %17
br label %19
19: ; preds = %7, %5, %9
%20 = phi i32 [ %18, %9 ], [ -1, %5 ], [ %3, %7 ]
ret i32 %20
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__218__search_substringB7v160006IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 comdat {
%5 = alloca i8, align 1
%6 = ptrtoint ptr %3 to i32
%7 = ptrtoint ptr %2 to i32
%8 = sub i32 %6, %7
%9 = icmp eq ptr %3, %2
br i1 %9, label %34, label %10
10: ; preds = %4
%11 = ptrtoint ptr %1 to i32
%12 = ptrtoint ptr %0 to i32
%13 = sub i32 %11, %12
%14 = icmp slt i32 %13, %8
br i1 %14, label %34, label %15
15: ; preds = %10
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #18
%16 = load i8, ptr %2, align 1, !tbaa !15
store i8 %16, ptr %5, align 1, !tbaa !15
br label %17
17: ; preds = %30, %15
%18 = phi ptr [ %0, %15 ], [ %31, %30 ]
%19 = ptrtoint ptr %18 to i32
%20 = sub i32 %11, %19
%21 = icmp slt i32 %20, %8
br i1 %21, label %32, label %22
22: ; preds = %17
%23 = sub i32 %20, %8
%24 = add i32 %23, 1
%25 = call noundef ptr @_ZNSt3__211char_traitsIcE4findEPKcmRS2_(ptr noundef %18, i32 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %5) #16
%26 = icmp eq ptr %25, null
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = call noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef nonnull %25, ptr noundef nonnull %2, i32 noundef %8) #16
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = getelementptr inbounds i8, ptr %25, i32 1
br label %17, !llvm.loop !16
32: ; preds = %27, %22, %17
%33 = phi ptr [ %1, %17 ], [ %1, %22 ], [ %25, %27 ]
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #18
br label %34
34: ; preds = %32, %10, %4
%35 = phi ptr [ %0, %4 ], [ %33, %32 ], [ %1, %10 ]
ret ptr %35
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef ptr @_ZNSt3__211char_traitsIcE4findEPKcmRS2_(ptr noundef %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #6 comdat {
%4 = icmp eq i32 %1, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i8, ptr %2, align 1, !tbaa !15
%7 = sext i8 %6 to i32
%8 = tail call ptr @memchr(ptr noundef %0, i32 noundef %7, i32 noundef %1) #16
br label %9
9: ; preds = %3, %5
%10 = phi ptr [ %8, %5 ], [ null, %3 ]
ret ptr %10
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #6 comdat {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcmp(ptr noundef %0, ptr noundef %1, i32 noundef %2) #16
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare ptr @memchr(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #7
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i32 noundef) local_unnamed_addr #7
; 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 #3 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) #18
%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 !17
%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 !17
%25 = getelementptr inbounds %"class.std::__2::basic_string", ptr %24, i32 1
store ptr %25, ptr %21, align 4, !tbaa !17
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) #16
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #18
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 !21
br label %11
7: ; preds = %2
%8 = load ptr, ptr %1, align 4, !tbaa !15
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = load i32, ptr %9, align 4, !tbaa !15
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: 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) #8
; 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 #3 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 !14
%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 !14
%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 !24
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !27
%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 !17
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !28
%15 = getelementptr inbounds %"class.std::__2::basic_string", ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !14
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 !28
%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 !28
%10 = load ptr, ptr %0, align 4, !tbaa !14
store ptr %9, ptr %0, align 4, !tbaa !14
store ptr %10, ptr %7, align 4, !tbaa !14
%11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%12 = load ptr, ptr %4, align 4, !tbaa !14
%13 = load ptr, ptr %11, align 4, !tbaa !14
store ptr %13, ptr %4, align 4, !tbaa !14
store ptr %12, ptr %11, align 4, !tbaa !14
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3
%15 = load ptr, ptr %3, align 4, !tbaa !14
%16 = load ptr, ptr %14, align 4, !tbaa !14
store ptr %16, ptr %3, align 4, !tbaa !14
store ptr %15, ptr %14, align 4, !tbaa !14
%17 = load ptr, ptr %7, align 4, !tbaa !28
store ptr %17, ptr %1, align 4, !tbaa !27
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 #9 comdat {
tail call void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #16
%2 = load ptr, ptr %0, align 4, !tbaa !27
%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 #10 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #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 #11 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #18
%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 !29
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 #12 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 #11 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #18
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #16
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 #9
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #13
; 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) #18
%8 = ptrtoint ptr %3 to i32
store i32 %8, ptr %6, align 4, !tbaa !14
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #18
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 !31
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 !32
store i8 1, ptr %19, align 4, !tbaa !34
%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) #16
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #18
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #18
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 #9 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !34, !range !38, !noundef !39
%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) #16
br label %6
6: ; preds = %5, %1
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #14
; 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 !40
%3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !41
%5 = load ptr, ptr %4, align 4, !tbaa.struct !42
%6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !43
%8 = load ptr, ptr %7, align 4, !tbaa.struct !42
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 #12 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) #16
%9 = getelementptr inbounds %"class.std::__2::basic_string", ptr %5, i32 1
br label %4, !llvm.loop !44
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 #6 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !28
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) #16
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 #2 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 !17
%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 !17
%9 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #16
br label %4, !llvm.loop !45
10: ; preds = %4
ret void
}
; 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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { minsize optsize }
attributes #18 = { nounwind }
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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!5, !5, i64 0}
!15 = !{!6, !6, i64 0}
!16 = distinct !{!16, !13}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEELi1ELb0EEE", !5, i64 0}
!21 = !{i64 0, i64 4, !14, i64 4, i64 4, !22, i64 8, i64 4, !22, i64 11, i64 4, !22, i64 0, i64 11, !15, i64 11, i64 0, !15, i64 11, i64 1, !15, i64 11, i64 1, !15, i64 0, i64 12, !15}
!22 = !{!23, !23, i64 0}
!23 = !{!"long", !6, i64 0}
!24 = !{!25}
!25 = distinct !{!25, !26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m"}
!27 = !{!18, !5, i64 0}
!28 = !{!18, !5, i64 4}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !7, i64 0}
!31 = distinct !{!31, !13}
!32 = !{!33, !5, i64 0}
!33 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEE", !5, i64 0}
!34 = !{!35, !37, i64 12}
!35 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEEE", !36, i64 0, !37, i64 12}
!36 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8}
!37 = !{!"bool", !6, i64 0}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = !{!36, !5, i64 0}
!41 = !{!36, !5, i64 8}
!42 = !{i64 0, i64 4, !14}
!43 = !{!36, !5, i64 4}
!44 = distinct !{!44, !13}
!45 = distinct !{!45, !13}
| (module
(type (;0;) (func (param i32 i32 i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func (param i32) (result i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func (param i32 i32 i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func (;0;) (type 1)))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func (;1;) (type 1)))
(import "env" "_ZNSt3__211char_traitsIcE4findEPKcmRS2_" (func (;2;) (type 0)))
(import "env" "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func (;3;) (type 0)))
(import "env" "memchr" (func (;4;) (type 0)))
(import "env" "memcmp" (func (;5;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;6;) (type 3)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;7;) (type 4)))
(import "env" "_ZdlPv" (func (;8;) (type 5)))
(import "env" "__cxa_allocate_exception" (func (;9;) (type 2)))
(import "env" "__cxa_throw" (func (;10;) (type 4)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;11;) (type 3)))
(import "env" "_Znwm" (func (;12;) (type 2)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;13;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;14;) (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 (;15;) (type 6))
(func (;16;) (type 4) (param i32 i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 12
i32.div_s
local.get 8
i32.gt_u
if ;; label = @2
block (result i32) ;; label = @3
local.get 3
local.get 8
i32.const 12
i32.mul
local.tee 10
i32.add
local.tee 3
i32.load
local.get 3
local.get 3
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 5
select
local.set 9
local.get 3
i32.load offset=4
local.get 4
local.get 5
select
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.set 5
i32.const 0
local.get 2
i32.load offset=4
local.get 3
local.get 7
select
local.tee 6
i32.eqz
br_if 0 (;@3;)
drop
local.get 9
local.tee 3
i32.add
local.tee 11
local.set 4
global.get 0
i32.const 16
i32.sub
local.tee 7
global.set 0
block ;; label = @4
local.get 5
local.get 6
i32.add
local.tee 6
local.get 5
i32.eq
if ;; label = @5
local.get 3
local.set 4
br 1 (;@4;)
end
local.get 6
local.get 5
i32.sub
local.tee 6
local.get 4
local.get 3
i32.sub
i32.gt_s
br_if 0 (;@4;)
local.get 7
local.get 5
i32.load8_u
i32.store8 offset=15
loop (result i32) ;; label = @5
local.get 4
local.get 3
i32.sub
local.tee 12
local.get 6
i32.lt_s
br_if 1 (;@4;)
local.get 3
local.get 12
local.get 6
i32.sub
i32.const 1
i32.add
local.get 7
i32.const 15
i32.add
call 2
local.tee 3
i32.eqz
br_if 1 (;@4;)
local.get 3
local.get 5
local.get 6
call 3
if (result i32) ;; label = @6
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@5;)
else
local.get 3
end
end
local.set 4
end
local.get 7
i32.const 16
i32.add
global.set 0
i32.const -1
local.get 4
local.get 9
i32.sub
local.get 4
local.get 11
i32.eq
select
end
i32.const -1
i32.ne
if ;; label = @3
block ;; label = @4
local.get 1
i32.load
local.get 10
i32.add
local.set 3
local.get 0
i32.load offset=4
local.get 0
i32.load offset=8
i32.ne
if ;; label = @5
local.get 0
local.get 3
call 0
br 1 (;@4;)
end
local.get 0
local.get 3
call 1
end
end
local.get 8
i32.const 1
i32.add
local.set 8
br 1 (;@1;)
end
end)
(func (;17;) (type 1) (param i32 i32)
local.get 0
local.get 0
i32.load offset=4
local.get 1
call 6
i32.const 12
i32.add
i32.store offset=4)
(func (;18;) (type 1) (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 9
global.get 4
local.set 3
global.get 1
call 11
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 10
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 9
call 13
local.get 1
local.get 0
call 10
unreachable
end
local.get 4
i32.const 12
i32.mul
call 12
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 6
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 14
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 14
drop
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.tee 0
if ;; label = @1
local.get 0
call 8
end
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;19;) (type 0) (param i32 i32 i32) (result i32)
local.get 1
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 2
i32.load8_s
local.get 1
call 4)
(func (;20;) (type 0) (param i32 i32 i32) (result i32)
local.get 2
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 1
local.get 2
call 5)
(func (;21;) (type 3) (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 7
local.get 0)
(export "__wasm_call_ctors" (func 15))
(export "__wasm_apply_data_relocs" (func 15))
(export "_Z19filter_by_substringNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEES6_" (func 16))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func 17))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func 18))
(export "_ZNSt3__211char_traitsIcE4findEPKcmRS2_" (func 19))
(export "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func 20))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 21))
(data (;0;) (global.get 1) "vector\00"))
| 8 | 185 | 13,614 | 588 |
CPP/8 | /*
For a given vector of integers, return a vector consisting of a sum and a product of all the integers in a vector.
Empty sum should be equal to 0 and empty product should be equal to 1.
>>> sum_product({})
(0, 1)
>>> sum_product({1, 2, 3, 4})
(10, 24)
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> sum_product(vector<int> numbers){
| #include<stdio.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
vector<int> sum_product(vector<int> numbers){
| int sum=0,product=1;
for (int i=0;i<numbers.size();i++)
{
sum+=numbers[i];
product*=numbers[i];
}
return {sum,product};
}
| #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(sum_product({}) ,{0, 1}));
assert (issame(sum_product({1, 1, 1}), {3, 1}));
assert (issame(sum_product({100, 0}),{100, 0}));
assert (issame(sum_product({3, 5, 7}) , {3 + 5 + 7, 3 * 5 * 7}));
assert (issame(sum_product({10}) ,{10, 10}));
}
| #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(sum_product({}) ,{0, 1}));
assert (issame(sum_product({1, 2, 3,4}), {10, 24}));
}
| ; ModuleID = 'c_code_test/code_8.cpp'
source_filename = "c_code_test/code_8.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::initializer_list" = type { ptr, i32 }
%"struct.std::__2::__exception_guard_exceptions" = type <{ %"class.std::__2::vector<int>::__destroy_vector", i8, [3 x i8] }>
%"class.std::__2::vector<int>::__destroy_vector" = type { ptr }
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev = 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__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev = 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 mustprogress optsize
define void @_Z11sum_productNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::initializer_list", align 4
%4 = alloca [2 x i32], align 4
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%6 = load ptr, ptr %5, align 4, !tbaa !3
%7 = load ptr, ptr %1, align 4, !tbaa !10
%8 = ptrtoint ptr %6 to i32
%9 = ptrtoint ptr %7 to i32
%10 = sub i32 %8, %9
%11 = ashr exact i32 %10, 2
br label %12
12: ; preds = %21, %2
%13 = phi i32 [ 0, %2 ], [ %24, %21 ]
%14 = phi i32 [ 1, %2 ], [ %25, %21 ]
%15 = phi i32 [ 0, %2 ], [ %26, %21 ]
%16 = icmp eq i32 %15, %11
br i1 %16, label %17, label %21
17: ; preds = %12
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
store i32 %13, ptr %4, align 4, !tbaa !11
%18 = getelementptr inbounds i32, ptr %4, i32 1
store i32 %14, ptr %18, align 4, !tbaa !11
store ptr %4, ptr %3, align 4, !tbaa !13
%19 = getelementptr inbounds %"class.std::initializer_list", ptr %3, i32 0, i32 1
store i32 2, ptr %19, align 4, !tbaa !16
%20 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull byval(%"class.std::initializer_list") align 4 %3) #11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
ret void
21: ; preds = %12
%22 = getelementptr inbounds i32, ptr %7, i32 %15
%23 = load i32, ptr %22, align 4, !tbaa !11
%24 = add nsw i32 %23, %13
%25 = mul nsw i32 %23, %14
%26 = add nuw i32 %15, 1
br label %12, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; 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 optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef byval(%"class.std::initializer_list") align 4 %1) unnamed_addr #2 comdat {
%3 = alloca %"struct.std::__2::__exception_guard_exceptions", align 4
store ptr null, ptr %0, align 4, !tbaa !10
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !3
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %5, align 4, !tbaa !19
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
store ptr %0, ptr %3, align 4, !tbaa.struct !20, !alias.scope !22
%6 = getelementptr inbounds %"class.std::initializer_list", ptr %1, i32 0, i32 1
%7 = load i32, ptr %6, align 4, !tbaa !16
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %7) #11
%10 = load ptr, ptr %1, align 4, !tbaa !13
%11 = load ptr, ptr %4, align 4, !tbaa !3
%12 = shl nsw i32 %7, 2
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %11, ptr align 4 %10, i32 %12, i1 false), !noalias !25
%13 = getelementptr inbounds i32, ptr %11, i32 %7
store ptr %13, ptr %4, align 4, !tbaa !3
br label %14
14: ; preds = %9, %2
%15 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %3, i32 0, i32 1
store i8 1, ptr %15, align 4, !tbaa !36
%16 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(5) %3) #12
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #0 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) #13
unreachable
5: ; preds = %2
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%7 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #11, !noalias !40
store ptr %7, ptr %0, align 4, !tbaa !10
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !3
%9 = getelementptr inbounds i32, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !21
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(5) %0) unnamed_addr #3 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !36, !range !43, !noundef !44
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #12
br label %6
6: ; preds = %5, %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 #4 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #13
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #5 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #10
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #11
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #14
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 #6 comdat {
%3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #11
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !45
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #3
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 #6
; 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 #0 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() #13
unreachable
5: ; preds = %2
%6 = shl nuw i32 %1, 2
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #15
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #5 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #10
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #12
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #14
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #3
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #3
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #8
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #0 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !47
%3 = load ptr, ptr %2, align 4, !tbaa !10
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef nonnull %3) #16
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #9
attributes #0 = { minsize mustprogress 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 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { nounwind }
attributes #11 = { minsize optsize }
attributes #12 = { minsize nounwind optsize }
attributes #13 = { minsize noreturn optsize }
attributes #14 = { noreturn }
attributes #15 = { builtin minsize optsize allocsize(0) }
attributes #16 = { builtin minsize nounwind optsize }
!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 = !{!14, !5, i64 0}
!14 = !{!"_ZTSSt16initializer_listIiE", !5, i64 0, !15, i64 4}
!15 = !{!"long", !6, i64 0}
!16 = !{!14, !15, i64 4}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!9, !5, i64 0}
!20 = !{i64 0, i64 4, !21}
!21 = !{!5, !5, i64 0}
!22 = !{!23}
!23 = distinct !{!23, !24, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_: argument 0"}
!24 = distinct !{!24, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_"}
!25 = !{!26, !28, !30, !32, !34}
!26 = distinct !{!26, !27, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!28 = distinct !{!28, !29, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!29 = distinct !{!29, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!30 = distinct !{!30, !31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!31 = distinct !{!31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!32 = distinct !{!32, !33, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!33 = distinct !{!33, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!34 = distinct !{!34, !35, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!35 = distinct !{!35, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!36 = !{!37, !39, i64 4}
!37 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEE", !38, i64 0, !39, i64 4}
!38 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorE", !5, i64 0}
!39 = !{!"bool", !6, i64 0}
!40 = !{!41}
!41 = distinct !{!41, !42, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!42 = distinct !{!42, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!43 = !{i8 0, i8 2}
!44 = !{}
!45 = !{!46, !46, i64 0}
!46 = !{!"vtable pointer", !7, i64 0}
!47 = !{!38, !5, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "memmove" (func (;0;) (type 1)))
(import "env" "__cxa_allocate_exception" (func (;1;) (type 0)))
(import "env" "__cxa_throw" (func (;2;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;3;) (type 3)))
(import "env" "_Znwm" (func (;4;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;5;) (type 0)))
(import "env" "_ZdlPv" (func (;6;) (type 4)))
(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 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 3
global.set 0
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 5
i32.sub
i32.const 2
i32.shr_s
local.set 6
i32.const 1
local.set 2
i32.const 0
local.set 1
loop ;; label = @1
local.get 1
local.get 6
i32.eq
if ;; label = @2
local.get 3
i32.const 2
i32.store offset=28
local.get 3
local.get 2
i32.store offset=20
local.get 3
local.get 4
i32.store offset=16
local.get 3
local.get 3
i32.const 16
i32.add
i32.store offset=24
local.get 3
local.get 3
i64.load offset=24 align=4
i64.store offset=8
global.get 0
i32.const 16
i32.sub
local.tee 1
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 1
local.get 0
i32.store offset=8
local.get 3
i32.load offset=12
local.tee 2
if ;; label = @3
local.get 2
i32.const 1073741824
i32.ge_u
if ;; label = @4
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 1
global.get 4
local.set 2
global.get 1
call 3
local.tee 3
local.get 2
i32.const 8
i32.add
i32.store
local.get 3
local.get 1
local.get 0
call 2
unreachable
end
local.get 2
i32.const 1073741824
i32.ge_u
if ;; label = @4
global.get 5
local.set 0
global.get 6
local.set 1
i32.const 4
call 1
call 5
local.get 1
local.get 0
call 2
unreachable
end
local.get 0
local.get 2
i32.const 2
i32.shl
local.tee 2
call 4
local.tee 4
i32.store offset=4
local.get 0
local.get 4
i32.store
local.get 0
local.get 2
local.get 4
i32.add
i32.store offset=8
local.get 0
local.get 0
i32.load offset=4
local.get 3
i32.load offset=8
local.get 2
call 0
local.get 2
i32.add
i32.store offset=4
end
local.get 1
i32.const 1
i32.store8 offset=12
local.get 1
i32.load8_u offset=12
i32.eqz
if ;; label = @3
local.get 1
i32.load offset=8
local.tee 2
i32.load
local.tee 0
if ;; label = @4
local.get 2
local.get 0
i32.store offset=4
local.get 0
call 6
end
end
local.get 1
i32.const 16
i32.add
global.set 0
local.get 3
i32.const 32
i32.add
global.set 0
else
local.get 5
local.get 1
i32.const 2
i32.shl
i32.add
i32.load
local.tee 7
local.get 2
i32.mul
local.set 2
local.get 4
local.get 7
i32.add
local.set 4
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 7))
(export "__wasm_apply_data_relocs" (func 7))
(export "_Z11sum_productNSt3__26vectorIiNS_9allocatorIiEEEE" (func 8))
(data (;0;) (global.get 1) "vector\00"))
| 8 | 158 | 5,237 | 207 |
CPP/9 | /*
From a given vector of integers, generate a vector of rolling maximum element found until given moment
in the sequence.
>>> rolling_max({1, 2, 3, 2, 3, 4, 2})
{1, 2, 3, 3, 3, 4, 4}
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> rolling_max(vector<int> numbers){
| #include<stdio.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
vector<int> rolling_max(vector<int> numbers){
| vector<int> out;
int max=0;
for (int i=0;i<numbers.size();i++)
{
if (numbers[i]>max) max=numbers[i];
out.push_back(max);
}
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(rolling_max({}),{}));
assert (issame(rolling_max({1, 2, 3, 4}) , {1, 2, 3, 4}));
assert (issame(rolling_max({4, 3, 2, 1}),{4, 4, 4, 4}));
assert (issame(rolling_max({3, 2, 3, 100, 3}) ,{3, 3, 3, 100, 100}));
} | #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(rolling_max({1, 2, 3, 2, 3, 4, 2}),{1, 2, 3, 3, 3, 4, 4}));
}
| ; ModuleID = 'c_code_test/code_9.cpp'
source_filename = "c_code_test/code_9.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 @_Z11rolling_maxNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca i32, 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 4, ptr nonnull %3) #13
store i32 0, ptr %3, align 4, !tbaa !12
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %7
7: ; preds = %23, %2
%8 = phi i32 [ 0, %2 ], [ %24, %23 ]
%9 = load ptr, ptr %6, align 4, !tbaa !10
%10 = load ptr, ptr %1, align 4, !tbaa !3
%11 = ptrtoint ptr %9 to i32
%12 = ptrtoint ptr %10 to i32
%13 = sub i32 %11, %12
%14 = ashr exact i32 %13, 2
%15 = icmp ult i32 %8, %14
br i1 %15, label %17, label %16
16: ; preds = %7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #13
ret void
17: ; preds = %7
%18 = getelementptr inbounds i32, ptr %10, i32 %8
%19 = load i32, ptr %18, align 4, !tbaa !12
%20 = load i32, ptr %3, align 4, !tbaa !12
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 %19, ptr %3, align 4, !tbaa !12
br label %23
23: ; preds = %22, %17
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %3) #14
%24 = add nuw nsw i32 %8, 1
br label %7, !llvm.loop !14
}
; 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 !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 !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) #14
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: 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) #13
%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) #14
%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) #14
%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 !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 !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) #14
%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) #13
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 !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 !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) #14, !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 !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 !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 !12, !noalias !26
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !12, !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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
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) #13
%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 = { 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 = { 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 = { nounwind }
attributes #14 = { minsize optsize }
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, !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 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!5, !5, i64 0}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, 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, !5, i64 0}
!25 = !{!18, !5, 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", !7, 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)))
(type (;3;) (func (param i32 i32 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 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 1)))
(import "env" "__cxa_throw" (func (;3;) (type 3)))
(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 0) (param i32 i32)
(local i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 3
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 3
i32.const 0
i32.store offset=12
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 2
i32.sub
i32.const 2
i32.shr_s
local.get 4
i32.gt_u
if ;; label = @2
local.get 2
local.get 4
i32.const 2
i32.shl
i32.add
i32.load
local.tee 2
local.get 3
i32.load offset=12
i32.gt_s
if ;; label = @3
local.get 3
local.get 2
i32.store offset=12
end
local.get 3
i32.const 12
i32.add
local.set 2
block ;; label = @3
local.get 0
i32.load offset=4
local.tee 5
local.get 0
i32.load offset=8
i32.ne
if ;; label = @4
local.get 5
local.get 2
i32.load
i32.store
local.get 0
local.get 5
i32.const 4
i32.add
i32.store offset=4
br 1 (;@3;)
end
local.get 0
local.get 2
call 0
end
local.get 4
i32.const 1
i32.add
local.set 4
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 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 "_Z11rolling_maxNSt3__26vectorIiNS_9allocatorIiEEEE" (func 8))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 9))
(data (;0;) (global.get 1) "vector\00"))
| 9 | 177 | 7,132 | 338 |
CPP/10 | #include<stdio.h>
#include<string>
using namespace std;
bool is_palindrome(string str){
//Test if given string is a palindrome
string s(str.rbegin(),str.rend());
return s==str;
}
string make_palindrome(string str){
/*
Find the shortest palindrome that begins with a supplied string.
Algorithm idea is simple: - Find the longest postfix of supplied string that is a palindrome.
- Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
>>> make_palindrome("")
""
>>> make_palindrome("cat")
"catac"
>>> make_palindrome("cata")
"catac"
*/
| #include<stdio.h>
#include<string>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
bool is_palindrome(string str){
string s(str.rbegin(),str.rend());
return s==str;
}
string make_palindrome(string str){
| int i;
for (i=0;i<str.length();i++)
{
string rstr=str.substr(i);
if (is_palindrome(rstr))
{
string nstr;
nstr=str.substr(0,i);
string n2str(nstr.rbegin(),nstr.rend());
return str+n2str;
}
}
string n2str(str.rbegin(),str.rend());
return str+n2str;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (make_palindrome("") == "");
assert (make_palindrome("x") == "x");
assert (make_palindrome("xyz") == "xyzyx");
assert (make_palindrome("xyx") == "xyx") ;
assert (make_palindrome("jerry") == "jerryrrej");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (make_palindrome("") == "");
assert (make_palindrome("cat") == "catac");
assert (make_palindrome("cata") == "catac");
}
| ; ModuleID = 'c_code_test/code_10.cpp'
source_filename = "c_code_test/code_10.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__211char_traitsIcE7compareEPKcS3_m = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
@.str = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define noundef zeroext i1 @_Z13is_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #15
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
%6 = load ptr, ptr %0, align 4
%7 = select i1 %5, ptr %6, ptr %0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = getelementptr inbounds i8, ptr %7, i32 %11
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr %12, ptr %7) #16
%13 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %0) #17
%14 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #15
ret i1 %13
}
; 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 nounwind optsize
define linkonce_odr hidden noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%7 = load i32, ptr %6, align 4
%8 = zext i8 %4 to i32
%9 = select i1 %5, i32 %7, i32 %8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%11 = load i8, ptr %10, align 1
%12 = icmp slt i8 %11, 0
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%14 = load i32, ptr %13, align 4
%15 = zext i8 %11 to i32
%16 = select i1 %12, i32 %14, i32 %15
%17 = icmp eq i32 %9, %16
br i1 %17, label %18, label %38
18: ; preds = %2
%19 = load ptr, ptr %1, align 4
%20 = select i1 %12, ptr %19, ptr %1
br i1 %5, label %21, label %25
21: ; preds = %18
%22 = load ptr, ptr %0, align 4
%23 = tail call noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %22, ptr noundef %20, i32 noundef %7) #17
%24 = icmp eq i32 %23, 0
br label %38
25: ; preds = %18, %34
%26 = phi i32 [ %35, %34 ], [ %8, %18 ]
%27 = phi ptr [ %36, %34 ], [ %0, %18 ]
%28 = phi ptr [ %37, %34 ], [ %20, %18 ]
%29 = icmp eq i32 %26, 0
br i1 %29, label %38, label %30
30: ; preds = %25
%31 = load i8, ptr %27, align 1, !tbaa !3
%32 = load i8, ptr %28, align 1, !tbaa !3
%33 = icmp eq i8 %31, %32
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = add nsw i32 %26, -1
%36 = getelementptr inbounds i8, ptr %27, i32 1
%37 = getelementptr inbounds i8, ptr %28, i32 1
br label %25, !llvm.loop !6
38: ; preds = %30, %25, %21, %2
%39 = phi i1 [ false, %2 ], [ %24, %21 ], [ %29, %25 ], [ %29, %30 ]
ret i1 %39
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define void @_Z15make_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
%8 = alloca %"class.std::__2::basic_string", align 4
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %11
11: ; preds = %38, %2
%12 = phi i32 [ 0, %2 ], [ %40, %38 ]
%13 = load i8, ptr %9, align 1
%14 = icmp slt i8 %13, 0
%15 = load i32, ptr %10, align 4
%16 = zext i8 %13 to i32
%17 = select i1 %14, i32 %15, i32 %16
%18 = icmp ult i32 %12, %17
br i1 %18, label %19, label %41
19: ; preds = %11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #15
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %12, i32 noundef -1) #16
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %3) #16
%21 = call noundef zeroext i1 @_Z13is_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef nonnull %4) #16
%22 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #17
br i1 %21, label %23, label %38
23: ; preds = %19
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #15
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %5, i8 0, i32 12, i1 false)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #15
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef 0, i32 noundef %12) #16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %6) #17
%24 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #15
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #15
%25 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %5, i32 0, i32 2
%26 = load i8, ptr %25, align 1
%27 = icmp slt i8 %26, 0
%28 = load ptr, ptr %5, align 4
%29 = select i1 %27, ptr %28, ptr %5
%30 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %5, i32 0, i32 1
%31 = load i32, ptr %30, align 4
%32 = zext i8 %26 to i32
%33 = select i1 %27, i32 %31, i32 %32
%34 = getelementptr inbounds i8, ptr %29, i32 %33
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr %34, ptr %29) #16
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %7) #16
%35 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #15
%36 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #15
%37 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #15
br label %46
38: ; preds = %19
%39 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #15
%40 = add nuw nsw i32 %12, 1
br label %11, !llvm.loop !8
41: ; preds = %11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #15
%42 = load ptr, ptr %1, align 4
%43 = select i1 %14, ptr %42, ptr %1
%44 = getelementptr inbounds i8, ptr %43, i32 %17
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr %44, ptr %43) #16
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %8) #16
%45 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #15
br label %46
46: ; preds = %23, %41
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 comdat {
%5 = alloca %"class.std::__2::allocator", align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #15
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(1) %5) #16
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #15
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 !9
br label %11
7: ; preds = %2
%8 = load ptr, ptr %1, align 4, !tbaa !3
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = load i32, ptr %9, align 4, !tbaa !3
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) #16
br label %11
11: ; preds = %7, %6
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%13 = load i8, ptr %12, align 1
%14 = icmp slt i8 %13, 0
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
%16 = load i32, ptr %15, align 4
%17 = zext i8 %13 to i32
%18 = select i1 %14, i32 %16, i32 %17
%19 = add i32 %18, %11
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #15
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #16
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #15
%21 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%22 = load i8, ptr %21, align 1
%23 = icmp slt i8 %22, 0
%24 = load ptr, ptr %0, align 4
%25 = select i1 %23, ptr %24, ptr %0
%26 = load i8, ptr %5, align 1
%27 = icmp slt i8 %26, 0
%28 = load ptr, ptr %1, align 4
%29 = select i1 %27, ptr %28, ptr %1
%30 = icmp ult ptr %29, %25
%31 = getelementptr inbounds i8, ptr %25, i32 %11
%32 = icmp ule ptr %31, %29
%33 = or i1 %30, %32
call void @llvm.assume(i1 %33)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %25, ptr align 1 %29, i32 %11, i1 false), !noalias !14
%34 = load i8, ptr %12, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %2, align 4
%37 = select i1 %35, ptr %36, ptr %2
%38 = icmp ult ptr %37, %31
%39 = getelementptr inbounds i8, ptr %31, i32 %18
%40 = icmp ule ptr %39, %37
%41 = or i1 %38, %40
call void @llvm.assume(i1 %41)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %31, ptr align 1 %37, i32 %18, i1 false), !noalias !25
store i8 0, ptr %39, align 1, !tbaa !3
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4
; 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) #5
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr %2) local_unnamed_addr #6 comdat {
%4 = ptrtoint ptr %1 to i32
%5 = ptrtoint ptr %2 to i32
%6 = sub i32 %4, %5
%7 = icmp ugt i32 %6, 2147483631
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
unreachable
9: ; preds = %3
%10 = icmp ult i32 %6, 11
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = trunc i32 %6 to i8
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %12, ptr %13, align 1
br label %21
14: ; preds = %9
%15 = or i32 %6, 15
%16 = add nuw i32 %15, 1
%17 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %16) #19, !noalias !36
store ptr %17, ptr %0, align 4, !tbaa !3
%18 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%19 = or i32 %16, -2147483648
store i32 %19, ptr %18, align 4
%20 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %6, ptr %20, align 4, !tbaa !3
br label %21
21: ; preds = %14, %11
%22 = phi ptr [ %0, %11 ], [ %17, %14 ]
br label %23
23: ; preds = %21, %27
%24 = phi ptr [ %28, %27 ], [ %1, %21 ]
%25 = phi ptr [ %30, %27 ], [ %22, %21 ]
%26 = icmp eq ptr %24, %2
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = getelementptr inbounds i8, ptr %24, i32 -1
%29 = load i8, ptr %28, align 1, !tbaa !3
store i8 %29, ptr %25, align 1, !tbaa !3
%30 = getelementptr inbounds i8, ptr %25, i32 1
br label %23, !llvm.loop !39
31: ; preds = %23
store i8 0, ptr %25, align 1, !tbaa !3
ret void
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #18
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #15
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #16
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #20
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) #16
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !40
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #10
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #11
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #12 comdat {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcmp(ptr noundef %0, ptr noundef %1, i32 noundef %2) #17
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i32 noundef) local_unnamed_addr #13
; Function Attrs: minsize optsize
declare noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #14
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #21
br label %8
8: ; preds = %6, %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 !9
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #19
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #5
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 nounwind 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: readwrite) }
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 mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #11 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #15 = { nounwind }
attributes #16 = { minsize optsize }
attributes #17 = { minsize nounwind optsize }
attributes #18 = { minsize noreturn optsize }
attributes #19 = { builtin minsize optsize allocsize(0) }
attributes #20 = { noreturn }
attributes #21 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = distinct !{!8, !7}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !12, i64 8, i64 4, !12, i64 11, i64 4, !12, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !4, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !4, i64 0}
!14 = !{!15, !17, !19, !21, !23}
!15 = distinct !{!15, !16, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!17 = distinct !{!17, !18, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!19 = distinct !{!19, !20, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!20 = distinct !{!20, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!21 = distinct !{!21, !22, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!22 = distinct !{!22, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!23 = distinct !{!23, !24, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!24 = distinct !{!24, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!25 = !{!26, !28, !30, !32, !34}
!26 = distinct !{!26, !27, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!28 = distinct !{!28, !29, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!29 = distinct !{!29, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!30 = distinct !{!30, !31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!31 = distinct !{!31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!32 = distinct !{!32, !33, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!33 = distinct !{!33, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!34 = distinct !{!34, !35, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!35 = distinct !{!35, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!36 = !{!37}
!37 = distinct !{!37, !38, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!38 = distinct !{!38, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!39 = distinct !{!39, !7}
!40 = !{!41, !41, i64 0}
!41 = !{!"vtable pointer", !5, i64 0}
| (module
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32) (result i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func))
(type (;5;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;6;) (func (param i32)))
(type (;7;) (func (param i32 i32)))
(type (;8;) (func (param i32 i32 i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 1)))
(import "env" "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func (;2;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;3;) (type 3)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_" (func (;4;) (type 5)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;5;) (type 0)))
(import "env" "memmove" (func (;6;) (type 2)))
(import "env" "_Znwm" (func (;7;) (type 1)))
(import "env" "__cxa_allocate_exception" (func (;8;) (type 1)))
(import "env" "__cxa_throw" (func (;9;) (type 0)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;10;) (type 3)))
(import "env" "memcmp" (func (;11;) (type 2)))
(import "env" "_ZdlPv" (func (;12;) (type 6)))
(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 "env" "memory" (memory (;0;) 1))
(func (;13;) (type 4))
(func (;14;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
local.get 6
i32.const 4
i32.add
local.tee 7
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.tee 1
local.get 0
i32.load offset=4
local.get 4
local.get 2
select
i32.add
local.get 1
call 0
block ;; label = @1
local.get 7
local.tee 1
i32.load offset=4
local.tee 8
local.get 1
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
local.tee 4
i32.const 0
i32.lt_s
select
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
local.tee 2
i32.const 0
i32.lt_s
select
i32.ne
br_if 0 (;@1;)
local.get 0
i32.load
local.get 0
local.get 2
i32.const 0
i32.lt_s
select
local.set 0
local.get 4
i32.const 0
i32.ge_s
if ;; label = @2
loop ;; label = @3
local.get 3
i32.eqz
local.set 5
local.get 3
i32.eqz
br_if 2 (;@1;)
local.get 1
i32.load8_u
local.get 0
i32.load8_u
i32.ne
br_if 2 (;@1;)
local.get 0
i32.const 1
i32.add
local.set 0
local.get 1
i32.const 1
i32.add
local.set 1
local.get 3
i32.const 1
i32.sub
local.set 3
br 0 (;@3;)
end
unreachable
end
local.get 1
i32.load
local.get 0
local.get 8
call 2
i32.eqz
local.set 5
end
local.get 7
call 1
drop
local.get 6
i32.const 16
i32.add
global.set 0
local.get 5)
(func (;15;) (type 0) (param i32 i32 i32)
(local i32 i32 i32)
local.get 1
local.get 2
i32.sub
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @1
block ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
local.get 3
i32.store8 offset=11
br 1 (;@2;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 5
call 7
local.set 4
local.get 0
local.get 5
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
local.get 4
i32.store
local.get 0
local.get 3
i32.store offset=4
local.get 4
local.set 0
end
loop ;; label = @2
local.get 1
local.get 2
i32.eq
i32.eqz
if ;; label = @3
local.get 0
local.get 1
i32.const 1
i32.sub
local.tee 1
i32.load8_u
i32.store8
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@2;)
end
end
local.get 0
i32.const 0
i32.store8
return
end
call 21
unreachable)
(func (;16;) (type 2) (param i32 i32 i32) (result i32)
local.get 2
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 1
local.get 2
call 11)
(func (;17;) (type 7) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const -64
i32.add
local.tee 3
global.set 0
block ;; label = @1
loop ;; label = @2
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
local.tee 6
i32.const 0
i32.lt_s
select
local.tee 5
local.get 4
i32.gt_u
if ;; label = @3
local.get 3
i32.const 52
i32.add
local.tee 6
local.get 1
local.get 4
i32.const -1
call 18
local.get 3
i32.const 40
i32.add
local.get 6
call 3
local.tee 2
call 14
local.get 2
call 1
drop
if ;; label = @4
local.get 3
i32.const 0
i32.store offset=32
local.get 3
i64.const 0
i64.store offset=24
local.get 3
i32.const 12
i32.add
local.tee 2
local.get 1
i32.const 0
local.get 4
call 18
local.get 3
i32.const 24
i32.add
local.tee 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @5
local.get 4
i32.load
call 12
end
local.get 4
local.get 2
i64.load align=4
i64.store align=4
local.get 4
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 2
call 1
drop
local.get 2
local.get 3
i32.load offset=24
local.get 4
local.get 3
i32.load8_s offset=35
local.tee 5
i32.const 0
i32.lt_s
local.tee 7
select
local.tee 8
local.get 3
i32.load offset=28
local.get 5
i32.const 255
i32.and
local.get 7
select
i32.add
local.get 8
call 0
local.get 0
local.get 1
local.get 2
call 20
local.get 3
i32.const 12
i32.add
call 1
drop
local.get 4
call 1
drop
local.get 6
call 1
drop
br 3 (;@1;)
else
local.get 4
i32.const 1
i32.add
local.set 4
local.get 3
i32.const 52
i32.add
call 1
drop
br 2 (;@2;)
end
unreachable
end
end
local.get 3
i32.const 52
i32.add
local.tee 2
local.get 1
i32.load
local.get 1
local.get 6
i32.const 0
i32.lt_s
select
local.tee 4
local.get 5
i32.add
local.get 4
call 0
local.get 0
local.get 1
local.get 2
call 20
local.get 2
call 1
drop
end
local.get 3
i32.const -64
i32.sub
global.set 0)
(func (;18;) (type 8) (param i32 i32 i32 i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 0
local.get 1
local.get 2
local.get 3
local.get 4
i32.const 15
i32.add
call 4
drop
local.get 4
i32.const 16
i32.add
global.set 0)
(func (;19;) (type 3) (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 5
local.get 0)
(func (;20;) (type 0) (param i32 i32 i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
block (result i32) ;; label = @1
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 4
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
select
local.tee 5
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 3
i32.store8 offset=11
local.get 0
br 2 (;@1;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 7
call 7
local.set 8
local.get 0
local.get 3
i32.store offset=4
local.get 0
local.get 8
i32.store
local.get 0
local.get 7
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@1;)
end
call 21
unreachable
end
local.tee 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 5
call 6
local.get 5
i32.add
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 4
call 6
local.get 4
i32.add
i32.const 0
i32.store8
local.get 6
i32.const 16
i32.add
global.set 0)
(func (;21;) (type 4)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 8
global.get 4
local.set 3
global.get 1
call 10
local.tee 0
local.get 3
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 9
unreachable)
(export "__wasm_call_ctors" (func 13))
(export "__wasm_apply_data_relocs" (func 13))
(export "_Z13is_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 14))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_" (func 15))
(export "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func 16))
(export "_Z15make_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 17))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 19))
(data (;0;) (global.get 1) "basic_string\00"))
| 15 | 347 | 13,221 | 579 |
CPP/11 | /*
Input are two strings a and b consisting only of 1s and 0s.
Perform binary XOR on these inputs and return result also as a string.
>>> string_xor("010", "110")
"100"
*/
#include<stdio.h>
#include<string>
using namespace std;
string string_xor(string a,string b){
| #include<stdio.h>
#include<string>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
string string_xor(string a,string b){
| string output="";
for (int i=0;(i<a.length() and i<b.length());i++)
{
if (i<a.length() and i<b.length())
{
if (a[i]== b[i])
{
output+='0';
}
else output+='1';
}
else
{
if (i>=a.length())
{
output+=b[i];
}
else output+=a[i];
}
}
return output;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (string_xor("111000", "101010") == "010010");
assert (string_xor("1", "1") == "0");
assert (string_xor("0101", "0000") == "0101");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (string_xor("010", "110") == "100");
}
| ; ModuleID = 'c_code_test/code_11.cpp'
source_filename = "c_code_test/code_11.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
; Function Attrs: minsize mustprogress optsize
define void @_Z10string_xorNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
%4 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #5
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%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
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
br label %9
9: ; preds = %24, %3
%10 = phi i32 [ 0, %3 ], [ %35, %24 ]
%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 %36
17: ; preds = %9
%18 = load i8, ptr %5, align 1
%19 = icmp slt i8 %18, 0
%20 = load i32, ptr %8, align 4
%21 = zext i8 %18 to i32
%22 = select i1 %19, i32 %20, i32 %21
%23 = icmp ult i32 %10, %22
br i1 %23, label %24, label %36
24: ; preds = %17
%25 = load ptr, ptr %1, align 4
%26 = select i1 %12, ptr %25, ptr %1
%27 = getelementptr inbounds i8, ptr %26, i32 %10
%28 = load i8, ptr %27, align 1, !tbaa !3
%29 = load ptr, ptr %2, align 4
%30 = select i1 %19, ptr %29, ptr %2
%31 = getelementptr inbounds i8, ptr %30, i32 %10
%32 = load i8, ptr %31, align 1, !tbaa !3
%33 = icmp eq i8 %28, %32
%34 = select i1 %33, i8 48, i8 49
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %34) #5
%35 = add nuw nsw i32 %10, 1
br label %9, !llvm.loop !6
36: ; preds = %17, %9
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #1 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #5
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #2
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #3
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; 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 #1
attributes #0 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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(inaccessiblemem: write) }
attributes #3 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize optsize }
attributes #6 = { minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32 i32 i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32) (result i32)))
(type (;4;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc" (func (;1;) (type 2)))
(import "env" "strlen" (func (;2;) (type 3)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 1)))
(import "env" "__memory_base" (global (;0;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;4;) (type 4))
(func (;5;) (type 1) (param i32 i32 i32)
(local i32 i32 i32)
local.get 0
global.get 0
call 0
local.set 5
i32.const 0
local.set 0
loop ;; label = @1
block ;; label = @2
local.get 0
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
i32.ge_u
br_if 0 (;@2;)
local.get 0
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 4
select
i32.ge_u
br_if 0 (;@2;)
local.get 5
i32.const 48
i32.const 49
local.get 1
i32.load
local.get 1
local.get 3
select
local.get 0
i32.add
i32.load8_u
local.get 2
i32.load
local.get 2
local.get 4
select
local.get 0
i32.add
i32.load8_u
i32.eq
select
call 1
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end)
(func (;6;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 4))
(export "__wasm_apply_data_relocs" (func 4))
(export "_Z10string_xorNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_" (func 5))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 6))
(data (;0;) (global.get 0) "\00"))
| 22 | 441 | 2,511 | 92 |
CPP/12 | /*
Out of vector of strings, return the longest one. Return the first one in case of multiple
strings of the same length. Return None in case the input vector is empty.
>>> longest({})
>>> longest({"a", "b", "c"})
"a"
>>> longest({"a", "bb", "ccc"})
"ccc"
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
string longest(vector<string> strings){
| #include<stdio.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
string longest(vector<string> strings){
| string out;
for (int i=0;i<strings.size();i++)
{
if (strings[i].length()>out.length()) out=strings[i];
}
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (longest({}) == "");
assert (longest({"x", "y", "z"}) == "x");
assert (longest({"x", "yyy", "zzzz", "www", "kkkk", "abc"}) == "zzzz");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (longest({}) == "");
assert (longest({"a", "b", "c"}) == "a");
assert (longest({"a", "bb", "ccc"}) == "ccc");
}
| ; ModuleID = 'c_code_test/code_12.cpp'
source_filename = "c_code_test/code_12.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::vector" = type { ptr, ptr, %"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 { ptr }
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_ = comdat any
; Function Attrs: minsize optsize
define void @_Z7longestNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
br label %6
6: ; preds = %32, %2
%7 = phi i32 [ 0, %2 ], [ %33, %32 ]
%8 = load ptr, ptr %3, align 4, !tbaa !3
%9 = load ptr, ptr %1, align 4, !tbaa !10
%10 = ptrtoint ptr %8 to i32
%11 = ptrtoint ptr %9 to i32
%12 = sub i32 %10, %11
%13 = sdiv exact i32 %12, 12
%14 = icmp ult i32 %7, %13
br i1 %14, label %15, label %34
15: ; preds = %6
%16 = getelementptr inbounds %"class.std::__2::basic_string", ptr %9, i32 %7
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %16, i32 0, i32 2
%18 = load i8, ptr %17, align 1
%19 = icmp slt i8 %18, 0
%20 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %16, i32 0, i32 1
%21 = load i32, ptr %20, align 4
%22 = zext i8 %18 to i32
%23 = select i1 %19, i32 %21, i32 %22
%24 = load i8, ptr %4, align 1
%25 = icmp slt i8 %24, 0
%26 = load i32, ptr %5, align 4
%27 = zext i8 %24 to i32
%28 = select i1 %25, i32 %26, i32 %27
%29 = icmp ugt i32 %23, %28
br i1 %29, label %30, label %32
30: ; preds = %15
%31 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %16) #4
br label %32
32: ; preds = %15, %30
%33 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !11
34: ; preds = %6
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #1 comdat {
%3 = icmp eq ptr %0, %1
br i1 %3, label %26, label %4
4: ; preds = %2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%9 = load i8, ptr %8, align 1
%10 = icmp slt i8 %9, 0
br i1 %7, label %18, label %11
11: ; preds = %4
br i1 %10, label %13, label %12
12: ; preds = %11
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 !13
br label %26
13: ; preds = %11
%14 = load ptr, ptr %1, align 4
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%16 = load i32, ptr %15, align 4
%17 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_no_aliasILb1EEERS5_PKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %14, i32 noundef %16) #4
br label %26
18: ; preds = %4
%19 = load ptr, ptr %1, align 4
%20 = select i1 %10, ptr %19, ptr %1
%21 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%22 = load i32, ptr %21, align 4
%23 = zext i8 %9 to i32
%24 = select i1 %10, i32 %22, i32 %23
%25 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_no_aliasILb0EEERS5_PKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %20, i32 noundef %24) #4
br label %26
26: ; preds = %2, %12, %18, %13
%27 = phi ptr [ %25, %18 ], [ %17, %13 ], [ %0, %12 ], [ %0, %2 ]
ret ptr %27
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #2
; 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) #3
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_no_aliasILb1EEERS5_PKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #0
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_no_aliasILb0EEERS5_PKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #0
attributes #0 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { minsize optsize }
!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__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 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 11, i64 4, !15, i64 0, i64 11, !17, i64 11, i64 0, !17, i64 11, i64 1, !17, i64 11, i64 1, !17, i64 0, i64 12, !17}
!14 = !{!5, !5, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !6, i64 0}
!17 = !{!6, !6, i64 0}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32 i32 i32) (result i32)))
(type (;2;) (func))
(type (;3;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_no_aliasILb1EEERS5_PKcm" (func (;1;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_no_aliasILb0EEERS5_PKcm" (func (;2;) (type 1)))
(import "env" "memory" (memory (;0;) 0))
(func (;3;) (type 2))
(func (;4;) (type 3) (param i32 i32)
(local i32 i32 i32)
local.get 0
i64.const 0
i64.store align=4
local.get 0
i32.const 0
i32.store offset=8
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 12
i32.div_s
local.get 2
i32.gt_u
if ;; label = @2
local.get 3
local.get 2
i32.const 12
i32.mul
i32.add
local.tee 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
select
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
select
i32.gt_u
if ;; label = @3
local.get 0
local.get 3
call 0
drop
end
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end)
(func (;5;) (type 0) (param i32 i32) (result i32)
(local i32 i32)
local.get 0
local.get 1
i32.ne
if (result i32) ;; label = @1
local.get 1
i32.load8_u offset=11
local.tee 3
i32.extend8_s
local.set 2
local.get 0
i32.load8_s offset=11
i32.const 0
i32.ge_s
if ;; label = @2
local.get 2
i32.const 0
i32.ge_s
if ;; label = @3
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 1
return
end
local.get 0
local.get 1
i32.load
local.get 1
local.get 2
i32.const 0
i32.lt_s
local.tee 0
select
local.get 1
i32.load offset=4
local.get 3
local.get 0
select
call 2
else
local.get 0
end)
(export "__wasm_call_ctors" (func 3))
(export "__wasm_apply_data_relocs" (func 3))
(export "_Z7longestNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE" (func 4))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_" (func 5)))
| 7 | 147 | 3,209 | 130 |
CPP/13 | /*
Return a greatest common divisor of two integers a and b
>>> greatest_common_divisor(3, 5)
1
>>> greatest_common_divisor(25, 15)
5
*/
#include<stdio.h>
using namespace std;
int greatest_common_divisor(int a, int b){
| #include<stdio.h>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
int greatest_common_divisor(int a, int b){
| int out,m;
while (true){
if (a<b)
{
m=a;a=b;b=m;
}
a=a%b;
if (a==0) return b;
}
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (greatest_common_divisor(3, 7) == 1);
assert (greatest_common_divisor(10, 15) == 5);
assert (greatest_common_divisor(49, 14) == 7);
assert (greatest_common_divisor(144, 60) == 12);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (greatest_common_divisor(3, 5) == 1);
assert (greatest_common_divisor(25, 15) == 5);
}
| ; ModuleID = 'c_code_test/code_13.cpp'
source_filename = "c_code_test/code_13.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z23greatest_common_divisorii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %8, %3 ]
%6 = tail call i32 @llvm.smin.i32(i32 %5, i32 %4)
%7 = tail call i32 @llvm.smax.i32(i32 %5, i32 %4)
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3, !llvm.loop !3
10: ; preds = %3
ret i32 %6
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
loop ;; label = @1
local.get 0
local.get 1
local.get 0
local.get 1
i32.gt_s
select
local.get 0
local.get 1
local.get 0
local.get 1
i32.lt_s
select
local.tee 1
i32.rem_s
local.tee 0
br_if 0 (;@1;)
end
local.get 1)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z23greatest_common_divisorii" (func 1)))
| 10 | 147 | 619 | 27 |
CPP/14 | /*
Return vector of all prefixes from shortest to longest of the input string
>>> all_prefixes("abc")
{"a", "ab", "abc"}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<string> all_prefixes(string str){
| #include<stdio.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<math.h>
#include<stdlib.h>
vector<string> all_prefixes(string str){
| vector<string> out;
string current="";
for (int i=0;i<str.length();i++)
{
current=current+str[i];
out.push_back(current);
}
return out;
}
| #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(all_prefixes(""),{}));
assert (issame(all_prefixes("asdfgh") ,{"a", "as", "asd", "asdf", "asdfg", "asdfgh"}));
assert (issame(all_prefixes("WWW") ,{"W", "WW", "WWW"}));
}
| #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(all_prefixes("abc"),{"a","ab","abc"}));
}
| ; ModuleID = 'c_code_test/code_14.cpp'
source_filename = "c_code_test/code_14.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 }
%"class.std::__2::allocator.4" = type { i8 }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.8" }
%"class.std::__2::__compressed_pair.8" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.9" }
%"struct.std::__2::__compressed_pair_elem.9" = 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__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006ERKS6_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = 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__29allocatorINS_12basic_stringIcNS_11char_traitsIcEENS0_IcEEEEE8allocateB7v160006Em = 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
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"basic_string\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
@.str.2 = private unnamed_addr constant [7 x i8] c"vector\00", align 1
; Function Attrs: minsize optsize
define void @_Z12all_prefixesNSt3__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 %"class.std::__2::basic_string", 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) #18
%7 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #19
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %10
10: ; preds = %20, %2
%11 = phi i32 [ 0, %2 ], [ %26, %20 ]
%12 = load i8, ptr %8, align 1
%13 = icmp slt i8 %12, 0
%14 = load i32, ptr %9, 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 %20, label %18
18: ; preds = %10
%19 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #18
ret void
20: ; preds = %10
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #18
%21 = load ptr, ptr %1, align 4
%22 = select i1 %13, ptr %21, ptr %1
%23 = getelementptr inbounds i8, ptr %22, i32 %11
%24 = load i8, ptr %23, align 1, !tbaa !12
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext %24) #19
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4) #20
%25 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #18
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) #19
%26 = add nuw nsw i32 %11, 1
br label %10, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #20
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #19
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator.4", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #18
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #19
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #18
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !15
store i8 %2, ptr %24, align 1, !tbaa !12
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !12
ret void
}
; 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 #2
; 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 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 #3 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 !26
%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) #19
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) #19
br label %10
10: ; preds = %9, %8
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.1) #21
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #18
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #19
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #22
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) #19
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !27
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #8 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #18
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #20
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #22
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #21
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #23
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !12
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !12
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; 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) #11
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #14 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !12
tail call void @_ZdlPv(ptr noundef %7) #24
br label %8
8: ; preds = %6, %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 !29
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !12
ret void
}
; 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) #19
%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 #3 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) #18
%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) #19
%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) #19
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !32
%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) #19
%24 = load ptr, ptr %21, align 4, !tbaa !32
%25 = getelementptr inbounds %"class.std::__2::basic_string", ptr %24, i32 1
store ptr %25, ptr %21, align 4, !tbaa !32
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) #19
%26 = call noundef ptr @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #20
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #18
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 !29
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) #19
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 #3 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) #21
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 !26
%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 !26
%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) #19, !noalias !36
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !39
%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 !32
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !40
%15 = getelementptr inbounds %"class.std::__2::basic_string", ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !26
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 !40
%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) #19
store ptr %9, ptr %7, align 4, !tbaa !40
%10 = load ptr, ptr %0, align 4, !tbaa !26
store ptr %9, ptr %0, align 4, !tbaa !26
store ptr %10, ptr %7, align 4, !tbaa !26
%11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%12 = load ptr, ptr %4, align 4, !tbaa !26
%13 = load ptr, ptr %11, align 4, !tbaa !26
store ptr %13, ptr %4, align 4, !tbaa !26
store ptr %12, ptr %11, align 4, !tbaa !26
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3
%15 = load ptr, ptr %3, align 4, !tbaa !26
%16 = load ptr, ptr %14, align 4, !tbaa !26
store ptr %16, ptr %3, align 4, !tbaa !26
store ptr %15, ptr %14, align 4, !tbaa !26
%17 = load ptr, ptr %7, align 4, !tbaa !40
store ptr %17, ptr %1, align 4, !tbaa !39
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 #9 comdat {
tail call void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #20
%2 = load ptr, ptr %0, align 4, !tbaa !39
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #24
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 #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.2) #21
unreachable
}
; 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 #15 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() #21
unreachable
5: ; preds = %2
%6 = mul nuw i32 %1, 12
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #23
ret ptr %7
}
; 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) #18
%8 = ptrtoint ptr %3 to i32
store i32 %8, ptr %6, align 4, !tbaa !26
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #18
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 !41
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 !42
store i8 1, ptr %19, align 4, !tbaa !44
%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) #20
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #18
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #18
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 #9 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !44, !range !48, !noundef !49
%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) #20
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 !50
%3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !51
%5 = load ptr, ptr %4, align 4, !tbaa.struct !52
%6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !53
%8 = load ptr, ptr %7, align 4, !tbaa.struct !52
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) #19
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 #15 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) #20
%9 = getelementptr inbounds %"class.std::__2::basic_string", ptr %5, i32 1
br label %4, !llvm.loop !54
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 #16 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !40
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) #20
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 !32
%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 !32
%9 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #20
br label %4, !llvm.loop !55
10: ; preds = %4
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #17
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize mustprogress 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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #16 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #17 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #18 = { nounwind }
attributes #19 = { minsize optsize }
attributes #20 = { minsize nounwind optsize }
attributes #21 = { minsize noreturn optsize }
attributes #22 = { noreturn }
attributes #23 = { builtin minsize optsize allocsize(0) }
attributes #24 = { builtin minsize nounwind optsize }
!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 = !{!16, !18, !20, !22, !24}
!16 = distinct !{!16, !17, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!17 = distinct !{!17, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!18 = distinct !{!18, !19, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!19 = distinct !{!19, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!20 = distinct !{!20, !21, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!21 = distinct !{!21, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!22 = distinct !{!22, !23, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!23 = distinct !{!23, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!24 = distinct !{!24, !25, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!25 = distinct !{!25, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!26 = !{!5, !5, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !7, i64 0}
!29 = !{i64 0, i64 4, !26, i64 4, i64 4, !30, i64 8, i64 4, !30, i64 11, i64 4, !30, 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}
!30 = !{!31, !31, i64 0}
!31 = !{!"long", !6, i64 0}
!32 = !{!33, !5, i64 8}
!33 = !{!"_ZTSNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !34, i64 12}
!34 = !{!"_ZTSNSt3__217__compressed_pairIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !9, i64 0, !35, i64 4}
!35 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEELi1ELb0EEE", !5, i64 0}
!36 = !{!37}
!37 = distinct !{!37, !38, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m: argument 0"}
!38 = distinct !{!38, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m"}
!39 = !{!33, !5, i64 0}
!40 = !{!33, !5, i64 4}
!41 = distinct !{!41, !14}
!42 = !{!43, !5, i64 0}
!43 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEE", !5, i64 0}
!44 = !{!45, !47, i64 12}
!45 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEEE", !46, i64 0, !47, i64 12}
!46 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8}
!47 = !{!"bool", !6, i64 0}
!48 = !{i8 0, i8 2}
!49 = !{}
!50 = !{!46, !5, i64 0}
!51 = !{!46, !5, i64 8}
!52 = !{i64 0, i64 4, !26}
!53 = !{!46, !5, i64 4}
!54 = distinct !{!54, !14}
!55 = distinct !{!55, !14}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func (param i32 i32 i32) (result i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 1)))
(import "env" "strlen" (func (;2;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 3)))
(import "env" "memmove" (func (;4;) (type 5)))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func (;5;) (type 2)))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func (;6;) (type 2)))
(import "env" "__cxa_allocate_exception" (func (;7;) (type 1)))
(import "env" "__cxa_throw" (func (;8;) (type 3)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;9;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;10;) (type 1)))
(import "env" "_Znwm" (func (;11;) (type 1)))
(import "env" "_ZdlPv" (func (;12;) (type 4)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;13;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;14;) (type 3)))
(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 (;15;) (type 6))
(func (;16;) (type 2) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 5
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 5
i32.const 20
i32.add
global.get 1
i32.const 19
i32.add
call 0
local.set 3
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.get 6
i32.le_u
if ;; label = @2
local.get 3
call 1
drop
local.get 5
i32.const 32
i32.add
global.set 0
else
local.get 1
i32.load
local.get 1
local.get 2
select
local.get 6
i32.add
i32.load8_s
local.set 8
global.get 0
i32.const 16
i32.sub
local.tee 9
global.set 0
block (result i32) ;; label = @3
local.get 5
i32.const 8
i32.add
local.set 2
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 7
i32.const 1
i32.add
local.tee 4
i32.const 2147483632
i32.lt_u
if ;; label = @4
local.get 4
i32.const 10
i32.le_u
if ;; label = @5
local.get 2
i32.const 0
i32.store offset=8
local.get 2
i64.const 0
i64.store align=4
local.get 2
local.get 4
i32.store8 offset=11
local.get 2
br 2 (;@3;)
end
local.get 4
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 10
call 11
local.set 11
local.get 2
local.get 4
i32.store offset=4
local.get 2
local.get 11
i32.store
local.get 2
local.get 10
i32.const -2147483648
i32.or
i32.store offset=8
local.get 2
br 1 (;@3;)
end
global.get 1
i32.const 7
i32.add
call 20
unreachable
end
local.tee 4
i32.load
local.get 4
local.get 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 7
call 4
local.get 7
i32.add
local.tee 4
local.get 8
i32.store8
local.get 4
i32.const 0
i32.store8 offset=1
local.get 9
i32.const 16
i32.add
global.set 0
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 3
i32.load
call 12
end
local.get 3
local.get 2
i64.load align=4
i64.store align=4
local.get 3
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 2
call 1
drop
block ;; label = @3
local.get 0
i32.load offset=4
local.get 0
i32.load offset=8
i32.ne
if ;; label = @4
local.get 0
local.get 3
call 5
br 1 (;@3;)
end
local.get 0
local.get 3
call 6
end
local.get 6
i32.const 1
i32.add
local.set 6
br 1 (;@1;)
end
end)
(func (;17;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(func (;18;) (type 2) (param i32 i32)
local.get 0
local.get 0
i32.load offset=4
local.get 1
call 13
i32.const 12
i32.add
i32.store offset=4)
(func (;19;) (type 2) (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 1
call 20
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 7
call 10
local.get 1
local.get 0
call 8
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 13
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 1
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 1
drop
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.tee 0
if ;; label = @1
local.get 0
call 12
end
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;20;) (type 4) (param i32)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 7
global.get 4
local.set 4
local.get 0
call 9
local.tee 0
local.get 4
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 8
unreachable)
(func (;21;) (type 0) (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 14
local.get 0)
(export "__wasm_call_ctors" (func 15))
(export "__wasm_apply_data_relocs" (func 15))
(export "_Z12all_prefixesNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 16))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 17))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func 18))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func 19))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 21))
(data (;0;) (global.get 1) "vector\00basic_string\00"))
| 9 | 178 | 13,555 | 596 |
CPP/15 | /*
Return a string containing space-delimited numbers starting from 0 upto n inclusive.
>>> string_sequence(0)
"0"
>>> string_sequence(5)
"0 1 2 3 4 5"
*/
#include<stdio.h>
#include<string>
using namespace std;
string string_sequence(int n){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string string_sequence(int n){
| string out="0";
for (int i=1;i<=n;i++)
out=out+" "+to_string(i);
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (string_sequence(0) == "0");
assert (string_sequence(3) == "0 1 2 3");
assert (string_sequence(10) == "0 1 2 3 4 5 6 7 8 9 10");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (string_sequence(0) == "0");
assert (string_sequence(5) == "0 1 2 3 4 5");
}
| ; ModuleID = 'c_code_test/code_15.cpp'
source_filename = "c_code_test/code_15.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_SA_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [2 x i8] c"0\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c" \00", align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize mustprogress optsize
define void @_Z15string_sequencei(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #16
%7 = tail call i32 @llvm.smax.i32(i32 %1, i32 0)
%8 = add nuw i32 %7, 1
br label %9
9: ; preds = %12, %2
%10 = phi i32 [ 1, %2 ], [ %16, %12 ]
%11 = icmp eq i32 %10, %8
br i1 %11, label %17, label %12
12: ; preds = %9
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #17
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #17
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str.1) #16
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #17
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, i32 noundef %10) #16
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_SA_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5) #16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #18
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #18
%14 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #17
%15 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #17
%16 = add nuw i32 %10, 1
br label %9, !llvm.loop !3
17: ; preds = %9
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #1 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #18
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #16
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_SA_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #3 comdat {
%4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #16
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %2) local_unnamed_addr #3 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %2) #18
%13 = add i32 %11, %12
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #17
%14 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %13, ptr noundef nonnull align 1 dereferenceable(1) %4) #16
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #17
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%16 = load i8, ptr %15, align 1
%17 = icmp slt i8 %16, 0
%18 = load ptr, ptr %0, align 4
%19 = select i1 %17, ptr %18, ptr %0
%20 = load i8, ptr %5, align 1
%21 = icmp slt i8 %20, 0
%22 = load ptr, ptr %1, align 4
%23 = select i1 %21, ptr %22, ptr %1
%24 = icmp ult ptr %23, %19
%25 = getelementptr inbounds i8, ptr %19, i32 %11
%26 = icmp ule ptr %25, %23
%27 = or i1 %24, %26
call void @llvm.assume(i1 %27)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %19, ptr align 1 %23, i32 %11, i1 false), !noalias !5
%28 = icmp ugt ptr %25, %2
%29 = getelementptr inbounds i8, ptr %25, i32 %12
%30 = icmp ule ptr %29, %2
%31 = or i1 %28, %30
call void @llvm.assume(i1 %31)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %25, ptr align 1 %2, i32 %12, i1 false), !noalias !16
store i8 0, ptr %29, align 1, !tbaa !27
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__29to_stringEi(ptr sret(%"class.std::__2::basic_string") align 4, i32 noundef) local_unnamed_addr #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 #4
; 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 #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #3
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.2) #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 #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #17
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #16
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #20
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 #1 comdat {
%3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #16
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !30
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 #1
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #1 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #19
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #21
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !27
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !27
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; 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) #11
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_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
%6 = load ptr, ptr %1, align 4
%7 = select i1 %5, ptr %6, ptr %1
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %7, i32 noundef %11) #16
ret ptr %12
}
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #1
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #14 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !27
tail call void @_ZdlPv(ptr noundef %7) #22
br label %8
8: ; preds = %6, %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 !32
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !27
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #15
attributes #0 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { minsize optsize }
attributes #17 = { nounwind }
attributes #18 = { minsize nounwind optsize }
attributes #19 = { minsize noreturn optsize }
attributes #20 = { noreturn }
attributes #21 = { builtin minsize optsize allocsize(0) }
attributes #22 = { builtin minsize nounwind optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = !{!6, !8, !10, !12, !14}
!6 = distinct !{!6, !7, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!7 = distinct !{!7, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!8 = distinct !{!8, !9, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!9 = distinct !{!9, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!10 = distinct !{!10, !11, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!11 = distinct !{!11, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!12 = distinct !{!12, !13, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!13 = distinct !{!13, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!14 = distinct !{!14, !15, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!15 = distinct !{!15, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!16 = !{!17, !19, !21, !23, !25}
!17 = distinct !{!17, !18, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!19 = distinct !{!19, !20, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!20 = distinct !{!20, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!21 = distinct !{!21, !22, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!22 = distinct !{!22, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!23 = distinct !{!23, !24, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!24 = distinct !{!24, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!25 = distinct !{!25, !26, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!27 = !{!28, !28, i64 0}
!28 = !{!"omnipotent char", !29, i64 0}
!29 = !{!"Simple C++ TBAA"}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !29, i64 0}
!32 = !{i64 0, i64 4, !33, i64 4, i64 4, !35, i64 8, i64 4, !35, i64 11, i64 4, !35, i64 0, i64 11, !27, i64 11, i64 0, !27, i64 11, i64 1, !27, i64 11, i64 1, !27, i64 0, i64 12, !27}
!33 = !{!34, !34, i64 0}
!34 = !{!"any pointer", !28, i64 0}
!35 = !{!36, !36, i64 0}
!36 = !{!"long", !28, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32 i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__29to_stringEi" (func (;1;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;2;) (type 0)))
(import "env" "strlen" (func (;3;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;4;) (type 3)))
(import "env" "memmove" (func (;5;) (type 4)))
(import "env" "__cxa_allocate_exception" (func (;6;) (type 0)))
(import "env" "__cxa_throw" (func (;7;) (type 3)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;8;) (type 1)))
(import "env" "_Znwm" (func (;9;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm" (func (;10;) (type 4)))
(import "env" "_ZdlPv" (func (;11;) (type 5)))
(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 "env" "memory" (memory (;0;) 1))
(func (;12;) (type 6))
(func (;13;) (type 2) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 6
global.set 0
local.get 1
i32.const 0
local.get 1
i32.const 0
i32.gt_s
select
i32.const 1
i32.add
local.set 8
local.get 0
global.get 1
i32.const 13
i32.add
call 0
local.set 3
i32.const 1
local.set 1
loop ;; label = @1
local.get 1
local.get 8
i32.ne
if ;; label = @2
global.get 0
i32.const 16
i32.sub
local.tee 7
global.set 0
global.get 1
i32.const 15
i32.add
local.tee 9
call 3
local.set 4
block (result i32) ;; label = @3
local.get 6
i32.const 24
i32.add
local.set 0
local.get 4
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 5
i32.add
local.tee 2
i32.const 2147483632
i32.lt_u
if ;; label = @4
local.get 2
i32.const 10
i32.le_u
if ;; label = @5
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 2
i32.store8 offset=11
local.get 0
br 2 (;@3;)
end
local.get 2
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 10
call 9
local.set 11
local.get 0
local.get 2
i32.store offset=4
local.get 0
local.get 11
i32.store
local.get 0
local.get 10
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@3;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 6
global.get 4
local.set 2
global.get 1
call 8
local.tee 3
local.get 2
i32.const 8
i32.add
i32.store
local.get 3
local.get 1
local.get 0
call 7
unreachable
end
local.tee 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 5
call 5
local.get 5
i32.add
local.get 9
local.get 4
call 5
local.get 4
i32.add
i32.const 0
i32.store8
local.get 7
i32.const 16
i32.add
global.set 0
local.get 6
i32.const 12
i32.add
local.tee 4
local.get 1
call 1
local.get 6
i32.const 36
i32.add
local.tee 2
local.get 0
local.get 4
i32.load
local.get 4
local.get 4
i32.load8_u offset=11
local.tee 5
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.get 4
i32.load offset=4
local.get 5
local.get 7
select
call 10
local.tee 5
i64.load align=4
i64.store align=4
local.get 2
local.get 5
i32.load offset=8
i32.store offset=8
local.get 5
i64.const 0
i64.store align=4
local.get 5
i32.const 0
i32.store offset=8
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 3
i32.load
call 11
end
local.get 3
local.get 2
i64.load align=4
i64.store align=4
local.get 3
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 1
i32.const 1
i32.add
local.set 1
local.get 2
call 2
drop
local.get 4
call 2
drop
local.get 0
call 2
drop
br 1 (;@1;)
end
end
local.get 6
i32.const 48
i32.add
global.set 0)
(func (;14;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 3
call 4
local.get 0)
(export "__wasm_call_ctors" (func 12))
(export "__wasm_apply_data_relocs" (func 12))
(export "_Z15string_sequencei" (func 13))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 14))
(data (;0;) (global.get 1) "basic_string\000\00 \00"))
| 5 | 95 | 6,928 | 275 |
CPP/16 | /*
Given a string, find out how many distinct characters (regardless of case) does it consist of
>>> count_distinct_characters("xyzXYZ")
3
>>> count_distinct_characters("Jerry")
4
*/
#include<stdio.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int count_distinct_characters(string str){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
int count_distinct_characters(string str){
| vector<char> distinct={};
transform(str.begin(),str.end(),str.begin(),::tolower);
for (int i=0;i<str.size();i++)
{
bool isin=false;
for (int j=0;j<distinct.size();j++)
if (distinct[j]==str[i])
isin=true;
if (isin==false) distinct.push_back(str[i]);
}
return distinct.size();
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (count_distinct_characters("") == 0);
assert (count_distinct_characters("abcde") == 5);
assert (count_distinct_characters("abcdecadeCADE") == 5);
assert (count_distinct_characters("aaaaAAAAaaaa") == 1);
assert (count_distinct_characters("Jerry jERRY JeRRRY") == 5);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (count_distinct_characters("xyzXYZ") == 3);
assert (count_distinct_characters("Jerry") == 4);
}
| ; ModuleID = 'c_code_test/code_16.cpp'
source_filename = "c_code_test/code_16.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.1" }
%"class.std::__2::__compressed_pair.1" = type { %"struct.std::__2::__compressed_pair_elem.2" }
%"struct.std::__2::__compressed_pair_elem.2" = type { ptr }
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
%"class.std::__2::vector<char>::__destroy_vector" = type { ptr }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.3" }
%"class.std::__2::__compressed_pair.3" = type { %"struct.std::__2::__compressed_pair_elem.2", %"struct.std::__2::__compressed_pair_elem.4" }
%"struct.std::__2::__compressed_pair_elem.4" = type { ptr }
$_ZNSt3__26vectorIcNS_9allocatorIcEEE9push_backB7v160006ERKc = comdat any
$_ZNSt3__26vectorIcNS_9allocatorIcEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorIcNS_9allocatorIcEEE16__destroy_vectorclB7v160006Ev = comdat any
$_ZNSt3__26vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_ = comdat any
$_ZNKSt3__26vectorIcNS_9allocatorIcEEE11__recommendB7v160006Em = comdat any
$_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEEC2EmmS3_ = comdat any
$_ZNSt3__26vectorIcNS_9allocatorIcEEE26__swap_out_circular_bufferERNS_14__split_bufferIcRS2_EE = comdat any
$_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEED2Ev = comdat any
$_ZNKSt3__26vectorIcNS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEE5clearB7v160006Ev = comdat any
$_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEE17__destruct_at_endB7v160006EPcNS_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
; Function Attrs: minsize optsize
define noundef i32 @_Z25count_distinct_charactersNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::vector", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #14
store ptr null, ptr %2, align 4, !tbaa !3
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !10
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !11
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = load ptr, ptr %0, align 4
%9 = select i1 %7, ptr %8, ptr %0
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%11 = load i32, ptr %10, align 4
%12 = zext i8 %6 to i32
%13 = select i1 %7, i32 %11, i32 %12
%14 = getelementptr inbounds i8, ptr %9, i32 %13
br label %15
15: ; preds = %18, %1
%16 = phi ptr [ %9, %1 ], [ %23, %18 ]
%17 = icmp eq ptr %16, %14
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = load i8, ptr %16, align 1, !tbaa !12
%20 = sext i8 %19 to i32
%21 = tail call noundef i32 @tolower(i32 noundef %20) #15
%22 = trunc i32 %21 to i8
store i8 %22, ptr %16, align 1, !tbaa !12
%23 = getelementptr i8, ptr %16, i32 1
br label %15, !llvm.loop !13
24: ; preds = %15, %58
%25 = phi i32 [ %59, %58 ], [ 0, %15 ]
%26 = load i8, ptr %5, align 1
%27 = icmp slt i8 %26, 0
%28 = load i32, ptr %10, align 4
%29 = zext i8 %26 to i32
%30 = select i1 %27, i32 %28, i32 %29
%31 = icmp ult i32 %25, %30
%32 = load ptr, ptr %3, align 4, !tbaa !10
%33 = load ptr, ptr %2, align 4, !tbaa !3
%34 = ptrtoint ptr %32 to i32
%35 = ptrtoint ptr %33 to i32
%36 = sub i32 %34, %35
br i1 %31, label %39, label %37
37: ; preds = %24
%38 = call noundef ptr @_ZNSt3__26vectorIcNS_9allocatorIcEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #14
ret i32 %36
39: ; preds = %24, %44
%40 = phi i1 [ %52, %44 ], [ false, %24 ]
%41 = phi i32 [ %53, %44 ], [ 0, %24 ]
%42 = icmp eq i32 %41, %36
br i1 %42, label %43, label %44
43: ; preds = %39
br i1 %40, label %58, label %54
44: ; preds = %39
%45 = getelementptr inbounds i8, ptr %33, i32 %41
%46 = load i8, ptr %45, align 1, !tbaa !12
%47 = load ptr, ptr %0, align 4
%48 = select i1 %27, ptr %47, ptr %0
%49 = getelementptr inbounds i8, ptr %48, i32 %25
%50 = load i8, ptr %49, align 1, !tbaa !12
%51 = icmp eq i8 %46, %50
%52 = select i1 %51, i1 true, i1 %40
%53 = add nuw i32 %41, 1
br label %39, !llvm.loop !15
54: ; preds = %43
%55 = load ptr, ptr %0, align 4
%56 = select i1 %27, ptr %55, ptr %0
%57 = getelementptr inbounds i8, ptr %56, i32 %25
call void @_ZNSt3__26vectorIcNS_9allocatorIcEEE9push_backB7v160006ERKc(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 1 dereferenceable(1) %57) #15
br label %58
58: ; preds = %54, %43
%59 = add nuw nsw i32 %25, 1
br label %24, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(read)
declare i32 @tolower(i32 noundef) local_unnamed_addr #2
; 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 optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIcNS_9allocatorIcEEE9push_backB7v160006ERKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) local_unnamed_addr #3 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 i8, ptr %1, align 1, !tbaa !12
store i8 %9, ptr %4, align 1, !tbaa !12
%10 = getelementptr inbounds i8, ptr %4, i32 1
store ptr %10, ptr %3, align 4, !tbaa !10
br label %12
11: ; preds = %2
tail call void @_ZNSt3__26vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) #15
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIcNS_9allocatorIcEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #4 comdat {
%2 = alloca %"class.std::__2::vector<char>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #14
store ptr %0, ptr %2, align 4, !tbaa !17
call void @_ZNSt3__26vectorIcNS_9allocatorIcEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #14
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIcNS_9allocatorIcEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #5 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !18
%3 = load ptr, ptr %2, align 4, !tbaa !3
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !10
tail call void @_ZdlPv(ptr noundef nonnull %3) #17
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #6
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__26vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) local_unnamed_addr #7 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 !10
%7 = load ptr, ptr %0, align 4, !tbaa !3
%8 = ptrtoint ptr %6 to i32
%9 = ptrtoint ptr %7 to i32
%10 = add i32 %8, 1
%11 = sub i32 %10, %9
%12 = tail call noundef i32 @_ZNKSt3__26vectorIcNS_9allocatorIcEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %11) #15
%13 = load ptr, ptr %5, align 4, !tbaa !10
%14 = load ptr, ptr %0, align 4, !tbaa !3
%15 = ptrtoint ptr %13 to i32
%16 = ptrtoint ptr %14 to i32
%17 = sub i32 %15, %16
%18 = call noundef ptr @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEEC2EmmS3_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %12, i32 noundef %17, ptr noundef nonnull align 1 dereferenceable(1) %4) #15
%19 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%20 = load ptr, ptr %19, align 4, !tbaa !20
%21 = load i8, ptr %1, align 1, !tbaa !12
store i8 %21, ptr %20, align 1, !tbaa !12
%22 = load ptr, ptr %19, align 4, !tbaa !20
%23 = getelementptr inbounds i8, ptr %22, i32 1
store ptr %23, ptr %19, align 4, !tbaa !20
call void @_ZNSt3__26vectorIcNS_9allocatorIcEEE26__swap_out_circular_bufferERNS_14__split_bufferIcRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #15
%24 = call noundef ptr @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #16
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__26vectorIcNS_9allocatorIcEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #7 comdat {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @_ZNKSt3__26vectorIcNS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
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, 1073741823
%13 = shl nuw nsw i32 %11, 1
%14 = tail call i32 @llvm.umax.i32(i32 %13, i32 %1)
%15 = select i1 %12, i32 %14, i32 2147483647
ret i32 %15
}
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEEC2EmmS3_(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 noalias noundef nonnull ptr @_Znwm(i32 noundef %1) #19, !noalias !24
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !27
%12 = getelementptr inbounds i8, 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 !20
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !28
%15 = getelementptr inbounds i8, 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__26vectorIcNS_9allocatorIcEEE26__swap_out_circular_bufferERNS_14__split_bufferIcRS2_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 !28
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 i8, ptr %9, i32 -1
%14 = load i8, ptr %13, align 1, !tbaa !12, !noalias !29
%15 = getelementptr inbounds i8, ptr %10, i32 -1
store i8 %14, ptr %15, align 1, !tbaa !12, !noalias !29
br label %8, !llvm.loop !34
16: ; preds = %8
store ptr %10, ptr %6, align 4, !tbaa !28
%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 !28
store ptr %25, ptr %1, align 4, !tbaa !27
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #4 comdat {
tail call void @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #16
%2 = load ptr, ptr %0, align 4, !tbaa !27
%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__26vectorIcNS_9allocatorIcEEE20__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) #18
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) #14
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #15
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #20
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) #15
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !35
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #4
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #11 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !28
tail call void @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEE17__destruct_at_endB7v160006EPcNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #16
ret void
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferIcRNS_9allocatorIcEEE17__destruct_at_endB7v160006EPcNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %1) local_unnamed_addr #12 comdat {
%3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !20
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 i8, ptr %6, i32 -1
store ptr %9, ptr %3, align 4, !tbaa !20
br label %5, !llvm.loop !37
10: ; preds = %5
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #13
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 = { minsize mustprogress nofree nounwind optsize willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { inlinehint minsize mustprogress 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 nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind }
attributes #15 = { minsize optsize }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { builtin minsize nounwind optsize }
attributes #18 = { minsize noreturn optsize }
attributes #19 = { builtin minsize optsize allocsize(0) }
attributes #20 = { noreturn }
!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__26vectorIcNS_9allocatorIcEEEE", !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_pairIPcNS_9allocatorIcEEEE", !9, i64 0}
!9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPcLi0ELb0EEE", !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 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!5, !5, i64 0}
!18 = !{!19, !5, i64 0}
!19 = !{!"_ZTSNSt3__26vectorIcNS_9allocatorIcEEE16__destroy_vectorE", !5, i64 0}
!20 = !{!21, !5, i64 8}
!21 = !{!"_ZTSNSt3__214__split_bufferIcRNS_9allocatorIcEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !22, i64 12}
!22 = !{!"_ZTSNSt3__217__compressed_pairIPcRNS_9allocatorIcEEEE", !9, i64 0, !23, i64 4}
!23 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIcEELi1ELb0EEE", !5, i64 0}
!24 = !{!25}
!25 = distinct !{!25, !26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!27 = !{!21, !5, i64 0}
!28 = !{!21, !5, i64 4}
!29 = !{!30, !32}
!30 = distinct !{!30, !31, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPcEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!31 = distinct !{!31, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPcEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"}
!32 = distinct !{!32, !33, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPcEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!33 = distinct !{!33, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPcEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!34 = distinct !{!34, !14}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !7, i64 0}
!37 = distinct !{!37, !14}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func (param i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func))
(import "env" "tolower" (func (;0;) (type 0)))
(import "env" "_ZNSt3__26vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_" (func (;1;) (type 1)))
(import "env" "_ZdlPv" (func (;2;) (type 2)))
(import "env" "_Znwm" (func (;3;) (type 0)))
(import "env" "__cxa_allocate_exception" (func (;4;) (type 0)))
(import "env" "__cxa_throw" (func (;5;) (type 3)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;6;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;7;) (type 5))
(func (;8;) (type 0) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 3
i64.const 0
i64.store offset=4 align=4
local.get 3
i32.const 0
i32.store offset=12
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 4
select
local.tee 1
local.get 0
i32.load offset=4
local.get 2
local.get 4
select
i32.add
local.set 2
loop (result i32) ;; label = @1
local.get 1
local.get 2
i32.eq
if (result i32) ;; label = @2
loop ;; label = @3
block ;; label = @4
local.get 3
i32.load offset=8
local.get 3
i32.load offset=4
local.tee 7
i32.sub
local.set 4
i32.const 0
local.set 2
i32.const 0
local.set 1
local.get 5
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 6
local.get 6
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 6
select
i32.ge_u
br_if 0 (;@4;)
loop ;; label = @5
local.get 1
local.get 4
i32.eq
if ;; label = @6
local.get 2
i32.const 1
i32.and
i32.eqz
if ;; label = @7
block ;; label = @8
local.get 0
i32.load
local.get 0
local.get 6
select
local.get 5
i32.add
local.set 2
local.get 3
i32.const 4
i32.add
local.tee 1
i32.load offset=4
local.tee 4
local.get 1
i32.load offset=8
i32.ne
if ;; label = @9
local.get 4
local.get 2
i32.load8_u
i32.store8
local.get 1
local.get 4
i32.const 1
i32.add
i32.store offset=4
br 1 (;@8;)
end
local.get 1
local.get 2
call 1
end
end
local.get 5
i32.const 1
i32.add
local.set 5
br 3 (;@3;)
else
local.get 1
local.get 7
i32.add
i32.load8_u
local.get 0
i32.load
local.get 0
local.get 6
select
local.get 5
i32.add
i32.load8_u
i32.eq
local.get 2
i32.or
local.set 2
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@5;)
end
unreachable
end
unreachable
end
end
global.get 0
i32.const 16
i32.sub
local.tee 0
global.set 0
local.get 0
local.get 3
i32.const 4
i32.add
i32.store offset=12
local.get 0
i32.load offset=12
local.tee 5
i32.load
local.tee 1
if ;; label = @3
local.get 5
local.get 1
i32.store offset=4
local.get 1
call 2
end
local.get 0
i32.const 16
i32.add
global.set 0
local.get 3
i32.const 16
i32.add
global.set 0
local.get 4
else
local.get 1
local.get 1
i32.load8_s
call 0
i32.store8
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end)
(func (;9;) (type 1) (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 1
i32.add
local.tee 3
i32.const 0
i32.lt_s
if ;; label = @1
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 4
global.get 4
local.set 3
global.get 1
call 6
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 5
unreachable
end
i32.const 2147483647
local.get 0
i32.load offset=8
local.get 0
i32.load
i32.sub
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 1073741823
i32.ge_u
select
local.set 4
local.get 0
i32.load offset=4
local.get 0
i32.load
i32.sub
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
call 3
local.set 3
end
local.get 2
local.get 3
i32.store offset=12
local.get 2
local.get 3
local.get 5
i32.add
local.tee 5
i32.store offset=20
local.get 2
local.get 3
local.get 4
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
i32.load8_u
i32.store8
local.get 2
local.get 2
i32.load offset=20
i32.const 1
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 1
i32.sub
local.tee 1
local.get 3
i32.const 1
i32.sub
local.tee 3
i32.load8_u
i32.store8
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 1
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 2
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 "_Z25count_distinct_charactersNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 8))
(export "_ZNSt3__26vectorIcNS_9allocatorIcEEE21__push_back_slow_pathIRKcEEvOT_" (func 9))
(data (;0;) (global.get 1) "vector\00"))
| 13 | 354 | 9,383 | 415 |
CPP/17 | /*
Input to this function is a string representing musical notes in a special ASCII format.
Your task is to parse this string and return vector of integers corresponding to how many beats does each
not last.
Here is a legend:
"o" - whole note, lasts four beats
"o|" - half note, lasts two beats
".|" - quater note, lasts one beat
>>> parse_music("o o| .| o| o| .| .| .| .| o o")
{4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<int> parse_music(string music_string){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<int> parse_music(string music_string){
| string current="";
vector<int> out={};
if (music_string.length()>0)
music_string=music_string+' ';
for (int i=0;i<music_string.length();i++)
{
if (music_string[i]==' ')
{
if (current=="o") out.push_back(4);
if (current=="o|") out.push_back(2);
if (current==".|") out.push_back(1);
current="";
}
else current+=music_string[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(parse_music("") , {}));
assert (issame(parse_music("o o o o") ,{4, 4, 4, 4}));
assert (issame(parse_music(".| .| .| .|") , {1, 1, 1, 1}));
assert (issame(parse_music("o| o| .| .| o o o o") , {2, 2, 1, 1, 4, 4, 4, 4}));
assert (issame(parse_music("o| .| o| .| o o| o o|") , {2, 1, 2, 1, 4, 2, 4, 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(parse_music("o o| .| o| o| .| .| .| .| o o") , {4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4}));
}
| ; ModuleID = 'c_code_test/code_17.cpp'
source_filename = "c_code_test/code_17.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 }
%"class.std::__2::allocator.4" = type { i8 }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.8" }
%"class.std::__2::__compressed_pair.8" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.9" }
%"struct.std::__2::__compressed_pair_elem.9" = type { ptr }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNSt3__2eqB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_ = 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__29allocatorIiE8allocateB7v160006Em = 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 [2 x i8] c"o\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"o|\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c".|\00", align 1
@.str.4 = private unnamed_addr constant [13 x i8] c"basic_string\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
@.str.5 = private unnamed_addr constant [7 x i8] c"vector\00", align 1
; Function Attrs: minsize optsize
define void @_Z11parse_musicNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca i32, align 4
%6 = alloca i32, align 4
%7 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #18
%8 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #19
store ptr null, ptr %0, align 4, !tbaa !3
%9 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %9, align 4, !tbaa !10
%10 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %10, align 4, !tbaa !11
%11 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%12 = load i8, ptr %11, align 1
%13 = icmp slt i8 %12, 0
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%15 = load i32, ptr %14, align 4
%16 = zext i8 %12 to i32
%17 = select i1 %13, i32 %15, i32 %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %2
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #18
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext 32) #19
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %4) #20
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #18
br label %21
21: ; preds = %19, %2
br label %22
22: ; preds = %21, %48
%23 = phi i32 [ %49, %48 ], [ 0, %21 ]
%24 = load i8, ptr %11, align 1
%25 = icmp slt i8 %24, 0
%26 = load i32, ptr %14, align 4
%27 = zext i8 %24 to i32
%28 = select i1 %25, i32 %26, i32 %27
%29 = icmp ult i32 %23, %28
br i1 %29, label %30, label %50
30: ; preds = %22
%31 = load ptr, ptr %1, align 4
%32 = select i1 %25, ptr %31, ptr %1
%33 = getelementptr inbounds i8, ptr %32, i32 %23
%34 = load i8, ptr %33, align 1, !tbaa !12
%35 = icmp eq i8 %34, 32
br i1 %35, label %36, label %47
36: ; preds = %30
%37 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str.1) #20
br i1 %37, label %38, label %39
38: ; preds = %36
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #18
store i32 4, ptr %5, align 4, !tbaa !13
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %5) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #18
br label %39
39: ; preds = %38, %36
%40 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str.2) #20
br i1 %40, label %41, label %42
41: ; preds = %39
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #18
store i32 2, ptr %6, align 4, !tbaa !13
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %6) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #18
br label %42
42: ; preds = %41, %39
%43 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str.3) #20
br i1 %43, label %44, label %45
44: ; preds = %42
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #18
store i32 1, ptr %7, align 4, !tbaa !13
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %7) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #18
br label %45
45: ; preds = %44, %42
%46 = 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) #19
br label %48
47: ; preds = %30
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext %34) #19
br label %48
48: ; preds = %45, %47
%49 = add nuw nsw i32 %23, 1
br label %22, !llvm.loop !15
50: ; preds = %22
%51 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #18
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: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #20
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #19
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator.4", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #18
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #19
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #18
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !17
store i8 %2, ptr %24, align 1, !tbaa !12
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !12
ret void
}
; 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 #2
; 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 mustprogress nounwind optsize
define linkonce_odr hidden noundef zeroext i1 @_ZNSt3__2eqB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EEPKS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #3 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #20
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = icmp eq i32 %4, %11
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = tail call noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef 0, i32 noundef -1, ptr noundef nonnull %1, i32 noundef %4) #20
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %2, %13
%17 = phi i1 [ %15, %13 ], [ false, %2 ]
ret i1 %17
}
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #4 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 !28
%7 = icmp ult ptr %4, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, ptr %1, align 4, !tbaa !13
store i32 %9, ptr %4, align 4, !tbaa !13
%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_pathIiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #19
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #4
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.4) #21
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #18
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #19
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #22
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) #19
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !29
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #8 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #18
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #20
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #22
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #21
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #23
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !12
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !12
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; 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) #11
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #3 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !12
tail call void @_ZdlPv(ptr noundef %7) #24
br label %8
8: ; preds = %6, %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 !31
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !12
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
declare noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #14
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #14 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) #18
%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) #19
%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) #19
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !34
%23 = load i32, ptr %1, align 4, !tbaa !13
store i32 %23, ptr %22, align 4, !tbaa !13
%24 = getelementptr inbounds i32, ptr %22, i32 1
store ptr %24, ptr %21, align 4, !tbaa !34
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) #19
%25 = call noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #20
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #18
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 #14 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) #21
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 !28
%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 !28
%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) #19, !noalias !38
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !41
%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 !34
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !42
%15 = getelementptr inbounds i32, ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !28
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 !42
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 !13, !noalias !43
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !13, !noalias !43
br label %8, !llvm.loop !48
16: ; preds = %8
store ptr %10, ptr %6, align 4, !tbaa !42
%17 = load ptr, ptr %0, align 4, !tbaa !28
store ptr %10, ptr %0, align 4, !tbaa !28
store ptr %17, ptr %6, align 4, !tbaa !28
%18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%19 = load ptr, ptr %3, align 4, !tbaa !28
%20 = load ptr, ptr %18, align 4, !tbaa !28
store ptr %20, ptr %3, align 4, !tbaa !28
store ptr %19, ptr %18, align 4, !tbaa !28
%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 !28
%24 = load ptr, ptr %22, align 4, !tbaa !28
store ptr %24, ptr %21, align 4, !tbaa !28
store ptr %23, ptr %22, align 4, !tbaa !28
%25 = load ptr, ptr %6, align 4, !tbaa !42
store ptr %25, ptr %1, align 4, !tbaa !41
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 #9 comdat {
tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #20
%2 = load ptr, ptr %0, align 4, !tbaa !41
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #24
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 #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.5) #21
unreachable
}
; 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 #15 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() #21
unreachable
5: ; preds = %2
%6 = shl nuw i32 %1, 2
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #23
ret ptr %7
}
; 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 #16 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !42
tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #20
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 #3 comdat {
%3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !34
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 !34
br label %5, !llvm.loop !49
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 #15 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) #19
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: 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #17
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #14 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #15 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #16 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #17 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #18 = { nounwind }
attributes #19 = { minsize optsize }
attributes #20 = { minsize nounwind optsize }
attributes #21 = { minsize noreturn optsize }
attributes #22 = { noreturn }
attributes #23 = { builtin minsize optsize allocsize(0) }
attributes #24 = { builtin minsize nounwind optsize }
!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 = !{!6, !6, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !20, !22, !24, !26}
!18 = distinct !{!18, !19, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!19 = distinct !{!19, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!20 = distinct !{!20, !21, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!21 = distinct !{!21, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!22 = distinct !{!22, !23, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!23 = distinct !{!23, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!24 = distinct !{!24, !25, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!25 = distinct !{!25, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!26 = distinct !{!26, !27, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!28 = !{!5, !5, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !7, i64 0}
!31 = !{i64 0, i64 4, !28, i64 4, i64 4, !32, i64 8, i64 4, !32, i64 11, i64 4, !32, 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}
!32 = !{!33, !33, i64 0}
!33 = !{!"long", !6, i64 0}
!34 = !{!35, !5, i64 8}
!35 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !36, i64 12}
!36 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !37, i64 4}
!37 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, i64 0}
!38 = !{!39}
!39 = distinct !{!39, !40, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!40 = distinct !{!40, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!41 = !{!35, !5, i64 0}
!42 = !{!35, !5, i64 4}
!43 = !{!44, !46}
!44 = distinct !{!44, !45, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!45 = distinct !{!45, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"}
!46 = distinct !{!46, !47, !"_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"}
!47 = distinct !{!47, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!48 = distinct !{!48, !16}
!49 = distinct !{!49, !16}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func (param i32 i32 i32) (result i32)))
(type (;6;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;7;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc" (func (;3;) (type 2)))
(import "env" "strlen" (func (;4;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;5;) (type 3)))
(import "env" "memmove" (func (;6;) (type 5)))
(import "env" "_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm" (func (;7;) (type 6)))
(import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_" (func (;8;) (type 2)))
(import "env" "__cxa_allocate_exception" (func (;9;) (type 1)))
(import "env" "__cxa_throw" (func (;10;) (type 3)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;11;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;12;) (type 1)))
(import "env" "_Znwm" (func (;13;) (type 1)))
(import "env" "_ZdlPv" (func (;14;) (type 4)))
(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 (;15;) (type 7))
(func (;16;) (type 2) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 4
global.set 0
local.get 4
i32.const 20
i32.add
global.get 1
i32.const 27
i32.add
call 0
local.set 5
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 offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
if ;; label = @1
global.get 0
i32.const 16
i32.sub
local.tee 7
global.set 0
block (result i32) ;; label = @2
local.get 4
i32.const 8
i32.add
local.set 2
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
select
local.tee 6
i32.const 1
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @3
local.get 3
i32.const 10
i32.le_u
if ;; label = @4
local.get 2
i32.const 0
i32.store offset=8
local.get 2
i64.const 0
i64.store align=4
local.get 2
local.get 3
i32.store8 offset=11
local.get 2
br 2 (;@2;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 8
call 13
local.set 9
local.get 2
local.get 3
i32.store offset=4
local.get 2
local.get 9
i32.store
local.get 2
local.get 8
i32.const -2147483648
i32.or
i32.store offset=8
local.get 2
br 1 (;@2;)
end
global.get 1
i32.const 15
i32.add
call 21
unreachable
end
local.tee 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 6
call 6
local.get 6
i32.add
local.tee 3
i32.const 32
i32.store8
local.get 3
i32.const 0
i32.store8 offset=1
local.get 7
i32.const 16
i32.add
global.set 0
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @2
local.get 1
i32.load
call 14
end
local.get 1
local.get 2
i64.load align=4
i64.store align=4
local.get 1
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 2
call 1
drop
end
i32.const 0
local.set 2
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 2
i32.gt_u
if ;; label = @2
block ;; label = @3
local.get 1
i32.load
local.get 1
local.get 3
select
local.get 2
i32.add
i32.load8_u
local.tee 3
i32.const 32
i32.eq
if ;; label = @4
local.get 5
global.get 1
i32.const 13
i32.add
call 18
if ;; label = @5
local.get 4
i32.const 4
i32.store offset=8
local.get 0
local.get 4
i32.const 8
i32.add
call 19
end
local.get 5
global.get 1
call 18
if ;; label = @5
local.get 4
i32.const 2
i32.store offset=8
local.get 0
local.get 4
i32.const 8
i32.add
call 19
end
local.get 5
global.get 1
i32.const 3
i32.add
call 18
if ;; label = @5
local.get 4
i32.const 1
i32.store offset=8
local.get 0
local.get 4
i32.const 8
i32.add
call 19
end
local.get 5
global.get 1
i32.const 27
i32.add
call 2
drop
br 1 (;@3;)
end
local.get 5
local.get 3
i32.extend8_s
call 3
end
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
local.get 5
call 1
drop
local.get 4
i32.const 32
i32.add
global.set 0)
(func (;17;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 4
call 5
local.get 0)
(func (;18;) (type 0) (param i32 i32) (result i32)
(local i32 i32 i32)
local.get 1
call 4
local.tee 3
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
select
i32.eq
if (result i32) ;; label = @1
local.get 0
i32.const 0
i32.const -1
local.get 1
local.get 3
call 7
else
i32.const 1
end
i32.eqz)
(func (;19;) (type 2) (param i32 i32)
(local i32)
local.get 0
i32.load offset=4
local.tee 2
local.get 0
i32.load offset=8
i32.lt_u
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 8)
(func (;20;) (type 2) (param i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 6
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 2
i32.const 1073741824
i32.ge_u
if ;; label = @1
global.get 1
i32.const 6
i32.add
call 21
unreachable
end
i32.const 1073741823
local.get 0
i32.load offset=8
local.get 0
i32.load
i32.sub
local.tee 3
i32.const 1
i32.shr_s
local.tee 4
local.get 2
local.get 2
local.get 4
i32.lt_u
select
local.get 3
i32.const 2147483644
i32.ge_u
select
local.set 3
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 4
local.get 6
i32.const 12
i32.add
local.tee 2
i32.const 0
i32.store offset=12
local.get 2
local.get 0
i32.const 8
i32.add
i32.store offset=16
local.get 3
if ;; label = @1
local.get 3
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 9
call 12
local.get 1
local.get 0
call 10
unreachable
end
local.get 3
i32.const 2
i32.shl
call 13
local.set 4
end
local.get 2
local.get 4
i32.store
local.get 2
local.get 4
local.get 5
i32.const 2
i32.shl
i32.add
local.tee 5
i32.store offset=8
local.get 2
local.get 4
local.get 3
i32.const 2
i32.shl
i32.add
i32.store offset=12
local.get 2
local.get 5
i32.store offset=4
local.get 2
i32.load offset=8
local.tee 3
local.get 1
i32.load
i32.store
local.get 2
local.get 3
i32.const 4
i32.add
i32.store offset=8
local.get 2
i32.load offset=4
local.set 1
local.get 0
i32.load
local.set 3
local.get 0
i32.load offset=4
local.set 4
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 4
i32.const 4
i32.sub
local.tee 4
i32.load
i32.store
br 1 (;@1;)
end
end
local.get 2
local.get 1
i32.store offset=4
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=4
local.get 0
i32.load offset=4
local.set 1
local.get 0
local.get 2
i32.load offset=8
i32.store offset=4
local.get 2
local.get 1
i32.store offset=8
local.get 0
i32.load offset=8
local.set 1
local.get 0
local.get 2
i32.load offset=12
i32.store offset=8
local.get 2
local.get 1
i32.store offset=12
local.get 2
local.get 2
i32.load offset=4
i32.store
local.get 2
i32.load offset=4
local.set 1
local.get 2
i32.load offset=8
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=8
br 1 (;@1;)
end
end
local.get 2
i32.load
local.tee 0
if ;; label = @1
local.get 0
call 14
end
local.get 6
i32.const 32
i32.add
global.set 0)
(func (;21;) (type 4) (param i32)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 9
global.get 4
local.set 4
local.get 0
call 11
local.tee 0
local.get 4
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 10
unreachable)
(export "__wasm_call_ctors" (func 15))
(export "__wasm_apply_data_relocs" (func 15))
(export "_Z11parse_musicNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 16))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 17))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_" (func 20))
(data (;0;) (global.get 1) "o|\00.|\00vector\00o\00basic_string\00"))
| 17 | 458 | 13,066 | 595 |
CPP/18 | /*
Find how many times a given substring can be found in the original string. Count overlaping cases.
>>> how_many_times("", "a")
0
>>> how_many_times("aaa", "a")
3
>>> how_many_times("aaaa", "aa")
3
*/
#include<stdio.h>
#include<string>
using namespace std;
int how_many_times(string str,string substring){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int how_many_times(string str,string substring){
| int out=0;
if (str.length()==0) return 0;
for (int i=0;i<=str.length()-substring.length();i++)
if (str.substr(i,substring.length())==substring)
out+=1;
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (how_many_times("", "x") == 0);
assert (how_many_times("xyxyxyx", "x") == 4);
assert (how_many_times("cacacacac", "cac") == 4);
assert (how_many_times("john doe", "john") == 1);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (how_many_times("", "a") == 0);
assert (how_many_times("aaa", "a") == 3);
assert (how_many_times("aaaa", "aa") == 3);
}
| ; ModuleID = 'c_code_test/code_18.cpp'
source_filename = "c_code_test/code_18.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm = comdat any
$_ZNSt3__211char_traitsIcE7compareEPKcS3_m = comdat any
; Function Attrs: minsize mustprogress optsize
define noundef i32 @_Z14how_many_timesNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%5 = load i8, ptr %4, align 1
%6 = icmp slt i8 %5, 0
%7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%8 = load i32, ptr %7, align 4
%9 = zext i8 %5 to i32
%10 = select i1 %6, i32 %8, i32 %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %38, label %12
12: ; preds = %2
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %15
15: ; preds = %12, %30
%16 = phi i32 [ %37, %30 ], [ %8, %12 ]
%17 = phi i8 [ %36, %30 ], [ %5, %12 ]
%18 = phi i32 [ %34, %30 ], [ 0, %12 ]
%19 = phi i32 [ %35, %30 ], [ 0, %12 ]
%20 = icmp slt i8 %17, 0
%21 = zext i8 %17 to i32
%22 = select i1 %20, i32 %16, i32 %21
%23 = load i8, ptr %13, align 1
%24 = icmp slt i8 %23, 0
%25 = load i32, ptr %14, align 4
%26 = zext i8 %23 to i32
%27 = select i1 %24, i32 %25, i32 %26
%28 = sub i32 %22, %27
%29 = icmp ugt i32 %19, %28
br i1 %29, label %38, label %30
30: ; preds = %15
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %19, i32 noundef %27) #8
%31 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %1) #9
%32 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #9
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
%33 = zext i1 %31 to i32
%34 = add nuw nsw i32 %18, %33
%35 = add nuw nsw i32 %19, 1
%36 = load i8, ptr %4, align 1
%37 = load i32, ptr %7, align 4
br label %15, !llvm.loop !3
38: ; preds = %15, %2
%39 = phi i32 [ 0, %2 ], [ %18, %15 ]
ret i32 %39
}
; 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 nounwind optsize
define linkonce_odr hidden noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%7 = load i32, ptr %6, align 4
%8 = zext i8 %4 to i32
%9 = select i1 %5, i32 %7, i32 %8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%11 = load i8, ptr %10, align 1
%12 = icmp slt i8 %11, 0
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%14 = load i32, ptr %13, align 4
%15 = zext i8 %11 to i32
%16 = select i1 %12, i32 %14, i32 %15
%17 = icmp eq i32 %9, %16
br i1 %17, label %18, label %38
18: ; preds = %2
%19 = load ptr, ptr %1, align 4
%20 = select i1 %12, ptr %19, ptr %1
br i1 %5, label %21, label %25
21: ; preds = %18
%22 = load ptr, ptr %0, align 4
%23 = tail call noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %22, ptr noundef %20, i32 noundef %7) #9
%24 = icmp eq i32 %23, 0
br label %38
25: ; preds = %18, %34
%26 = phi i32 [ %35, %34 ], [ %8, %18 ]
%27 = phi ptr [ %36, %34 ], [ %0, %18 ]
%28 = phi ptr [ %37, %34 ], [ %20, %18 ]
%29 = icmp eq i32 %26, 0
br i1 %29, label %38, label %30
30: ; preds = %25
%31 = load i8, ptr %27, align 1, !tbaa !5
%32 = load i8, ptr %28, align 1, !tbaa !5
%33 = icmp eq i8 %31, %32
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = add nsw i32 %26, -1
%36 = getelementptr inbounds i8, ptr %27, i32 1
%37 = getelementptr inbounds i8, ptr %28, i32 1
br label %25, !llvm.loop !8
38: ; preds = %30, %25, %21, %2
%39 = phi i1 [ false, %2 ], [ %24, %21 ], [ %29, %25 ], [ %29, %30 ]
ret i1 %39
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 comdat {
%5 = alloca %"class.std::__2::allocator", align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(1) %5) #8
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
ret void
}
; 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 #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
declare noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #5 comdat {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcmp(ptr noundef %0, ptr noundef %1, i32 noundef %2) #9
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i32 noundef) local_unnamed_addr #6
attributes #0 = { minsize mustprogress 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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { nounwind }
attributes #8 = { minsize optsize }
attributes #9 = { minsize nounwind optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !4}
| (module
(type (;0;) (func (param i32 i32 i32) (result i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;3;) (func))
(type (;4;) (func (param i32 i32) (result i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;0;) (type 1)))
(import "env" "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func (;1;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_" (func (;2;) (type 2)))
(import "env" "memcmp" (func (;3;) (type 0)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;4;) (type 3))
(func (;5;) (type 4) (param i32 i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 8
global.set 0
block ;; label = @1
local.get 0
i32.load offset=4
local.tee 4
local.get 0
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
local.tee 2
i32.const 0
i32.lt_s
select
i32.eqz
br_if 0 (;@1;)
loop ;; label = @2
local.get 6
local.get 4
local.get 2
i32.const 255
i32.and
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 4
i32.sub
i32.gt_u
br_if 1 (;@1;)
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 8
i32.const 4
i32.add
local.tee 2
local.get 0
local.get 6
local.get 4
local.get 3
i32.const 15
i32.add
call 2
drop
local.get 3
i32.const 16
i32.add
global.set 0
local.get 6
i32.const 1
i32.add
local.set 6
i32.const 0
local.set 7
block ;; label = @3
local.get 2
local.tee 4
i32.load offset=4
local.tee 10
local.get 2
i32.load8_u offset=11
local.tee 5
local.get 5
i32.extend8_s
local.tee 11
i32.const 0
i32.lt_s
select
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
local.tee 3
i32.const 0
i32.lt_s
select
i32.ne
br_if 0 (;@3;)
local.get 1
i32.load
local.get 1
local.get 3
i32.const 0
i32.lt_s
select
local.set 3
local.get 11
i32.const 0
i32.ge_s
if ;; label = @4
loop ;; label = @5
local.get 5
i32.eqz
local.set 7
local.get 5
i32.eqz
br_if 2 (;@3;)
local.get 4
i32.load8_u
local.get 3
i32.load8_u
i32.ne
br_if 2 (;@3;)
local.get 3
i32.const 1
i32.add
local.set 3
local.get 4
i32.const 1
i32.add
local.set 4
local.get 5
i32.const 1
i32.sub
local.set 5
br 0 (;@5;)
end
unreachable
end
local.get 4
i32.load
local.get 3
local.get 10
call 1
i32.eqz
local.set 7
end
local.get 7
local.get 9
i32.add
local.set 9
local.get 2
call 0
drop
local.get 0
i32.load offset=4
local.set 4
local.get 0
i32.load8_u offset=11
local.set 2
br 0 (;@2;)
end
unreachable
end
local.get 8
i32.const 16
i32.add
global.set 0
local.get 9)
(func (;6;) (type 0) (param i32 i32 i32) (result i32)
local.get 2
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 1
local.get 2
call 3)
(export "__wasm_call_ctors" (func 4))
(export "__wasm_apply_data_relocs" (func 4))
(export "_Z14how_many_timesNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_" (func 5))
(export "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func 6)))
| 7 | 194 | 4,828 | 200 |
CPP/19 | /*
Input is a space-delimited string of numberals from "zero" to "nine".
Valid choices are "zero", "one", 'two", 'three", "four", "five", 'six", 'seven", "eight" and "nine".
Return the string with numbers sorted from smallest to largest
>>> sort_numbers('three one five")
"one three five"
*/
#include<stdio.h>
#include<string>
#include<map>
using namespace std;
string sort_numbers(string numbers){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<map>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string sort_numbers(string numbers){
| map<string,int> tonum={{"zero",0},{"one",1},{"two",2},{"three",3},{"four",4},{"five",5},{"six",6},{"seven",7},{"eight",8},{"nine",9}};
map<int,string> numto={{0,"zero"},{1,"one"},{2,"two"},{3,"three"},{4,"four"},{5,"five"},{6,"six"},{7,"seven"},{8,"eight"},{9,"nine"}};
int count[10];
for (int i=0;i<10;i++)
count[i]=0;
string out="",current="";
if (numbers.length()>0) numbers=numbers+' ';
for (int i=0;i<numbers.length();i++)
if (numbers[i]==' ')
{
count[tonum[current]]+=1;
current="";
}
else current+=numbers[i];
for (int i=0;i<10;i++)
for (int j=0;j<count[i];j++)
out=out+numto[i]+' ';
if (out.length()>0) out.pop_back();
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (sort_numbers("") == "");
assert (sort_numbers("three") == "three");
assert (sort_numbers("three five nine") == "three five nine");
assert (sort_numbers("five zero four seven nine eight") == "zero four five seven eight nine");
assert (sort_numbers("six five four three two one zero") == "zero one two three four five six");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (sort_numbers("three one five") == "one three five");
}
| ; ModuleID = 'c_code_test/code_19.cpp'
source_filename = "c_code_test/code_19.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"
%"struct.std::__2::piecewise_construct_t" = type { i8 }
%"class.std::__2::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::map" = type { %"class.std::__2::__tree" }
%"class.std::__2::__tree" = type { ptr, %"class.std::__2::__compressed_pair.1", %"class.std::__2::__compressed_pair.7" }
%"class.std::__2::__compressed_pair.1" = type { %"struct.std::__2::__compressed_pair_elem.2" }
%"struct.std::__2::__compressed_pair_elem.2" = type { %"class.std::__2::__tree_end_node" }
%"class.std::__2::__tree_end_node" = type { ptr }
%"class.std::__2::__compressed_pair.7" = type { %"struct.std::__2::__compressed_pair_elem.8" }
%"struct.std::__2::__compressed_pair_elem.8" = type { i32 }
%"class.std::initializer_list" = type { ptr, i32 }
%"struct.std::__2::pair" = type { %"class.std::__2::basic_string", i32 }
%"struct.std::__2::less" = type { i8 }
%"class.std::__2::map.10" = type { %"class.std::__2::__tree.11" }
%"class.std::__2::__tree.11" = type { ptr, %"class.std::__2::__compressed_pair.12", %"class.std::__2::__compressed_pair.17" }
%"class.std::__2::__compressed_pair.12" = type { %"struct.std::__2::__compressed_pair_elem.2" }
%"class.std::__2::__compressed_pair.17" = type { %"struct.std::__2::__compressed_pair_elem.8" }
%"class.std::initializer_list.22" = type { ptr, i32 }
%"struct.std::__2::pair.23" = type { i32, %"class.std::__2::basic_string" }
%"struct.std::__2::less.20" = type { i8 }
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"class.std::__2::allocator" = type { i8 }
%"struct.std::__2::pair.26" = type <{ %"class.std::__2::__tree_iterator", i8, [3 x i8] }>
%"class.std::__2::__tree_iterator" = type { ptr }
%"class.std::__2::tuple" = type { %"struct.std::__2::__tuple_impl" }
%"struct.std::__2::__tuple_impl" = type { %"class.std::__2::__tuple_leaf" }
%"class.std::__2::__tuple_leaf" = type { ptr }
%"class.std::__2::tuple.44" = type { i8 }
%"class.std::__2::__tree_node" = type { %"class.std::__2::__tree_node_base.base", %"struct.std::__2::__value_type" }
%"class.std::__2::__tree_node_base.base" = type <{ %"class.std::__2::__tree_end_node", ptr, ptr, i8 }>
%"struct.std::__2::__value_type" = type { %"struct.std::__2::pair" }
%"struct.std::__2::pair.34" = type <{ %"class.std::__2::__tree_iterator.33", i8, [3 x i8] }>
%"class.std::__2::__tree_iterator.33" = type { ptr }
%"class.std::__2::tuple.47" = type { %"struct.std::__2::__tuple_impl.48" }
%"struct.std::__2::__tuple_impl.48" = type { %"class.std::__2::__tuple_leaf.49" }
%"class.std::__2::__tuple_leaf.49" = type { ptr }
%"class.std::__2::__tree_node.36" = type { %"class.std::__2::__tree_node_base.base", %"struct.std::__2::__value_type.37" }
%"struct.std::__2::__value_type.37" = type { %"struct.std::__2::pair.23" }
%"class.std::__2::unique_ptr" = type { %"class.std::__2::__compressed_pair.27" }
%"class.std::__2::__compressed_pair.27" = type { %"struct.std::__2::__compressed_pair_elem.28", %"struct.std::__2::__compressed_pair_elem.29" }
%"struct.std::__2::__compressed_pair_elem.28" = type { ptr }
%"struct.std::__2::__compressed_pair_elem.29" = type { %"class.std::__2::__tree_node_destructor" }
%"class.std::__2::__tree_node_destructor" = type <{ ptr, i8, [3 x i8] }>
%"class.std::__2::__tree_node_base" = type <{ %"class.std::__2::__tree_end_node", ptr, ptr, i8, [3 x i8] }>
%"class.std::__2::__tree_const_iterator" = type { ptr }
%"class.std::__2::basic_string_view" = type { ptr, i32 }
%"class.std::__2::unique_ptr.38" = type { %"class.std::__2::__compressed_pair.39" }
%"class.std::__2::__compressed_pair.39" = type { %"struct.std::__2::__compressed_pair_elem.40", %"struct.std::__2::__compressed_pair_elem.41" }
%"struct.std::__2::__compressed_pair_elem.40" = type { ptr }
%"struct.std::__2::__compressed_pair_elem.41" = type { %"class.std::__2::__tree_node_destructor.42" }
%"class.std::__2::__tree_node_destructor.42" = type <{ ptr, i8, [3 x i8] }>
%"class.std::__2::__tree_const_iterator.31" = type { ptr }
$_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEC2B7v160006ESt16initializer_listISB_ERKS8_ = comdat any
$_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEC2B7v160006ESt16initializer_listISB_ERKS8_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEixERSA_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_S6_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_ = comdat any
$_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEixERSA_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE8pop_backB7v160006Ev = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEE6insertB7v160006IPKSB_EEvT_SH_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE15__insert_uniqueB7v160006ENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEERKNS_4pairIKS7_iEE = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIS7_JRKNS_4pairIKS7_iEEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKS7_iEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_ = comdat any
$_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev = comdat any
$_ZNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEmmB7v160006Ev = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_ = comdat any
$_ZNSt3__24nextB7v160006INS_21__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEEENS_9enable_ifIXsr25__is_cpp17_input_iteratorIT_EE5valueESG_E4typeESG_NS_15iterator_traitsISG_E15difference_typeE = comdat any
$_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareB7v160006ERKS5_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareINS_17basic_string_viewIcS2_EEEENS_9enable_ifIXsr33__can_be_converted_to_string_viewIcS2_T_EE5valueEiE4typeERKSA_ = comdat any
$_ZNSt3__211char_traitsIcE7compareEPKcS3_m = comdat any
$_ZNSt3__216__tree_prev_iterB7v160006IPNS_16__tree_node_baseIPvEEPNS_15__tree_end_nodeIS4_EEEET_T0_ = comdat any
$_ZNSt3__210__tree_maxB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_ = comdat any
$_ZNSt3__29__advanceB7v160006INS_21__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEEEvRT_NS_15iterator_traitsISF_E15difference_typeENS_26bidirectional_iterator_tagE = comdat any
$_ZNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEppB7v160006Ev = comdat any
$_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_ = comdat any
$_ZNSt3__210__tree_minB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_ = comdat any
$_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2ERKS8_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ = comdat any
$_ZNSt3__227__tree_balance_after_insertB7v160006IPNS_16__tree_node_baseIPvEEEEvT_S5_ = comdat any
$_ZNSt3__218__tree_left_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_ = comdat any
$_ZNSt3__219__tree_right_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_ = comdat any
$_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEE5resetB7v160006EPSB_ = comdat any
$_ZNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEiEEPvEEEEEclB7v160006EPSB_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEED2Ev = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE = comdat any
$_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEE6insertB7v160006IPKSB_EEvT_SH_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE15__insert_uniqueB7v160006ENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEERKNS_4pairIKiS7_EE = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIiJRKNS_4pairIKiS7_EEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKiS7_EEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_ = comdat any
$_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev = comdat any
$_ZNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEmmB7v160006Ev = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_ = comdat any
$_ZNSt3__24nextB7v160006INS_21__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEEENS_9enable_ifIXsr25__is_cpp17_input_iteratorIT_EE5valueESG_E4typeESG_NS_15iterator_traitsISG_E15difference_typeE = comdat any
$_ZNSt3__29__advanceB7v160006INS_21__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEEEvRT_NS_15iterator_traitsISF_E15difference_typeENS_26bidirectional_iterator_tagE = comdat any
$_ZNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEppB7v160006Ev = comdat any
$_ZNSt3__24pairIKiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEC2ERKS8_ = comdat any
$_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEE5resetB7v160006EPSB_ = comdat any
$_ZNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEPvEEEEEclB7v160006EPSB_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEED2Ev = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIS7_JRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_ = comdat any
$_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_ = comdat any
$_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2B7v160006IJRS7_EJEEENS_21piecewise_construct_tENS_5tupleIJDpT_EEENSC_IJDpT0_EEE = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc = comdat any
$_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIiJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_ = comdat any
@.str = private unnamed_addr constant [5 x i8] c"zero\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"one\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"two\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"three\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"four\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c"five\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c"six\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"seven\00", align 1
@.str.8 = private unnamed_addr constant [6 x i8] c"eight\00", align 1
@.str.9 = private unnamed_addr constant [5 x i8] c"nine\00", align 1
@.str.10 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.11 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
@_ZNSt3__2L19piecewise_constructE = internal constant %"struct.std::__2::piecewise_construct_t" zeroinitializer, align 1
; Function Attrs: minsize optsize
define void @_Z12sort_numbersNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::map", align 4
%4 = alloca %"class.std::initializer_list", align 4
%5 = alloca [10 x %"struct.std::__2::pair"], align 4
%6 = alloca %"struct.std::__2::less", align 1
%7 = alloca %"class.std::__2::map.10", align 4
%8 = alloca %"class.std::initializer_list.22", align 4
%9 = alloca [10 x %"struct.std::__2::pair.23"], align 4
%10 = alloca %"struct.std::__2::less.20", align 1
%11 = alloca [10 x i32], align 16
%12 = alloca %"class.std::__2::basic_string", align 4
%13 = alloca %"class.std::__2::basic_string", align 4
%14 = alloca i32, align 4
%15 = alloca %"class.std::__2::basic_string", align 4
%16 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #19
call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %5) #19
%17 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull @.str) #20
%18 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 0, i32 1
store i32 0, ptr %18, align 4, !tbaa !3
%19 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 1
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull @.str.1) #20
%21 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 1, i32 1
store i32 1, ptr %21, align 4, !tbaa !3
%22 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 2
%23 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull @.str.2) #20
%24 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 2, i32 1
store i32 2, ptr %24, align 4, !tbaa !3
%25 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 3
%26 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull @.str.3) #20
%27 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 3, i32 1
store i32 3, ptr %27, align 4, !tbaa !3
%28 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 4
%29 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %28, ptr noundef nonnull @.str.4) #20
%30 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 4, i32 1
store i32 4, ptr %30, align 4, !tbaa !3
%31 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 5
%32 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %31, ptr noundef nonnull @.str.5) #20
%33 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 5, i32 1
store i32 5, ptr %33, align 4, !tbaa !3
%34 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 6
%35 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %34, ptr noundef nonnull @.str.6) #20
%36 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 6, i32 1
store i32 6, ptr %36, align 4, !tbaa !3
%37 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 7
%38 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %37, ptr noundef nonnull @.str.7) #20
%39 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 7, i32 1
store i32 7, ptr %39, align 4, !tbaa !3
%40 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 8
%41 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %40, ptr noundef nonnull @.str.8) #20
%42 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 8, i32 1
store i32 8, ptr %42, align 4, !tbaa !3
%43 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 9
%44 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull @.str.9) #20
%45 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 9, i32 1
store i32 9, ptr %45, align 4, !tbaa !3
store ptr %5, ptr %4, align 4, !tbaa !12
%46 = getelementptr inbounds %"class.std::initializer_list", ptr %4, i32 0, i32 1
store i32 10, ptr %46, align 4, !tbaa !16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #19
%47 = call noundef ptr @_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEC2B7v160006ESt16initializer_listISB_ERKS8_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull byval(%"class.std::initializer_list") align 4 %4, ptr noundef nonnull align 1 dereferenceable(1) %6) #20
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #19
%48 = getelementptr inbounds %"struct.std::__2::pair", ptr %5, i32 10
br label %49
49: ; preds = %49, %2
%50 = phi ptr [ %48, %2 ], [ %51, %49 ]
%51 = getelementptr inbounds %"struct.std::__2::pair", ptr %50, i32 -1
%52 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %51) #21
%53 = icmp eq ptr %51, %5
br i1 %53, label %54, label %49
54: ; preds = %49
call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %5) #19
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #19
call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %9) #19
store i32 0, ptr %9, align 4, !tbaa !17
%55 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 0, i32 1
%56 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %55, ptr noundef nonnull @.str) #20
%57 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 1
store i32 1, ptr %57, align 4, !tbaa !17
%58 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 1, i32 1
%59 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %58, ptr noundef nonnull @.str.1) #20
%60 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 2
store i32 2, ptr %60, align 4, !tbaa !17
%61 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 2, i32 1
%62 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %61, ptr noundef nonnull @.str.2) #20
%63 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 3
store i32 3, ptr %63, align 4, !tbaa !17
%64 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 3, i32 1
%65 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %64, ptr noundef nonnull @.str.3) #20
%66 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 4
store i32 4, ptr %66, align 4, !tbaa !17
%67 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 4, i32 1
%68 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %67, ptr noundef nonnull @.str.4) #20
%69 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 5
store i32 5, ptr %69, align 4, !tbaa !17
%70 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 5, i32 1
%71 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %70, ptr noundef nonnull @.str.5) #20
%72 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 6
store i32 6, ptr %72, align 4, !tbaa !17
%73 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 6, i32 1
%74 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %73, ptr noundef nonnull @.str.6) #20
%75 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 7
store i32 7, ptr %75, align 4, !tbaa !17
%76 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 7, i32 1
%77 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %76, ptr noundef nonnull @.str.7) #20
%78 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 8
store i32 8, ptr %78, align 4, !tbaa !17
%79 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 8, i32 1
%80 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %79, ptr noundef nonnull @.str.8) #20
%81 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 9
store i32 9, ptr %81, align 4, !tbaa !17
%82 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 9, i32 1
%83 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %82, ptr noundef nonnull @.str.9) #20
store ptr %9, ptr %8, align 4, !tbaa !19
%84 = getelementptr inbounds %"class.std::initializer_list.22", ptr %8, i32 0, i32 1
store i32 10, ptr %84, align 4, !tbaa !21
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #19
%85 = call noundef ptr @_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEC2B7v160006ESt16initializer_listISB_ERKS8_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull byval(%"class.std::initializer_list.22") align 4 %8, ptr noundef nonnull align 1 dereferenceable(1) %10) #20
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #19
%86 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %9, i32 10
br label %87
87: ; preds = %87, %54
%88 = phi ptr [ %86, %54 ], [ %89, %87 ]
%89 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %88, i32 -1
%90 = getelementptr %"struct.std::__2::pair.23", ptr %88, i32 -1, i32 1
%91 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %90) #21
%92 = icmp eq ptr %89, %9
br i1 %92, label %93, label %87
93: ; preds = %87
call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %9) #19
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #19
br label %94
94: ; preds = %108, %93
%95 = phi i32 [ 0, %93 ], [ %110, %108 ]
%96 = icmp eq i32 %95, 10
br i1 %96, label %97, label %108
97: ; preds = %94
%98 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str.10) #20
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #19
%99 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull @.str.10) #20
%100 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%101 = load i8, ptr %100, align 1
%102 = icmp slt i8 %101, 0
%103 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%104 = load i32, ptr %103, align 4
%105 = zext i8 %101 to i32
%106 = select i1 %102, i32 %104, i32 %105
%107 = icmp eq i32 %106, 0
br i1 %107, label %113, label %111
108: ; preds = %94
%109 = getelementptr inbounds [10 x i32], ptr %11, i32 0, i32 %95
store i32 0, ptr %109, align 4, !tbaa !22
%110 = add nuw nsw i32 %95, 1
br label %94, !llvm.loop !23
111: ; preds = %97
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #19
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext 32) #20
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %13) #21
%112 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #19
br label %113
113: ; preds = %111, %97
br label %114
114: ; preds = %113, %137
%115 = phi i32 [ %138, %137 ], [ 0, %113 ]
%116 = load i8, ptr %100, align 1
%117 = icmp slt i8 %116, 0
%118 = load i32, ptr %103, align 4
%119 = zext i8 %116 to i32
%120 = select i1 %117, i32 %118, i32 %119
%121 = icmp ult i32 %115, %120
br i1 %121, label %123, label %122
122: ; preds = %114
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #19
br label %139
123: ; preds = %114
%124 = load ptr, ptr %1, align 4
%125 = select i1 %117, ptr %124, ptr %1
%126 = getelementptr inbounds i8, ptr %125, i32 %115
%127 = load i8, ptr %126, align 1, !tbaa !25
%128 = icmp eq i8 %127, 32
br i1 %128, label %129, label %136
129: ; preds = %123
%130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEixERSA_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %12) #20
%131 = load i32, ptr %130, align 4, !tbaa !22
%132 = getelementptr inbounds [10 x i32], ptr %11, i32 0, i32 %131
%133 = load i32, ptr %132, align 4, !tbaa !22
%134 = add nsw i32 %133, 1
store i32 %134, ptr %132, align 4, !tbaa !22
%135 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull @.str.10) #20
br label %137
136: ; preds = %123
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %12, i8 noundef signext %127) #20
br label %137
137: ; preds = %129, %136
%138 = add nuw nsw i32 %115, 1
br label %114, !llvm.loop !26
139: ; preds = %157, %122
%140 = phi i32 [ 0, %122 ], [ %158, %157 ]
store i32 %140, ptr %14, align 4, !tbaa !22
%141 = icmp slt i32 %140, 10
br i1 %141, label %151, label %142
142: ; preds = %139
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #19
%143 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%144 = load i8, ptr %143, align 1
%145 = icmp slt i8 %144, 0
%146 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%147 = load i32, ptr %146, align 4
%148 = zext i8 %144 to i32
%149 = select i1 %145, i32 %147, i32 %148
%150 = icmp eq i32 %149, 0
br i1 %150, label %166, label %165
151: ; preds = %139, %159
%152 = phi i32 [ %164, %159 ], [ %140, %139 ]
%153 = phi i32 [ %163, %159 ], [ 0, %139 ]
%154 = getelementptr inbounds [10 x i32], ptr %11, i32 0, i32 %152
%155 = load i32, ptr %154, align 4, !tbaa !22
%156 = icmp slt i32 %153, %155
br i1 %156, label %159, label %157
157: ; preds = %151
%158 = add nsw i32 %152, 1
br label %139, !llvm.loop !27
159: ; preds = %151
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #19
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #19
%160 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEixERSA_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(4) %14) #20
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %160) #20
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %15, ptr noundef nonnull align 4 dereferenceable(12) %16, i8 noundef signext 32) #20
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %15) #21
%161 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #21
%162 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #19
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #19
%163 = add nuw nsw i32 %153, 1
%164 = load i32, ptr %14, align 4, !tbaa !22
br label %151, !llvm.loop !28
165: ; preds = %142
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE8pop_backB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #20
br label %166
166: ; preds = %165, %142
%167 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #19
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #19
%168 = call noundef ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #19
%169 = call noundef ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #19
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: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEC2B7v160006ESt16initializer_listISB_ERKS8_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef byval(%"class.std::initializer_list") align 4 %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !29
%5 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 2
store i32 0, ptr %5, align 4, !tbaa !31
store ptr %4, ptr %0, align 4, !tbaa !33
%6 = load ptr, ptr %1, align 4, !tbaa !12
%7 = getelementptr inbounds %"class.std::initializer_list", ptr %1, i32 0, i32 1
%8 = load i32, ptr %7, align 4, !tbaa !16
%9 = getelementptr inbounds %"struct.std::__2::pair", ptr %6, i32 %8
tail call void @_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEE6insertB7v160006IPKSB_EEvT_SH_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %6, ptr noundef %9) #20
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEC2B7v160006ESt16initializer_listISB_ERKS8_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef byval(%"class.std::initializer_list.22") align 4 %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !29
%5 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 2
store i32 0, ptr %5, align 4, !tbaa !31
store ptr %4, ptr %0, align 4, !tbaa !33
%6 = load ptr, ptr %1, align 4, !tbaa !19
%7 = getelementptr inbounds %"class.std::initializer_list.22", ptr %1, i32 0, i32 1
%8 = load i32, ptr %7, align 4, !tbaa !21
%9 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %6, i32 %8
tail call void @_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEE6insertB7v160006IPKSB_EEvT_SH_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %6, ptr noundef %9) #20
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #21
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #20
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #19
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #20
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #19
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !34
store i8 %2, ptr %24, align 1, !tbaa !25
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !25
ret void
}
; 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 #2
; Function Attrs: minsize optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEixERSA_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #0 comdat {
%3 = alloca %"struct.std::__2::pair.26", align 4
%4 = alloca %"class.std::__2::tuple", align 4
%5 = alloca %"class.std::__2::tuple.44", align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #19
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #19
store ptr %1, ptr %4, align 4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #19
call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIS7_JRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_(ptr nonnull sret(%"struct.std::__2::pair.26") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 1 dereferenceable(1) @_ZNSt3__2L19piecewise_constructE, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %5) #20
%6 = load ptr, ptr %3, align 4, !tbaa !45
%7 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %6, i32 0, i32 1, i32 0, i32 1
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #19
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #19
ret ptr %7
}
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #3 comdat {
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) #20
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)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %1, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%13 = load i8, ptr %12, align 1
%14 = icmp slt i8 %13, 0
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
%16 = load i32, ptr %15, align 4
%17 = zext i8 %13 to i32
%18 = select i1 %14, i32 %16, i32 %17
%19 = add i32 %18, %11
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #19
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #20
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #19
%21 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%22 = load i8, ptr %21, align 1
%23 = icmp slt i8 %22, 0
%24 = load ptr, ptr %0, align 4
%25 = select i1 %23, ptr %24, ptr %0
%26 = load i8, ptr %5, align 1
%27 = icmp slt i8 %26, 0
%28 = load ptr, ptr %1, align 4
%29 = select i1 %27, ptr %28, ptr %1
%30 = icmp ult ptr %29, %25
%31 = getelementptr inbounds i8, ptr %25, i32 %11
%32 = icmp ule ptr %31, %29
%33 = or i1 %30, %32
call void @llvm.assume(i1 %33)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %25, ptr align 1 %29, i32 %11, i1 false), !noalias !47
%34 = load i8, ptr %12, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %2, align 4
%37 = select i1 %35, ptr %36, ptr %2
%38 = icmp ult ptr %37, %31
%39 = getelementptr inbounds i8, ptr %31, i32 %18
%40 = icmp ule ptr %39, %37
%41 = or i1 %38, %40
call void @llvm.assume(i1 %41)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %31, ptr align 1 %37, i32 %18, i1 false), !noalias !58
store i8 0, ptr %39, align 1, !tbaa !25
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEixERSA_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #0 comdat {
%3 = alloca %"struct.std::__2::pair.34", align 4
%4 = alloca %"class.std::__2::tuple.47", align 4
%5 = alloca %"class.std::__2::tuple.44", align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #19
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #19
store ptr %1, ptr %4, align 4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #19
call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIiJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_(ptr nonnull sret(%"struct.std::__2::pair.34") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 1 dereferenceable(1) @_ZNSt3__2L19piecewise_constructE, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %5) #20
%6 = load ptr, ptr %3, align 4, !tbaa !69
%7 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %6, i32 0, i32 1, i32 0, i32 1
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #19
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #19
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE8pop_backB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #4 comdat {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
%9 = add i32 %8, -1
br i1 %4, label %10, label %12
10: ; preds = %1
%11 = load ptr, ptr %0, align 4
store i32 %9, ptr %5, align 4, !tbaa !25
br label %15
12: ; preds = %1
%13 = icmp ult i32 %9, 11
tail call void @llvm.assume(i1 %13)
%14 = trunc i32 %9 to i8
store i8 %14, ptr %2, align 1
br label %15
15: ; preds = %10, %12
%16 = phi ptr [ %11, %10 ], [ %0, %12 ]
%17 = getelementptr inbounds i8, ptr %16, i32 %9
store i8 0, ptr %17, align 1, !tbaa !25
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #3
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.11) #22
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #19
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #20
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #23
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) #20
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !71
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEE6insertB7v160006IPKSB_EEvT_SH_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
br label %5
5: ; preds = %9, %3
%6 = phi ptr [ %1, %3 ], [ %11, %9 ]
%7 = icmp eq ptr %6, %2
br i1 %7, label %8, label %9
8: ; preds = %5
ret void
9: ; preds = %5
%10 = tail call ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE15__insert_uniqueB7v160006ENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEERKNS_4pairIKS7_iEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr nonnull %4, ptr noundef nonnull align 4 dereferenceable(16) %6) #20
%11 = getelementptr inbounds %"struct.std::__2::pair", ptr %6, i32 1
br label %5, !llvm.loop !73
}
; 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) #11
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE15__insert_uniqueB7v160006ENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEERKNS_4pairIKS7_iEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(16) %2) local_unnamed_addr #13 comdat {
%4 = alloca %"struct.std::__2::pair.26", align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #19
call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIS7_JRKNS_4pairIKS7_iEEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_(ptr nonnull sret(%"struct.std::__2::pair.26") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(16) %2) #20
%5 = load ptr, ptr %4, align 4, !tbaa.struct !74
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #19
ret ptr %5
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIS7_JRKNS_4pairIKS7_iEEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_(ptr noalias sret(%"struct.std::__2::pair.26") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr %2, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(16) %4) local_unnamed_addr #0 comdat {
%6 = alloca ptr, align 4
%7 = alloca ptr, align 4
%8 = alloca %"class.std::__2::unique_ptr", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #19
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #19
%9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr %2, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(12) %3) #20
%10 = load ptr, ptr %9, align 4, !tbaa !33
%11 = icmp eq ptr %10, null
br i1 %11, label %12, label %17
12: ; preds = %5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #19
call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKS7_iEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_(ptr nonnull sret(%"class.std::__2::unique_ptr") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(16) %4) #20
%13 = load ptr, ptr %6, align 4, !tbaa !33
%14 = load ptr, ptr %8, align 4, !tbaa !33
call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %13, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef %14) #21
%15 = load ptr, ptr %8, align 4, !tbaa !33
store ptr null, ptr %8, align 4, !tbaa !33
%16 = call noundef ptr @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #19
br label %17
17: ; preds = %12, %5
%18 = phi i8 [ 1, %12 ], [ 0, %5 ]
%19 = phi ptr [ %15, %12 ], [ %10, %5 ]
%20 = ptrtoint ptr %19 to i32
store i32 %20, ptr %0, align 4, !tbaa !33
%21 = getelementptr inbounds %"struct.std::__2::pair.26", ptr %0, i32 0, i32 1
store i8 %18, ptr %21, align 4, !tbaa !75
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #19
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(12) %4) local_unnamed_addr #0 comdat {
%6 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
%7 = icmp eq ptr %6, %1
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %1, i32 0, i32 1
%10 = tail call noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %9) #21
br i1 %10, label %11, label %27
11: ; preds = %5, %8
%12 = load ptr, ptr %0, align 4, !tbaa !33
%13 = icmp eq ptr %12, %1
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = tail call noundef ptr @_ZNSt3__216__tree_prev_iterB7v160006IPNS_16__tree_node_baseIPvEEPNS_15__tree_end_nodeIS4_EEEET_T0_(ptr noundef %1) #21
%16 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %15, i32 0, i32 1
%17 = tail call noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %4) #21
br i1 %17, label %18, label %25
18: ; preds = %11, %14
%19 = phi ptr [ %15, %14 ], [ %1, %11 ]
%20 = load ptr, ptr %1, align 4, !tbaa !29
%21 = icmp eq ptr %20, null
br i1 %21, label %22, label %23
22: ; preds = %18
store ptr %1, ptr %2, align 4, !tbaa !33
br label %44
23: ; preds = %18
store ptr %19, ptr %2, align 4, !tbaa !33
%24 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %19, i32 0, i32 1
br label %44
25: ; preds = %14
%26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(12) %4) #20
br label %44
27: ; preds = %8
%28 = tail call noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %4) #21
br i1 %28, label %29, label %43
29: ; preds = %27
%30 = tail call ptr @_ZNSt3__24nextB7v160006INS_21__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEEENS_9enable_ifIXsr25__is_cpp17_input_iteratorIT_EE5valueESG_E4typeESG_NS_15iterator_traitsISG_E15difference_typeE(ptr %1, i32 noundef 1) #20
%31 = icmp eq ptr %30, %6
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %30, i32 0, i32 1
%34 = tail call noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %33) #21
br i1 %34, label %35, label %41
35: ; preds = %29, %32
%36 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %1, i32 0, i32 1
%37 = load ptr, ptr %36, align 4, !tbaa !78
%38 = icmp eq ptr %37, null
br i1 %38, label %39, label %40
39: ; preds = %35
store ptr %1, ptr %2, align 4, !tbaa !33
br label %44
40: ; preds = %35
store ptr %30, ptr %2, align 4, !tbaa !33
br label %44
41: ; preds = %32
%42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(12) %4) #20
br label %44
43: ; preds = %27
store ptr %1, ptr %2, align 4, !tbaa !33
store ptr %1, ptr %3, align 4, !tbaa !33
br label %44
44: ; preds = %39, %40, %41, %22, %23, %25, %43
%45 = phi ptr [ %3, %43 ], [ %1, %22 ], [ %24, %23 ], [ %26, %25 ], [ %36, %39 ], [ %30, %40 ], [ %42, %41 ]
ret ptr %45
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKS7_iEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_(ptr noalias sret(%"class.std::__2::unique_ptr") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(16) %2) local_unnamed_addr #0 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree", ptr %1, i32 0, i32 1
%5 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i32 noundef 32) #24
store ptr %5, ptr %0, align 4, !tbaa !80
%6 = getelementptr inbounds i8, ptr %0, i32 4
%7 = ptrtoint ptr %4 to i32
store i32 %7, ptr %6, align 4
%8 = getelementptr inbounds i8, ptr %0, i32 8
store i8 0, ptr %8, align 4
%9 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %5, i32 0, i32 1
%10 = tail call noundef ptr @_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2ERKS8_(ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(16) %2) #20
store i8 1, ptr %8, align 4, !tbaa !82
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef %3) local_unnamed_addr #14 comdat {
store ptr null, ptr %3, align 4, !tbaa !29
%5 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %3, i32 0, i32 1
store ptr null, ptr %5, align 4, !tbaa !78
%6 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %3, i32 0, i32 2
store ptr %1, ptr %6, align 4, !tbaa !84
store ptr %3, ptr %2, align 4, !tbaa !33
%7 = load ptr, ptr %0, align 4, !tbaa !33
%8 = load ptr, ptr %7, align 4, !tbaa !29
%9 = icmp eq ptr %8, null
br i1 %9, label %12, label %10
10: ; preds = %4
store ptr %8, ptr %0, align 4, !tbaa !33
%11 = load ptr, ptr %2, align 4, !tbaa !33
br label %12
12: ; preds = %10, %4
%13 = phi ptr [ %11, %10 ], [ %3, %4 ]
%14 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
%15 = load ptr, ptr %14, align 4, !tbaa !29
tail call void @_ZNSt3__227__tree_balance_after_insertB7v160006IPNS_16__tree_node_baseIPvEEEEvT_S5_(ptr noundef %15, ptr noundef %13) #21
%16 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 2
%17 = load i32, ptr %16, align 4, !tbaa !85
%18 = add i32 %17, 1
store i32 %18, ptr %16, align 4, !tbaa !85
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #9 comdat {
tail call void @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEE5resetB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef null) #21
ret ptr %0
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEmmB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #14 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !86
%3 = tail call noundef ptr @_ZNSt3__216__tree_prev_iterB7v160006IPNS_16__tree_node_baseIPvEEPNS_15__tree_end_nodeIS4_EEEET_T0_(ptr noundef %2) #21
store ptr %3, ptr %0, align 4, !tbaa !86
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #13 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
%5 = load ptr, ptr %4, align 4, !tbaa !29
%6 = icmp eq ptr %5, null
br i1 %6, label %24, label %7
7: ; preds = %3, %21
%8 = phi ptr [ %22, %21 ], [ %5, %3 ]
%9 = phi ptr [ %23, %21 ], [ %4, %3 ]
%10 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %8, i32 0, i32 1
%11 = tail call noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %10) #21
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load ptr, ptr %8, align 4, !tbaa !29
%14 = icmp eq ptr %13, null
br i1 %14, label %24, label %21
15: ; preds = %7
%16 = tail call noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %2) #21
br i1 %16, label %17, label %24
17: ; preds = %15
%18 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %8, i32 0, i32 1
%19 = load ptr, ptr %18, align 4, !tbaa !78
%20 = icmp eq ptr %19, null
br i1 %20, label %24, label %21
21: ; preds = %17, %12
%22 = phi ptr [ %13, %12 ], [ %19, %17 ]
%23 = phi ptr [ %8, %12 ], [ %18, %17 ]
br label %7, !llvm.loop !88
24: ; preds = %15, %17, %12, %3
%25 = phi ptr [ %4, %3 ], [ %8, %12 ], [ %8, %17 ], [ %8, %15 ]
%26 = phi ptr [ %4, %3 ], [ %9, %15 ], [ %18, %17 ], [ %8, %12 ]
store ptr %25, ptr %1, align 4, !tbaa !33
ret ptr %26
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden ptr @_ZNSt3__24nextB7v160006INS_21__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEEENS_9enable_ifIXsr25__is_cpp17_input_iteratorIT_EE5valueESG_E4typeESG_NS_15iterator_traitsISG_E15difference_typeE(ptr %0, i32 noundef %1) local_unnamed_addr #4 comdat {
%3 = alloca %"class.std::__2::__tree_const_iterator", align 4
store ptr %0, ptr %3, align 4
call void @_ZNSt3__29__advanceB7v160006INS_21__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEEEvRT_NS_15iterator_traitsISF_E15difference_typeENS_26bidirectional_iterator_tagE(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %1) #20
%4 = load ptr, ptr %3, align 4, !tbaa.struct !74
ret ptr %4
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef zeroext i1 @_ZNSt3__2ltB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEEbRKNS_12basic_stringIT_T0_T1_EESB_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #15 comdat {
%3 = tail call noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #21
%4 = icmp slt i32 %3, 0
ret i1 %4
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = alloca %"class.std::__2::basic_string_view", align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #19
tail call void @llvm.experimental.noalias.scope.decl(metadata !89)
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%5 = load i8, ptr %4, align 1, !noalias !89
%6 = icmp slt i8 %5, 0
%7 = load ptr, ptr %1, align 4, !noalias !89
%8 = select i1 %6, ptr %7, ptr %1
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = load i32, ptr %9, align 4, !noalias !89
%11 = zext i8 %5 to i32
%12 = select i1 %6, i32 %10, i32 %11
store ptr %8, ptr %3, align 4, !tbaa !92, !alias.scope !89
%13 = getelementptr inbounds %"class.std::__2::basic_string_view", ptr %3, i32 0, i32 1
store i32 %12, ptr %13, align 4, !tbaa !94, !alias.scope !89
%14 = icmp eq i32 %12, 0
%15 = icmp ne ptr %8, null
%16 = or i1 %15, %14
tail call void @llvm.assume(i1 %16)
%17 = call noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareINS_17basic_string_viewIcS2_EEEENS_9enable_ifIXsr33__can_be_converted_to_string_viewIcS2_T_EE5valueEiE4typeERKSA_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(8) %3) #21
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #19
ret i32 %17
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareINS_17basic_string_viewIcS2_EEEENS_9enable_ifIXsr33__can_be_converted_to_string_viewIcS2_T_EE5valueEiE4typeERKSA_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(8) %1) local_unnamed_addr #15 comdat {
%3 = load i32, ptr %1, align 4
%4 = getelementptr inbounds i8, ptr %1, i32 4
%5 = load i32, ptr %4, align 4
%6 = inttoptr i32 %3 to ptr
%7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%8 = load i8, ptr %7, align 1
%9 = icmp slt i8 %8, 0
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%11 = load i32, ptr %10, align 4
%12 = zext i8 %8 to i32
%13 = select i1 %9, i32 %11, i32 %12
%14 = load ptr, ptr %0, align 4
%15 = select i1 %9, ptr %14, ptr %0
%16 = icmp ult i32 %5, %13
%17 = tail call i32 @llvm.umin.i32(i32 %5, i32 %13)
%18 = tail call noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %15, ptr noundef %6, i32 noundef %17) #21
%19 = icmp eq i32 %18, 0
%20 = icmp ult i32 %13, %5
%21 = zext i1 %16 to i32
%22 = select i1 %20, i32 -1, i32 %21
%23 = select i1 %19, i32 %22, i32 %18
ret i32 %23
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #14 comdat {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcmp(ptr noundef %0, ptr noundef %1, i32 noundef %2) #21
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i32 noundef) local_unnamed_addr #12
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__216__tree_prev_iterB7v160006IPNS_16__tree_node_baseIPvEEPNS_15__tree_end_nodeIS4_EEEET_T0_(ptr noundef %0) local_unnamed_addr #15 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
%3 = load ptr, ptr %0, align 4, !tbaa !29
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call noundef ptr @_ZNSt3__210__tree_maxB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_(ptr noundef nonnull %3) #21
br label %13
7: ; preds = %1, %7
%8 = phi ptr [ %10, %7 ], [ %0, %1 ]
%9 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %8, i32 0, i32 2
%10 = load ptr, ptr %9, align 4, !tbaa !84
%11 = load ptr, ptr %10, align 4, !tbaa !29
%12 = icmp eq ptr %11, %8
br i1 %12, label %7, label %13, !llvm.loop !95
13: ; preds = %7, %5
%14 = phi ptr [ %6, %5 ], [ %10, %7 ]
ret ptr %14
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__210__tree_maxB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_(ptr noundef %0) local_unnamed_addr #15 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
br label %3
3: ; preds = %3, %1
%4 = phi ptr [ %0, %1 ], [ %6, %3 ]
%5 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %4, i32 0, i32 1
%6 = load ptr, ptr %5, align 4, !tbaa !78
%7 = icmp eq ptr %6, null
br i1 %7, label %8, label %3, !llvm.loop !96
8: ; preds = %3
ret ptr %4
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__29__advanceB7v160006INS_21__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEEEvRT_NS_15iterator_traitsISF_E15difference_typeENS_26bidirectional_iterator_tagE(ptr noundef nonnull align 4 dereferenceable(4) %0, i32 noundef %1) local_unnamed_addr #13 comdat {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %10
4: ; preds = %2, %7
%5 = phi i32 [ %9, %7 ], [ %1, %2 ]
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEppB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #20
%9 = add nsw i32 %5, -1
br label %4, !llvm.loop !97
10: ; preds = %2, %13
%11 = phi i32 [ %15, %13 ], [ %1, %2 ]
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEmmB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #20
%15 = add i32 %11, 1
br label %10, !llvm.loop !98
16: ; preds = %10, %4
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEppB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #14 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !86
%3 = tail call noundef ptr @_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_(ptr noundef %2) #21
store ptr %3, ptr %0, align 4, !tbaa !86
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_(ptr noundef %0) local_unnamed_addr #15 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
%3 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !78
%5 = icmp eq ptr %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call noundef ptr @_ZNSt3__210__tree_minB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_(ptr noundef nonnull %4) #21
br label %14
8: ; preds = %1, %8
%9 = phi ptr [ %11, %8 ], [ %0, %1 ]
%10 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %9, i32 0, i32 2
%11 = load ptr, ptr %10, align 4, !tbaa !84
%12 = load ptr, ptr %11, align 4, !tbaa !29
%13 = icmp eq ptr %12, %9
br i1 %13, label %14, label %8, !llvm.loop !99
14: ; preds = %8, %6
%15 = phi ptr [ %7, %6 ], [ %11, %8 ]
ret ptr %15
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__210__tree_minB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_(ptr noundef %0) local_unnamed_addr #15 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
br label %3
3: ; preds = %3, %1
%4 = phi ptr [ %0, %1 ], [ %5, %3 ]
%5 = load ptr, ptr %4, align 4, !tbaa !29
%6 = icmp eq ptr %5, null
br i1 %6, label %7, label %3, !llvm.loop !100
7: ; preds = %3
ret ptr %4
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2ERKS8_(ptr noundef nonnull returned align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %1) unnamed_addr #0 comdat {
%3 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #20
%4 = getelementptr inbounds %"struct.std::__2::pair", ptr %0, i32 0, i32 1
%5 = getelementptr inbounds %"struct.std::__2::pair", ptr %1, i32 0, i32 1
%6 = load i32, ptr %5, align 4, !tbaa !3
store i32 %6, ptr %4, align 4, !tbaa !3
ret ptr %0
}
; 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 !101
br label %11
7: ; preds = %2
%8 = load ptr, ptr %1, align 4, !tbaa !25
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = load i32, ptr %9, align 4, !tbaa !25
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) #20
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: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__227__tree_balance_after_insertB7v160006IPNS_16__tree_node_baseIPvEEEEvT_S5_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #14 comdat {
%3 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %3)
%4 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %4)
%5 = icmp eq ptr %1, %0
%6 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %1, i32 0, i32 3
%7 = zext i1 %5 to i8
store i8 %7, ptr %6, align 4, !tbaa !102
br label %8
8: ; preds = %62, %2
%9 = phi ptr [ %1, %2 ], [ %19, %62 ]
%10 = icmp eq ptr %9, %0
br i1 %10, label %67, label %11
11: ; preds = %8
%12 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %9, i32 0, i32 2
%13 = load ptr, ptr %12, align 4, !tbaa !84
%14 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %13, i32 0, i32 3
%15 = load i8, ptr %14, align 4, !tbaa !102, !range !103, !noundef !104
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %67
17: ; preds = %11
%18 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %13, i32 0, i32 2
%19 = load ptr, ptr %18, align 4, !tbaa !84
%20 = load ptr, ptr %19, align 4, !tbaa !29
%21 = icmp eq ptr %20, %13
br i1 %21, label %22, label %43
22: ; preds = %17
%23 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %19, i32 0, i32 1
%24 = load ptr, ptr %23, align 4, !tbaa !78
%25 = icmp eq ptr %24, null
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %24, i32 0, i32 3
%28 = load i8, ptr %27, align 4, !tbaa !102, !range !103, !noundef !104
%29 = icmp eq i8 %28, 0
br i1 %29, label %62, label %30
30: ; preds = %26, %22
%31 = load ptr, ptr %13, align 4, !tbaa !29
%32 = icmp eq ptr %31, %9
br i1 %32, label %38, label %33
33: ; preds = %30
%34 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %13, i32 0, i32 2
tail call void @_ZNSt3__218__tree_left_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_(ptr noundef nonnull %13) #21
%35 = load ptr, ptr %34, align 4, !tbaa !84
%36 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %35, i32 0, i32 2
%37 = load ptr, ptr %36, align 4, !tbaa !84
br label %38
38: ; preds = %30, %33
%39 = phi ptr [ %19, %30 ], [ %37, %33 ]
%40 = phi ptr [ %13, %30 ], [ %35, %33 ]
%41 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %40, i32 0, i32 3
store i8 1, ptr %41, align 4, !tbaa !102
%42 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %39, i32 0, i32 3
store i8 0, ptr %42, align 4, !tbaa !102
tail call void @_ZNSt3__219__tree_right_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_(ptr noundef %39) #21
br label %67
43: ; preds = %17
%44 = icmp eq ptr %20, null
br i1 %44, label %49, label %45
45: ; preds = %43
%46 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %20, i32 0, i32 3
%47 = load i8, ptr %46, align 4, !tbaa !102, !range !103, !noundef !104
%48 = icmp eq i8 %47, 0
br i1 %48, label %62, label %49
49: ; preds = %45, %43
%50 = load ptr, ptr %13, align 4, !tbaa !29
%51 = icmp eq ptr %50, %9
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %13, i32 0, i32 2
tail call void @_ZNSt3__219__tree_right_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_(ptr noundef nonnull %13) #21
%54 = load ptr, ptr %53, align 4, !tbaa !84
%55 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %54, i32 0, i32 2
%56 = load ptr, ptr %55, align 4, !tbaa !84
br label %57
57: ; preds = %49, %52
%58 = phi ptr [ %56, %52 ], [ %19, %49 ]
%59 = phi ptr [ %54, %52 ], [ %13, %49 ]
%60 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %59, i32 0, i32 3
store i8 1, ptr %60, align 4, !tbaa !102
%61 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %58, i32 0, i32 3
store i8 0, ptr %61, align 4, !tbaa !102
tail call void @_ZNSt3__218__tree_left_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_(ptr noundef %58) #21
br label %67
62: ; preds = %45, %26
%63 = phi ptr [ %27, %26 ], [ %46, %45 ]
store i8 1, ptr %14, align 4, !tbaa !102
%64 = icmp eq ptr %19, %0
%65 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %19, i32 0, i32 3
%66 = zext i1 %64 to i8
store i8 %66, ptr %65, align 4, !tbaa !102
store i8 1, ptr %63, align 4, !tbaa !102
br label %8, !llvm.loop !105
67: ; preds = %8, %11, %57, %38
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__218__tree_left_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_(ptr noundef %0) local_unnamed_addr #14 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
%3 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !78, !nonnull !104, !noundef !104
%5 = load ptr, ptr %4, align 4, !tbaa !29
store ptr %5, ptr %3, align 4, !tbaa !78
%6 = icmp eq ptr %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %5, i32 0, i32 2
store ptr %0, ptr %8, align 4, !tbaa !84
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %0, i32 0, i32 2
%11 = load ptr, ptr %10, align 4, !tbaa !84
%12 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %4, i32 0, i32 2
store ptr %11, ptr %12, align 4, !tbaa !84
%13 = load ptr, ptr %10, align 4, !tbaa !84
%14 = load ptr, ptr %13, align 4, !tbaa !29
%15 = icmp eq ptr %14, %0
%16 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %13, i32 0, i32 1
%17 = select i1 %15, ptr %13, ptr %16
store ptr %4, ptr %17, align 4, !tbaa !33
store ptr %0, ptr %4, align 4, !tbaa !29
store ptr %4, ptr %10, align 4, !tbaa !84
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__219__tree_right_rotateB7v160006IPNS_16__tree_node_baseIPvEEEEvT_(ptr noundef %0) local_unnamed_addr #14 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
%3 = load ptr, ptr %0, align 4, !tbaa !29, !nonnull !104, !noundef !104
%4 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %3, i32 0, i32 1
%5 = load ptr, ptr %4, align 4, !tbaa !78
store ptr %5, ptr %0, align 4, !tbaa !29
%6 = icmp eq ptr %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %5, i32 0, i32 2
store ptr %0, ptr %8, align 4, !tbaa !84
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %0, i32 0, i32 2
%11 = load ptr, ptr %10, align 4, !tbaa !84
%12 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %3, i32 0, i32 2
store ptr %11, ptr %12, align 4, !tbaa !84
%13 = load ptr, ptr %10, align 4, !tbaa !84
%14 = load ptr, ptr %13, align 4, !tbaa !29
%15 = icmp eq ptr %14, %0
%16 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %13, i32 0, i32 1
%17 = select i1 %15, ptr %13, ptr %16
store ptr %3, ptr %17, align 4, !tbaa !33
store ptr %0, ptr %4, align 4, !tbaa !78
store ptr %3, ptr %10, align 4, !tbaa !84
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEE5resetB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #14 comdat {
%3 = load ptr, ptr %0, align 4, !tbaa !33
store ptr %1, ptr %0, align 4, !tbaa !33
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, ptr %0, i32 4
tail call void @_ZNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEiEEPvEEEEEclB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(5) %6, ptr noundef nonnull %3) #21
br label %7
7: ; preds = %5, %2
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden void @_ZNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEiEEPvEEEEEclB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(5) %0, ptr noundef %1) local_unnamed_addr #9 comdat {
%3 = getelementptr inbounds %"class.std::__2::__tree_node_destructor", ptr %0, i32 0, i32 1
%4 = load i8, ptr %3, align 4, !tbaa !82, !range !103, !noundef !104
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %1, i32 0, i32 1
%8 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #21
br label %9
9: ; preds = %6, %2
%10 = icmp eq ptr %1, null
br i1 %10, label %12, label %11
11: ; preds = %9
tail call void @_ZdlPv(ptr noundef nonnull %1) #25
br label %12
12: ; preds = %11, %9
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr noundef ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #9 comdat {
%2 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !29
tail call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %3) #21
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #9 comdat {
%3 = icmp eq ptr %1, null
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = load ptr, ptr %1, align 4, !tbaa !29
tail call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %6) #21
%7 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %1, i32 0, i32 1
%8 = load ptr, ptr %7, align 4, !tbaa !78
tail call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %8) #21
%9 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %1, i32 0, i32 1
%10 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #21
tail call void @_ZdlPv(ptr noundef nonnull %1) #25
br label %4
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEE6insertB7v160006IPKSB_EEvT_SH_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 1
br label %5
5: ; preds = %9, %3
%6 = phi ptr [ %1, %3 ], [ %11, %9 ]
%7 = icmp eq ptr %6, %2
br i1 %7, label %8, label %9
8: ; preds = %5
ret void
9: ; preds = %5
%10 = tail call ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE15__insert_uniqueB7v160006ENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEERKNS_4pairIKiS7_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr nonnull %4, ptr noundef nonnull align 4 dereferenceable(16) %6) #20
%11 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %6, i32 1
br label %5, !llvm.loop !106
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE15__insert_uniqueB7v160006ENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEERKNS_4pairIKiS7_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(16) %2) local_unnamed_addr #13 comdat {
%4 = alloca %"struct.std::__2::pair.34", align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #19
call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIiJRKNS_4pairIKiS7_EEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_(ptr nonnull sret(%"struct.std::__2::pair.34") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(16) %2) #20
%5 = load ptr, ptr %4, align 4, !tbaa.struct !74
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #19
ret ptr %5
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIiJRKNS_4pairIKiS7_EEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_(ptr noalias sret(%"struct.std::__2::pair.34") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(16) %4) local_unnamed_addr #0 comdat {
%6 = alloca ptr, align 4
%7 = alloca ptr, align 4
%8 = alloca %"class.std::__2::unique_ptr.38", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #19
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #19
%9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr %2, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %3) #20
%10 = load ptr, ptr %9, align 4, !tbaa !33
%11 = icmp eq ptr %10, null
br i1 %11, label %12, label %17
12: ; preds = %5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #19
call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKiS7_EEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_(ptr nonnull sret(%"class.std::__2::unique_ptr.38") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(16) %4) #20
%13 = load ptr, ptr %6, align 4, !tbaa !33
%14 = load ptr, ptr %8, align 4, !tbaa !33
call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %13, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef %14) #21
%15 = load ptr, ptr %8, align 4, !tbaa !33
store ptr null, ptr %8, align 4, !tbaa !33
%16 = call noundef ptr @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #19
br label %17
17: ; preds = %12, %5
%18 = phi i8 [ 1, %12 ], [ 0, %5 ]
%19 = phi ptr [ %15, %12 ], [ %10, %5 ]
%20 = ptrtoint ptr %19 to i32
store i32 %20, ptr %0, align 4, !tbaa !33
%21 = getelementptr inbounds %"struct.std::__2::pair.34", ptr %0, i32 0, i32 1
store i8 %18, ptr %21, align 4, !tbaa !107
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #19
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) local_unnamed_addr #0 comdat {
%6 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 1
%7 = icmp eq ptr %6, %1
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %1, i32 0, i32 1
%10 = load i32, ptr %4, align 4, !tbaa !22
%11 = load i32, ptr %9, align 4, !tbaa !22
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %31
13: ; preds = %5, %8
%14 = load ptr, ptr %0, align 4, !tbaa !33
%15 = icmp eq ptr %14, %1
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = tail call noundef ptr @_ZNSt3__216__tree_prev_iterB7v160006IPNS_16__tree_node_baseIPvEEPNS_15__tree_end_nodeIS4_EEEET_T0_(ptr noundef %1) #21
%18 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %17, i32 0, i32 1
%19 = load i32, ptr %18, align 4, !tbaa !22
%20 = load i32, ptr %4, align 4, !tbaa !22
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %29
22: ; preds = %13, %16
%23 = phi ptr [ %17, %16 ], [ %1, %13 ]
%24 = load ptr, ptr %1, align 4, !tbaa !29
%25 = icmp eq ptr %24, null
br i1 %25, label %26, label %27
26: ; preds = %22
store ptr %1, ptr %2, align 4, !tbaa !33
br label %50
27: ; preds = %22
store ptr %23, ptr %2, align 4, !tbaa !33
%28 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %23, i32 0, i32 1
br label %50
29: ; preds = %16
%30 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4) #20
br label %50
31: ; preds = %8
%32 = icmp slt i32 %11, %10
br i1 %32, label %33, label %49
33: ; preds = %31
%34 = tail call ptr @_ZNSt3__24nextB7v160006INS_21__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEEENS_9enable_ifIXsr25__is_cpp17_input_iteratorIT_EE5valueESG_E4typeESG_NS_15iterator_traitsISG_E15difference_typeE(ptr nonnull %1, i32 noundef 1) #20
%35 = icmp eq ptr %34, %6
br i1 %35, label %41, label %36
36: ; preds = %33
%37 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %34, i32 0, i32 1
%38 = load i32, ptr %4, align 4, !tbaa !22
%39 = load i32, ptr %37, align 4, !tbaa !22
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %47
41: ; preds = %33, %36
%42 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %1, i32 0, i32 1
%43 = load ptr, ptr %42, align 4, !tbaa !78
%44 = icmp eq ptr %43, null
br i1 %44, label %45, label %46
45: ; preds = %41
store ptr %1, ptr %2, align 4, !tbaa !33
br label %50
46: ; preds = %41
store ptr %34, ptr %2, align 4, !tbaa !33
br label %50
47: ; preds = %36
%48 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4) #20
br label %50
49: ; preds = %31
store ptr %1, ptr %2, align 4, !tbaa !33
store ptr %1, ptr %3, align 4, !tbaa !33
br label %50
50: ; preds = %45, %46, %47, %26, %27, %29, %49
%51 = phi ptr [ %3, %49 ], [ %1, %26 ], [ %28, %27 ], [ %30, %29 ], [ %42, %45 ], [ %34, %46 ], [ %48, %47 ]
ret ptr %51
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKiS7_EEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_(ptr noalias sret(%"class.std::__2::unique_ptr.38") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(16) %2) local_unnamed_addr #0 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %1, i32 0, i32 1
%5 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i32 noundef 32) #24
store ptr %5, ptr %0, align 4, !tbaa !109
%6 = getelementptr inbounds i8, ptr %0, i32 4
%7 = ptrtoint ptr %4 to i32
store i32 %7, ptr %6, align 4
%8 = getelementptr inbounds i8, ptr %0, i32 8
store i8 0, ptr %8, align 4
%9 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %5, i32 0, i32 1
%10 = tail call noundef ptr @_ZNSt3__24pairIKiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEC2ERKS8_(ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(16) %2) #20
store i8 1, ptr %8, align 4, !tbaa !111
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef %3) local_unnamed_addr #14 comdat {
store ptr null, ptr %3, align 4, !tbaa !29
%5 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %3, i32 0, i32 1
store ptr null, ptr %5, align 4, !tbaa !78
%6 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %3, i32 0, i32 2
store ptr %1, ptr %6, align 4, !tbaa !84
store ptr %3, ptr %2, align 4, !tbaa !33
%7 = load ptr, ptr %0, align 4, !tbaa !33
%8 = load ptr, ptr %7, align 4, !tbaa !29
%9 = icmp eq ptr %8, null
br i1 %9, label %12, label %10
10: ; preds = %4
store ptr %8, ptr %0, align 4, !tbaa !33
%11 = load ptr, ptr %2, align 4, !tbaa !33
br label %12
12: ; preds = %10, %4
%13 = phi ptr [ %11, %10 ], [ %3, %4 ]
%14 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 1
%15 = load ptr, ptr %14, align 4, !tbaa !29
tail call void @_ZNSt3__227__tree_balance_after_insertB7v160006IPNS_16__tree_node_baseIPvEEEEvT_S5_(ptr noundef %15, ptr noundef %13) #21
%16 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 2
%17 = load i32, ptr %16, align 4, !tbaa !85
%18 = add i32 %17, 1
store i32 %18, ptr %16, align 4, !tbaa !85
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #9 comdat {
tail call void @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEE5resetB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef null) #21
ret ptr %0
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEmmB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #14 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !113
%3 = tail call noundef ptr @_ZNSt3__216__tree_prev_iterB7v160006IPNS_16__tree_node_baseIPvEEPNS_15__tree_end_nodeIS4_EEEET_T0_(ptr noundef %2) #21
store ptr %3, ptr %0, align 4, !tbaa !113
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) local_unnamed_addr #13 comdat {
%4 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 1
%5 = load ptr, ptr %4, align 4, !tbaa !29
%6 = icmp eq ptr %5, null
br i1 %6, label %27, label %7
7: ; preds = %3
%8 = load i32, ptr %2, align 4, !tbaa !22
br label %9
9: ; preds = %24, %7
%10 = phi ptr [ %5, %7 ], [ %25, %24 ]
%11 = phi ptr [ %4, %7 ], [ %26, %24 ]
%12 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %10, i32 0, i32 1
%13 = load i32, ptr %12, align 4, !tbaa !22
%14 = icmp slt i32 %8, %13
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load ptr, ptr %10, align 4, !tbaa !29
%17 = icmp eq ptr %16, null
br i1 %17, label %27, label %24
18: ; preds = %9
%19 = icmp slt i32 %13, %8
br i1 %19, label %20, label %27
20: ; preds = %18
%21 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %10, i32 0, i32 1
%22 = load ptr, ptr %21, align 4, !tbaa !78
%23 = icmp eq ptr %22, null
br i1 %23, label %27, label %24
24: ; preds = %20, %15
%25 = phi ptr [ %16, %15 ], [ %22, %20 ]
%26 = phi ptr [ %10, %15 ], [ %21, %20 ]
br label %9, !llvm.loop !115
27: ; preds = %18, %20, %15, %3
%28 = phi ptr [ %4, %3 ], [ %10, %15 ], [ %10, %20 ], [ %10, %18 ]
%29 = phi ptr [ %4, %3 ], [ %11, %18 ], [ %21, %20 ], [ %10, %15 ]
store ptr %28, ptr %1, align 4, !tbaa !33
ret ptr %29
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden ptr @_ZNSt3__24nextB7v160006INS_21__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEEENS_9enable_ifIXsr25__is_cpp17_input_iteratorIT_EE5valueESG_E4typeESG_NS_15iterator_traitsISG_E15difference_typeE(ptr %0, i32 noundef %1) local_unnamed_addr #4 comdat {
%3 = alloca %"class.std::__2::__tree_const_iterator.31", align 4
store ptr %0, ptr %3, align 4
call void @_ZNSt3__29__advanceB7v160006INS_21__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEEEvRT_NS_15iterator_traitsISF_E15difference_typeENS_26bidirectional_iterator_tagE(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %1) #20
%4 = load ptr, ptr %3, align 4, !tbaa.struct !74
ret ptr %4
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__29__advanceB7v160006INS_21__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEEEvRT_NS_15iterator_traitsISF_E15difference_typeENS_26bidirectional_iterator_tagE(ptr noundef nonnull align 4 dereferenceable(4) %0, i32 noundef %1) local_unnamed_addr #13 comdat {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %10
4: ; preds = %2, %7
%5 = phi i32 [ %9, %7 ], [ %1, %2 ]
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEppB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #20
%9 = add nsw i32 %5, -1
br label %4, !llvm.loop !116
10: ; preds = %2, %13
%11 = phi i32 [ %15, %13 ], [ %1, %2 ]
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEmmB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #20
%15 = add i32 %11, 1
br label %10, !llvm.loop !117
16: ; preds = %10, %4
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEppB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #14 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !113
%3 = tail call noundef ptr @_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_(ptr noundef %2) #21
store ptr %3, ptr %0, align 4, !tbaa !113
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__24pairIKiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEC2ERKS8_(ptr noundef nonnull returned align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %1) unnamed_addr #0 comdat {
%3 = load i32, ptr %1, align 4, !tbaa !17
store i32 %3, ptr %0, align 4, !tbaa !17
%4 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %0, i32 0, i32 1
%5 = getelementptr inbounds %"struct.std::__2::pair.23", ptr %1, i32 0, i32 1
%6 = 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) %5) #20
ret ptr %0
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEE5resetB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #14 comdat {
%3 = load ptr, ptr %0, align 4, !tbaa !33
store ptr %1, ptr %0, align 4, !tbaa !33
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, ptr %0, i32 4
tail call void @_ZNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEPvEEEEEclB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(5) %6, ptr noundef nonnull %3) #21
br label %7
7: ; preds = %5, %2
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden void @_ZNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEPvEEEEEclB7v160006EPSB_(ptr noundef nonnull align 4 dereferenceable(5) %0, ptr noundef %1) local_unnamed_addr #9 comdat {
%3 = getelementptr inbounds %"class.std::__2::__tree_node_destructor.42", ptr %0, i32 0, i32 1
%4 = load i8, ptr %3, align 4, !tbaa !111, !range !103, !noundef !104
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %1, i32 0, i32 1, i32 0, i32 1
%8 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #21
br label %9
9: ; preds = %6, %2
%10 = icmp eq ptr %1, null
br i1 %10, label %12, label %11
11: ; preds = %9
tail call void @_ZdlPv(ptr noundef nonnull %1) #25
br label %12
12: ; preds = %11, %9
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr noundef ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #9 comdat {
%2 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !29
tail call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %3) #21
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #9 comdat {
%3 = icmp eq ptr %1, null
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = load ptr, ptr %1, align 4, !tbaa !29
tail call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %6) #21
%7 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %1, i32 0, i32 1
%8 = load ptr, ptr %7, align 4, !tbaa !78
tail call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %8) #21
%9 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %1, i32 0, i32 1, i32 0, i32 1
%10 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #21
tail call void @_ZdlPv(ptr noundef nonnull %1) #25
br label %4
}
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #22
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #24
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !25
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !25
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #16
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #15 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !25
tail call void @_ZdlPv(ptr noundef %7) #25
br label %8
8: ; preds = %6, %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 !101
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !25
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIS7_JRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_(ptr noalias sret(%"struct.std::__2::pair.26") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %5) local_unnamed_addr #0 comdat {
%7 = alloca ptr, align 4
%8 = alloca %"class.std::__2::unique_ptr", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #19
%9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(12) %2) #20
%10 = load ptr, ptr %9, align 4, !tbaa !33
%11 = icmp eq ptr %10, null
br i1 %11, label %12, label %17
12: ; preds = %6
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #19
call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_(ptr nonnull sret(%"class.std::__2::unique_ptr") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %5) #20
%13 = load ptr, ptr %7, align 4, !tbaa !33
%14 = load ptr, ptr %8, align 4, !tbaa !33
call void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %13, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef %14) #21
%15 = load ptr, ptr %8, align 4, !tbaa !33
store ptr null, ptr %8, align 4, !tbaa !33
%16 = call noundef ptr @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #19
br label %17
17: ; preds = %12, %6
%18 = phi i8 [ 1, %12 ], [ 0, %6 ]
%19 = phi ptr [ %15, %12 ], [ %10, %6 ]
%20 = ptrtoint ptr %19 to i32
store i32 %20, ptr %0, align 4, !tbaa !33
%21 = getelementptr inbounds %"struct.std::__2::pair.26", ptr %0, i32 0, i32 1
store i8 %18, ptr %21, align 4, !tbaa !75
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #19
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_(ptr noalias sret(%"class.std::__2::unique_ptr") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 1 dereferenceable(1) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 1 dereferenceable(1) %4) local_unnamed_addr #0 comdat {
%6 = getelementptr inbounds %"class.std::__2::__tree", ptr %1, i32 0, i32 1
%7 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i32 noundef 32) #24
store ptr %7, ptr %0, align 4, !tbaa !80
%8 = getelementptr inbounds i8, ptr %0, i32 4
%9 = ptrtoint ptr %6 to i32
store i32 %9, ptr %8, align 4
%10 = getelementptr inbounds i8, ptr %0, i32 8
store i8 0, ptr %10, align 4
%11 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %7, i32 0, i32 1
%12 = load ptr, ptr %3, align 4
%13 = tail call noundef ptr @_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2B7v160006IJRS7_EJEEENS_21piecewise_construct_tENS_5tupleIJDpT_EEENSC_IJDpT0_EEE(ptr noundef nonnull align 4 dereferenceable(16) %11, ptr %12) #20
store i8 1, ptr %10, align 4, !tbaa !82
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2B7v160006IJRS7_EJEEENS_21piecewise_construct_tENS_5tupleIJDpT_EEENSC_IJDpT0_EEE(ptr noundef nonnull returned align 4 dereferenceable(16) %0, ptr %1) unnamed_addr #0 comdat {
%3 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #20
%4 = getelementptr inbounds %"struct.std::__2::pair", ptr %0, i32 0, i32 1
store i32 0, ptr %4, align 4, !tbaa !3
ret ptr %0
}
; 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 #13 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) #20
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: 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__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIiJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_(ptr noalias sret(%"struct.std::__2::pair.34") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %5) local_unnamed_addr #0 comdat {
%7 = alloca ptr, align 4
%8 = alloca %"class.std::__2::unique_ptr.38", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #19
%9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %2) #20
%10 = load ptr, ptr %9, align 4, !tbaa !33
%11 = icmp eq ptr %10, null
br i1 %11, label %12, label %24
12: ; preds = %6
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #19
call void @llvm.experimental.noalias.scope.decl(metadata !118)
%13 = getelementptr inbounds %"class.std::__2::__tree.11", ptr %1, i32 0, i32 1
%14 = call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i32 noundef 32) #24, !noalias !118
%15 = getelementptr inbounds i8, ptr %8, i32 4
%16 = ptrtoint ptr %13 to i32
store i32 %16, ptr %15, align 4, !alias.scope !118
%17 = getelementptr inbounds i8, ptr %8, i32 8
%18 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %14, i32 0, i32 1
%19 = load ptr, ptr %4, align 4, !noalias !118
%20 = load i32, ptr %19, align 4, !tbaa !22, !noalias !118
store i32 %20, ptr %18, align 4, !tbaa !17, !noalias !118
%21 = getelementptr inbounds %"class.std::__2::__tree_node.36", ptr %14, i32 0, i32 1, i32 0, i32 1
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %21, i8 0, i32 12, i1 false), !noalias !118
store i8 1, ptr %17, align 4, !tbaa !111, !alias.scope !118
%22 = load ptr, ptr %7, align 4, !tbaa !33
call void @_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %22, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull %14) #21
store ptr null, ptr %8, align 4, !tbaa !33
%23 = call noundef ptr @_ZNSt3__210unique_ptrINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEENS_22__tree_node_destructorINS6_ISB_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #21
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #19
br label %24
24: ; preds = %12, %6
%25 = phi i8 [ 1, %12 ], [ 0, %6 ]
%26 = phi ptr [ %14, %12 ], [ %10, %6 ]
%27 = ptrtoint ptr %26 to i32
store i32 %27, ptr %0, align 4, !tbaa !33
%28 = getelementptr inbounds %"struct.std::__2::pair.34", ptr %0, i32 0, i32 1
store i8 %25, ptr %28, align 4, !tbaa !107
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #19
ret void
}
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite)
declare void @llvm.experimental.noalias.scope.decl(metadata) #17
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #18
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize 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 nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #15 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #16 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #17 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
attributes #18 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #19 = { nounwind }
attributes #20 = { minsize optsize }
attributes #21 = { minsize nounwind optsize }
attributes #22 = { minsize noreturn optsize }
attributes #23 = { noreturn }
attributes #24 = { builtin minsize optsize allocsize(0) }
attributes #25 = { builtin minsize nounwind optsize }
!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, !11, i64 12}
!4 = !{!"_ZTSNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEE", !5, i64 0, !11, i64 12}
!5 = !{!"_ZTSNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE", !6, i64 0}
!6 = !{!"_ZTSNSt3__217__compressed_pairINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repES5_EE", !7, i64 0}
!7 = !{!"_ZTSNSt3__222__compressed_pair_elemINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repELi0ELb0EEE", !8, i64 0}
!8 = !{!"_ZTSNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5__repE", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"_ZTSSt16initializer_listINSt3__24pairIKNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiEEE", !14, i64 0, !15, i64 4}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!"long", !9, i64 0}
!16 = !{!13, !15, i64 4}
!17 = !{!18, !11, i64 0}
!18 = !{!"_ZTSNSt3__24pairIKiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEE", !11, i64 0, !5, i64 4}
!19 = !{!20, !14, i64 0}
!20 = !{!"_ZTSSt16initializer_listINSt3__24pairIKiNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEEE", !14, i64 0, !15, i64 4}
!21 = !{!20, !15, i64 4}
!22 = !{!11, !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!9, !9, i64 0}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = !{!30, !14, i64 0}
!30 = !{!"_ZTSNSt3__215__tree_end_nodeIPNS_16__tree_node_baseIPvEEEE", !14, i64 0}
!31 = !{!32, !15, i64 0}
!32 = !{!"_ZTSNSt3__222__compressed_pair_elemImLi0ELb0EEE", !15, i64 0}
!33 = !{!14, !14, i64 0}
!34 = !{!35, !37, !39, !41, !43}
!35 = distinct !{!35, !36, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!36 = distinct !{!36, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!37 = distinct !{!37, !38, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!38 = distinct !{!38, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!39 = distinct !{!39, !40, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!40 = distinct !{!40, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!41 = distinct !{!41, !42, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!42 = distinct !{!42, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!43 = distinct !{!43, !44, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!44 = distinct !{!44, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!45 = !{!46, !14, i64 0}
!46 = !{!"_ZTSNSt3__215__tree_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEE", !14, i64 0}
!47 = !{!48, !50, !52, !54, !56}
!48 = distinct !{!48, !49, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!49 = distinct !{!49, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!50 = distinct !{!50, !51, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!51 = distinct !{!51, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!52 = distinct !{!52, !53, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!53 = distinct !{!53, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!54 = distinct !{!54, !55, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!55 = distinct !{!55, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!56 = distinct !{!56, !57, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!57 = distinct !{!57, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!58 = !{!59, !61, !63, !65, !67}
!59 = distinct !{!59, !60, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!60 = distinct !{!60, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!61 = distinct !{!61, !62, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!62 = distinct !{!62, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!63 = distinct !{!63, !64, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!64 = distinct !{!64, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!65 = distinct !{!65, !66, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!66 = distinct !{!66, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!67 = distinct !{!67, !68, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!68 = distinct !{!68, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!69 = !{!70, !14, i64 0}
!70 = !{!"_ZTSNSt3__215__tree_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEE", !14, i64 0}
!71 = !{!72, !72, i64 0}
!72 = !{!"vtable pointer", !10, i64 0}
!73 = distinct !{!73, !24}
!74 = !{i64 0, i64 4, !33}
!75 = !{!76, !77, i64 4}
!76 = !{!"_ZTSNSt3__24pairINS_15__tree_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS9_PvEElEEbEE", !46, i64 0, !77, i64 4}
!77 = !{!"bool", !9, i64 0}
!78 = !{!79, !14, i64 4}
!79 = !{!"_ZTSNSt3__216__tree_node_baseIPvEE", !30, i64 0, !14, i64 4, !14, i64 8, !77, i64 12}
!80 = !{!81, !14, i64 0}
!81 = !{!"_ZTSNSt3__222__compressed_pair_elemIPNS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPvEELi0ELb0EEE", !14, i64 0}
!82 = !{!83, !77, i64 4}
!83 = !{!"_ZTSNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEiEEPvEEEEEE", !14, i64 0, !77, i64 4}
!84 = !{!79, !14, i64 8}
!85 = !{!15, !15, i64 0}
!86 = !{!87, !14, i64 0}
!87 = !{!"_ZTSNSt3__221__tree_const_iteratorINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEEPNS_11__tree_nodeIS8_PvEElEE", !14, i64 0}
!88 = distinct !{!88, !24}
!89 = !{!90}
!90 = distinct !{!90, !91, !"_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEcvNS_17basic_string_viewIcS2_EEB7v160006Ev: argument 0"}
!91 = distinct !{!91, !"_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEcvNS_17basic_string_viewIcS2_EEB7v160006Ev"}
!92 = !{!93, !14, i64 0}
!93 = !{!"_ZTSNSt3__217basic_string_viewIcNS_11char_traitsIcEEEE", !14, i64 0, !15, i64 4}
!94 = !{!93, !15, i64 4}
!95 = distinct !{!95, !24}
!96 = distinct !{!96, !24}
!97 = distinct !{!97, !24}
!98 = distinct !{!98, !24}
!99 = distinct !{!99, !24}
!100 = distinct !{!100, !24}
!101 = !{i64 0, i64 4, !33, i64 4, i64 4, !85, i64 8, i64 4, !85, i64 11, i64 4, !85, i64 0, i64 11, !25, i64 11, i64 0, !25, i64 11, i64 1, !25, i64 11, i64 1, !25, i64 0, i64 12, !25}
!102 = !{!79, !77, i64 12}
!103 = !{i8 0, i8 2}
!104 = !{}
!105 = distinct !{!105, !24}
!106 = distinct !{!106, !24}
!107 = !{!108, !77, i64 4}
!108 = !{!"_ZTSNSt3__24pairINS_15__tree_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS9_PvEElEEbEE", !70, i64 0, !77, i64 4}
!109 = !{!110, !14, i64 0}
!110 = !{!"_ZTSNSt3__222__compressed_pair_elemIPNS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPvEELi0ELb0EEE", !14, i64 0}
!111 = !{!112, !77, i64 4}
!112 = !{!"_ZTSNSt3__222__tree_node_destructorINS_9allocatorINS_11__tree_nodeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEPvEEEEEE", !14, i64 0, !77, i64 4}
!113 = !{!114, !14, i64 0}
!114 = !{!"_ZTSNSt3__221__tree_const_iteratorINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEPNS_11__tree_nodeIS8_PvEElEE", !14, i64 0}
!115 = distinct !{!115, !24}
!116 = distinct !{!116, !24}
!117 = distinct !{!117, !24}
!118 = !{!119}
!119 = distinct !{!119, !120, !"_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_: argument 0"}
!120 = distinct !{!120, !"_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_"}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32 i32 i32)))
(type (;2;) (func (param i32) (result i32)))
(type (;3;) (func (param i32 i32)))
(type (;4;) (func (param i32 i32 i32) (result i32)))
(type (;5;) (func (param i32 i32 i32 i32 i32)))
(type (;6;) (func (param i32)))
(type (;7;) (func (param i32 i32 i32 i32 i32 i32)))
(type (;8;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;9;) (func (param i32 i32 i32 i32)))
(type (;10;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 2)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEED2Ev" (func (;2;) (type 2)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEED2Ev" (func (;3;) (type 2)))
(import "env" "_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEixERSA_" (func (;4;) (type 0)))
(import "env" "_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEixERSA_" (func (;5;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc" (func (;6;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc" (func (;7;) (type 3)))
(import "env" "_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEE6insertB7v160006IPKSB_EEvT_SH_" (func (;8;) (type 1)))
(import "env" "_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEE6insertB7v160006IPKSB_EEvT_SH_" (func (;9;) (type 1)))
(import "env" "strlen" (func (;10;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;11;) (type 1)))
(import "env" "memmove" (func (;12;) (type 4)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIS7_JRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_" (func (;13;) (type 7)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIiJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_" (func (;14;) (type 7)))
(import "env" "__cxa_allocate_exception" (func (;15;) (type 2)))
(import "env" "__cxa_throw" (func (;16;) (type 1)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;17;) (type 0)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIS7_JRKNS_4pairIKS7_iEEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_" (func (;18;) (type 5)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_" (func (;19;) (type 8)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKS7_iEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_" (func (;20;) (type 1)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_" (func (;21;) (type 9)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_" (func (;22;) (type 4)))
(import "env" "_Znwm" (func (;23;) (type 2)))
(import "env" "_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2ERKS8_" (func (;24;) (type 0)))
(import "env" "_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareINS_17basic_string_viewIcS2_EEEENS_9enable_ifIXsr33__can_be_converted_to_string_viewIcS2_T_EE5valueEiE4typeERKSA_" (func (;25;) (type 0)))
(import "env" "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func (;26;) (type 4)))
(import "env" "memcmp" (func (;27;) (type 4)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;28;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;29;) (type 1)))
(import "env" "_ZdlPv" (func (;30;) (type 6)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE" (func (;31;) (type 3)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIiJRKNS_4pairIKiS7_EEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_" (func (;32;) (type 5)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_" (func (;33;) (type 8)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKiS7_EEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_" (func (;34;) (type 1)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_" (func (;35;) (type 9)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_" (func (;36;) (type 4)))
(import "env" "_ZNSt3__24pairIKiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEC2ERKS8_" (func (;37;) (type 0)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE" (func (;38;) (type 3)))
(import "env" "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_" (func (;39;) (type 5)))
(import "env" "_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2B7v160006IJRS7_EJEEENS_21piecewise_construct_tENS_5tupleIJDpT_EEENSC_IJDpT0_EEE" (func (;40;) (type 0)))
(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 "env" "memory" (memory (;0;) 1))
(func (;41;) (type 10))
(func (;42;) (type 3) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 272
i32.sub
local.tee 4
global.set 0
local.get 4
i32.const 80
i32.add
global.get 1
local.tee 2
i32.const 19
i32.add
call 0
local.tee 3
i32.const 0
i32.store offset=12
local.get 3
i32.const 16
i32.add
local.get 2
i32.const 48
i32.add
call 0
drop
local.get 3
i32.const 1
i32.store offset=28
local.get 3
i32.const 32
i32.add
local.get 2
i32.const 15
i32.add
call 0
drop
local.get 3
i32.const 2
i32.store offset=44
local.get 3
i32.const 48
i32.add
local.get 2
i32.const 57
i32.add
call 0
drop
local.get 3
i32.const 3
i32.store offset=60
local.get 3
i32.const -64
i32.sub
local.get 2
i32.const 10
i32.add
call 0
drop
local.get 3
i32.const 4
i32.store offset=76
local.get 3
i32.const 80
i32.add
local.get 2
i32.const 43
i32.add
call 0
drop
local.get 3
i32.const 5
i32.store offset=92
local.get 3
i32.const 96
i32.add
local.get 2
call 0
drop
local.get 3
i32.const 6
i32.store offset=108
local.get 3
i32.const 112
i32.add
local.get 2
i32.const 24
i32.add
call 0
drop
local.get 3
i32.const 7
i32.store offset=124
local.get 3
i32.const 128
i32.add
local.get 2
i32.const 4
i32.add
call 0
drop
local.get 3
i32.const 8
i32.store offset=140
local.get 3
i32.const 144
i32.add
local.get 2
i32.const 52
i32.add
call 0
drop
local.get 3
i32.const 9
i32.store offset=156
local.get 4
i32.const 10
i32.store offset=256
local.get 4
local.get 3
i32.store offset=252
local.get 4
local.get 4
i64.load offset=252 align=4
i64.store offset=8
local.get 3
i32.const 160
i32.add
local.set 2
local.get 4
i32.const 260
i32.add
local.tee 5
i64.const 0
i64.store offset=4 align=4
local.get 5
local.get 5
i32.const 4
i32.add
i32.store
local.get 5
local.get 4
i32.load offset=8
local.tee 8
local.get 8
local.get 4
i32.load offset=12
i32.const 4
i32.shl
i32.add
call 8
local.get 5
local.set 8
loop ;; label = @1
local.get 2
i32.const 16
i32.sub
call 1
local.tee 2
local.get 3
i32.ne
br_if 0 (;@1;)
end
local.get 4
i32.const 0
i32.store offset=80
local.get 4
i32.const 84
i32.add
global.get 1
local.tee 3
i32.const 19
i32.add
call 0
drop
local.get 4
i32.const 1
i32.store offset=96
local.get 4
i32.const 100
i32.add
local.get 3
i32.const 48
i32.add
call 0
drop
local.get 4
i32.const 2
i32.store offset=112
local.get 4
i32.const 116
i32.add
local.get 3
i32.const 15
i32.add
call 0
drop
local.get 4
i32.const 3
i32.store offset=128
local.get 4
i32.const 132
i32.add
local.get 3
i32.const 57
i32.add
call 0
drop
local.get 4
i32.const 4
i32.store offset=144
local.get 4
i32.const 148
i32.add
local.get 3
i32.const 10
i32.add
call 0
drop
local.get 4
i32.const 5
i32.store offset=160
local.get 4
i32.const 164
i32.add
local.get 3
i32.const 43
i32.add
call 0
drop
local.get 4
i32.const 6
i32.store offset=176
local.get 4
i32.const 180
i32.add
local.get 3
call 0
drop
local.get 4
i32.const 7
i32.store offset=192
local.get 4
i32.const 196
i32.add
local.get 3
i32.const 24
i32.add
call 0
drop
local.get 4
i32.const 8
i32.store offset=208
local.get 4
i32.const 212
i32.add
local.get 3
i32.const 4
i32.add
call 0
drop
local.get 4
i32.const 9
i32.store offset=224
local.get 4
i32.const 228
i32.add
local.get 3
i32.const 52
i32.add
call 0
drop
local.get 4
i32.const 10
i32.store offset=64
local.get 4
local.get 4
i32.const 80
i32.add
i32.store offset=60
local.get 4
local.get 4
i64.load offset=60 align=4
i64.store
local.get 4
i32.const 68
i32.add
local.tee 3
i64.const 0
i64.store offset=4 align=4
local.get 3
local.get 3
i32.const 4
i32.add
i32.store
local.get 3
local.get 4
i32.load
local.tee 2
local.get 2
local.get 4
i32.load offset=4
i32.const 4
i32.shl
i32.add
call 9
local.get 3
local.set 9
local.get 4
i32.const 240
i32.add
local.set 2
loop ;; label = @1
local.get 2
i32.const 12
i32.sub
call 1
drop
local.get 2
i32.const 16
i32.sub
local.tee 2
local.get 4
i32.const 80
i32.add
i32.ne
br_if 0 (;@1;)
end
i32.const 0
local.set 2
loop ;; label = @1
local.get 2
i32.const 10
i32.eq
if ;; label = @2
local.get 0
global.get 1
i32.const 62
i32.add
local.tee 0
call 0
local.set 3
local.get 4
i32.const 48
i32.add
local.get 0
call 0
local.set 5
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
select
if ;; label = @3
global.get 0
i32.const 16
i32.sub
local.tee 7
global.set 0
local.get 4
i32.const 36
i32.add
local.tee 0
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 2
i32.const 1
i32.add
call 51
local.tee 6
i32.load
local.get 6
local.get 6
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 2
call 12
local.get 2
i32.add
local.tee 2
i32.const 32
i32.store8
local.get 2
i32.const 0
i32.store8 offset=1
local.get 7
i32.const 16
i32.add
global.set 0
local.get 1
local.get 0
call 44
local.get 0
call 1
drop
end
i32.const 0
local.set 2
loop ;; label = @3
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 0
select
local.get 2
i32.le_u
if ;; label = @4
i32.const 0
local.set 2
loop ;; label = @5
local.get 4
local.get 2
i32.store offset=32
i32.const 0
local.set 1
local.get 2
i32.const 10
i32.ge_s
if ;; label = @6
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
select
if ;; label = @7
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
local.tee 1
i32.const 0
i32.lt_s
select
i32.const 1
i32.sub
local.set 0
block ;; label = @8
local.get 1
i32.const 0
i32.lt_s
if ;; label = @9
local.get 3
local.get 0
i32.store offset=4
local.get 3
i32.load
local.set 3
br 1 (;@8;)
end
local.get 3
local.get 0
i32.store8 offset=11
end
local.get 0
local.get 3
i32.add
i32.const 0
i32.store8
end
local.get 5
call 1
drop
local.get 9
call 2
drop
local.get 8
call 3
drop
local.get 4
i32.const 272
i32.add
global.set 0
else
loop ;; label = @7
local.get 4
i32.const 80
i32.add
local.get 2
i32.const 2
i32.shl
i32.add
i32.load
local.get 1
i32.gt_s
if ;; label = @8
local.get 9
local.get 4
i32.const 32
i32.add
call 4
local.set 2
global.get 0
i32.const 16
i32.sub
local.tee 11
global.set 0
local.get 4
i32.const 20
i32.add
local.tee 0
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 6
local.get 6
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 6
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 7
local.get 7
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 7
i32.add
call 51
local.tee 10
i32.load
local.get 10
local.get 10
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 7
call 12
local.get 7
i32.add
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 6
call 12
local.get 6
i32.add
i32.const 0
i32.store8
local.get 11
i32.const 16
i32.add
global.set 0
local.get 0
i32.const 32
call 7
local.get 4
i32.const 36
i32.add
local.tee 2
local.get 0
i32.load offset=8
i32.store offset=8
local.get 2
local.get 0
i64.load align=4
i64.store align=4
local.get 0
i64.const 0
i64.store align=4
local.get 0
i32.const 0
i32.store offset=8
local.get 3
local.get 2
call 44
local.get 1
i32.const 1
i32.add
local.set 1
local.get 2
call 1
drop
local.get 0
call 1
drop
local.get 4
i32.load offset=32
local.set 2
br 1 (;@7;)
end
end
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@5;)
end
end
else
block ;; label = @5
local.get 1
i32.load
local.get 1
local.get 0
select
local.get 2
i32.add
i32.load8_u
local.tee 0
i32.const 32
i32.eq
if ;; label = @6
local.get 4
i32.const 80
i32.add
local.get 8
local.get 5
call 5
i32.load
i32.const 2
i32.shl
i32.add
local.tee 0
local.get 0
i32.load
i32.const 1
i32.add
i32.store
local.get 5
global.get 1
i32.const 62
i32.add
call 6
drop
br 1 (;@5;)
end
local.get 5
local.get 0
i32.extend8_s
call 7
end
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@3;)
end
end
else
local.get 4
i32.const 80
i32.add
local.get 2
i32.const 2
i32.shl
i32.add
i32.const 0
i32.store
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end)
(func (;43;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 10
call 11
local.get 0)
(func (;44;) (type 3) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 30
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(func (;45;) (type 2) (param i32) (result i32)
local.get 0
local.get 0
i32.load offset=4
call 38
local.get 0)
(func (;46;) (type 2) (param i32) (result i32)
local.get 0
local.get 0
i32.load offset=4
call 31
local.get 0)
(func (;47;) (type 0) (param i32 i32) (result i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
local.get 1
i32.store offset=4
local.get 2
i32.const 8
i32.add
local.get 0
local.get 1
global.get 1
i32.const 63
i32.add
local.get 2
i32.const 4
i32.add
local.get 2
i32.const 3
i32.add
call 14
local.get 2
i32.load offset=8
local.get 2
i32.const 16
i32.add
global.set 0
i32.const 20
i32.add)
(func (;48;) (type 0) (param i32 i32) (result i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
local.get 1
i32.store offset=4
local.get 2
i32.const 8
i32.add
local.get 0
local.get 1
global.get 1
i32.const 63
i32.add
local.get 2
i32.const 4
i32.add
local.get 2
i32.const 3
i32.add
call 13
local.get 2
i32.load offset=8
local.get 2
i32.const 16
i32.add
global.set 0
i32.const 28
i32.add)
(func (;49;) (type 1) (param i32 i32 i32)
(local i32 i32)
local.get 0
i32.const 4
i32.add
local.set 4
loop ;; label = @1
local.get 1
local.get 2
i32.ne
if ;; label = @2
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 3
i32.const 8
i32.add
local.get 0
local.get 4
local.get 1
local.get 1
call 18
local.get 3
i32.load offset=8
drop
local.get 3
i32.const 16
i32.add
global.set 0
local.get 1
i32.const 16
i32.add
local.set 1
br 1 (;@1;)
end
end)
(func (;50;) (type 1) (param i32 i32 i32)
(local i32 i32)
local.get 0
i32.const 4
i32.add
local.set 4
loop ;; label = @1
local.get 1
local.get 2
i32.ne
if ;; label = @2
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 3
i32.const 8
i32.add
local.get 0
local.get 4
local.get 1
local.get 1
call 32
local.get 3
i32.load offset=8
drop
local.get 3
i32.const 16
i32.add
global.set 0
local.get 1
i32.const 16
i32.add
local.set 1
br 1 (;@1;)
end
end)
(func (;51;) (type 0) (param i32 i32) (result i32)
(local i32 i32)
local.get 1
i32.const 2147483632
i32.lt_u
if ;; label = @1
local.get 1
i32.const 10
i32.le_u
if ;; label = @2
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.store8 offset=11
local.get 0
return
end
local.get 1
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 2
call 23
local.set 3
local.get 0
local.get 1
i32.store offset=4
local.get 0
local.get 3
i32.store
local.get 0
local.get 2
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
return
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 15
global.get 4
local.set 3
global.get 1
i32.const 30
i32.add
call 17
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 16
unreachable)
(func (;52;) (type 7) (param i32 i32 i32 i32 i32 i32)
(local i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
local.get 0
local.get 1
local.get 6
i32.const 12
i32.add
local.get 2
call 22
local.tee 7
i32.load
local.tee 2
if (result i32) ;; label = @1
i32.const 0
else
local.get 6
local.get 1
local.get 3
local.get 4
local.get 5
call 39
local.get 1
local.get 6
i32.load offset=12
local.get 7
local.get 6
i32.load
call 21
local.get 6
i32.load
local.set 2
local.get 6
i32.const 0
i32.store
local.get 6
call 63
i32.const 1
end
i32.store8 offset=4
local.get 0
local.get 2
i32.store
local.get 6
i32.const 16
i32.add
global.set 0)
(func (;53;) (type 7) (param i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 0
local.get 1
local.get 3
i32.const 12
i32.add
local.get 2
call 36
local.tee 5
i32.load
local.tee 2
if (result i32) ;; label = @1
i32.const 0
else
i32.const 32
call 23
local.set 2
local.get 3
local.get 1
i32.const 4
i32.add
i32.store offset=4
local.get 4
i32.load
i32.load
local.set 4
local.get 2
i64.const 0
i64.store offset=20 align=4
local.get 2
local.get 4
i32.store offset=16
local.get 2
i32.const 0
i32.store offset=28
local.get 3
i32.const 1
i32.store8 offset=8
local.get 1
local.get 3
i32.load offset=12
local.get 5
local.get 2
call 35
local.get 3
i32.const 0
i32.store
local.get 3
call 75
i32.const 1
end
i32.store8 offset=4
local.get 0
local.get 2
i32.store
local.get 3
i32.const 16
i32.add
global.set 0)
(func (;54;) (type 5) (param i32 i32 i32 i32 i32)
(local i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 5
global.set 0
local.get 0
local.get 1
local.get 2
local.get 5
i32.const 28
i32.add
local.get 5
i32.const 24
i32.add
local.get 3
call 19
local.tee 2
i32.load
local.tee 3
if (result i32) ;; label = @1
i32.const 0
else
local.get 5
i32.const 12
i32.add
local.tee 6
local.get 1
local.get 4
call 20
local.get 1
local.get 5
i32.load offset=28
local.get 2
local.get 5
i32.load offset=12
call 21
local.get 5
i32.load offset=12
local.set 3
local.get 5
i32.const 0
i32.store offset=12
local.get 6
call 63
i32.const 1
end
i32.store8 offset=4
local.get 0
local.get 3
i32.store
local.get 5
i32.const 32
i32.add
global.set 0)
(func (;55;) (type 8) (param i32 i32 i32 i32 i32) (result i32)
(local i32 i32)
block ;; label = @1
block ;; label = @2
block ;; label = @3
local.get 1
local.get 0
i32.const 4
i32.add
local.tee 5
i32.ne
if ;; label = @4
local.get 4
local.get 1
i32.const 16
i32.add
local.tee 6
call 58
i32.eqz
br_if 1 (;@3;)
end
local.get 1
local.set 3
local.get 1
local.get 0
i32.load
i32.ne
if ;; label = @4
local.get 1
call 59
local.tee 3
i32.const 16
i32.add
local.get 4
call 58
i32.eqz
br_if 2 (;@2;)
end
local.get 1
i32.load
i32.eqz
if ;; label = @4
local.get 2
local.get 1
i32.store
local.get 1
return
end
local.get 2
local.get 3
i32.store
local.get 3
i32.const 4
i32.add
return
end
local.get 6
local.get 4
call 58
i32.eqz
br_if 1 (;@1;)
local.get 5
local.get 1
call 60
local.tee 3
i32.ne
if ;; label = @3
local.get 4
local.get 3
i32.const 16
i32.add
call 58
i32.eqz
br_if 1 (;@2;)
end
local.get 1
i32.load offset=4
i32.eqz
if ;; label = @3
local.get 2
local.get 1
i32.store
local.get 1
i32.const 4
i32.add
return
end
local.get 2
local.get 3
i32.store
local.get 3
return
end
local.get 0
local.get 2
local.get 4
call 22
return
end
local.get 2
local.get 1
i32.store
local.get 3
local.get 1
i32.store
local.get 3)
(func (;56;) (type 1) (param i32 i32 i32)
(local i32)
i32.const 32
call 23
local.set 3
local.get 0
i32.const 0
i32.store8 offset=8
local.get 0
local.get 1
i32.const 4
i32.add
i32.store offset=4
local.get 0
local.get 3
i32.store
local.get 3
i32.const 16
i32.add
local.get 2
call 24
drop
local.get 0
i32.const 1
i32.store8 offset=8)
(func (;57;) (type 9) (param i32 i32 i32 i32)
(local i32 i32)
local.get 3
local.get 1
i32.store offset=8
local.get 3
i64.const 0
i64.store align=4
local.get 2
local.get 3
i32.store
local.get 0
i32.load
i32.load
local.tee 1
if ;; label = @1
local.get 0
local.get 1
i32.store
local.get 2
i32.load
local.set 3
end
local.get 3
local.get 3
local.get 0
i32.load offset=4
local.tee 5
i32.eq
i32.store8 offset=12
loop ;; label = @1
block ;; label = @2
local.get 3
local.get 5
i32.eq
br_if 0 (;@2;)
local.get 3
i32.load offset=8
local.tee 2
i32.load8_u offset=12
br_if 0 (;@2;)
block ;; label = @3
local.get 2
local.get 2
i32.load offset=8
local.tee 1
i32.load
local.tee 4
i32.eq
if ;; label = @4
block ;; label = @5
local.get 1
i32.load offset=4
local.tee 4
i32.eqz
br_if 0 (;@5;)
local.get 4
i32.load8_u offset=12
br_if 0 (;@5;)
br 2 (;@3;)
end
local.get 3
local.get 2
i32.load
i32.ne
if ;; label = @5
local.get 2
call 67
local.get 2
i32.load offset=8
local.tee 2
i32.load offset=8
local.set 1
end
local.get 2
i32.const 1
i32.store8 offset=12
local.get 1
i32.const 0
i32.store8 offset=12
local.get 1
call 68
br 2 (;@2;)
end
block ;; label = @4
local.get 4
i32.eqz
br_if 0 (;@4;)
local.get 4
i32.load8_u offset=12
br_if 0 (;@4;)
br 1 (;@3;)
end
local.get 3
local.get 2
i32.load
i32.eq
if ;; label = @4
local.get 2
call 68
local.get 2
i32.load offset=8
local.tee 2
i32.load offset=8
local.set 1
end
local.get 2
i32.const 1
i32.store8 offset=12
local.get 1
i32.const 0
i32.store8 offset=12
local.get 1
call 67
br 1 (;@2;)
end
local.get 2
i32.const 1
i32.store8 offset=12
local.get 1
local.get 1
local.get 5
i32.eq
i32.store8 offset=12
local.get 4
i32.const 1
i32.store8 offset=12
local.get 1
local.set 3
br 1 (;@1;)
end
end
local.get 0
local.get 0
i32.load offset=8
i32.const 1
i32.add
i32.store offset=8)
(func (;58;) (type 0) (param i32 i32) (result i32)
(local i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 1
i32.load
local.set 4
local.get 2
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
i32.store offset=12
local.get 2
local.get 4
local.get 1
local.get 3
select
i32.store offset=8
local.get 0
local.get 2
i32.const 8
i32.add
call 25
local.get 2
i32.const 16
i32.add
global.set 0
i32.const 31
i32.shr_u)
(func (;59;) (type 2) (param i32) (result i32)
(local i32)
local.get 0
i32.load
local.tee 1
if ;; label = @1
local.get 1
local.set 0
loop ;; label = @2
local.get 0
local.tee 1
i32.load offset=4
local.tee 0
br_if 0 (;@2;)
end
local.get 1
return
end
loop ;; label = @1
local.get 0
local.get 0
i32.load offset=8
local.tee 0
i32.load
i32.eq
br_if 0 (;@1;)
end
local.get 0)
(func (;60;) (type 2) (param i32) (result i32)
(local i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
local.get 0
i32.store offset=12
i32.const 1
local.set 0
loop ;; label = @1
local.get 0
i32.const 0
i32.gt_s
if ;; label = @2
local.get 2
block (result i32) ;; label = @3
local.get 2
i32.load offset=12
local.tee 1
i32.load offset=4
local.tee 3
if ;; label = @4
loop ;; label = @5
local.get 3
local.tee 1
i32.load
local.tee 3
br_if 0 (;@5;)
end
local.get 1
br 1 (;@3;)
end
loop ;; label = @4
local.get 1
local.get 1
i32.load offset=8
local.tee 1
i32.load
i32.ne
br_if 0 (;@4;)
end
local.get 1
end
i32.store offset=12
local.get 0
i32.const 1
i32.sub
local.set 0
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.get 2
i32.const 16
i32.add
global.set 0)
(func (;61;) (type 4) (param i32 i32 i32) (result i32)
(local i32 i32)
local.get 0
i32.const 4
i32.add
local.set 4
block ;; label = @1
local.get 0
i32.load offset=4
local.tee 3
i32.eqz
if ;; label = @2
local.get 4
local.set 0
br 1 (;@1;)
end
loop ;; label = @2
local.get 2
local.get 3
local.tee 0
i32.const 16
i32.add
local.tee 3
call 58
if ;; label = @3
local.get 0
local.set 4
local.get 0
i32.load
local.tee 3
br_if 1 (;@2;)
br 2 (;@1;)
end
local.get 3
local.get 2
call 58
i32.eqz
br_if 1 (;@1;)
local.get 0
i32.const 4
i32.add
local.set 4
local.get 0
i32.load offset=4
local.tee 3
br_if 0 (;@2;)
end
end
local.get 1
local.get 0
i32.store
local.get 4)
(func (;62;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
call 28
local.tee 0
local.get 1
i32.load offset=12
i32.store offset=12
local.get 0)
(func (;63;) (type 6) (param i32)
local.get 0
i32.const 16
call 79)
(func (;64;) (type 0) (param i32 i32) (result i32)
(local i32 i32)
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.get 1
i32.load
local.get 1
i32.load offset=4
local.tee 1
local.get 0
i32.load offset=4
local.get 2
local.get 3
select
local.tee 0
local.get 0
local.get 1
i32.gt_u
local.tee 2
select
call 26
local.tee 3
i32.const -1
local.get 2
local.get 0
local.get 1
i32.lt_u
select
local.get 3
select)
(func (;65;) (type 4) (param i32 i32 i32) (result i32)
local.get 2
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 1
local.get 2
call 27)
(func (;66;) (type 0) (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 29
local.get 0)
(func (;67;) (type 6) (param i32)
(local i32 i32)
local.get 0
local.get 0
i32.load offset=4
local.tee 1
i32.load
local.tee 2
i32.store offset=4
local.get 2
if ;; label = @1
local.get 2
local.get 0
i32.store offset=8
end
local.get 1
local.get 0
i32.load offset=8
i32.store offset=8
local.get 0
i32.load offset=8
local.tee 2
local.get 2
i32.load
local.get 0
i32.ne
i32.const 2
i32.shl
i32.add
local.get 1
i32.store
local.get 1
local.get 0
i32.store
local.get 0
local.get 1
i32.store offset=8)
(func (;68;) (type 6) (param i32)
(local i32 i32)
local.get 0
local.get 0
i32.load
local.tee 1
i32.load offset=4
local.tee 2
i32.store
local.get 2
if ;; label = @1
local.get 2
local.get 0
i32.store offset=8
end
local.get 1
local.get 0
i32.load offset=8
i32.store offset=8
local.get 0
i32.load offset=8
local.tee 2
local.get 2
i32.load
local.get 0
i32.ne
i32.const 2
i32.shl
i32.add
local.get 1
i32.store
local.get 1
local.get 0
i32.store offset=4
local.get 0
local.get 1
i32.store offset=8)
(func (;69;) (type 3) (param i32 i32)
local.get 1
if ;; label = @1
local.get 0
local.get 1
i32.load
call 31
local.get 0
local.get 1
i32.load offset=4
call 31
local.get 1
i32.const 16
i32.add
call 1
drop
local.get 1
call 30
end)
(func (;70;) (type 5) (param i32 i32 i32 i32 i32)
(local i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 5
global.set 0
local.get 0
local.get 1
local.get 2
local.get 5
i32.const 28
i32.add
local.get 5
i32.const 24
i32.add
local.get 3
call 33
local.tee 2
i32.load
local.tee 3
if (result i32) ;; label = @1
i32.const 0
else
local.get 5
i32.const 12
i32.add
local.tee 6
local.get 1
local.get 4
call 34
local.get 1
local.get 5
i32.load offset=28
local.get 2
local.get 5
i32.load offset=12
call 35
local.get 5
i32.load offset=12
local.set 3
local.get 5
i32.const 0
i32.store offset=12
local.get 6
call 75
i32.const 1
end
i32.store8 offset=4
local.get 0
local.get 3
i32.store
local.get 5
i32.const 32
i32.add
global.set 0)
(func (;71;) (type 8) (param i32 i32 i32 i32 i32) (result i32)
(local i32 i32 i32)
block ;; label = @1
block ;; label = @2
block ;; label = @3
local.get 1
local.get 0
i32.const 4
i32.add
local.tee 5
i32.ne
if ;; label = @4
local.get 4
i32.load
local.tee 6
local.get 1
i32.load offset=16
local.tee 7
i32.ge_s
br_if 1 (;@3;)
end
local.get 1
local.set 3
local.get 1
local.get 0
i32.load
i32.ne
if ;; label = @4
local.get 1
call 59
local.tee 3
i32.load offset=16
local.get 4
i32.load
i32.ge_s
br_if 2 (;@2;)
end
local.get 1
i32.load
i32.eqz
if ;; label = @4
local.get 2
local.get 1
i32.store
local.get 1
return
end
local.get 2
local.get 3
i32.store
local.get 3
i32.const 4
i32.add
return
end
local.get 6
local.get 7
i32.le_s
br_if 1 (;@1;)
local.get 5
local.get 1
call 60
local.tee 3
i32.ne
if ;; label = @3
local.get 4
i32.load
local.get 3
i32.load offset=16
i32.ge_s
br_if 1 (;@2;)
end
local.get 1
i32.load offset=4
i32.eqz
if ;; label = @3
local.get 2
local.get 1
i32.store
local.get 1
i32.const 4
i32.add
return
end
local.get 2
local.get 3
i32.store
local.get 3
return
end
local.get 0
local.get 2
local.get 4
call 36
return
end
local.get 2
local.get 1
i32.store
local.get 3
local.get 1
i32.store
local.get 3)
(func (;72;) (type 1) (param i32 i32 i32)
(local i32)
i32.const 32
call 23
local.set 3
local.get 0
i32.const 0
i32.store8 offset=8
local.get 0
local.get 1
i32.const 4
i32.add
i32.store offset=4
local.get 0
local.get 3
i32.store
local.get 3
i32.const 16
i32.add
local.get 2
call 37
drop
local.get 0
i32.const 1
i32.store8 offset=8)
(func (;73;) (type 4) (param i32 i32 i32) (result i32)
(local i32 i32)
local.get 0
i32.const 4
i32.add
local.set 4
block ;; label = @1
local.get 0
i32.load offset=4
local.tee 3
i32.eqz
if ;; label = @2
local.get 4
local.set 0
br 1 (;@1;)
end
local.get 2
i32.load
local.set 2
loop ;; label = @2
local.get 3
local.tee 0
i32.load offset=16
local.tee 3
local.get 2
i32.gt_s
if ;; label = @3
local.get 0
local.set 4
local.get 0
i32.load
local.tee 3
br_if 1 (;@2;)
br 2 (;@1;)
end
local.get 2
local.get 3
i32.le_s
br_if 1 (;@1;)
local.get 0
i32.const 4
i32.add
local.set 4
local.get 0
i32.load offset=4
local.tee 3
br_if 0 (;@2;)
end
end
local.get 1
local.get 0
i32.store
local.get 4)
(func (;74;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
i32.load
i32.store
local.get 0
i32.const 4
i32.add
local.get 1
i32.const 4
i32.add
call 28
drop
local.get 0)
(func (;75;) (type 6) (param i32)
local.get 0
i32.const 20
call 79)
(func (;76;) (type 3) (param i32 i32)
local.get 1
if ;; label = @1
local.get 0
local.get 1
i32.load
call 38
local.get 0
local.get 1
i32.load offset=4
call 38
local.get 1
i32.const 20
i32.add
call 1
drop
local.get 1
call 30
end)
(func (;77;) (type 5) (param i32 i32 i32 i32 i32)
i32.const 32
call 23
local.set 2
local.get 0
i32.const 0
i32.store8 offset=8
local.get 0
local.get 1
i32.const 4
i32.add
i32.store offset=4
local.get 0
local.get 2
i32.store
local.get 2
i32.const 16
i32.add
local.get 3
i32.load
call 40
drop
local.get 0
i32.const 1
i32.store8 offset=8)
(func (;78;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
call 28
local.tee 0
i32.const 0
i32.store offset=12
local.get 0)
(func (;79;) (type 3) (param i32 i32)
(local i32)
local.get 0
i32.load
local.set 2
local.get 0
i32.const 0
i32.store
local.get 2
if ;; label = @1
local.get 0
i32.load8_u offset=8
if ;; label = @2
local.get 2
local.get 1
i32.add
call 1
drop
end
local.get 2
if ;; label = @2
local.get 2
call 30
end
end)
(export "__wasm_call_ctors" (func 41))
(export "__wasm_apply_data_relocs" (func 41))
(export "_Z12sort_numbersNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 42))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 43))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEED2Ev" (func 45))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEED2Ev" (func 46))
(export "_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEEixERSA_" (func 47))
(export "_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEEixERSA_" (func 48))
(export "_ZNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiNS_4lessIS6_EENS4_INS_4pairIKS6_iEEEEE6insertB7v160006IPKSB_EEvT_SH_" (func 49))
(export "_ZNSt3__23mapIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_4lessIiEENS4_INS_4pairIKiS6_EEEEE6insertB7v160006IPKSB_EEvT_SH_" (func 50))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIS7_JRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_" (func 52))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE25__emplace_unique_key_argsIiJRKNS_21piecewise_construct_tENS_5tupleIJRKiEEENSJ_IJEEEEEENS_4pairINS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEERKT_DpOT0_" (func 53))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIS7_JRKNS_4pairIKS7_iEEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_" (func 54))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_" (func 55))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKS7_iEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_" (func 56))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_" (func 57))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE12__find_equalIS7_EERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_" (func 61))
(export "_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2ERKS8_" (func 62))
(export "_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareINS_17basic_string_viewIcS2_EEEENS_9enable_ifIXsr33__can_be_converted_to_string_viewIcS2_T_EE5valueEiE4typeERKSA_" (func 64))
(export "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func 65))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 66))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE" (func 69))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE30__emplace_hint_unique_key_argsIiJRKNS_4pairIKiS7_EEEEENSG_INS_15__tree_iteratorIS8_PNS_11__tree_nodeIS8_PvEElEEbEENS_21__tree_const_iteratorIS8_SP_lEERKT_DpOT0_" (func 70))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEENS_21__tree_const_iteratorIS8_PNS_11__tree_nodeIS8_SH_EElEERPNS_15__tree_end_nodeISJ_EESK_RKT_" (func 71))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_4pairIKiS7_EEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISO_EEEEEEDpOT_" (func 72))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE16__insert_node_atEPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEERSJ_SJ_" (func 57))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE12__find_equalIiEERPNS_16__tree_node_baseIPvEERPNS_15__tree_end_nodeISJ_EERKT_" (func 73))
(export "_ZNSt3__24pairIKiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEC2ERKS8_" (func 74))
(export "_ZNSt3__26__treeINS_12__value_typeIiNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEENS_19__map_value_compareIiS8_NS_4lessIiEELb1EEENS5_IS8_EEE7destroyEPNS_11__tree_nodeIS8_PvEE" (func 76))
(export "_ZNSt3__26__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEENS_19__map_value_compareIS7_S8_NS_4lessIS7_EELb1EEENS5_IS8_EEE16__construct_nodeIJRKNS_21piecewise_construct_tENS_5tupleIJRKS7_EEENSJ_IJEEEEEENS_10unique_ptrINS_11__tree_nodeIS8_PvEENS_22__tree_node_destructorINS5_ISR_EEEEEEDpOT_" (func 77))
(export "_ZNSt3__24pairIKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEiEC2B7v160006IJRS7_EJEEENS_21piecewise_construct_tENS_5tupleIJDpT_EEENSC_IJDpT0_EEE" (func 78))
(data (;0;) (global.get 1) "six\00eight\00four\00two\00zero\00seven\00basic_string\00five\00one\00nine\00three\00\00"))
| 20 | 765 | 57,101 | 2,187 |
CPP/20 | /*
From a supplied vector of numbers (of length at least two) select and return two that are the closest to each
other and return them in order (smaller number, larger number).
>>> find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.2})
(2.0, 2.2)
>>> find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.0})
(2.0, 2.0)
*/
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
vector<float> find_closest_elements(vector<float> numbers){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<float> find_closest_elements(vector<float> numbers){
| vector<float> out={};
for (int i=0;i<numbers.size();i++)
for (int j=i+1;j<numbers.size();j++)
if (out.size()==0 or abs(numbers[i]-numbers[j])<abs(out[0]-out[1]))
out={numbers[i],numbers[j]};
if (out[0]>out[1])
out={out[1],out[0]};
return out;
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(find_closest_elements({1.0, 2.0, 3.9, 4.0, 5.0, 2.2}) , {3.9, 4.0}));
assert (issame(find_closest_elements({1.0, 2.0, 5.9, 4.0, 5.0}) , {5.0, 5.9} ));
assert (issame(find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.2}) ,{2.0, 2.2}));
assert (issame(find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}) ,{2.0, 2.0}));
assert (issame(find_closest_elements({1.1, 2.2, 3.1, 4.1, 5.1}) , {2.2, 3.1}));
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.2}) ,{2.0, 2.2}));
assert (issame(find_closest_elements({1.0, 2.0, 3.0, 4.0, 5.0, 2.0}) ,{2.0, 2.0}));
}
| ; ModuleID = 'c_code_test/code_20.cpp'
source_filename = "c_code_test/code_20.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 }
$_ZNSt3__26vectorIfNS_9allocatorIfEEE6assignIPKfLi0EEEvT_S7_ = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE13__vdeallocateEv = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE11__vallocateB7v160006Em = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorIfE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = 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 @_Z21find_closest_elementsNSt3__26vectorIfNS_9allocatorIfEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca [2 x float], align 4
%4 = alloca [2 x float], 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
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%8 = getelementptr inbounds float, ptr %3, i32 1
%9 = getelementptr inbounds float, ptr %3, i32 2
%10 = load ptr, ptr %7, align 4, !tbaa !10
%11 = load ptr, ptr %1, align 4, !tbaa !3
br label %12
12: ; preds = %31, %2
%13 = phi ptr [ %11, %2 ], [ %32, %31 ]
%14 = phi ptr [ %10, %2 ], [ %33, %31 ]
%15 = phi ptr [ %11, %2 ], [ %34, %31 ]
%16 = phi ptr [ %10, %2 ], [ %35, %31 ]
%17 = phi i32 [ 0, %2 ], [ %30, %31 ]
%18 = ptrtoint ptr %16 to i32
%19 = ptrtoint ptr %15 to i32
%20 = sub i32 %18, %19
%21 = ashr exact i32 %20, 2
%22 = icmp ult i32 %17, %21
br i1 %22, label %29, label %23
23: ; preds = %12
%24 = load ptr, ptr %0, align 4, !tbaa !3
%25 = load float, ptr %24, align 4, !tbaa !12
%26 = getelementptr inbounds float, ptr %24, i32 1
%27 = load float, ptr %26, align 4, !tbaa !12
%28 = fcmp ogt float %25, %27
br i1 %28, label %68, label %72
29: ; preds = %12
%30 = add nuw nsw i32 %17, 1
br label %31
31: ; preds = %64, %29
%32 = phi ptr [ %13, %29 ], [ %65, %64 ]
%33 = phi ptr [ %14, %29 ], [ %66, %64 ]
%34 = phi ptr [ %15, %29 ], [ %65, %64 ]
%35 = phi ptr [ %16, %29 ], [ %66, %64 ]
%36 = phi i32 [ %30, %29 ], [ %67, %64 ]
%37 = ptrtoint ptr %35 to i32
%38 = ptrtoint ptr %34 to i32
%39 = sub i32 %37, %38
%40 = ashr exact i32 %39, 2
%41 = icmp ult i32 %36, %40
br i1 %41, label %42, label %12, !llvm.loop !14
42: ; preds = %31
%43 = load ptr, ptr %5, align 4, !tbaa !10
%44 = load ptr, ptr %0, align 4, !tbaa !3
%45 = icmp eq ptr %43, %44
%46 = getelementptr inbounds float, ptr %34, i32 %17
%47 = load float, ptr %46, align 4, !tbaa !12
br i1 %45, label %59, label %48
48: ; preds = %42
%49 = getelementptr inbounds float, ptr %34, i32 %36
%50 = load float, ptr %49, align 4, !tbaa !12
%51 = fsub float %47, %50
%52 = call float @llvm.fabs.f32(float %51)
%53 = load float, ptr %44, align 4, !tbaa !12
%54 = getelementptr inbounds float, ptr %44, i32 1
%55 = load float, ptr %54, align 4, !tbaa !12
%56 = fsub float %53, %55
%57 = call float @llvm.fabs.f32(float %56)
%58 = fcmp olt float %52, %57
br i1 %58, label %59, label %64
59: ; preds = %42, %48
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #13
store float %47, ptr %3, align 4, !tbaa !12
%60 = getelementptr inbounds float, ptr %34, i32 %36
%61 = load float, ptr %60, align 4, !tbaa !12
store float %61, ptr %8, align 4, !tbaa !12
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE6assignIPKfLi0EEEvT_S7_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %3, ptr noundef nonnull %9) #14
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #13
%62 = load ptr, ptr %7, align 4, !tbaa !10
%63 = load ptr, ptr %1, align 4, !tbaa !3
br label %64
64: ; preds = %48, %59
%65 = phi ptr [ %32, %48 ], [ %63, %59 ]
%66 = phi ptr [ %33, %48 ], [ %62, %59 ]
%67 = add nuw nsw i32 %36, 1
br label %31, !llvm.loop !16
68: ; preds = %23
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #13
store float %27, ptr %4, align 4, !tbaa !12
%69 = getelementptr inbounds float, ptr %4, i32 1
%70 = load float, ptr %24, align 4, !tbaa !12
store float %70, ptr %69, align 4, !tbaa !12
%71 = getelementptr inbounds float, ptr %4, i32 2
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE6assignIPKfLi0EEEvT_S7_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %4, ptr noundef nonnull %71) #14
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #13
br label %72
72: ; preds = %23, %68
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #2
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26vectorIfNS_9allocatorIfEEE6assignIPKfLi0EEEvT_S7_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 comdat {
%4 = ptrtoint ptr %2 to i32
%5 = ptrtoint ptr %1 to i32
%6 = sub i32 %4, %5
%7 = ashr exact i32 %6, 2
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !17
%10 = load ptr, ptr %0, align 4, !tbaa !3
%11 = ptrtoint ptr %9 to i32
%12 = ptrtoint ptr %10 to i32
%13 = sub i32 %11, %12
%14 = ashr exact i32 %13, 2
%15 = icmp ugt i32 %7, %14
br i1 %15, label %35, label %16
16: ; preds = %3
%17 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%18 = load ptr, ptr %17, align 4, !tbaa !10
%19 = ptrtoint ptr %18 to i32
%20 = sub i32 %19, %12
%21 = ashr exact i32 %20, 2
%22 = icmp ugt i32 %7, %21
%23 = getelementptr inbounds float, ptr %1, i32 %21
%24 = select i1 %22, ptr %23, ptr %2
%25 = ptrtoint ptr %24 to i32
%26 = sub i32 %25, %5
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %10, ptr align 4 %1, i32 %26, i1 false), !noalias !18
br i1 %22, label %27, label %32
27: ; preds = %16
%28 = load ptr, ptr %17, align 4, !tbaa !10
%29 = sub i32 %4, %25
%30 = ashr exact i32 %29, 2
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %28, ptr align 4 %23, i32 %29, i1 false), !noalias !29
%31 = getelementptr inbounds float, ptr %28, i32 %30
store ptr %31, ptr %17, align 4, !tbaa !10
br label %40
32: ; preds = %16
%33 = ashr exact i32 %26, 2
%34 = getelementptr inbounds float, ptr %10, i32 %33
store ptr %34, ptr %17, align 4, !tbaa !10
br label %40
35: ; preds = %3
tail call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE13__vdeallocateEv(ptr noundef nonnull align 4 dereferenceable(12) %0) #15
%36 = tail call noundef i32 @_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %7) #14
tail call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %36) #14
%37 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%38 = load ptr, ptr %37, align 4, !tbaa !10
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %38, ptr align 4 %1, i32 %6, i1 false), !noalias !40
%39 = getelementptr inbounds float, ptr %38, i32 %7
store ptr %39, ptr %37, align 4, !tbaa !10
br label %40
40: ; preds = %27, %32, %35
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIfNS_9allocatorIfEEE13__vdeallocateEv(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #4 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !3
%3 = icmp eq ptr %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %2, ptr %5, align 4, !tbaa !10
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
tail call void @_ZdlPv(ptr noundef nonnull %2) #16
store ptr null, ptr %6, align 4, !tbaa !17
store ptr null, ptr %5, align 4, !tbaa !10
store ptr null, ptr %0, align 4, !tbaa !3
br label %7
7: ; preds = %4, %1
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIfNS_9allocatorIfEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #5 comdat {
%3 = icmp ugt i32 %1, 1073741823
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
unreachable
5: ; preds = %2
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%7 = tail call noundef ptr @_ZNSt3__29allocatorIfE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #14, !noalias !51
store ptr %7, ptr %0, align 4, !tbaa !3
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !10
%9 = getelementptr inbounds float, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !17
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__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__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #7
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__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) #17
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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !54
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #10
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__29allocatorIfE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #5 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() #17
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 #9 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #13
%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 #10
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #10
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #11
; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize nobuiltin optsize allocsize(0) "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 = { nounwind }
attributes #14 = { minsize optsize }
attributes #15 = { minsize nounwind optsize }
attributes #16 = { builtin minsize nounwind optsize }
attributes #17 = { minsize noreturn 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, !5, i64 0}
!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 4}
!11 = !{!9, !5, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!5, !5, i64 0}
!18 = !{!19, !21, !23, !25, !27}
!19 = distinct !{!19, !20, !"_ZNSt3__219__copy_trivial_implB7v160006IKffEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!20 = distinct !{!20, !"_ZNSt3__219__copy_trivial_implB7v160006IKffEENS_4pairIPT_PT0_EES4_S4_S6_"}
!21 = distinct !{!21, !22, !"_ZNKSt3__214__copy_trivialclB7v160006IKffLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!22 = distinct !{!22, !"_ZNKSt3__214__copy_trivialclB7v160006IKffLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!23 = distinct !{!23, !24, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKfS8_PfLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!24 = distinct !{!24, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKfS8_PfLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!25 = distinct !{!25, !26, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKfS6_PfEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKfS6_PfEENS_4pairIT2_T4_EES9_T3_SA_"}
!27 = distinct !{!27, !28, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKfS3_PfEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!28 = distinct !{!28, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKfS3_PfEENS_4pairIT0_T2_EES6_T1_S7_"}
!29 = !{!30, !32, !34, !36, !38}
!30 = distinct !{!30, !31, !"_ZNSt3__219__copy_trivial_implB7v160006IKffEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!31 = distinct !{!31, !"_ZNSt3__219__copy_trivial_implB7v160006IKffEENS_4pairIPT_PT0_EES4_S4_S6_"}
!32 = distinct !{!32, !33, !"_ZNKSt3__214__copy_trivialclB7v160006IKffLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!33 = distinct !{!33, !"_ZNKSt3__214__copy_trivialclB7v160006IKffLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!34 = distinct !{!34, !35, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKfS8_PfLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!35 = distinct !{!35, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKfS8_PfLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!36 = distinct !{!36, !37, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKfS6_PfEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!37 = distinct !{!37, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKfS6_PfEENS_4pairIT2_T4_EES9_T3_SA_"}
!38 = distinct !{!38, !39, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKfS3_PfEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!39 = distinct !{!39, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKfS3_PfEENS_4pairIT0_T2_EES6_T1_S7_"}
!40 = !{!41, !43, !45, !47, !49}
!41 = distinct !{!41, !42, !"_ZNSt3__219__copy_trivial_implB7v160006IKffEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!42 = distinct !{!42, !"_ZNSt3__219__copy_trivial_implB7v160006IKffEENS_4pairIPT_PT0_EES4_S4_S6_"}
!43 = distinct !{!43, !44, !"_ZNKSt3__214__copy_trivialclB7v160006IKffLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!44 = distinct !{!44, !"_ZNKSt3__214__copy_trivialclB7v160006IKffLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!45 = distinct !{!45, !46, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKfS8_PfLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!46 = distinct !{!46, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKfS8_PfLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!47 = distinct !{!47, !48, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKfS6_PfEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!48 = distinct !{!48, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKfS6_PfEENS_4pairIT2_T4_EES9_T3_SA_"}
!49 = distinct !{!49, !50, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKfS3_PfEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!50 = distinct !{!50, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKfS3_PfEENS_4pairIT0_T2_EES6_T1_S7_"}
!51 = !{!52}
!52 = distinct !{!52, !53, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!53 = distinct !{!53, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!54 = !{!55, !55, i64 0}
!55 = !{!"vtable pointer", !7, i64 0}
| (module
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func (param i32 i32) (result i32)))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__26vectorIfNS_9allocatorIfEEE6assignIPKfLi0EEEvT_S7_" (func (;0;) (type 0)))
(import "env" "memmove" (func (;1;) (type 3)))
(import "env" "_ZdlPv" (func (;2;) (type 4)))
(import "env" "__cxa_allocate_exception" (func (;3;) (type 1)))
(import "env" "__cxa_throw" (func (;4;) (type 0)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;5;) (type 5)))
(import "env" "_Znwm" (func (;6;) (type 1)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;7;) (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 (;8;) (type 2))
(func (;9;) (type 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 f32)
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 16
i32.add
local.set 8
local.get 1
i32.load
local.set 3
local.get 1
i32.load offset=4
local.set 6
loop ;; label = @1
local.get 6
local.get 3
i32.sub
i32.const 2
i32.shr_s
local.get 5
i32.le_u
if ;; label = @2
local.get 0
i32.load
local.tee 1
f32.load
local.get 1
f32.load offset=4
local.tee 10
f32.gt
if ;; label = @3
local.get 2
local.get 10
f32.store offset=8
local.get 2
local.get 1
f32.load
f32.store offset=12
local.get 0
local.get 2
i32.const 8
i32.add
local.get 2
i32.const 16
i32.add
call 0
end
local.get 2
i32.const 16
i32.add
global.set 0
return
end
local.get 5
i32.const 1
i32.add
local.tee 9
local.set 4
loop ;; label = @2
local.get 6
local.get 3
i32.sub
i32.const 2
i32.shr_s
local.get 4
i32.le_u
if ;; label = @3
local.get 9
local.set 5
br 2 (;@1;)
else
local.get 3
local.get 5
i32.const 2
i32.shl
i32.add
f32.load
local.set 10
block ;; label = @4
local.get 0
i32.load
local.tee 7
local.get 0
i32.load offset=4
i32.ne
if ;; label = @5
local.get 10
local.get 3
local.get 4
i32.const 2
i32.shl
i32.add
f32.load
f32.sub
f32.abs
local.get 7
f32.load
local.get 7
f32.load offset=4
f32.sub
f32.abs
f32.lt
i32.eqz
br_if 1 (;@4;)
end
local.get 2
local.get 10
f32.store offset=8
local.get 2
local.get 3
local.get 4
i32.const 2
i32.shl
i32.add
f32.load
f32.store offset=12
local.get 0
local.get 2
i32.const 8
i32.add
local.get 8
call 0
local.get 1
i32.load
local.set 3
local.get 1
i32.load offset=4
local.set 6
end
local.get 4
i32.const 1
i32.add
local.set 4
br 1 (;@2;)
end
unreachable
end
unreachable
end
unreachable)
(func (;10;) (type 0) (param i32 i32 i32)
(local i32 i32 i32 i32 i32)
local.get 2
local.get 1
i32.sub
local.tee 5
i32.const 2
i32.shr_s
local.tee 4
local.get 0
i32.load offset=8
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
i32.le_u
if ;; label = @1
local.get 3
local.get 1
local.get 1
local.get 0
i32.load offset=4
local.get 3
i32.sub
local.tee 3
i32.add
local.tee 5
local.get 2
local.get 4
local.get 3
i32.const 2
i32.shr_s
local.tee 3
i32.gt_u
select
local.tee 6
local.get 1
i32.sub
local.tee 1
call 1
local.set 7
local.get 3
local.get 4
i32.lt_u
if ;; label = @2
local.get 0
local.get 0
i32.load offset=4
local.get 5
local.get 2
local.get 6
i32.sub
local.tee 0
call 1
local.get 0
i32.add
i32.store offset=4
return
end
local.get 0
local.get 1
local.get 7
i32.add
i32.store offset=4
return
end
local.get 0
i32.load
local.tee 2
if ;; label = @1
local.get 0
local.get 2
i32.store offset=4
local.get 2
call 2
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
end
local.get 4
i32.const 1073741824
i32.ge_u
if ;; label = @1
call 11
unreachable
end
i32.const 1073741823
local.get 0
i32.load offset=8
local.get 0
i32.load
i32.sub
local.tee 2
i32.const 1
i32.shr_s
local.tee 3
local.get 4
local.get 3
local.get 4
i32.gt_u
select
local.get 2
i32.const 2147483644
i32.ge_u
select
local.tee 2
i32.const 1073741824
i32.ge_u
if ;; label = @1
call 11
unreachable
end
local.get 0
local.get 2
i32.const 1073741824
i32.ge_u
if ;; label = @1
global.get 5
local.set 0
global.get 6
local.set 1
i32.const 4
call 3
call 7
local.get 1
local.get 0
call 4
unreachable
end
local.get 2
i32.const 2
i32.shl
local.tee 2
call 6
local.tee 3
i32.store offset=4
local.get 0
local.get 3
i32.store
local.get 0
local.get 2
local.get 3
i32.add
i32.store offset=8
local.get 0
local.get 0
i32.load offset=4
local.get 1
local.get 5
call 1
local.get 4
i32.const 2
i32.shl
i32.add
i32.store offset=4)
(func (;11;) (type 2)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 3
global.get 4
local.set 3
global.get 1
call 5
local.tee 0
local.get 3
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 4
unreachable)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z21find_closest_elementsNSt3__26vectorIfNS_9allocatorIfEEEE" (func 9))
(export "_ZNSt3__26vectorIfNS_9allocatorIfEEE6assignIPKfLi0EEEvT_S7_" (func 10))
(data (;0;) (global.get 1) "vector\00"))
| 9 | 293 | 7,865 | 362 |
CPP/21 | /*
Given vector of numbers (of at least two elements), apply a linear transform to that vector,
such that the smallest number will become 0 and the largest will become 1
>>> rescale_to_unit({1.0, 2.0, 3.0, 4.0, 5.0})
{0.0, 0.25, 0.5, 0.75, 1.0}
*/
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
vector<float> rescale_to_unit(vector<float> numbers){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<float> rescale_to_unit(vector<float> numbers){
| float min=100000,max=-100000;
for (int i=0;i<numbers.size();i++)
{
if (numbers[i]<min) min=numbers[i];
if (numbers[i]>max) max=numbers[i];
}
for (int i=0;i<numbers.size();i++)
numbers[i]=(numbers[i]-min)/(max-min);
return numbers;
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(rescale_to_unit({2.0, 49.9}) , {0.0, 1.0}));
assert (issame(rescale_to_unit({100.0, 49.9}) ,{1.0, 0.0}));
assert (issame(rescale_to_unit({1.0, 2.0, 3.0, 4.0, 5.0}) , {0.0, 0.25, 0.5, 0.75, 1.0}));
assert (issame(rescale_to_unit({2.0, 1.0, 5.0, 3.0, 4.0}) , {0.25, 0.0, 1.0, 0.5, 0.75}));
assert (issame(rescale_to_unit({12.0, 11.0, 15.0, 13.0, 14.0}) ,{0.25, 0.0, 1.0, 0.5, 0.75}));
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(rescale_to_unit({1.0, 2.0, 3.0, 4.0, 5.0}) , {0.0, 0.25, 0.5, 0.75, 1.0}));
}
| ; ModuleID = 'c_code_test/code_21.cpp'
source_filename = "c_code_test/code_21.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 }
$_ZNSt3__26vectorIfNS_9allocatorIfEEEC2B7v160006EOS3_ = comdat any
; Function Attrs: minsize mustprogress nounwind optsize
define void @_Z15rescale_to_unitNSt3__26vectorIfNS_9allocatorIfEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !3
%5 = load ptr, ptr %1, 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 = %17, %2
%11 = phi float [ 1.000000e+05, %2 ], [ %21, %17 ]
%12 = phi float [ -1.000000e+05, %2 ], [ %23, %17 ]
%13 = phi i32 [ 0, %2 ], [ %24, %17 ]
%14 = icmp eq i32 %13, %9
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = fsub float %12, %11
br label %25
17: ; preds = %10
%18 = getelementptr inbounds float, ptr %5, i32 %13
%19 = load float, ptr %18, align 4, !tbaa !11
%20 = fcmp olt float %19, %11
%21 = select i1 %20, float %19, float %11
%22 = fcmp ogt float %19, %12
%23 = select i1 %22, float %19, float %12
%24 = add nuw i32 %13, 1
br label %10, !llvm.loop !13
25: ; preds = %15, %30
%26 = phi i32 [ %35, %30 ], [ 0, %15 ]
%27 = icmp eq i32 %26, %9
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call noundef ptr @_ZNSt3__26vectorIfNS_9allocatorIfEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #2
ret void
30: ; preds = %25
%31 = getelementptr inbounds float, ptr %5, i32 %26
%32 = load float, ptr %31, align 4, !tbaa !11
%33 = fsub float %32, %11
%34 = fdiv float %33, %16
store float %34, ptr %31, align 4, !tbaa !11
%35 = add nuw i32 %26, 1
br label %25, !llvm.loop !15
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIfNS_9allocatorIfEEEC2B7v160006EOS3_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #1 comdat {
store ptr null, ptr %0, align 4, !tbaa !10
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !16
%5 = load ptr, ptr %1, align 4, !tbaa !10
store ptr %5, ptr %0, align 4, !tbaa !10
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !3
store ptr %7, ptr %3, align 4, !tbaa !3
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !17
store ptr %9, ptr %4, align 4, !tbaa !17
store ptr null, ptr %8, align 4, !tbaa !17
store ptr null, ptr %6, align 4, !tbaa !3
store ptr null, ptr %1, align 4, !tbaa !10
ret ptr %0
}
attributes #0 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { minsize nounwind optsize }
!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}
!16 = !{!9, !5, i64 0}
!17 = !{!5, !5, i64 0}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32)
(local i32 i32 i32 i32 f32 f32 f32)
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.set 4
f32.const -0x1.86ap+16 (;=-100000;)
local.set 6
f32.const 0x1.86ap+16 (;=100000;)
local.set 7
loop ;; label = @1
local.get 2
local.get 4
i32.eq
if ;; label = @2
block ;; label = @3
local.get 6
local.get 7
f32.sub
local.set 6
i32.const 0
local.set 2
loop ;; label = @4
local.get 2
local.get 4
i32.eq
br_if 1 (;@3;)
local.get 3
local.get 2
i32.const 2
i32.shl
i32.add
local.tee 5
local.get 5
f32.load
local.get 7
f32.sub
local.get 6
f32.div
f32.store
local.get 2
i32.const 1
i32.add
local.set 2
br 0 (;@4;)
end
unreachable
end
else
local.get 3
local.get 2
i32.const 2
i32.shl
i32.add
f32.load
local.tee 8
local.get 6
local.get 6
local.get 8
f32.lt
select
local.set 6
local.get 8
local.get 7
local.get 7
local.get 8
f32.gt
select
local.set 7
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.load
i32.store
local.get 0
local.get 1
i32.load offset=4
i32.store offset=4
local.get 0
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z15rescale_to_unitNSt3__26vectorIfNS_9allocatorIfEEEE" (func 1)))
| 10 | 297 | 2,389 | 113 |
CPP/23 | /*
Return length of given string
>>> strlen("")
0
>>> strlen("abc")
3
*/
#include<stdio.h>
#include<string>
using namespace std;
int strlen(string str){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int strlen(string str){
| return str.length();
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (strlen("") == 0);
assert (strlen("x") == 1);
assert (strlen("asdasnakj") == 9);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (strlen("") == 0);
assert (strlen("abc") == 3);
}
| ; ModuleID = 'c_code_test/code_22.cpp'
source_filename = "c_code_test/code_22.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(argmem: read)
define noundef i32 @_Z6strlenNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
ret i32 %8
}
attributes #0 = { minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(argmem: read) "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 i32) (result i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
select)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z6strlenNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 2 | 27 | 545 | 19 |
CPP/24 | /*
For a given number n, find the largest number that divides n evenly, smaller than n
>>> largest_divisor(15)
5
*/
#include<stdio.h>
using namespace std;
int largest_divisor(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int largest_divisor(int n){
| for (int i=2;i*i<=n;i++)
if (n%i==0) return n/i;
return 1;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (largest_divisor(3) == 1);
assert (largest_divisor(7) == 1);
assert (largest_divisor(10) == 5);
assert (largest_divisor(100) == 50);
assert (largest_divisor(49) == 7);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (largest_divisor(15) == 5);
}
| ; ModuleID = 'c_code_test/code_23.cpp'
source_filename = "c_code_test/code_23.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 i32 @_Z15largest_divisori(i32 noundef %0) local_unnamed_addr #0 {
br label %2
2: ; preds = %12, %1
%3 = phi i32 [ 2, %1 ], [ %13, %12 ]
%4 = mul nsw i32 %3, %3
%5 = icmp sgt i32 %4, %0
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = freeze i32 %3
%8 = sdiv i32 %0, %7
%9 = mul i32 %8, %7
%10 = sub i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = add nuw nsw i32 %3, 1
br label %2, !llvm.loop !3
14: ; preds = %2, %6
%15 = phi i32 [ %8, %6 ], [ 1, %2 ]
ret i32 %15
}
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)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32)
i32.const 2
local.set 1
loop ;; label = @1
local.get 0
local.get 1
local.get 1
i32.mul
i32.lt_s
if ;; label = @2
i32.const 1
return
end
local.get 0
local.get 1
i32.div_s
local.tee 2
local.get 1
i32.mul
local.set 3
local.get 1
i32.const 1
i32.add
local.set 1
local.get 0
local.get 3
i32.ne
br_if 0 (;@1;)
end
local.get 2)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z15largest_divisori" (func 1)))
| 5 | 79 | 795 | 38 |
CPP/25 | /*
Return vector of prime factors of given integer in the order from smallest to largest.
Each of the factors should be vectored number of times corresponding to how many times it appeares in factorization.
Input number should be equal to the product of all factors
>>> factorize(8)
{2, 2, 2}
>>> factorize(25)
{5, 5}
>>> factorize(70)
{2, 5, 7}
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> factorize(int n){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<int> factorize(int n){
| vector<int> out={};
for (int i=2;i*i<=n;i++)
if (n%i==0)
{
n=n/i;
out.push_back(i);
i-=1;
}
out.push_back(n);
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(factorize(2) , {2}));
assert (issame(factorize(4) , {2, 2}));
assert (issame(factorize(8) , {2, 2, 2}));
assert (issame(factorize(3 * 19) , {3, 19}));
assert (issame(factorize(3 * 19 * 3 * 19) , {3, 3, 19, 19}));
assert (issame(factorize(3 * 19 * 3 * 19 * 3 * 19) , {3, 3, 3, 19, 19, 19}));
assert (issame(factorize(3 * 19 * 19 * 19) , {3, 19, 19, 19}));
assert (issame(factorize(3 * 2 * 3) , {2, 3, 3}));
}
| #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(factorize(8) , {2, 2, 2}));
assert (issame(factorize(25) , {5,5}));
assert (issame(factorize(70) , {2,5,7}));
}
| ; ModuleID = 'c_code_test/code_24.cpp'
source_filename = "c_code_test/code_24.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 @_Z9factorizei(ptr noalias sret(%"class.std::__2::vector") align 4 %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
store i32 %1, ptr %3, 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #13
br label %7
7: ; preds = %23, %2
%8 = phi i32 [ %1, %2 ], [ %25, %23 ]
%9 = phi i32 [ 2, %2 ], [ %26, %23 ]
store i32 %9, ptr %4, align 4, !tbaa !3
%10 = mul nsw i32 %9, %9
%11 = icmp sgt i32 %10, %8
br i1 %11, label %12, label %13
12: ; preds = %7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #13
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %3) #14
ret void
13: ; preds = %7
%14 = freeze i32 %8
%15 = freeze i32 %9
%16 = sdiv i32 %14, %15
%17 = mul i32 %16, %15
%18 = sub i32 %14, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %13
store i32 %16, ptr %3, align 4, !tbaa !3
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %4) #14
%21 = load i32, ptr %4, align 4, !tbaa !3
%22 = add nsw i32 %21, -1
store i32 %22, ptr %4, align 4, !tbaa !3
br label %23
23: ; preds = %13, %20
%24 = phi i32 [ %9, %13 ], [ %22, %20 ]
%25 = phi i32 [ %8, %13 ], [ %16, %20 ]
%26 = add nsw i32 %24, 1
br label %7, !llvm.loop !14
}
; 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 !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) #14
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: 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) #13
%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) #14
%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) #14
%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) #14
%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) #13
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) #14, !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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
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) #13
%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 = { 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 = { 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 = { nounwind }
attributes #14 = { minsize optsize }
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)))
(type (;3;) (func (param i32 i32 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 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 1)))
(import "env" "__cxa_throw" (func (;3;) (type 3)))
(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 0) (param i32 i32)
(local i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
local.get 1
i32.store offset=12
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
i32.const 2
local.set 3
loop ;; label = @1
local.get 2
local.get 3
i32.store offset=8
local.get 3
local.get 3
i32.mul
local.get 1
i32.gt_s
i32.eqz
if ;; label = @2
local.get 1
local.get 3
i32.div_s
local.tee 4
local.get 3
i32.mul
local.get 1
i32.eq
if ;; label = @3
local.get 2
local.get 4
i32.store offset=12
local.get 0
local.get 2
i32.const 8
i32.add
call 9
local.get 2
local.get 2
i32.load offset=8
i32.const 1
i32.sub
local.tee 3
i32.store offset=8
local.get 4
local.set 1
end
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@1;)
end
end
local.get 0
local.get 2
i32.const 12
i32.add
call 9
local.get 2
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 "_Z9factorizei" (func 8))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 10))
(data (;0;) (global.get 1) "vector\00"))
| 11 | 200 | 7,252 | 352 |
CPP/26 | /*
From a vector of integers, remove all elements that occur more than once.
Keep order of elements left the same as in the input.
>>> remove_duplicates({1, 2, 3, 2, 4})
{1, 3, 4}
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> remove_duplicates(vector<int> numbers){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<int> remove_duplicates(vector<int> numbers){
| vector<int> out={};
vector<int> has1={};
vector<int> has2={};
for (int i=0;i<numbers.size();i++)
{
if (find(has2.begin(),has2.end(),numbers[i])!=has2.end()) continue;
if (find(has1.begin(),has1.end(),numbers[i])!=has1.end())
{
has2.push_back(numbers[i]);
}
else has1.push_back(numbers[i]);
}
for (int i=0;i<numbers.size();i++)
if (find(has2.begin(),has2.end(),numbers[i])==has2.end())
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(remove_duplicates({}) , {}));
assert (issame(remove_duplicates({1, 2, 3, 4}) , {1, 2, 3, 4}));
assert (issame(remove_duplicates({1, 2, 3, 2, 4, 3, 5}) , {1, 4, 5}));
}
| #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(remove_duplicates({1, 2, 3, 2,4}) , {1, 3, 4}));
}
| ; ModuleID = 'c_code_test/code_25.cpp'
source_filename = "c_code_test/code_25.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::vector<int>::__destroy_vector" = 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__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev = 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 @_Z17remove_duplicatesNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::vector", align 4
%4 = alloca %"class.std::__2::vector", 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) #13
store ptr null, ptr %3, align 4, !tbaa !3
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %3, i32 0, i32 1
store ptr null, ptr %7, align 4, !tbaa !10
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %3, i32 0, i32 2
store ptr null, ptr %8, align 4, !tbaa !11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #13
store ptr null, ptr %4, align 4, !tbaa !3
%9 = getelementptr inbounds %"class.std::__2::vector", ptr %4, i32 0, i32 1
store ptr null, ptr %9, align 4, !tbaa !10
%10 = getelementptr inbounds %"class.std::__2::vector", ptr %4, i32 0, i32 2
store ptr null, ptr %10, align 4, !tbaa !11
%11 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %12
12: ; preds = %39, %2
%13 = phi i32 [ 0, %2 ], [ %40, %39 ]
%14 = load ptr, ptr %11, align 4, !tbaa !10
%15 = load ptr, ptr %1, 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 = icmp ult i32 %13, %19
br i1 %20, label %21, label %41
21: ; preds = %12
%22 = load ptr, ptr %4, align 4, !tbaa !3
%23 = load ptr, ptr %9, align 4, !tbaa !10
%24 = getelementptr inbounds i32, ptr %15, i32 %13
%25 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %22, ptr %23, ptr noundef nonnull align 4 dereferenceable(4) %24) #14
%26 = load ptr, ptr %9, align 4, !tbaa !10
%27 = icmp eq ptr %25, %26
br i1 %27, label %28, label %39
28: ; preds = %21
%29 = load ptr, ptr %3, align 4, !tbaa !3
%30 = load ptr, ptr %7, align 4, !tbaa !10
%31 = load ptr, ptr %1, align 4, !tbaa !3
%32 = getelementptr inbounds i32, ptr %31, i32 %13
%33 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %29, ptr %30, ptr noundef nonnull align 4 dereferenceable(4) %32) #14
%34 = load ptr, ptr %7, align 4, !tbaa !10
%35 = icmp eq ptr %33, %34
%36 = load ptr, ptr %1, align 4, !tbaa !3
%37 = getelementptr inbounds i32, ptr %36, i32 %13
%38 = select i1 %35, ptr %3, ptr %4
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %38, ptr noundef nonnull align 4 dereferenceable(4) %37) #14
br label %39
39: ; preds = %28, %21
%40 = add nuw nsw i32 %13, 1
br label %12, !llvm.loop !12
41: ; preds = %12, %63
%42 = phi ptr [ %66, %63 ], [ %15, %12 ]
%43 = phi ptr [ %65, %63 ], [ %14, %12 ]
%44 = phi i32 [ %64, %63 ], [ 0, %12 ]
%45 = ptrtoint ptr %43 to i32
%46 = ptrtoint ptr %42 to i32
%47 = sub i32 %45, %46
%48 = ashr exact i32 %47, 2
%49 = icmp ult i32 %44, %48
br i1 %49, label %53, label %50
50: ; preds = %41
%51 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #13
%52 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #13
ret void
53: ; preds = %41
%54 = load ptr, ptr %4, align 4, !tbaa !3
%55 = load ptr, ptr %9, align 4, !tbaa !10
%56 = getelementptr inbounds i32, ptr %42, i32 %44
%57 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %54, ptr %55, ptr noundef nonnull align 4 dereferenceable(4) %56) #14
%58 = load ptr, ptr %9, align 4, !tbaa !10
%59 = icmp eq ptr %57, %58
br i1 %59, label %60, label %63
60: ; preds = %53
%61 = load ptr, ptr %1, align 4, !tbaa !3
%62 = getelementptr inbounds i32, ptr %61, i32 %44
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %62) #14
br label %63
63: ; preds = %53, %60
%64 = add nuw nsw i32 %44, 1
%65 = load ptr, ptr %11, align 4, !tbaa !10
%66 = load ptr, ptr %1, align 4, !tbaa !3
br label %41, !llvm.loop !14
}
; 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 nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(4) %2) local_unnamed_addr #2 comdat {
%4 = load i32, ptr %2, align 4
br label %5
5: ; preds = %11, %3
%6 = phi ptr [ %0, %3 ], [ %12, %11 ]
%7 = icmp eq ptr %6, %1
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = load i32, ptr %6, align 4, !tbaa !15
%10 = icmp eq i32 %9, %4
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, ptr %6, i32 1
br label %5, !llvm.loop !17
13: ; preds = %8, %5
%14 = phi ptr [ %6, %8 ], [ %1, %5 ]
ret ptr %14
}
; 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 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 #3 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 !18
%7 = icmp eq ptr %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, ptr %1, align 4, !tbaa !15
store i32 %9, ptr %4, align 4, !tbaa !15
%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) #14
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #4 comdat {
%2 = alloca %"class.std::__2::vector<int>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #13
store ptr %0, ptr %2, align 4, !tbaa !18
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #13
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #5 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !19
%3 = load ptr, ptr %2, align 4, !tbaa !3
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !10
tail call void @_ZdlPv(ptr noundef nonnull %3) #16
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #6
; 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 #7 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) #13
%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) #14
%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) #14
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !21
%23 = load i32, ptr %1, align 4, !tbaa !15
store i32 %23, ptr %22, align 4, !tbaa !15
%24 = getelementptr inbounds i32, ptr %22, i32 1
store ptr %24, ptr %21, align 4, !tbaa !21
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) #14
%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) #13
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 #7 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) #17
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 !18
%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 !18
%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) #14, !noalias !25
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !28
%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 !21
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !29
%15 = getelementptr inbounds i32, ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !18
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 !29
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 !15, !noalias !30
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !15, !noalias !30
br label %8, !llvm.loop !35
16: ; preds = %8
store ptr %10, ptr %6, align 4, !tbaa !29
%17 = load ptr, ptr %0, align 4, !tbaa !18
store ptr %10, ptr %0, align 4, !tbaa !18
store ptr %17, ptr %6, align 4, !tbaa !18
%18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%19 = load ptr, ptr %3, align 4, !tbaa !18
%20 = load ptr, ptr %18, align 4, !tbaa !18
store ptr %20, ptr %3, align 4, !tbaa !18
store ptr %19, ptr %18, align 4, !tbaa !18
%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 !18
%24 = load ptr, ptr %22, align 4, !tbaa !18
store ptr %24, ptr %21, align 4, !tbaa !18
store ptr %23, ptr %22, align 4, !tbaa !18
%25 = load ptr, ptr %6, align 4, !tbaa !29
store ptr %25, ptr %1, align 4, !tbaa !28
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 #4 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 !28
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #16
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) #17
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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !36
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #4
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 #5 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() #17
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 #9 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #13
%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 #4
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #4
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; 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 #11 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !29
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 #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !21
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 !21
br label %5, !llvm.loop !38
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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { inlinehint minsize mustprogress 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 nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { 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 = { nounwind }
attributes #14 = { minsize optsize }
attributes #15 = { minsize nounwind optsize }
attributes #16 = { builtin minsize nounwind optsize }
attributes #17 = { minsize noreturn 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, !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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !6, i64 0}
!17 = distinct !{!17, !13}
!18 = !{!5, !5, i64 0}
!19 = !{!20, !5, i64 0}
!20 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorE", !5, i64 0}
!21 = !{!22, !5, i64 8}
!22 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !23, i64 12}
!23 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !24, i64 4}
!24 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, i64 0}
!25 = !{!26}
!26 = distinct !{!26, !27, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!28 = !{!22, !5, i64 0}
!29 = !{!22, !5, i64 4}
!30 = !{!31, !33}
!31 = distinct !{!31, !32, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!32 = distinct !{!32, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"}
!33 = distinct !{!33, !34, !"_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"}
!34 = distinct !{!34, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!35 = distinct !{!35, !13}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !7, i64 0}
!38 = distinct !{!38, !13}
| (module
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32 i32) (result i32)))
(import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func (;0;) (type 0)))
(import "env" "_ZdlPv" (func (;1;) (type 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 1)))
(import "env" "__cxa_throw" (func (;3;) (type 3)))
(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 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=28
local.get 2
i64.const 0
i64.store offset=20 align=4
local.get 2
i32.const 0
i32.store offset=16
local.get 2
i64.const 0
i64.store offset=8 align=4
loop ;; label = @1
block ;; label = @2
local.get 1
i32.load offset=4
local.tee 4
local.get 1
i32.load
local.tee 6
i32.sub
i32.const 2
i32.shr_s
local.get 3
i32.le_u
if ;; label = @3
loop ;; label = @4
local.get 5
local.get 4
local.get 6
i32.sub
i32.const 2
i32.shr_s
i32.ge_u
br_if 2 (;@2;)
local.get 2
i32.load offset=8
local.get 2
i32.load offset=12
local.get 6
local.get 5
i32.const 2
i32.shl
local.tee 3
i32.add
call 9
local.get 2
i32.load offset=12
i32.eq
if ;; label = @5
local.get 0
local.get 1
i32.load
local.get 3
i32.add
call 10
end
local.get 5
i32.const 1
i32.add
local.set 5
local.get 1
i32.load
local.set 6
local.get 1
i32.load offset=4
local.set 4
br 0 (;@4;)
end
unreachable
end
local.get 2
i32.load offset=8
local.get 2
i32.load offset=12
local.get 6
local.get 3
i32.const 2
i32.shl
local.tee 4
i32.add
call 9
local.get 2
i32.load offset=12
i32.eq
if ;; label = @3
local.get 2
i32.const 20
i32.add
local.get 2
i32.const 8
i32.add
local.get 2
i32.load offset=20
local.get 2
i32.load offset=24
local.get 1
i32.load
local.get 4
i32.add
call 9
local.get 2
i32.load offset=24
i32.eq
select
local.get 1
i32.load
local.get 4
i32.add
call 10
end
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@1;)
end
end
local.get 2
i32.const 8
i32.add
call 11
local.get 2
i32.const 20
i32.add
call 11
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;9;) (type 6) (param i32 i32 i32) (result i32)
local.get 2
i32.load
local.set 2
loop ;; label = @1
block ;; label = @2
local.get 0
local.get 1
i32.ne
if (result i32) ;; label = @3
local.get 0
i32.load
local.get 2
i32.ne
br_if 1 (;@2;)
local.get 0
else
local.get 1
end
return
end
local.get 0
i32.const 4
i32.add
local.set 0
br 0 (;@1;)
end
unreachable)
(func (;10;) (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 (;11;) (type 2) (param i32)
(local i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 1
global.set 0
local.get 1
local.get 0
i32.store offset=12
local.get 1
i32.load offset=12
local.tee 2
i32.load
local.tee 0
if ;; label = @1
local.get 2
local.get 0
i32.store offset=4
local.get 0
call 1
end
local.get 1
i32.const 16
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 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 "_Z17remove_duplicatesNSt3__26vectorIiNS_9allocatorIiEEEE" (func 8))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 12))
(data (;0;) (global.get 1) "vector\00"))
| 20 | 525 | 9,968 | 478 |
CPP/27 | /*
For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
>>> flip_case("Hello")
"hELLO"
*/
#include<stdio.h>
#include<string>
using namespace std;
string filp_case(string str){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string filp_case(string str){
| string out="";
for (int i=0;i<str.length();i++)
{
char w=str[i];
if (w>=97 and w<=122) {w-=32;}
else
if (w>=65 and w<=90){ w+=32;}
out=out+w;
}
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (filp_case("") == "");
assert (filp_case("Hello!") == "hELLO!");
assert (filp_case("These violent delights have violent ends") == "tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (filp_case("Hello") == "hELLO");
}
| ; ModuleID = 'c_code_test/code_26.cpp'
source_filename = "c_code_test/code_26.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize mustprogress optsize
define void @_Z9filp_caseNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #15
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %7
7: ; preds = %29, %2
%8 = phi i32 [ 0, %2 ], [ %32, %29 ]
%9 = load i8, ptr %5, align 1
%10 = icmp slt i8 %9, 0
%11 = load i32, ptr %6, align 4
%12 = zext i8 %9 to i32
%13 = select i1 %10, i32 %11, i32 %12
%14 = icmp ult i32 %8, %13
br i1 %14, label %15, label %33
15: ; preds = %7
%16 = load ptr, ptr %1, align 4
%17 = select i1 %10, ptr %16, ptr %1
%18 = getelementptr inbounds i8, ptr %17, i32 %8
%19 = load i8, ptr %18, align 1, !tbaa !3
%20 = add i8 %19, -97
%21 = icmp ult i8 %20, 26
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = add nsw i8 %19, -32
br label %29
24: ; preds = %15
%25 = add i8 %19, -65
%26 = icmp ult i8 %25, 26
%27 = add i8 %19, 32
%28 = select i1 %26, i8 %27, i8 %19
br label %29
29: ; preds = %24, %22
%30 = phi i8 [ %23, %22 ], [ %28, %24 ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #16
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %30) #15
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #17
%31 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #16
%32 = add nuw nsw i32 %8, 1
br label %7, !llvm.loop !6
33: ; preds = %7
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #1 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #17
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #15
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #1 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #16
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #15
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #16
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !8
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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: 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 #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.1) #18
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 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) #15
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #19
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 #1 comdat {
%3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #15
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !19
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 #1
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #1 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #20
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; 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) #11
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #14 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #21
br label %8
8: ; preds = %6, %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 !21
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
attributes #0 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = { 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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { minsize optsize }
attributes #16 = { nounwind }
attributes #17 = { minsize nounwind optsize }
attributes #18 = { minsize noreturn optsize }
attributes #19 = { noreturn }
attributes #20 = { builtin minsize optsize allocsize(0) }
attributes #21 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !11, !13, !15, !17}
!9 = distinct !{!9, !10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!11 = distinct !{!11, !12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!12 = distinct !{!12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!13 = distinct !{!13, !14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!14 = distinct !{!14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!15 = distinct !{!15, !16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!17 = distinct !{!17, !18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !5, i64 0}
!21 = !{i64 0, i64 4, !22, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 11, i64 4, !24, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !4, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "memmove" (func (;4;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;5;) (type 0)))
(import "env" "__cxa_throw" (func (;6;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;7;) (type 1)))
(import "env" "_Znwm" (func (;8;) (type 0)))
(import "env" "_ZdlPv" (func (;9;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;10;) (type 5))
(func (;11;) (type 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 5
global.set 0
local.get 0
global.get 1
i32.const 12
i32.add
call 0
local.set 4
i32.const 0
local.set 0
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.get 0
i32.gt_u
if ;; label = @2
local.get 5
i32.const 4
i32.add
local.set 2
block (result i32) ;; label = @3
local.get 1
i32.load
local.get 1
local.get 3
select
local.get 0
i32.add
i32.load8_u
local.tee 3
i32.const 97
i32.sub
i32.const 255
i32.and
i32.const 25
i32.le_u
if ;; label = @4
local.get 3
i32.const 32
i32.sub
br 1 (;@3;)
end
local.get 3
i32.const 32
i32.add
local.get 3
local.get 3
i32.const 65
i32.sub
i32.const 255
i32.and
i32.const 26
i32.lt_u
select
end
i32.extend8_s
local.set 7
global.get 0
i32.const 16
i32.sub
local.tee 8
global.set 0
block (result i32) ;; label = @3
local.get 4
i32.load offset=4
local.get 4
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 6
i32.const 1
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @4
local.get 3
i32.const 10
i32.le_u
if ;; label = @5
local.get 2
i32.const 0
i32.store offset=8
local.get 2
i64.const 0
i64.store align=4
local.get 2
local.get 3
i32.store8 offset=11
local.get 2
br 2 (;@3;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 9
call 8
local.set 10
local.get 2
local.get 3
i32.store offset=4
local.get 2
local.get 10
i32.store
local.get 2
local.get 9
i32.const -2147483648
i32.or
i32.store offset=8
local.get 2
br 1 (;@3;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 5
global.get 4
local.set 4
global.get 1
call 7
local.tee 2
local.get 4
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 6
unreachable
end
local.tee 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 4
i32.load
local.get 4
local.get 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 6
call 4
local.get 6
i32.add
local.tee 3
local.get 7
i32.store8
local.get 3
i32.const 0
i32.store8 offset=1
local.get 8
i32.const 16
i32.add
global.set 0
local.get 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 4
i32.load
call 9
end
local.get 4
local.get 2
i64.load align=4
i64.store align=4
local.get 4
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 0
i32.const 1
i32.add
local.set 0
local.get 2
call 1
drop
br 1 (;@1;)
end
end
local.get 5
i32.const 16
i32.add
global.set 0)
(func (;12;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 10))
(export "__wasm_apply_data_relocs" (func 10))
(export "_Z9filp_caseNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 11))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 12))
(data (;0;) (global.get 1) "basic_string\00"))
| 11 | 222 | 6,571 | 257 |
CPP/28 | /*
Concatenate vector of strings into a single string
>>> concatenate({})
""
>>> concatenate({"a", "b", "c"})
"abc"
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
string concatenate(vector<string> strings){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string concatenate(vector<string> strings){
| string out="";
for (int i=0;i<strings.size();i++)
out=out+strings[i];
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (concatenate({}) == "");
assert (concatenate({"x", "y", "z"}) == "xyz");
assert (concatenate({"x", "y", "z", "w", "k"}) == "xyzwk");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (concatenate({}) == "");
assert (concatenate({"a", "b", "c"}) == "abc");
}
| ; ModuleID = 'c_code_test/code_27.cpp'
source_filename = "c_code_test/code_27.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::vector" = type { ptr, ptr, %"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 { ptr }
%"class.std::__2::allocator" = type { i8 }
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize mustprogress optsize
define void @_Z11concatenateNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #15
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %6
6: ; preds = %15, %2
%7 = phi i32 [ 0, %2 ], [ %18, %15 ]
%8 = load ptr, ptr %5, align 4, !tbaa !3
%9 = load ptr, ptr %1, align 4, !tbaa !10
%10 = ptrtoint ptr %8 to i32
%11 = ptrtoint ptr %9 to i32
%12 = sub i32 %10, %11
%13 = sdiv exact i32 %12, 12
%14 = icmp ult i32 %7, %13
br i1 %14, label %15, label %19
15: ; preds = %6
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #16
%16 = getelementptr inbounds %"class.std::__2::basic_string", ptr %9, i32 %7
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %16) #15
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #17
%17 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #16
%18 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !11
19: ; preds = %6
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #1 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #17
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #15
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #1 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%13 = load i8, ptr %12, align 1
%14 = icmp slt i8 %13, 0
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
%16 = load i32, ptr %15, align 4
%17 = zext i8 %13 to i32
%18 = select i1 %14, i32 %16, i32 %17
%19 = add i32 %18, %11
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #16
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #15
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #16
%21 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%22 = load i8, ptr %21, align 1
%23 = icmp slt i8 %22, 0
%24 = load ptr, ptr %0, align 4
%25 = select i1 %23, ptr %24, ptr %0
%26 = load i8, ptr %5, align 1
%27 = icmp slt i8 %26, 0
%28 = load ptr, ptr %1, align 4
%29 = select i1 %27, ptr %28, ptr %1
%30 = icmp ult ptr %29, %25
%31 = getelementptr inbounds i8, ptr %25, i32 %11
%32 = icmp ule ptr %31, %29
%33 = or i1 %30, %32
call void @llvm.assume(i1 %33)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %25, ptr align 1 %29, i32 %11, i1 false), !noalias !13
%34 = load i8, ptr %12, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %2, align 4
%37 = select i1 %35, ptr %36, ptr %2
%38 = icmp ult ptr %37, %31
%39 = getelementptr inbounds i8, ptr %31, i32 %18
%40 = icmp ule ptr %39, %37
%41 = or i1 %38, %40
call void @llvm.assume(i1 %41)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %31, ptr align 1 %37, i32 %18, i1 false), !noalias !24
store i8 0, ptr %39, align 1, !tbaa !35
ret void
}
; 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: 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 #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.1) #18
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 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) #15
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #19
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 #1 comdat {
%3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #15
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !36
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 #1
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #1 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #20
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !35
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !35
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; 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) #11
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #14 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !35
tail call void @_ZdlPv(ptr noundef %7) #21
br label %8
8: ; preds = %6, %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 !38
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !35
ret void
}
attributes #0 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = { 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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { minsize optsize }
attributes #16 = { nounwind }
attributes #17 = { minsize nounwind optsize }
attributes #18 = { minsize noreturn optsize }
attributes #19 = { noreturn }
attributes #20 = { builtin minsize optsize allocsize(0) }
attributes #21 = { builtin minsize nounwind optsize }
!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__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 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !16, !18, !20, !22}
!14 = distinct !{!14, !15, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!15 = distinct !{!15, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!16 = distinct !{!16, !17, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!17 = distinct !{!17, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!18 = distinct !{!18, !19, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!19 = distinct !{!19, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!20 = distinct !{!20, !21, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!21 = distinct !{!21, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!22 = distinct !{!22, !23, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!23 = distinct !{!23, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!24 = !{!25, !27, !29, !31, !33}
!25 = distinct !{!25, !26, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!27 = distinct !{!27, !28, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!28 = distinct !{!28, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!29 = distinct !{!29, !30, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!30 = distinct !{!30, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!31 = distinct !{!31, !32, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!32 = distinct !{!32, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!33 = distinct !{!33, !34, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!34 = distinct !{!34, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!35 = !{!6, !6, i64 0}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !7, i64 0}
!38 = !{i64 0, i64 4, !39, i64 4, i64 4, !40, i64 8, i64 4, !40, i64 11, i64 4, !40, i64 0, i64 11, !35, i64 11, i64 0, !35, i64 11, i64 1, !35, i64 11, i64 1, !35, i64 0, i64 12, !35}
!39 = !{!5, !5, i64 0}
!40 = !{!41, !41, i64 0}
!41 = !{!"long", !6, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "memmove" (func (;4;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;5;) (type 0)))
(import "env" "__cxa_throw" (func (;6;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;7;) (type 1)))
(import "env" "_Znwm" (func (;8;) (type 0)))
(import "env" "_ZdlPv" (func (;9;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;10;) (type 5))
(func (;11;) (type 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
local.get 0
global.get 1
i32.const 12
i32.add
call 0
local.set 2
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 4
i32.sub
i32.const 12
i32.div_s
local.get 5
i32.gt_u
if ;; label = @2
global.get 0
i32.const 16
i32.sub
local.tee 9
global.set 0
block (result i32) ;; label = @3
local.get 6
i32.const 4
i32.add
local.set 0
local.get 4
local.get 5
i32.const 12
i32.mul
i32.add
local.tee 4
i32.load offset=4
local.get 4
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 7
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 8
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @4
local.get 3
i32.const 10
i32.le_u
if ;; label = @5
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 3
i32.store8 offset=11
local.get 0
br 2 (;@3;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 10
call 8
local.set 11
local.get 0
local.get 3
i32.store offset=4
local.get 0
local.get 11
i32.store
local.get 0
local.get 10
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@3;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 5
global.get 4
local.set 4
global.get 1
call 7
local.tee 2
local.get 4
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 6
unreachable
end
local.tee 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 8
call 4
local.get 8
i32.add
local.get 4
i32.load
local.get 4
local.get 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 7
call 4
local.get 7
i32.add
i32.const 0
i32.store8
local.get 9
i32.const 16
i32.add
global.set 0
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 2
i32.load
call 9
end
local.get 2
local.get 0
i64.load align=4
i64.store align=4
local.get 2
local.get 0
i32.load offset=8
i32.store offset=8
local.get 0
i32.const 0
i32.store8 offset=11
local.get 0
i32.const 0
i32.store8
local.get 5
i32.const 1
i32.add
local.set 5
local.get 0
call 1
drop
br 1 (;@1;)
end
end
local.get 6
i32.const 16
i32.add
global.set 0)
(func (;12;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 10))
(export "__wasm_apply_data_relocs" (func 10))
(export "_Z11concatenateNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE" (func 11))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 12))
(data (;0;) (global.get 1) "basic_string\00"))
| 5 | 104 | 6,197 | 238 |
CPP/29 | /*
Filter an input vector of strings only for ones that start with a given prefix.
>>> filter_by_prefix({}, "a")
{}
>>> filter_by_prefix({"abc", "bcd", "cde", "vector"}, "a")
{"abc", "vector"}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<string> filter_by_prefix(vector<string> strings, string prefix){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<string> filter_by_prefix(vector<string> strings, string prefix){
| vector<string> out={};
for (int i=0;i<strings.size();i++)
if (strings[i].substr(0,prefix.length())==prefix) out.push_back(strings[i]);
return out;
}
| #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(filter_by_prefix({}, "john") , {}));
assert (issame(filter_by_prefix({"xxx", "asd", "xxy", "john doe", "xxxAAA", "xxx"}, "xxx") , {"xxx", "xxxAAA", "xxx"}));
}
| #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(filter_by_prefix({}, "a") , {}));
assert (issame(filter_by_prefix({"abc", "bcd", "cde", "array"}, "a") , {"abc", "array"}));
}
| ; ModuleID = 'c_code_test/code_28.cpp'
source_filename = "c_code_test/code_28.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 }
%"class.std::__2::allocator.4" = type { 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__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm = comdat any
$_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006ERKS6_ = comdat any
$_ZNSt3__211char_traitsIcE7compareEPKcS3_m = 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
@.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 @_Z16filter_by_prefixNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEES6_(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #0 {
%4 = alloca %"class.std::__2::basic_string", 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
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
br label %10
10: ; preds = %31, %3
%11 = phi i32 [ 0, %3 ], [ %32, %31 ]
%12 = load ptr, ptr %7, align 4, !tbaa !10
%13 = load ptr, ptr %1, align 4, !tbaa !3
%14 = ptrtoint ptr %12 to i32
%15 = ptrtoint ptr %13 to i32
%16 = sub i32 %14, %15
%17 = sdiv exact i32 %16, 12
%18 = icmp ult i32 %11, %17
br i1 %18, label %19, label %33
19: ; preds = %10
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #16
%20 = getelementptr inbounds %"class.std::__2::basic_string", ptr %13, i32 %11
%21 = load i8, ptr %8, align 1
%22 = icmp slt i8 %21, 0
%23 = load i32, ptr %9, align 4
%24 = zext i8 %21 to i32
%25 = select i1 %22, i32 %23, i32 %24
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %20, i32 noundef 0, i32 noundef %25) #17
%26 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %2) #18
%27 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #16
br i1 %26, label %28, label %31
28: ; preds = %19
%29 = load ptr, ptr %1, align 4, !tbaa !3
%30 = getelementptr inbounds %"class.std::__2::basic_string", ptr %29, i32 %11
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) %30) #17
br label %31
31: ; preds = %19, %28
%32 = add nuw nsw i32 %11, 1
br label %10, !llvm.loop !12
33: ; preds = %10
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 nounwind optsize
define linkonce_odr hidden noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%7 = load i32, ptr %6, align 4
%8 = zext i8 %4 to i32
%9 = select i1 %5, i32 %7, i32 %8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%11 = load i8, ptr %10, align 1
%12 = icmp slt i8 %11, 0
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%14 = load i32, ptr %13, align 4
%15 = zext i8 %11 to i32
%16 = select i1 %12, i32 %14, i32 %15
%17 = icmp eq i32 %9, %16
br i1 %17, label %18, label %38
18: ; preds = %2
%19 = load ptr, ptr %1, align 4
%20 = select i1 %12, ptr %19, ptr %1
br i1 %5, label %21, label %25
21: ; preds = %18
%22 = load ptr, ptr %0, align 4
%23 = tail call noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %22, ptr noundef %20, i32 noundef %7) #18
%24 = icmp eq i32 %23, 0
br label %38
25: ; preds = %18, %34
%26 = phi i32 [ %35, %34 ], [ %8, %18 ]
%27 = phi ptr [ %36, %34 ], [ %0, %18 ]
%28 = phi ptr [ %37, %34 ], [ %20, %18 ]
%29 = icmp eq i32 %26, 0
br i1 %29, label %38, label %30
30: ; preds = %25
%31 = load i8, ptr %27, align 1, !tbaa !14
%32 = load i8, ptr %28, align 1, !tbaa !14
%33 = icmp eq i8 %31, %32
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = add nsw i32 %26, -1
%36 = getelementptr inbounds i8, ptr %27, i32 1
%37 = getelementptr inbounds i8, ptr %28, i32 1
br label %25, !llvm.loop !15
38: ; preds = %30, %25, %21, %2
%39 = phi i1 [ false, %2 ], [ %24, %21 ], [ %29, %25 ], [ %29, %30 ]
ret i1 %39
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 comdat {
%5 = alloca %"class.std::__2::allocator.4", align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #16
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(1) %5) #17
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #16
ret void
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 #4 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 !16
%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: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: minsize optsize
declare noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #6 comdat {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcmp(ptr noundef %0, ptr noundef %1, i32 noundef %2) #18
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i32 noundef) local_unnamed_addr #7
; 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 #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) #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 !17
%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 !17
%25 = getelementptr inbounds %"class.std::__2::basic_string", ptr %24, i32 1
store ptr %25, ptr %21, align 4, !tbaa !17
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 !21
br label %11
7: ; preds = %2
%8 = load ptr, ptr %1, align 4, !tbaa !14
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = load i32, ptr %9, align 4, !tbaa !14
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: 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) #8
; 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 #4 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 !16
%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 !16
%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 !24
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !27
%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 !17
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !28
%15 = getelementptr inbounds %"class.std::__2::basic_string", 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__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 !28
%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 !28
%10 = load ptr, ptr %0, align 4, !tbaa !16
store ptr %9, ptr %0, align 4, !tbaa !16
store ptr %10, ptr %7, align 4, !tbaa !16
%11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%12 = load ptr, ptr %4, align 4, !tbaa !16
%13 = load ptr, ptr %11, align 4, !tbaa !16
store ptr %13, ptr %4, align 4, !tbaa !16
store ptr %12, ptr %11, align 4, !tbaa !16
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3
%15 = load ptr, ptr %3, align 4, !tbaa !16
%16 = load ptr, ptr %14, align 4, !tbaa !16
store ptr %16, ptr %3, align 4, !tbaa !16
store ptr %15, ptr %14, align 4, !tbaa !16
%17 = load ptr, ptr %7, align 4, !tbaa !28
store ptr %17, ptr %1, align 4, !tbaa !27
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 #9 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 !27
%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 #10 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #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 #11 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 !29
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 #12 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 #11 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 #9
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #13
; 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 !16
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 !31
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 !32
store i8 1, ptr %19, align 4, !tbaa !34
%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 #9 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !34, !range !38, !noundef !39
%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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #14
; 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 !40
%3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !41
%5 = load ptr, ptr %4, align 4, !tbaa.struct !42
%6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !43
%8 = load ptr, ptr %7, align 4, !tbaa.struct !42
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 #12 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 !44
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 #6 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !28
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 #2 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 !17
%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 !17
%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 !45
10: ; preds = %4
ret void
}
; 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 nounwind 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 = { 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 nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !6, i64 0}
!15 = distinct !{!15, !13}
!16 = !{!5, !5, i64 0}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEELi1ELb0EEE", !5, i64 0}
!21 = !{i64 0, i64 4, !16, i64 4, i64 4, !22, i64 8, i64 4, !22, i64 11, i64 4, !22, i64 0, i64 11, !14, i64 11, i64 0, !14, i64 11, i64 1, !14, i64 11, i64 1, !14, i64 0, i64 12, !14}
!22 = !{!23, !23, i64 0}
!23 = !{!"long", !6, i64 0}
!24 = !{!25}
!25 = distinct !{!25, !26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m"}
!27 = !{!18, !5, i64 0}
!28 = !{!18, !5, i64 4}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !7, i64 0}
!31 = distinct !{!31, !13}
!32 = !{!33, !5, i64 0}
!33 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEE", !5, i64 0}
!34 = !{!35, !37, i64 12}
!35 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEEE", !36, i64 0, !37, i64 12}
!36 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8}
!37 = !{!"bool", !6, i64 0}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = !{!36, !5, i64 0}
!41 = !{!36, !5, i64 8}
!42 = !{i64 0, i64 4, !16}
!43 = !{!36, !5, i64 4}
!44 = distinct !{!44, !13}
!45 = distinct !{!45, !13}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func (param i32 i32 i32) (result i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func (param i32 i32 i32)))
(type (;5;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;6;) (func (param i32)))
(type (;7;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;0;) (type 0)))
(import "env" "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func (;1;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_" (func (;2;) (type 5)))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func (;3;) (type 1)))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func (;4;) (type 1)))
(import "env" "memcmp" (func (;5;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;6;) (type 3)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;7;) (type 4)))
(import "env" "_ZdlPv" (func (;8;) (type 6)))
(import "env" "__cxa_allocate_exception" (func (;9;) (type 0)))
(import "env" "__cxa_throw" (func (;10;) (type 4)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;11;) (type 3)))
(import "env" "_Znwm" (func (;12;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;13;) (type 0)))
(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 (;14;) (type 7))
(func (;15;) (type 4) (param i32 i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 10
global.set 0
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 12
i32.div_s
local.get 8
i32.gt_u
if ;; label = @2
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
select
local.set 5
global.get 0
i32.const 16
i32.sub
local.tee 7
global.set 0
local.get 10
i32.const 4
i32.add
local.tee 4
local.get 3
local.get 8
i32.const 12
i32.mul
local.tee 11
i32.add
i32.const 0
local.get 5
local.get 7
i32.const 15
i32.add
call 2
drop
local.get 7
i32.const 16
i32.add
global.set 0
i32.const 0
local.set 9
block ;; label = @3
local.get 4
local.tee 5
i32.load offset=4
local.tee 12
local.get 4
i32.load8_u offset=11
local.tee 6
local.get 6
i32.extend8_s
local.tee 7
i32.const 0
i32.lt_s
select
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
local.tee 3
i32.const 0
i32.lt_s
select
i32.ne
br_if 0 (;@3;)
local.get 2
i32.load
local.get 2
local.get 3
i32.const 0
i32.lt_s
select
local.set 3
local.get 7
i32.const 0
i32.ge_s
if ;; label = @4
loop ;; label = @5
local.get 6
i32.eqz
local.set 9
local.get 6
i32.eqz
br_if 2 (;@3;)
local.get 5
i32.load8_u
local.get 3
i32.load8_u
i32.ne
br_if 2 (;@3;)
local.get 3
i32.const 1
i32.add
local.set 3
local.get 5
i32.const 1
i32.add
local.set 5
local.get 6
i32.const 1
i32.sub
local.set 6
br 0 (;@5;)
end
unreachable
end
local.get 5
i32.load
local.get 3
local.get 12
call 1
i32.eqz
local.set 9
end
local.get 4
call 0
drop
local.get 9
if ;; label = @3
block ;; label = @4
local.get 1
i32.load
local.get 11
i32.add
local.set 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 4
call 3
br 1 (;@4;)
end
local.get 0
local.get 4
call 4
end
end
local.get 8
i32.const 1
i32.add
local.set 8
br 1 (;@1;)
end
end
local.get 10
i32.const 16
i32.add
global.set 0)
(func (;16;) (type 2) (param i32 i32 i32) (result i32)
local.get 2
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 1
local.get 2
call 5)
(func (;17;) (type 1) (param i32 i32)
local.get 0
local.get 0
i32.load offset=4
local.get 1
call 6
i32.const 12
i32.add
i32.store offset=4)
(func (;18;) (type 1) (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 9
global.get 4
local.set 3
global.get 1
call 11
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 10
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 9
call 13
local.get 1
local.get 0
call 10
unreachable
end
local.get 4
i32.const 12
i32.mul
call 12
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 6
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 0
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 0
drop
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.tee 0
if ;; label = @1
local.get 0
call 8
end
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;19;) (type 3) (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 7
local.get 0)
(export "__wasm_call_ctors" (func 14))
(export "__wasm_apply_data_relocs" (func 14))
(export "_Z16filter_by_prefixNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEES6_" (func 15))
(export "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func 16))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE22__construct_one_at_endB7v160006IJRKS6_EEEvDpOT_" (func 17))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIRKS6_EEvOT_" (func 18))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 19))
(data (;0;) (global.get 1) "vector\00"))
| 5 | 169 | 13,015 | 570 |
CPP/30 | /*
Return only positive numbers in the vector.
>>> get_positive({-1, 2, -4, 5, 6})
{2, 5, 6}
>>> get_positive({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})
{5, 3, 2, 3, 9, 123, 1}
*/
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
vector<float> get_positive(vector<float> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<float> get_positive(vector<float> l){
| vector<float> out={};
for (int i=0;i<l.size();i++)
if (l[i]>0) out.push_back(l[i]);
return out;
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(get_positive({-1, -2, 4, 5, 6}) , {4, 5, 6} ));
assert (issame(get_positive({5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10}) , {5, 3, 2, 3, 3, 9, 123, 1}));
assert (issame(get_positive({-1, -2}) , {} ));
assert (issame(get_positive({}) , {}));
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(get_positive({-1, 2, -4, 5, 6}) , {2, 5, 6} ));
assert (issame(get_positive({5, 3, -5, 2, -3,3, 9, 0, 123, 1, -10}) , {5, 3, 2, 3, 9, 123, 1}));
}
| ; ModuleID = 'c_code_test/code_29.cpp'
source_filename = "c_code_test/code_29.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__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_ = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEEC2EmmS3_ = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorIfE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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 @_Z12get_positiveNSt3__26vectorIfNS_9allocatorIfEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
store ptr null, ptr %0, align 4, !tbaa !3
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !10
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !11
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %6
6: ; preds = %20, %2
%7 = phi i32 [ 0, %2 ], [ %21, %20 ]
%8 = load ptr, ptr %5, align 4, !tbaa !10
%9 = load ptr, ptr %1, align 4, !tbaa !3
%10 = ptrtoint ptr %8 to i32
%11 = ptrtoint ptr %9 to i32
%12 = sub i32 %10, %11
%13 = ashr exact i32 %12, 2
%14 = icmp ult i32 %7, %13
br i1 %14, label %15, label %22
15: ; preds = %6
%16 = getelementptr inbounds float, ptr %9, i32 %7
%17 = load float, ptr %16, align 4, !tbaa !12
%18 = fcmp ogt float %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %15
tail call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %16) #13
br label %20
20: ; preds = %15, %19
%21 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !14
22: ; preds = %6
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__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf(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 !16
%7 = icmp eq ptr %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load float, ptr %1, align 4, !tbaa !12
store float %9, ptr %4, align 4, !tbaa !12
%10 = getelementptr inbounds float, ptr %4, i32 1
store ptr %10, ptr %3, align 4, !tbaa !10
br label %12
11: ; preds = %2
tail call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_(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.end.p0(i64 immarg, ptr nocapture) #1
; 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__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_(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 !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__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #13
%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_bufferIfRNS_9allocatorIfEEEC2EmmS3_(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 float, ptr %1, align 4, !tbaa !12
store float %23, ptr %22, align 4, !tbaa !12
%24 = getelementptr inbounds float, ptr %22, i32 1
store ptr %24, ptr %21, align 4, !tbaa !17
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_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_bufferIfRNS_9allocatorIfEEED2Ev(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__26vectorIfNS_9allocatorIfEEE11__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__26vectorIfNS_9allocatorIfEEE20__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 !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_bufferIfRNS_9allocatorIfEEEC2EmmS3_(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 !16
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call noundef ptr @_ZNSt3__29allocatorIfE8allocateB7v160006Em(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 float, 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 float, 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__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_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 !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 float, ptr %9, i32 -1
%14 = load float, ptr %13, align 4, !tbaa !12, !noalias !26
%15 = getelementptr inbounds float, ptr %10, i32 -1
store float %14, ptr %15, align 4, !tbaa !12, !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_bufferIfRNS_9allocatorIfEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #5 comdat {
tail call void @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev(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__26vectorIfNS_9allocatorIfEEE20__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__29allocatorIfE8allocateB7v160006Em(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_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev(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_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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 float, 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 = { 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 = { 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, !5, i64 0}
!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 4}
!11 = !{!9, !5, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!5, !5, i64 0}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferIfRNS_9allocatorIfEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPfRNS_9allocatorIfEEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIfEELi1ELb0EEE", !5, i64 0}
!21 = !{!22}
!22 = distinct !{!22, !23, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!23 = distinct !{!23, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!24 = !{!18, !5, i64 0}
!25 = !{!18, !5, i64 4}
!26 = !{!27, !29}
!27 = distinct !{!27, !28, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPfEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!28 = distinct !{!28, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPfEES6_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_iteratorIPfEES9_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_iteratorIPfEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!31 = distinct !{!31, !15}
!32 = !{!33, !33, i64 0}
!33 = !{!"vtable pointer", !7, 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)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func))
(import "env" "_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_" (func (;0;) (type 0)))
(import "env" "_ZdlPv" (func (;1;) (type 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 1)))
(import "env" "__cxa_throw" (func (;3;) (type 3)))
(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 0) (param i32 i32)
(local i32 i32 i32)
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 2
i32.sub
i32.const 2
i32.shr_s
local.get 3
i32.gt_u
if ;; label = @2
local.get 2
local.get 3
i32.const 2
i32.shl
i32.add
local.tee 2
f32.load
f32.const 0x0p+0 (;=0;)
f32.gt
if ;; label = @3
block ;; label = @4
local.get 0
i32.load offset=4
local.tee 4
local.get 0
i32.load offset=8
i32.ne
if ;; label = @5
local.get 4
local.get 2
f32.load
f32.store
local.get 0
local.get 4
i32.const 4
i32.add
i32.store offset=4
br 1 (;@4;)
end
local.get 0
local.get 2
call 0
end
end
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@1;)
end
end)
(func (;9;) (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
f32.load
f32.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
f32.load
f32.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 "_Z12get_positiveNSt3__26vectorIfNS_9allocatorIfEEEE" (func 8))
(export "_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_" (func 9))
(data (;0;) (global.get 1) "vector\00"))
| 5 | 118 | 6,810 | 318 |
CPP/31 | /*
Return true if a given number is prime, and false otherwise.
>>> is_prime(6)
false
>>> is_prime(101)
true
>>> is_prime(11)
true
>>> is_prime(13441)
true
>>> is_prime(61)
true
>>> is_prime(4)
false
>>> is_prime(1)
false
*/
#include<stdio.h>
using namespace std;
bool is_prime(long long n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool is_prime(long long n){
| if (n<2) return false;
for (long long i=2;i*i<=n;i++)
if (n%i==0) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_prime(6) == false);
assert (is_prime(101) == true);
assert (is_prime(11) == true);
assert (is_prime(13441) == true);
assert (is_prime(61) == true);
assert (is_prime(4) == false);
assert (is_prime(1) == false);
assert (is_prime(5) == true);
assert (is_prime(11) == true);
assert (is_prime(17) == true);
assert (is_prime(5 * 17) == false);
assert (is_prime(11 * 7) == false);
assert (is_prime(13441 * 19) == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_prime(6) == false);
assert (is_prime(101) == true);
assert (is_prime(11) == true);
assert (is_prime(13441) == true);
assert (is_prime(61) == true);
assert (is_prime(4) == false);
assert (is_prime(1) == false);
}
| ; ModuleID = 'c_code_test/code_30.cpp'
source_filename = "c_code_test/code_30.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 zeroext i1 @_Z8is_primex(i64 noundef %0) local_unnamed_addr #0 {
%2 = icmp slt i64 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %7
%4 = phi i64 [ %10, %7 ], [ 2, %1 ]
%5 = mul nsw i64 %4, %4
%6 = icmp sgt i64 %5, %0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = srem i64 %0, %4
%9 = icmp eq i64 %8, 0
%10 = add nuw nsw i64 %4, 1
br i1 %9, label %11, label %3, !llvm.loop !3
11: ; preds = %3, %7, %1
%12 = phi i1 [ false, %1 ], [ %6, %7 ], [ %6, %3 ]
ret i1 %12
}
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)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i64) (result i32)))
(type (;2;) (func (param i32 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i64) (result i32)
(local i64 i64 i32)
i64.const 2
local.set 1
block ;; label = @1
local.get 0
i64.const 2
i64.lt_s
br_if 0 (;@1;)
loop ;; label = @2
local.get 1
local.get 1
i64.mul
local.get 0
i64.gt_s
local.tee 3
br_if 1 (;@1;)
local.get 0
local.get 1
i64.rem_s
local.get 1
i64.const 1
i64.add
local.set 1
i64.const 0
i64.ne
br_if 0 (;@2;)
end
end
local.get 3)
(func (;2;) (type 2) (param i32 i32) (result i32)
local.get 0
i64.extend_i32_u
local.get 1
i64.extend_i32_u
i64.const 32
i64.shl
i64.or
call 1)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z8is_primex" (func 2))
(export "orig$_Z8is_primex" (func 1)))
| 5 | 115 | 1,083 | 48 |
CPP/32 | #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
double poly(vector<double> xs, double x){
/*
Evaluates polynomial with coefficients xs at point x. return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n
*/
double sum=0;
int i;
for (i=0;i<xs.size();i++)
{
sum+=xs[i]*pow(x,i);
}
return sum;
}
double find_zero(vector<double> xs){
/*
xs are coefficients of a polynomial. find_zero find x such that poly(x) = 0. find_zero returns only only zero point, even if there are many.
Moreover, find_zero only takes list xs having even number of coefficients and largest non zero coefficient as it guarantees a solution.
>>> round(find_zero([1, 2]), 2) #f(x) = 1 + 2x
-0.5
>>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3
1.0
*/
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
double poly(vector<double> xs, double x){
double sum=0;
int i;
for (i=0;i<xs.size();i++)
{
sum+=xs[i]*pow(x,i);
}
return sum;
}
double find_zero(vector<double> xs){
| double ans=0;
double value;
value=poly(xs,ans);
while (abs(value)>1e-6)
{
double driv=0;
for (int i=1;i<xs.size();i++)
{
driv+=xs[i]*pow(ans,i-1)*i;
}
ans=ans-value/driv;
value=poly(xs,ans);
}
return ans;
}
| #undef NDEBUG
#include<assert.h>
int main(){
double solution;
int ncoeff;
for (int i=0;i<100;i++)
{
ncoeff = 2 * (1+rand()%4);
vector<double> coeffs = {};
for (int j=0;j<ncoeff;j++)
{
double coeff = -10+rand()%21;
if (coeff == 0) coeff = 1;
coeffs.push_back(coeff);
}
solution = find_zero(coeffs);
assert (abs(poly(coeffs, solution))< 1e-3);
}
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (find_zero({1,2})+0.5<1e-4);
assert (find_zero({-6,11,-6,1})-1<1e-4);
}
| ; ModuleID = 'c_code_test/code_31.cpp'
source_filename = "c_code_test/code_31.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::__exception_guard_exceptions" = type <{ %"class.std::__2::vector<double>::__destroy_vector", i8, [3 x i8] }>
%"class.std::__2::vector<double>::__destroy_vector" = type { ptr }
$_ZNSt3__26vectorIdNS_9allocatorIdEEEC2ERKS3_ = comdat any
$_ZNSt3__26vectorIdNS_9allocatorIdEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorIdNS_9allocatorIdEEE11__vallocateB7v160006Em = comdat any
$_ZNSt3__26vectorIdNS_9allocatorIdEEE18__construct_at_endIPdLi0EEEvT_S6_m = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_6vectorIdNS_9allocatorIdEEE16__destroy_vectorEED2B7v160006Ev = comdat any
$_ZNKSt3__26vectorIdNS_9allocatorIdEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorIdE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__26vectorIdNS_9allocatorIdEEE16__destroy_vectorclB7v160006Ev = 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 mustprogress nofree nosync nounwind optsize willreturn memory(read, inaccessiblemem: none)
define noundef double @_Z4polyNSt3__26vectorIdNS_9allocatorIdEEEEd(ptr nocapture noundef readonly %0, double 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, 3
br label %10
10: ; preds = %14, %2
%11 = phi double [ 0.000000e+00, %2 ], [ %19, %14 ]
%12 = phi i32 [ 0, %2 ], [ %20, %14 ]
%13 = icmp eq i32 %12, %9
br i1 %13, label %21, label %14
14: ; preds = %10
%15 = getelementptr inbounds double, ptr %5, i32 %12
%16 = load double, ptr %15, align 8, !tbaa !11
%17 = sitofp i32 %12 to double
%18 = tail call double @llvm.pow.f64(double %1, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %16, double %18, double %11)
%20 = add nuw i32 %12, 1
br label %10, !llvm.loop !13
21: ; preds = %10
ret double %11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize mustprogress optsize
define noundef double @_Z9find_zeroNSt3__26vectorIdNS_9allocatorIdEEEE(ptr noundef nonnull %0) local_unnamed_addr #3 {
%2 = alloca %"class.std::__2::vector", align 4
%3 = alloca %"class.std::__2::vector", align 4
%4 = call noundef ptr @_ZNSt3__26vectorIdNS_9allocatorIdEEEC2ERKS3_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %0) #11
%5 = call noundef double @_Z4polyNSt3__26vectorIdNS_9allocatorIdEEEEd(ptr noundef nonnull %2, double noundef 0.000000e+00) #11
%6 = call noundef ptr @_ZNSt3__26vectorIdNS_9allocatorIdEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #12
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
br label %8
8: ; preds = %25, %1
%9 = phi double [ 0.000000e+00, %1 ], [ %27, %25 ]
%10 = phi double [ %5, %1 ], [ %29, %25 ]
%11 = call double @llvm.fabs.f64(double %10)
%12 = fcmp ogt double %11, 0x3EB0C6F7A0B5ED8D
br i1 %12, label %13, label %41
13: ; preds = %8
%14 = load ptr, ptr %7, align 4, !tbaa !3
%15 = load ptr, ptr %0, align 4, !tbaa !10
%16 = ptrtoint ptr %14 to i32
%17 = ptrtoint ptr %15 to i32
%18 = sub i32 %16, %17
%19 = ashr exact i32 %18, 3
%20 = call i32 @llvm.umax.i32(i32 %19, i32 1)
br label %21
21: ; preds = %13, %31
%22 = phi double [ %39, %31 ], [ 0.000000e+00, %13 ]
%23 = phi i32 [ %40, %31 ], [ 1, %13 ]
%24 = icmp eq i32 %23, %20
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = fdiv double %10, %22
%27 = fsub double %9, %26
%28 = call noundef ptr @_ZNSt3__26vectorIdNS_9allocatorIdEEEC2ERKS3_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %0) #11
%29 = call noundef double @_Z4polyNSt3__26vectorIdNS_9allocatorIdEEEEd(ptr noundef nonnull %3, double noundef %27) #11
%30 = call noundef ptr @_ZNSt3__26vectorIdNS_9allocatorIdEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #12
br label %8, !llvm.loop !15
31: ; preds = %21
%32 = getelementptr inbounds double, ptr %15, i32 %23
%33 = load double, ptr %32, align 8, !tbaa !11
%34 = add nsw i32 %23, -1
%35 = sitofp i32 %34 to double
%36 = call double @llvm.pow.f64(double %9, double %35)
%37 = fmul double %36, %33
%38 = sitofp i32 %23 to double
%39 = call double @llvm.fmuladd.f64(double %37, double %38, double %22)
%40 = add nuw i32 %23, 1
br label %21, !llvm.loop !16
41: ; preds = %8
ret double %9
}
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIdNS_9allocatorIdEEEC2ERKS3_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #4 comdat {
%3 = alloca %"struct.std::__2::__exception_guard_exceptions", align 4
store ptr null, ptr %0, align 4, !tbaa !10
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !3
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %5, align 4, !tbaa !17
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #13
store ptr %0, ptr %3, align 4, !tbaa.struct !18, !alias.scope !20
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !3
%8 = load ptr, ptr %1, align 4, !tbaa !10
%9 = icmp eq ptr %7, %8
br i1 %9, label %17, label %10
10: ; preds = %2
%11 = ptrtoint ptr %8 to i32
%12 = ptrtoint ptr %7 to i32
%13 = sub i32 %12, %11
%14 = ashr exact i32 %13, 3
tail call void @_ZNSt3__26vectorIdNS_9allocatorIdEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %14) #11
%15 = load ptr, ptr %1, align 4, !tbaa !10
%16 = load ptr, ptr %6, align 4, !tbaa !3
tail call void @_ZNSt3__26vectorIdNS_9allocatorIdEEE18__construct_at_endIPdLi0EEEvT_S6_m(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %15, ptr noundef %16, i32 noundef %14) #11
br label %17
17: ; preds = %10, %2
%18 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %3, i32 0, i32 1
store i8 1, ptr %18, align 4, !tbaa !23
%19 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIdNS_9allocatorIdEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(5) %3) #12
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #13
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIdNS_9allocatorIdEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #5 comdat {
%2 = alloca %"class.std::__2::vector<double>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #13
store ptr %0, ptr %2, align 4, !tbaa !19
call void @_ZNSt3__26vectorIdNS_9allocatorIdEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #13
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.pow.f64(double, double) #2
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIdNS_9allocatorIdEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #3 comdat {
%3 = icmp ugt i32 %1, 536870911
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @_ZNKSt3__26vectorIdNS_9allocatorIdEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #14
unreachable
5: ; preds = %2
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%7 = tail call noundef ptr @_ZNSt3__29allocatorIdE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #11, !noalias !27
store ptr %7, ptr %0, align 4, !tbaa !10
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !3
%9 = getelementptr inbounds double, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !19
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26vectorIdNS_9allocatorIdEEE18__construct_at_endIPdLi0EEEvT_S6_m(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #4 comdat {
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%6 = load ptr, ptr %5, align 4, !tbaa !3
br label %7
7: ; preds = %11, %4
%8 = phi ptr [ %6, %4 ], [ %14, %11 ]
%9 = phi ptr [ %1, %4 ], [ %13, %11 ]
%10 = icmp eq ptr %9, %2
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load double, ptr %9, align 8, !tbaa !11
store double %12, ptr %8, align 8, !tbaa !11
%13 = getelementptr inbounds double, ptr %9, i32 1
%14 = getelementptr inbounds double, ptr %8, i32 1
br label %7, !llvm.loop !30
15: ; preds = %7
store ptr %8, ptr %5, align 4, !tbaa !3
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIdNS_9allocatorIdEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(5) %0) unnamed_addr #5 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !23, !range !31, !noundef !32
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNSt3__26vectorIdNS_9allocatorIdEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #12
br label %6
6: ; preds = %5, %1
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__26vectorIdNS_9allocatorIdEEE20__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) #14
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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #11
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #15
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 #4 comdat {
%3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #11
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 #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 #4
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__29allocatorIdE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #3 comdat {
%3 = icmp ugt i32 %1, 536870911
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @_ZSt28__throw_bad_array_new_lengthB7v160006v() #14
unreachable
5: ; preds = %2
%6 = shl nuw i32 %1, 3
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #16
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) #13
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #12
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #15
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 #8
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIdNS_9allocatorIdEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #3 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !35
%3 = load ptr, ptr %2, align 4, !tbaa !10
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef nonnull %3) #17
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #10
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 willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize 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 nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { minsize optsize }
attributes #12 = { minsize nounwind optsize }
attributes #13 = { nounwind }
attributes #14 = { minsize noreturn optsize }
attributes #15 = { noreturn }
attributes #16 = { builtin minsize optsize allocsize(0) }
attributes #17 = { builtin minsize nounwind optsize }
!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__26vectorIdNS_9allocatorIdEEEE", !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_pairIPdNS_9allocatorIdEEEE", !9, i64 0}
!9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPdLi0ELb0EEE", !5, i64 0}
!10 = !{!4, !5, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!9, !5, i64 0}
!18 = !{i64 0, i64 4, !19}
!19 = !{!5, !5, i64 0}
!20 = !{!21}
!21 = distinct !{!21, !22, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIdNS_9allocatorIdEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_: argument 0"}
!22 = distinct !{!22, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIdNS_9allocatorIdEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_"}
!23 = !{!24, !26, i64 4}
!24 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_6vectorIdNS_9allocatorIdEEE16__destroy_vectorEEE", !25, i64 0, !26, i64 4}
!25 = !{!"_ZTSNSt3__26vectorIdNS_9allocatorIdEEE16__destroy_vectorE", !5, i64 0}
!26 = !{!"bool", !6, i64 0}
!27 = !{!28}
!28 = distinct !{!28, !29, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIdEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!29 = distinct !{!29, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIdEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!30 = distinct !{!30, !14}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !7, i64 0}
!35 = !{!25, !5, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32)))
(type (;2;) (func (param i32 i32 i32 i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func (param f64 f64) (result f64)))
(type (;5;) (func (param i32 i32 i32)))
(type (;6;) (func))
(type (;7;) (func (param i32 f64) (result f64)))
(type (;8;) (func (param i32) (result f64)))
(import "env" "pow" (func (;0;) (type 4)))
(import "env" "_ZNSt3__26vectorIdNS_9allocatorIdEEE18__construct_at_endIPdLi0EEEvT_S6_m" (func (;1;) (type 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 0)))
(import "env" "__cxa_throw" (func (;3;) (type 5)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;4;) (type 3)))
(import "env" "_Znwm" (func (;5;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;6;) (type 0)))
(import "env" "_ZdlPv" (func (;7;) (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 (;8;) (type 6))
(func (;9;) (type 7) (param i32 f64) (result f64)
(local f64 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 3
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 3
local.get 0
i32.const 3
i32.shl
i32.add
f64.load
local.get 1
local.get 0
f64.convert_i32_s
call 0
f64.mul
local.get 2
f64.add
local.set 2
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end
local.get 2)
(func (;10;) (type 8) (param i32) (result f64)
(local i32 i32 i32 i32 f64 f64 f64)
global.get 0
i32.const 32
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 20
i32.add
local.get 0
call 11
local.tee 1
f64.const 0x0p+0 (;=0;)
call 9
local.set 6
local.get 1
call 12
loop ;; label = @1
local.get 6
f64.abs
f64.const 0x1.0c6f7a0b5ed8dp-20 (;=1e-06;)
f64.gt
if ;; label = @2
i32.const 1
local.set 1
i32.const 1
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 4
i32.sub
i32.const 3
i32.shr_s
local.tee 3
local.get 3
i32.const 1
i32.le_u
select
local.set 3
f64.const 0x0p+0 (;=0;)
local.set 7
loop ;; label = @3
local.get 1
local.get 3
i32.eq
if ;; label = @4
local.get 2
i32.const 8
i32.add
local.get 0
call 11
local.tee 1
local.get 5
local.get 6
local.get 7
f64.div
f64.sub
local.tee 5
call 9
local.set 6
local.get 1
call 12
br 3 (;@1;)
else
local.get 4
local.get 1
i32.const 3
i32.shl
i32.add
f64.load
local.get 5
local.get 1
i32.const 1
i32.sub
f64.convert_i32_s
call 0
f64.mul
local.get 1
f64.convert_i32_s
f64.mul
local.get 7
f64.add
local.set 7
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@3;)
end
unreachable
end
unreachable
end
end
local.get 2
i32.const 32
i32.add
global.set 0
local.get 5)
(func (;11;) (type 3) (param i32 i32) (result 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
local.get 0
i32.store offset=8
local.get 1
i32.load offset=4
local.tee 3
local.get 1
i32.load
local.tee 4
i32.ne
if ;; label = @1
local.get 3
local.get 4
i32.sub
i32.const 3
i32.shr_s
local.tee 3
i32.const 536870912
i32.ge_u
if ;; label = @2
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
local.get 0
local.get 3
i32.const 536870912
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 3
i32.const 3
i32.shl
local.tee 5
call 5
local.tee 4
i32.store offset=4
local.get 0
local.get 4
i32.store
local.get 0
local.get 4
local.get 5
i32.add
i32.store offset=8
local.get 0
local.get 1
i32.load
local.get 1
i32.load offset=4
local.get 3
call 1
end
local.get 2
i32.const 1
i32.store8 offset=12
local.get 2
i32.const 8
i32.add
local.tee 1
i32.load8_u offset=4
i32.eqz
if ;; label = @1
local.get 1
call 14
end
local.get 2
i32.const 16
i32.add
global.set 0
local.get 0)
(func (;12;) (type 1) (param i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 1
global.set 0
local.get 1
local.get 0
i32.store offset=12
local.get 1
i32.const 12
i32.add
call 14
local.get 1
i32.const 16
i32.add
global.set 0)
(func (;13;) (type 2) (param i32 i32 i32 i32)
local.get 0
i32.load offset=4
local.set 3
loop ;; label = @1
local.get 1
local.get 2
i32.eq
i32.eqz
if ;; label = @2
local.get 3
local.get 1
f64.load
f64.store
local.get 3
i32.const 8
i32.add
local.set 3
local.get 1
i32.const 8
i32.add
local.set 1
br 1 (;@1;)
end
end
local.get 0
local.get 3
i32.store offset=4)
(func (;14;) (type 1) (param i32)
(local i32)
local.get 0
i32.load
local.tee 1
i32.load
local.tee 0
if ;; label = @1
local.get 1
local.get 0
i32.store offset=4
local.get 0
call 7
end)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z4polyNSt3__26vectorIdNS_9allocatorIdEEEEd" (func 9))
(export "_Z9find_zeroNSt3__26vectorIdNS_9allocatorIdEEEE" (func 10))
(export "_ZNSt3__26vectorIdNS_9allocatorIdEEE18__construct_at_endIPdLi0EEEvT_S6_m" (func 13))
(data (;0;) (global.get 1) "vector\00"))
| 16 | 296 | 7,790 | 347 |
CPP/33 | /*
This function takes a vector l and returns a vector l' such that
l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal
to the values of the corresponding indicies of l, but sorted.
>>> sort_third({1, 2, 3})
{1, 2, 3}
>>> sort_third({5, 6, 3, 4, 8, 9, 2})
{2, 6, 3, 4, 8, 9, 5}
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> sort_third(vector<int> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<int> sort_third(vector<int> l){
| vector<int> third={};
int i;
for (i=0;i*3<l.size();i++)
third.push_back(l[i*3]);
sort(third.begin(),third.end());
vector<int> out={};
for (i=0;i<l.size();i++)
{
if (i%3==0) {out.push_back(third[i/3]);}
else out.push_back(l[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(sort_third({1, 2, 3}) , sort_third({1, 2, 3})));
assert (issame(sort_third({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}) , sort_third({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})));
assert (issame(sort_third({5, 8, -12, 4, 23, 2, 3, 11, 12, -10}) , sort_third({5, 8, -12, 4, 23, 2, 3, 11, 12, -10})));
assert (issame(sort_third({5, 6, 3, 4, 8, 9, 2}) , {2, 6, 3, 4, 8, 9, 5}));
assert (issame(sort_third({5, 8, 3, 4, 6, 9, 2}) , {2, 8, 3, 4, 6, 9, 5}));
assert (issame(sort_third({5, 6, 9, 4, 8, 3, 2}) , {2, 6, 9, 4, 8, 3, 5}));
assert (issame(sort_third({5, 6, 3, 4, 8, 9, 2, 1}) , {2, 6, 3, 4, 8, 9, 5, 1}));
}
| #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(sort_third({1, 2, 3}) , {1, 2, 3}));
assert (issame(sort_third({5, 6, 3, 4, 8, 9, 2}) , {2, 6, 3, 4, 8, 9, 5}));
}
| ; ModuleID = 'c_code_test/code_32.cpp'
source_filename = "c_code_test/code_32.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::vector<int>::__destroy_vector" = 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 }
%"struct.std::__2::__less.3" = type { i8 }
$_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev = 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__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_ = 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 @_Z10sort_thirdNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::vector", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #13
store ptr null, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %3, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !10
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %3, i32 0, i32 2
store ptr null, ptr %5, align 4, !tbaa !11
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %7
7: ; preds = %17, %2
%8 = phi i32 [ 0, %2 ], [ %19, %17 ]
%9 = mul nuw nsw i32 %8, 3
%10 = load ptr, ptr %6, align 4, !tbaa !10
%11 = load ptr, ptr %1, align 4, !tbaa !3
%12 = ptrtoint ptr %10 to i32
%13 = ptrtoint ptr %11 to i32
%14 = sub i32 %12, %13
%15 = ashr exact i32 %14, 2
%16 = icmp ult i32 %9, %15
br i1 %16, label %17, label %20
17: ; preds = %7
%18 = getelementptr inbounds i32, ptr %11, i32 %9
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(4) %18) #14
%19 = add nuw nsw i32 %8, 1
br label %7, !llvm.loop !12
20: ; preds = %7
%21 = load ptr, ptr %3, align 4, !tbaa !3
%22 = load ptr, ptr %4, align 4, !tbaa !10
call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %21, ptr %22) #14
store ptr null, ptr %0, align 4, !tbaa !3
%23 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %23, align 4, !tbaa !10
%24 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %24, align 4, !tbaa !11
br label %25
25: ; preds = %34, %20
%26 = phi i32 [ 0, %20 ], [ %44, %34 ]
%27 = load ptr, ptr %6, align 4, !tbaa !10
%28 = load ptr, ptr %1, align 4, !tbaa !3
%29 = ptrtoint ptr %27 to i32
%30 = ptrtoint ptr %28 to i32
%31 = sub i32 %29, %30
%32 = ashr exact i32 %31, 2
%33 = icmp ult i32 %26, %32
br i1 %33, label %34, label %45
34: ; preds = %25
%35 = freeze i32 %26
%36 = udiv i32 %35, 3
%37 = mul i32 %36, 3
%38 = sub i32 %35, %37
%39 = icmp eq i32 %38, 0
%40 = load ptr, ptr %3, align 4
%41 = getelementptr inbounds i32, ptr %40, i32 %36
%42 = getelementptr inbounds i32, ptr %28, i32 %26
%43 = select i1 %39, ptr %41, ptr %42
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %43) #14
%44 = add nuw nsw i32 %26, 1
br label %25, !llvm.loop !14
45: ; preds = %25
%46 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #13
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 !15
%7 = icmp eq ptr %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, ptr %1, align 4, !tbaa !16
store i32 %9, ptr %4, align 4, !tbaa !16
%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) #14
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #3 comdat {
%2 = alloca %"class.std::__2::vector<int>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #13
store ptr %0, ptr %2, align 4, !tbaa !15
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #13
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #4 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !18
%3 = load ptr, ptr %2, align 4, !tbaa !3
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !10
tail call void @_ZdlPv(ptr noundef nonnull %3) #16
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; 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) #13
%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) #14
%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) #14
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !20
%23 = load i32, ptr %1, align 4, !tbaa !16
store i32 %23, ptr %22, align 4, !tbaa !16
%24 = getelementptr inbounds i32, ptr %22, i32 1
store ptr %24, ptr %21, align 4, !tbaa !20
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) #14
%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) #13
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) #17
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 = 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 !15
%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) #14, !noalias !24
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !27
%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 !20
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !28
%15 = getelementptr inbounds i32, 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__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 !28
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 !16, !noalias !29
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !16, !noalias !29
br label %8, !llvm.loop !34
16: ; preds = %8
store ptr %10, ptr %6, align 4, !tbaa !28
%17 = load ptr, ptr %0, align 4, !tbaa !15
store ptr %10, ptr %0, align 4, !tbaa !15
store ptr %17, ptr %6, align 4, !tbaa !15
%18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%19 = load ptr, ptr %3, align 4, !tbaa !15
%20 = load ptr, ptr %18, align 4, !tbaa !15
store ptr %20, ptr %3, align 4, !tbaa !15
store ptr %19, ptr %18, align 4, !tbaa !15
%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 !15
%24 = load ptr, ptr %22, align 4, !tbaa !15
store ptr %24, ptr %21, align 4, !tbaa !15
store ptr %23, ptr %22, align 4, !tbaa !15
%25 = load ptr, ptr %6, align 4, !tbaa !28
store ptr %25, ptr %1, align 4, !tbaa !27
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 #3 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 !27
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #16
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 #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !35
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #3
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 #4 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() #17
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 #8 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #13
%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 #3
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #3
; 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 !28
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 !20
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 !20
br label %5, !llvm.loop !37
10: ; preds = %5
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #6 comdat {
%3 = alloca %"struct.std::__2::__less.3", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #14
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; 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 = { 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 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn 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 = { nounwind }
attributes #14 = { minsize optsize }
attributes #15 = { minsize nounwind optsize }
attributes #16 = { builtin minsize nounwind optsize }
attributes #17 = { minsize noreturn 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, !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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!5, !5, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !6, i64 0}
!18 = !{!19, !5, i64 0}
!19 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorE", !5, i64 0}
!20 = !{!21, !5, i64 8}
!21 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !22, i64 12}
!22 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !23, i64 4}
!23 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, i64 0}
!24 = !{!25}
!25 = distinct !{!25, !26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!27 = !{!21, !5, i64 0}
!28 = !{!21, !5, i64 4}
!29 = !{!30, !32}
!30 = distinct !{!30, !31, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!31 = distinct !{!31, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"}
!32 = distinct !{!32, !33, !"_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"}
!33 = distinct !{!33, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!34 = distinct !{!34, !13}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !7, i64 0}
!37 = distinct !{!37, !13}
| (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" "_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_" (func (;7;) (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 (;8;) (type 5))
(func (;9;) (type 0) (param i32 i32)
(local i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 3
i32.const 0
i32.store offset=12
local.get 3
i64.const 0
i64.store offset=4 align=4
loop ;; label = @1
local.get 2
i32.const 3
i32.mul
local.tee 4
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 5
i32.sub
i32.const 2
i32.shr_s
i32.lt_u
if ;; label = @2
local.get 3
i32.const 4
i32.add
local.get 5
local.get 4
i32.const 2
i32.shl
i32.add
call 10
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
local.get 3
i32.load offset=4
local.get 3
i32.load offset=8
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 15
i32.add
call 7
local.get 2
i32.const 16
i32.add
global.set 0
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
i32.const 0
local.set 2
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 4
i32.sub
i32.const 2
i32.shr_s
local.get 2
i32.gt_u
if ;; label = @2
local.get 0
local.get 3
i32.load offset=4
local.get 2
i32.const 3
i32.div_u
local.tee 5
i32.const 2
i32.shl
i32.add
local.get 4
local.get 2
i32.const 2
i32.shl
i32.add
i32.const 0
local.get 2
i32.sub
local.get 5
i32.const -3
i32.mul
i32.eq
select
call 10
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
global.get 0
i32.const 16
i32.sub
local.tee 0
global.set 0
local.get 0
local.get 3
i32.const 4
i32.add
i32.store offset=12
local.get 0
i32.load offset=12
local.tee 2
i32.load
local.tee 1
if ;; label = @1
local.get 2
local.get 1
i32.store offset=4
local.get 1
call 1
end
local.get 0
i32.const 16
i32.add
global.set 0
local.get 3
i32.const 16
i32.add
global.set 0)
(func (;10;) (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 (;11;) (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 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z10sort_thirdNSt3__26vectorIiNS_9allocatorIiEEEE" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 11))
(data (;0;) (global.get 1) "vector\00"))
| 16 | 311 | 8,520 | 423 |
CPP/34 | /*
Return sorted unique elements in a vector
>>> unique({5, 3, 5, 2, 3, 3, 9, 0, 123})
{0, 2, 3, 5, 9, 123}
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> unique(vector<int> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<int> unique(vector<int> l){
| vector<int> out={};
for (int i=0;i<l.size();i++)
if (find(out.begin(),out.end(),l[i])==out.end())
out.push_back(l[i]);
sort(out.begin(),out.end());
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(unique({5, 3, 5, 2, 3, 3, 9, 0, 123}) , {0, 2, 3, 5, 9, 123}));
}
| #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(unique({5, 3, 5, 2, 3, 3, 9, 0, 123}) , {0, 2, 3, 5, 9, 123}));
}
| ; ModuleID = 'c_code_test/code_33.cpp'
source_filename = "c_code_test/code_33.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 }
%"struct.std::__2::__less.3" = type { i8 }
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_ = comdat any
$_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__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_ = 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 @_Z6uniqueNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
store ptr null, ptr %0, align 4, !tbaa !3
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !10
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !11
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %6
6: ; preds = %26, %2
%7 = phi i32 [ 0, %2 ], [ %27, %26 ]
%8 = load ptr, ptr %5, align 4, !tbaa !10
%9 = load ptr, ptr %1, align 4, !tbaa !3
%10 = ptrtoint ptr %8 to i32
%11 = ptrtoint ptr %9 to i32
%12 = sub i32 %10, %11
%13 = ashr exact i32 %12, 2
%14 = icmp ult i32 %7, %13
%15 = load ptr, ptr %0, align 4, !tbaa !3
%16 = load ptr, ptr %3, align 4, !tbaa !10
br i1 %14, label %18, label %17
17: ; preds = %6
tail call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %15, ptr %16) #13
ret void
18: ; preds = %6
%19 = getelementptr inbounds i32, ptr %9, i32 %7
%20 = tail call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %15, ptr %16, ptr noundef nonnull align 4 dereferenceable(4) %19) #13
%21 = load ptr, ptr %3, align 4, !tbaa !10
%22 = icmp eq ptr %20, %21
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load ptr, ptr %1, align 4, !tbaa !3
%25 = getelementptr inbounds i32, ptr %24, i32 %7
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %25) #13
br label %26
26: ; preds = %18, %23
%27 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !12
}
; 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 nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(4) %2) local_unnamed_addr #2 comdat {
%4 = load i32, ptr %2, align 4
br label %5
5: ; preds = %11, %3
%6 = phi ptr [ %0, %3 ], [ %12, %11 ]
%7 = icmp eq ptr %6, %1
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = load i32, ptr %6, align 4, !tbaa !14
%10 = icmp eq i32 %9, %4
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, ptr %6, i32 1
br label %5, !llvm.loop !16
13: ; preds = %8, %5
%14 = phi ptr [ %6, %8 ], [ %1, %5 ]
ret ptr %14
}
; 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 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 #3 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 !14
store i32 %9, ptr %4, align 4, !tbaa !14
%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) #13
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4
; 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 #5 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 !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) #13
%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) #13
%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 !14
store i32 %23, ptr %22, align 4, !tbaa !14
%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) #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 #5 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 !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) #13, !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 !14, !noalias !27
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !14, !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 #6 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 !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) #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 #7 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 #8 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 !33
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #6
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 #9 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 #8 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 #6
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #6
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; 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 #11 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) #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 #2 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: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #5 comdat {
%3 = alloca %"struct.std::__2::__less.3", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #13
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize 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 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { 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, !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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !6, i64 0}
!16 = distinct !{!16, !13}
!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, !13}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !7, i64 0}
!35 = distinct !{!35, !13}
| (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" "_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_" (func (;7;) (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 (;8;) (type 5))
(func (;9;) (type 0) (param i32 i32)
(local i32 i32 i32 i32 i32)
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 5
i32.sub
i32.const 2
i32.shr_s
local.get 4
i32.gt_u
if ;; label = @2
block (result i32) ;; label = @3
local.get 5
local.get 4
i32.const 2
i32.shl
local.tee 6
i32.add
i32.load
local.set 5
loop ;; label = @4
block ;; label = @5
local.get 2
local.get 3
i32.ne
if (result i32) ;; label = @6
local.get 2
i32.load
local.get 5
i32.ne
br_if 1 (;@5;)
local.get 2
else
local.get 3
end
br 2 (;@3;)
end
local.get 2
i32.const 4
i32.add
local.set 2
br 0 (;@4;)
end
unreachable
end
local.get 0
i32.load offset=4
local.tee 3
i32.eq
if ;; label = @3
local.get 1
i32.load
local.get 6
i32.add
local.set 2
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 2
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 2
call 0
end
local.get 0
i32.load offset=4
local.set 3
end
local.get 4
i32.const 1
i32.add
local.set 4
local.get 0
i32.load
local.set 2
br 1 (;@1;)
end
end
global.get 0
i32.const 16
i32.sub
local.tee 0
global.set 0
local.get 2
local.get 3
local.get 0
i32.const 15
i32.add
call 7
local.get 0
i32.const 16
i32.add
global.set 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 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z6uniqueNSt3__26vectorIiNS_9allocatorIiEEEE" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 10))
(data (;0;) (global.get 1) "vector\00"))
| 7 | 198 | 8,089 | 374 |
CPP/35 | /*
Return maximum element in the vector.
>>> max_element({1, 2, 3})
3
>>> max_element({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})
123
*/
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
float max_element(vector<float> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
float max_element(vector<float> l){
| float max=-10000;
for (int i=0;i<l.size();i++)
if (max<l[i]) max=l[i];
return max;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(max_element({1, 2, 3})- 3)<1e-4);
assert (abs(max_element({5, 3, -5, 2, -3, 3, 9, 0, 124, 1, -10})- 124)<1e-4);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(max_element({1, 2, 3})- 3)<1e-4);
assert (abs(max_element({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10})- 123)<1e-4);
}
| ; ModuleID = 'c_code_test/code_34.cpp'
source_filename = "c_code_test/code_34.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 float @_Z11max_elementNSt3__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 = %14, %1
%10 = phi float [ -1.000000e+04, %1 ], [ %18, %14 ]
%11 = phi i32 [ 0, %1 ], [ %19, %14 ]
%12 = icmp eq i32 %11, %8
br i1 %12, label %13, label %14
13: ; preds = %9
ret float %10
14: ; preds = %9
%15 = getelementptr inbounds float, ptr %4, i32 %11
%16 = load float, ptr %15, align 4, !tbaa !11
%17 = fcmp olt float %10, %16
%18 = select i1 %17, float %16, float %10
%19 = add nuw i32 %11, 1
br label %9, !llvm.loop !13
}
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__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"}
| (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 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.set 4
i32.const 0
local.set 0
f32.const -0x1.388p+13 (;=-10000;)
local.set 1
loop (result f32) ;; label = @1
local.get 0
local.get 4
i32.eq
if (result f32) ;; label = @2
local.get 1
else
local.get 3
local.get 0
i32.const 2
i32.shl
i32.add
f32.load
local.tee 2
local.get 1
local.get 1
local.get 2
f32.lt
select
local.set 1
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z11max_elementNSt3__26vectorIfNS_9allocatorIfEEEE" (func 1)))
| 6 | 94 | 1,117 | 50 |
CPP/36 | /*
Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
>>> fizz_buzz(50)
0
>>> fizz_buzz(78)
2
>>> fizz_buzz(79)
3
*/
#include<stdio.h>
using namespace std;
int fizz_buzz(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int fizz_buzz(int n){
| int count=0;
for (int i=0;i<n;i++)
if (i%11==0 or i%13==0)
{
int q=i;
while (q>0)
{
if (q%10==7) count+=1;
q=q/10;
}
}
return count;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fizz_buzz(50) == 0);
assert (fizz_buzz(78) == 2);
assert (fizz_buzz(79) == 3);
assert (fizz_buzz(100) == 3);
assert (fizz_buzz(200) == 6);
assert (fizz_buzz(4000) == 192);
assert (fizz_buzz(10000) == 639);
assert (fizz_buzz(100000) == 8026);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fizz_buzz(50) == 0);
assert (fizz_buzz(78) == 2);
assert (fizz_buzz(79) == 3);
}
| ; ModuleID = 'c_code_test/code_35.cpp'
source_filename = "c_code_test/code_35.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z9fizz_buzzi(i32 noundef %0) local_unnamed_addr #0 {
%2 = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
br label %3
3: ; preds = %26, %1
%4 = phi i32 [ 0, %1 ], [ %27, %26 ]
%5 = phi i32 [ 0, %1 ], [ %28, %26 ]
%6 = icmp eq i32 %5, %2
br i1 %6, label %7, label %8
7: ; preds = %3
ret i32 %4
8: ; preds = %3
%9 = urem i32 %5, 11
%10 = icmp eq i32 %9, 0
%11 = urem i32 %5, 13
%12 = icmp eq i32 %11, 0
%13 = or i1 %10, %12
br i1 %13, label %14, label %26
14: ; preds = %8, %18
%15 = phi i32 [ %25, %18 ], [ %4, %8 ]
%16 = phi i32 [ %20, %18 ], [ %5, %8 ]
%17 = icmp eq i32 %16, 0
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = freeze i32 %16
%20 = udiv i32 %19, 10
%21 = mul i32 %20, 10
%22 = sub i32 %19, %21
%23 = icmp eq i32 %22, 7
%24 = zext i1 %23 to i32
%25 = add nsw i32 %15, %24
br label %14, !llvm.loop !3
26: ; preds = %14, %8
%27 = phi i32 [ %4, %8 ], [ %15, %14 ]
%28 = add nuw i32 %5, 1
br label %3, !llvm.loop !5
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = distinct !{!5, !4}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32)
local.get 0
i32.const 0
local.get 0
i32.const 0
i32.gt_s
select
local.set 3
loop ;; label = @1
local.get 1
local.get 3
i32.eq
i32.eqz
if ;; label = @2
local.get 1
i32.const 13
i32.rem_u
local.set 4
block ;; label = @3
block ;; label = @4
local.get 1
i32.const 11
i32.rem_u
i32.eqz
if ;; label = @5
local.get 1
local.set 0
br 1 (;@4;)
end
local.get 1
local.set 0
local.get 4
br_if 1 (;@3;)
end
loop ;; label = @4
local.get 0
i32.eqz
br_if 1 (;@3;)
local.get 2
local.get 0
local.get 0
i32.const 10
i32.div_u
local.tee 0
i32.const -10
i32.mul
i32.add
i32.const 7
i32.eq
i32.add
local.set 2
br 0 (;@4;)
end
unreachable
end
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end
local.get 2)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z9fizz_buzzi" (func 1)))
| 13 | 216 | 1,583 | 71 |
CPP/37 | /*
This function takes a vector l and returns a vector l' such that
l' is identical to l in the odd indicies, while its values at the even indicies are equal
to the values of the even indicies of l, but sorted.
>>> sort_even({1, 2, 3})
{1, 2, 3}
>>> sort_even({5, 6, 3, 4})
{3, 6, 5, 4}
*/
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<float> sort_even(vector<float> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<float> sort_even(vector<float> l){
| vector<float> out={};
vector<float> even={};
for (int i=0;i*2<l.size();i++)
even.push_back(l[i*2]);
sort(even.begin(),even.end());
for (int i=0;i<l.size();i++)
{
if (i%2==0) out.push_back(even[i/2]);
if (i%2==1) out.push_back(l[i]);
}
return out;
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(sort_even({1, 2, 3}), {1, 2, 3}));
assert (issame(sort_even({5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10}) , {-10, 3, -5, 2, -3, 3, 5, 0, 9, 1, 123}));
assert (issame(sort_even({5, 8, -12, 4, 23, 2, 3, 11, 12, -10}) , {-12, 8, 3, 4, 5, 2, 12, 11, 23, -10}));
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(sort_even({1, 2, 3}), {1, 2, 3}));
assert (issame(sort_even({5, 6,3,4}) , {3,6,5,4}));
}
| ; ModuleID = 'c_code_test/code_36.cpp'
source_filename = "c_code_test/code_36.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::vector<float>::__destroy_vector" = 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 }
%"struct.std::__2::__less.3" = type { i8 }
$_ZNSt3__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE16__destroy_vectorclB7v160006Ev = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_ = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEEC2EmmS3_ = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorIfE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_17integral_constantIbLb0EEE = comdat any
$_ZNSt3__24sortB7v160006INS_11__wrap_iterIPfEENS_6__lessIffEEEEvT_S6_T0_ = 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 @_Z9sort_evenNSt3__26vectorIfNS_9allocatorIfEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::vector", 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) #13
store ptr null, ptr %3, align 4, !tbaa !3
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %3, i32 0, i32 1
store ptr null, ptr %6, align 4, !tbaa !10
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %3, i32 0, i32 2
store ptr null, ptr %7, align 4, !tbaa !11
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %9
9: ; preds = %22, %2
%10 = phi i32 [ 0, %2 ], [ %24, %22 ]
%11 = shl nuw nsw i32 %10, 1
%12 = load ptr, ptr %8, align 4, !tbaa !10
%13 = load ptr, ptr %1, align 4, !tbaa !3
%14 = ptrtoint ptr %12 to i32
%15 = ptrtoint ptr %13 to i32
%16 = sub i32 %14, %15
%17 = ashr exact i32 %16, 2
%18 = icmp ult i32 %11, %17
br i1 %18, label %22, label %19
19: ; preds = %9
%20 = load ptr, ptr %3, align 4, !tbaa !3
%21 = load ptr, ptr %6, align 4, !tbaa !10
call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPfEENS_6__lessIffEEEEvT_S6_T0_(ptr %20, ptr %21) #14
br label %25
22: ; preds = %9
%23 = getelementptr inbounds float, ptr %13, i32 %11
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(4) %23) #14
%24 = add nuw nsw i32 %10, 1
br label %9, !llvm.loop !12
25: ; preds = %36, %19
%26 = phi i32 [ 0, %19 ], [ %44, %36 ]
%27 = load ptr, ptr %8, align 4, !tbaa !10
%28 = load ptr, ptr %1, align 4, !tbaa !3
%29 = ptrtoint ptr %27 to i32
%30 = ptrtoint ptr %28 to i32
%31 = sub i32 %29, %30
%32 = ashr exact i32 %31, 2
%33 = icmp ult i32 %26, %32
br i1 %33, label %36, label %34
34: ; preds = %25
%35 = call noundef ptr @_ZNSt3__26vectorIfNS_9allocatorIfEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #13
ret void
36: ; preds = %25
%37 = and i32 %26, 1
%38 = icmp eq i32 %37, 0
%39 = lshr i32 %26, 1
%40 = load ptr, ptr %3, align 4
%41 = getelementptr inbounds float, ptr %40, i32 %39
%42 = getelementptr inbounds float, ptr %28, i32 %26
%43 = select i1 %38, ptr %41, ptr %42
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %43) #14
%44 = add nuw nsw i32 %26, 1
br label %25, !llvm.loop !14
}
; 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__26vectorIfNS_9allocatorIfEEE9push_backB7v160006ERKf(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 !15
%7 = icmp eq ptr %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load float, ptr %1, align 4, !tbaa !16
store float %9, ptr %4, align 4, !tbaa !16
%10 = getelementptr inbounds float, ptr %4, i32 1
store ptr %10, ptr %3, align 4, !tbaa !10
br label %12
11: ; preds = %2
tail call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #14
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: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIfNS_9allocatorIfEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #3 comdat {
%2 = alloca %"class.std::__2::vector<float>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #13
store ptr %0, ptr %2, align 4, !tbaa !15
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #13
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIfNS_9allocatorIfEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #4 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !18
%3 = load ptr, ptr %2, align 4, !tbaa !3
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !10
tail call void @_ZdlPv(ptr noundef nonnull %3) #16
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_(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) #13
%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__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #14
%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_bufferIfRNS_9allocatorIfEEEC2EmmS3_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %13, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #14
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !20
%23 = load float, ptr %1, align 4, !tbaa !16
store float %23, ptr %22, align 4, !tbaa !16
%24 = getelementptr inbounds float, ptr %22, i32 1
store ptr %24, ptr %21, align 4, !tbaa !20
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #14
%25 = call noundef ptr @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #15
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #13
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__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__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
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 = 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_bufferIfRNS_9allocatorIfEEEC2EmmS3_(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__29allocatorIfE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #14, !noalias !24
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !27
%12 = getelementptr inbounds float, 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 !20
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !28
%15 = getelementptr inbounds float, 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__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_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 !28
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 float, ptr %9, i32 -1
%14 = load float, ptr %13, align 4, !tbaa !16, !noalias !29
%15 = getelementptr inbounds float, ptr %10, i32 -1
store float %14, ptr %15, align 4, !tbaa !16, !noalias !29
br label %8, !llvm.loop !34
16: ; preds = %8
store ptr %10, ptr %6, align 4, !tbaa !28
%17 = load ptr, ptr %0, align 4, !tbaa !15
store ptr %10, ptr %0, align 4, !tbaa !15
store ptr %17, ptr %6, align 4, !tbaa !15
%18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%19 = load ptr, ptr %3, align 4, !tbaa !15
%20 = load ptr, ptr %18, align 4, !tbaa !15
store ptr %20, ptr %3, align 4, !tbaa !15
store ptr %19, ptr %18, align 4, !tbaa !15
%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 !15
%24 = load ptr, ptr %22, align 4, !tbaa !15
store ptr %24, ptr %21, align 4, !tbaa !15
store ptr %23, ptr %22, align 4, !tbaa !15
%25 = load ptr, ptr %6, align 4, !tbaa !28
store ptr %25, ptr %1, align 4, !tbaa !27
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #3 comdat {
tail call void @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #15
%2 = load ptr, ptr %0, align 4, !tbaa !27
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #16
br label %5
5: ; preds = %4, %1
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !35
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #3
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__29allocatorIfE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %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 @_ZSt28__throw_bad_array_new_lengthB7v160006v() #17
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 #8 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #13
%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 #3
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #3
; 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_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev(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 !28
tail call void @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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 !20
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 float, ptr %6, i32 -1
store ptr %9, ptr %3, align 4, !tbaa !20
br label %5, !llvm.loop !37
10: ; preds = %5
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPfEENS_6__lessIffEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #6 comdat {
%3 = alloca %"struct.std::__2::__less.3", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #14
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; 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 = { 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 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn 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 = { nounwind }
attributes #14 = { minsize optsize }
attributes #15 = { minsize nounwind optsize }
attributes #16 = { builtin minsize nounwind optsize }
attributes #17 = { minsize noreturn 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, !5, i64 0}
!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 4}
!11 = !{!9, !5, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!5, !5, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !6, i64 0}
!18 = !{!19, !5, i64 0}
!19 = !{!"_ZTSNSt3__26vectorIfNS_9allocatorIfEEE16__destroy_vectorE", !5, i64 0}
!20 = !{!21, !5, i64 8}
!21 = !{!"_ZTSNSt3__214__split_bufferIfRNS_9allocatorIfEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !22, i64 12}
!22 = !{!"_ZTSNSt3__217__compressed_pairIPfRNS_9allocatorIfEEEE", !9, i64 0, !23, i64 4}
!23 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIfEELi1ELb0EEE", !5, i64 0}
!24 = !{!25}
!25 = distinct !{!25, !26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!26 = distinct !{!26, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!27 = !{!21, !5, i64 0}
!28 = !{!21, !5, i64 4}
!29 = !{!30, !32}
!30 = distinct !{!30, !31, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPfEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!31 = distinct !{!31, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPfEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"}
!32 = distinct !{!32, !33, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPfEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!33 = distinct !{!33, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPfEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!34 = distinct !{!34, !13}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !7, i64 0}
!37 = distinct !{!37, !13}
| (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__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_" (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" "_ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_" (func (;7;) (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 (;8;) (type 5))
(func (;9;) (type 0) (param i32 i32)
(local i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 3
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 3
i32.const 0
i32.store offset=12
local.get 3
i64.const 0
i64.store offset=4 align=4
loop ;; label = @1
local.get 2
i32.const 1
i32.shl
local.tee 4
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 5
i32.sub
i32.const 2
i32.shr_s
i32.ge_u
if ;; label = @2
block ;; label = @3
local.get 3
i32.load offset=4
local.get 3
i32.load offset=8
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 15
i32.add
call 7
local.get 2
i32.const 16
i32.add
global.set 0
i32.const 0
local.set 2
loop ;; label = @4
local.get 2
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 4
i32.sub
i32.const 2
i32.shr_s
i32.ge_u
br_if 1 (;@3;)
local.get 0
local.get 4
local.get 2
i32.const 2
i32.shl
i32.add
local.get 3
i32.load offset=4
local.get 2
i32.const 1
i32.shl
i32.const -4
i32.and
i32.add
local.get 2
i32.const 1
i32.and
select
call 10
local.get 2
i32.const 1
i32.add
local.set 2
br 0 (;@4;)
end
unreachable
end
else
local.get 3
i32.const 4
i32.add
local.get 5
local.get 4
i32.const 2
i32.shl
i32.add
call 10
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
global.get 0
i32.const 16
i32.sub
local.tee 0
global.set 0
local.get 0
local.get 3
i32.const 4
i32.add
i32.store offset=12
local.get 0
i32.load offset=12
local.tee 2
i32.load
local.tee 1
if ;; label = @1
local.get 2
local.get 1
i32.store offset=4
local.get 1
call 1
end
local.get 0
i32.const 16
i32.add
global.set 0
local.get 3
i32.const 16
i32.add
global.set 0)
(func (;10;) (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
f32.load
f32.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 (;11;) (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
f32.load
f32.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
f32.load
f32.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 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z9sort_evenNSt3__26vectorIfNS_9allocatorIfEEEE" (func 9))
(export "_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIRKfEEvOT_" (func 11))
(data (;0;) (global.get 1) "vector\00"))
| 12 | 305 | 8,774 | 421 |
CPP/38 | #include<stdio.h>
#include<string>
using namespace std;
string encode_cyclic(string s){
// returns encoded string by cycling groups of three characters.
// split string to groups. Each of length 3.
int l=s.length();
int num=(l+2)/3;
string x,output;
int i;
for (i=0;i*3<l;i++)
{
//cycle elements in each group. Unless group has fewer elements than 3.
x=s.substr(i*3,3);
if (x.length()==3) x=x.substr(1)+x[0];
output=output+x;
}
return output;
}
string decode_cyclic(string s){
/*
takes as input string encoded with encode_cyclic function. Returns decoded string.
*/
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string encode_cyclic(string s){
int l=s.length();
int num=(l+2)/3;
string x,output;
int i;
for (i=0;i*3<l;i++)
{
x=s.substr(i*3,3);
if (x.length()==3) x=x.substr(1)+x[0];
output=output+x;
}
return output;
}
string decode_cyclic(string s){
| int l=s.length();
int num=(l+2)/3;
string x,output;
int i;
for (i=0;i*3<l;i++)
{
x=s.substr(i*3,3);
if (x.length()==3) x=x[2]+x.substr(0,2);
output=output+x;
}
return output;
}
| #undef NDEBUG
#include<assert.h>
int main(){
for (int i=0;i<100;i++)
{
int l=10+rand()%11;
string str="";
for (int j=0;j<l;j++)
{
char chr=97+rand()%26;
str+=chr;
}
string encoded_str = encode_cyclic(str);
assert (decode_cyclic(encoded_str) == str);
}
}
| ; ModuleID = 'c_code_test/code_37.cpp'
source_filename = "c_code_test/code_37.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_S6_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EES6_OS9_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
@.str = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z13encode_cyclicNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%9 = load i8, ptr %8, align 1
%10 = icmp slt i8 %9, 0
%11 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%12 = load i32, ptr %11, align 4
%13 = zext i8 %9 to i32
%14 = select i1 %10, i32 %12, i32 %13
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #13
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 0, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%16 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
br label %17
17: ; preds = %37, %2
%18 = phi i32 [ 0, %2 ], [ %39, %37 ]
%19 = mul nuw nsw i32 %18, 3
%20 = icmp slt i32 %19, %14
br i1 %20, label %21, label %40
21: ; preds = %17
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #13
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %19, i32 noundef 3) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4) #15
%22 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #13
%23 = load i8, ptr %15, align 1
%24 = icmp slt i8 %23, 0
%25 = load i32, ptr %16, align 4
%26 = zext i8 %23 to i32
%27 = select i1 %24, i32 %25, i32 %26
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %37
29: ; preds = %21
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #13
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #13
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 1, i32 noundef -1) #14
%30 = load i8, ptr %15, align 1
%31 = icmp slt i8 %30, 0
%32 = load ptr, ptr %3, align 4
%33 = select i1 %31, ptr %32, ptr %3
%34 = load i8, ptr %33, align 1, !tbaa !3
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %6, i8 noundef signext %34) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %5) #15
%35 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #15
%36 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #13
br label %37
37: ; preds = %29, %21
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #13
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %7) #15
%38 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #13
%39 = add nuw nsw i32 %18, 1
br label %17, !llvm.loop !6
40: ; preds = %17
%41 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #13
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: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 comdat {
%5 = alloca %"class.std::__2::allocator", align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #13
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(1) %5) #14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #13
ret void
}
; 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 #2
; 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 optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #3 comdat {
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc(ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) #14
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)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %1, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%13 = load i8, ptr %12, align 1
%14 = icmp slt i8 %13, 0
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
%16 = load i32, ptr %15, align 4
%17 = zext i8 %13 to i32
%18 = select i1 %14, i32 %16, i32 %17
%19 = add i32 %18, %11
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #13
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #13
%21 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%22 = load i8, ptr %21, align 1
%23 = icmp slt i8 %22, 0
%24 = load ptr, ptr %0, align 4
%25 = select i1 %23, ptr %24, ptr %0
%26 = load i8, ptr %5, align 1
%27 = icmp slt i8 %26, 0
%28 = load ptr, ptr %1, align 4
%29 = select i1 %27, ptr %28, ptr %1
%30 = icmp ult ptr %29, %25
%31 = getelementptr inbounds i8, ptr %25, i32 %11
%32 = icmp ule ptr %31, %29
%33 = or i1 %30, %32
call void @llvm.assume(i1 %33)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %25, ptr align 1 %29, i32 %11, i1 false), !noalias !8
%34 = load i8, ptr %12, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %2, align 4
%37 = select i1 %35, ptr %36, ptr %2
%38 = icmp ult ptr %37, %31
%39 = getelementptr inbounds i8, ptr %31, i32 %18
%40 = icmp ule ptr %39, %37
%41 = or i1 %38, %40
call void @llvm.assume(i1 %41)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %31, ptr align 1 %37, i32 %18, i1 false), !noalias !19
store i8 0, ptr %39, align 1, !tbaa !3
ret void
}
; Function Attrs: minsize optsize
define void @_Z13decode_cyclicNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%9 = load i8, ptr %8, align 1
%10 = icmp slt i8 %9, 0
%11 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%12 = load i32, ptr %11, align 4
%13 = zext i8 %9 to i32
%14 = select i1 %10, i32 %12, i32 %13
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #13
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 0, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%16 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
br label %17
17: ; preds = %36, %2
%18 = phi i32 [ 0, %2 ], [ %38, %36 ]
%19 = mul nuw nsw i32 %18, 3
%20 = icmp slt i32 %19, %14
br i1 %20, label %21, label %39
21: ; preds = %17
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #13
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %19, i32 noundef 3) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4) #15
%22 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #13
%23 = load i8, ptr %15, align 1
%24 = icmp slt i8 %23, 0
%25 = load i32, ptr %16, align 4
%26 = zext i8 %23 to i32
%27 = select i1 %24, i32 %25, i32 %26
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %36
29: ; preds = %21
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #13
%30 = load ptr, ptr %3, align 4
%31 = select i1 %24, ptr %30, ptr %3
%32 = getelementptr inbounds i8, ptr %31, i32 2
%33 = load i8, ptr %32, align 1, !tbaa !3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #13
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 0, i32 noundef 2) #14
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EES6_OS9_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, i8 noundef signext %33, ptr noundef nonnull align 4 dereferenceable(12) %6) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %5) #15
%34 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #15
%35 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #13
br label %36
36: ; preds = %29, %21
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #13
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %7) #15
%37 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #13
%38 = add nuw nsw i32 %18, 1
br label %17, !llvm.loop !30
39: ; preds = %17
%40 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #13
ret void
}
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EES6_OS9_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, i8 noundef signext %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #3 comdat {
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%5 = load i8, ptr %4, align 1
%6 = icmp slt i8 %5, 0
%7 = load ptr, ptr %2, align 4
%8 = select i1 %6, ptr %7, ptr %2
%9 = tail call ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr %8, i8 noundef signext %1) #14
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %2, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %2, i8 0, i32 12, i1 false)
ret void
}
; 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 noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #7 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #16
br label %8
8: ; preds = %6, %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 !31
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #8
; 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 hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #18
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #9 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #10 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #19
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) #14
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !36
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #11
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #12
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #6
; Function Attrs: minsize optsize
declare ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc(ptr noundef nonnull align 4 dereferenceable(12), ptr, i8 noundef signext) local_unnamed_addr #0
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize 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 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #9 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 = { nounwind }
attributes #14 = { minsize optsize }
attributes #15 = { minsize nounwind optsize }
attributes #16 = { builtin minsize nounwind optsize }
attributes #17 = { minsize noreturn optsize }
attributes #18 = { builtin minsize optsize allocsize(0) }
attributes #19 = { noreturn }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !11, !13, !15, !17}
!9 = distinct !{!9, !10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!11 = distinct !{!11, !12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!12 = distinct !{!12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!13 = distinct !{!13, !14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!14 = distinct !{!14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!15 = distinct !{!15, !16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!17 = distinct !{!17, !18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!19 = !{!20, !22, !24, !26, !28}
!20 = distinct !{!20, !21, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!21 = distinct !{!21, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!22 = distinct !{!22, !23, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!23 = distinct !{!23, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!24 = distinct !{!24, !25, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!25 = distinct !{!25, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!26 = distinct !{!26, !27, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!28 = distinct !{!28, !29, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!29 = distinct !{!29, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!30 = distinct !{!30, !7}
!31 = !{i64 0, i64 4, !32, i64 4, i64 4, !34, i64 8, i64 4, !34, i64 11, i64 4, !34, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!32 = !{!33, !33, i64 0}
!33 = !{!"any pointer", !4, i64 0}
!34 = !{!35, !35, i64 0}
!35 = !{!"long", !4, i64 0}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !5, i64 0}
| (module
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32) (result i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func (param i32 i32) (result i32)))
(type (;7;) (func))
(type (;8;) (func (param i32 i32 i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_" (func (;1;) (type 4)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc" (func (;2;) (type 0)))
(import "env" "memmove" (func (;3;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc" (func (;4;) (type 2)))
(import "env" "_ZdlPv" (func (;5;) (type 5)))
(import "env" "_Znwm" (func (;6;) (type 1)))
(import "env" "__cxa_allocate_exception" (func (;7;) (type 1)))
(import "env" "__cxa_throw" (func (;8;) (type 3)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;9;) (type 6)))
(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 "env" "memory" (memory (;0;) 1))
(func (;10;) (type 7))
(func (;11;) (type 0) (param i32 i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 3
global.set 0
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.set 2
local.get 3
i32.const 0
i32.store offset=40
local.get 3
i64.const 0
i64.store offset=32
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.set 7
loop ;; label = @1
local.get 7
local.get 5
i32.const 3
i32.mul
local.tee 2
i32.gt_s
if ;; label = @2
local.get 3
i32.const 20
i32.add
local.tee 4
local.get 1
local.get 2
i32.const 3
call 12
local.get 3
i32.const 32
i32.add
local.tee 6
local.get 4
call 13
local.get 4
call 0
drop
local.get 3
i32.load offset=36
local.get 3
i32.load8_s offset=43
local.tee 2
i32.const 255
i32.and
local.get 2
i32.const 0
i32.lt_s
select
i32.const 3
i32.eq
if ;; label = @3
local.get 3
i32.const 8
i32.add
local.tee 2
local.get 6
i32.const 1
i32.const -1
call 12
local.get 2
local.get 3
i32.load offset=32
local.get 6
local.get 3
i32.load8_s offset=43
i32.const 0
i32.lt_s
select
i32.load8_s
call 2
local.get 4
local.get 2
i32.load offset=8
i32.store offset=8
local.get 4
local.get 2
i64.load align=4
i64.store align=4
local.get 2
i64.const 0
i64.store align=4
local.get 2
i32.const 0
i32.store offset=8
local.get 6
local.get 4
call 13
local.get 4
call 0
drop
local.get 2
call 0
drop
end
local.get 3
i32.const 20
i32.add
local.tee 2
local.get 0
local.get 3
i32.const 32
i32.add
call 14
local.get 0
local.get 2
call 13
local.get 5
i32.const 1
i32.add
local.set 5
local.get 2
call 0
drop
br 1 (;@1;)
end
end
local.get 3
i32.const 32
i32.add
call 0
drop
local.get 3
i32.const 48
i32.add
global.set 0)
(func (;12;) (type 8) (param i32 i32 i32 i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 0
local.get 1
local.get 2
local.get 3
local.get 4
i32.const 15
i32.add
call 1
drop
local.get 4
i32.const 16
i32.add
global.set 0)
(func (;13;) (type 0) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 5
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(func (;14;) (type 3) (param i32 i32 i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
block (result i32) ;; label = @1
local.get 2
i32.load offset=4
local.get 2
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 4
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
select
local.tee 5
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 3
i32.store8 offset=11
local.get 0
br 2 (;@1;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 7
call 6
local.set 8
local.get 0
local.get 3
i32.store offset=4
local.get 0
local.get 8
i32.store
local.get 0
local.get 7
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@1;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 7
global.get 4
local.set 3
global.get 1
call 9
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 8
unreachable
end
local.tee 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 5
call 3
local.get 5
i32.add
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 4
call 3
local.get 4
i32.add
i32.const 0
i32.store8
local.get 6
i32.const 16
i32.add
global.set 0)
(func (;15;) (type 0) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 3
global.set 0
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.set 2
local.get 3
i32.const 0
i32.store offset=40
local.get 3
i64.const 0
i64.store offset=32
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.set 7
loop ;; label = @1
local.get 7
local.get 5
i32.const 3
i32.mul
local.tee 2
i32.gt_s
if ;; label = @2
local.get 3
i32.const 20
i32.add
local.tee 4
local.get 1
local.get 2
i32.const 3
call 12
local.get 3
i32.const 32
i32.add
local.tee 6
local.get 4
call 13
local.get 4
call 0
drop
local.get 3
i32.load offset=36
local.get 3
i32.load8_s offset=43
local.tee 2
i32.const 255
i32.and
local.get 2
i32.const 0
i32.lt_s
local.tee 2
select
i32.const 3
i32.eq
if ;; label = @3
local.get 3
i32.load offset=32
local.get 6
local.get 2
select
i32.load8_s offset=2
local.set 8
local.get 3
i32.const 8
i32.add
local.tee 2
local.get 6
i32.const 0
i32.const 2
call 12
local.get 2
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 8
call 4
drop
local.get 4
local.get 2
i32.load offset=8
i32.store offset=8
local.get 4
local.get 2
i64.load align=4
i64.store align=4
local.get 2
i64.const 0
i64.store align=4
local.get 2
i32.const 0
i32.store offset=8
local.get 6
local.get 4
call 13
local.get 4
call 0
drop
local.get 2
call 0
drop
end
local.get 3
i32.const 20
i32.add
local.tee 2
local.get 0
local.get 3
i32.const 32
i32.add
call 14
local.get 0
local.get 2
call 13
local.get 5
i32.const 1
i32.add
local.set 5
local.get 2
call 0
drop
br 1 (;@1;)
end
end
local.get 3
i32.const 32
i32.add
call 0
drop
local.get 3
i32.const 48
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 10))
(export "__wasm_apply_data_relocs" (func 10))
(export "_Z13encode_cyclicNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 11))
(export "_Z13decode_cyclicNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 15))
(data (;0;) (global.get 1) "basic_string\00"))
| 14 | 235 | 10,939 | 505 |
|
CPP/39 | /*
prime_fib returns n-th number that is a Fibonacci number and it's also prime.
>>> prime_fib(1)
2
>>> prime_fib(2)
3
>>> prime_fib(3)
5
>>> prime_fib(4)
13
>>> prime_fib(5)
89
*/
#include<stdio.h>
using namespace std;
int prime_fib(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int prime_fib(int n){
| int f1,f2,m;
f1=1;f2=2;
int count=0;
while (count<n)
{
f1=f1+f2;
m=f1;f1=f2;f2=m;
bool isprime=true;
for (int w=2;w*w<=f1;w++)
if (f1%w==0)
{
isprime=false; break;
}
if (isprime) count+=1;
if (count==n) return f1;
}
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (prime_fib(1) == 2);
assert (prime_fib(2) == 3);
assert (prime_fib(3) == 5);
assert (prime_fib(4) == 13);
assert (prime_fib(5) == 89);
assert (prime_fib(6) == 233);
assert (prime_fib(7) == 1597);
assert (prime_fib(8) == 28657);
assert (prime_fib(9) == 514229);
assert (prime_fib(10) == 433494437);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (prime_fib(1) == 2);
assert (prime_fib(2) == 3);
assert (prime_fib(3) == 5);
assert (prime_fib(4) == 13);
assert (prime_fib(5) == 89);
}
| ; ModuleID = 'c_code_test/code_38.cpp'
source_filename = "c_code_test/code_38.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 nosync nounwind optsize memory(inaccessiblemem: write)
define noundef i32 @_Z9prime_fibi(i32 noundef %0) local_unnamed_addr #0 {
br label %2
2: ; preds = %18, %1
%3 = phi i32 [ 1, %1 ], [ %4, %18 ]
%4 = phi i32 [ 2, %1 ], [ %7, %18 ]
%5 = phi i32 [ 0, %1 ], [ %19, %18 ]
%6 = icmp slt i32 %5, %0
tail call void @llvm.assume(i1 %6)
%7 = add nsw i32 %4, %3
br label %8
8: ; preds = %12, %2
%9 = phi i32 [ 2, %2 ], [ %15, %12 ]
%10 = mul nsw i32 %9, %9
%11 = icmp sgt i32 %10, %4
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = srem i32 %4, %9
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i32 %9, 1
br i1 %14, label %18, label %8, !llvm.loop !3
16: ; preds = %8
%17 = add nsw i32 %5, 1
br label %18
18: ; preds = %12, %16
%19 = phi i32 [ %17, %16 ], [ %5, %12 ]
%20 = icmp eq i32 %19, %0
br i1 %20, label %21, label %2, !llvm.loop !5
21: ; preds = %18
ret i32 %4
}
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize memory(inaccessiblemem: write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = distinct !{!5, !4}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32 i32)
i32.const 2
local.set 4
i32.const 1
local.set 1
loop ;; label = @1
local.get 4
local.tee 3
local.get 1
i32.add
local.set 4
i32.const 2
local.set 1
block ;; label = @2
loop ;; label = @3
local.get 3
local.get 1
local.get 1
i32.mul
i32.ge_s
if ;; label = @4
local.get 3
local.get 1
i32.rem_s
local.get 1
i32.const 1
i32.add
local.set 1
br_if 1 (;@3;)
br 2 (;@2;)
end
end
local.get 2
i32.const 1
i32.add
local.set 2
end
local.get 3
local.set 1
local.get 0
local.get 2
i32.ne
br_if 0 (;@1;)
end
local.get 1)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z9prime_fibi" (func 1)))
| 18 | 340 | 1,157 | 53 |
CPP/40 | /*
triples_sum_to_zero takes a vector of integers as an input.
it returns true if there are three distinct elements in the vector that
sum to zero, and false otherwise.
>>> triples_sum_to_zero({1, 3, 5, 0})
false
>>> triples_sum_to_zero({1, 3, -2, 1})
true
>>> triples_sum_to_zero({1, 2, 3, 7})
false
>>> triples_sum_to_zero({2, 4, -5, 3, 9, 7})
true
>>> triples_sum_to_zero({1})
false
*/
#include<stdio.h>
#include<vector>
using namespace std;
bool triples_sum_to_zero(vector<int> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
bool triples_sum_to_zero(vector<int> l){
| for (int i=0;i<l.size();i++)
for (int j=i+1;j<l.size();j++)
for (int k=j+1;k<l.size();k++)
if (l[i]+l[j]+l[k]==0) return true;
return false;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (triples_sum_to_zero({1, 3, 5, 0}) == false);
assert (triples_sum_to_zero({1, 3, 5, -1}) == false);
assert (triples_sum_to_zero({1, 3, -2, 1}) == true);
assert (triples_sum_to_zero({1, 2, 3, 7}) == false);
assert (triples_sum_to_zero({1, 2, 5, 7}) == false);
assert (triples_sum_to_zero({2, 4, -5, 3, 9, 7}) == true);
assert (triples_sum_to_zero({1}) == false);
assert (triples_sum_to_zero({1, 3, 5, -100}) == false);
assert (triples_sum_to_zero({100, 3, 5, -100}) == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (triples_sum_to_zero({1, 3, 5, 0}) == false);
assert (triples_sum_to_zero({1, 3, -2, 1}) == true);
assert (triples_sum_to_zero({1, 2, 3, 7}) == false);
assert (triples_sum_to_zero({2, 4, -5, 3, 9, 7}) == true);
}
| ; ModuleID = 'c_code_test/code_39.cpp'
source_filename = "c_code_test/code_39.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 @_Z19triples_sum_to_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 = %15, %1
%10 = phi i32 [ 0, %1 ], [ %13, %15 ]
%11 = icmp eq i32 %10, %8
br i1 %11, label %33, label %12
12: ; preds = %9
%13 = add nuw i32 %10, 1
%14 = getelementptr inbounds i32, ptr %4, i32 %10
br label %15
15: ; preds = %21, %12
%16 = phi i32 [ %13, %12 ], [ %19, %21 ]
%17 = icmp eq i32 %16, %8
br i1 %17, label %9, label %18, !llvm.loop !11
18: ; preds = %15
%19 = add i32 %16, 1
%20 = getelementptr inbounds i32, ptr %4, i32 %16
br label %21
21: ; preds = %24, %18
%22 = phi i32 [ %19, %18 ], [ %32, %24 ]
%23 = icmp ult i32 %22, %8
br i1 %23, label %24, label %15
24: ; preds = %21
%25 = load i32, ptr %14, align 4, !tbaa !13
%26 = load i32, ptr %20, align 4, !tbaa !13
%27 = add nsw i32 %26, %25
%28 = getelementptr inbounds i32, ptr %4, i32 %22
%29 = load i32, ptr %28, align 4, !tbaa !13
%30 = sub i32 0, %29
%31 = icmp eq i32 %27, %30
%32 = add nuw nsw i32 %22, 1
br i1 %31, label %33, label %21, !llvm.loop !15
33: ; preds = %9, %24
%34 = icmp ult i32 %10, %8
ret i1 %34
}
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !6, i64 0}
!15 = distinct !{!15, !12}
| (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 i32 i32 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.set 2
loop ;; label = @1
block ;; label = @2
local.get 1
local.get 2
i32.eq
if ;; label = @3
local.get 2
local.set 1
br 1 (;@2;)
end
local.get 3
local.get 1
i32.const 2
i32.shl
i32.add
local.set 4
local.get 1
i32.const 1
i32.add
local.tee 5
local.set 0
loop ;; label = @3
local.get 0
local.get 2
i32.eq
if ;; label = @4
local.get 5
local.set 1
br 3 (;@1;)
end
local.get 3
local.get 0
i32.const 2
i32.shl
i32.add
local.set 6
local.get 0
i32.const 1
i32.add
local.tee 7
local.set 0
loop ;; label = @4
local.get 0
local.get 2
i32.ge_u
if ;; label = @5
local.get 7
local.set 0
br 2 (;@3;)
end
local.get 0
i32.const 2
i32.shl
local.set 8
local.get 0
i32.const 1
i32.add
local.set 0
local.get 6
i32.load
local.get 4
i32.load
i32.add
i32.const 0
local.get 3
local.get 8
i32.add
i32.load
i32.sub
i32.ne
br_if 0 (;@4;)
end
end
end
end
local.get 1
local.get 2
i32.lt_u)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z19triples_sum_to_zeroNSt3__26vectorIiNS_9allocatorIiEEEE" (func 1)))
| 6 | 167 | 2,183 | 97 |
CPP/41 | /*
Imagine a road that's a perfectly straight infinitely long line.
n cars are driving left to right; simultaneously, a different set of n cars
are driving right to left. The two sets of cars start out being very far from
each other. All cars move in the same speed. Two cars are said to collide
when a car that's moving left to right hits a car that's moving right to left.
However, the cars are infinitely sturdy and strong; as a result, they continue moving
in their trajectory as if they did not collide.
This function outputs the number of such collisions.
*/
#include<stdio.h>
using namespace std;
int car_race_collision(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int car_race_collision(int n){
| return n*n;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (car_race_collision(2) == 4);
assert (car_race_collision(3) == 9);
assert (car_race_collision(4) == 16);
assert (car_race_collision(8) == 64);
assert (car_race_collision(10) == 100);
}
| ; ModuleID = 'c_code_test/code_40.cpp'
source_filename = "c_code_test/code_40.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 i32 @_Z18car_race_collisioni(i32 noundef %0) local_unnamed_addr #0 {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
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 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
local.get 0
local.get 0
i32.mul)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z18car_race_collisioni" (func 1)))
| 2 | 18 | 328 | 11 |
|
CPP/42 | /*
Return vector with elements incremented by 1.
>>> incr_vector({1, 2, 3})
{2, 3, 4}
>>> incr_vector({5, 3, 5, 2, 3, 3, 9, 0, 123})
{6, 4, 6, 3, 4, 4, 10, 1, 124}
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> incr_list(vector<int> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<int> incr_list(vector<int> l){
| for (int i=0;i<l.size();i++)
l[i]+=1;
return l;
}
| #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(incr_list({}) , {}));
assert (issame(incr_list({3, 2, 1}) , {4, 3, 2}));
assert (issame(incr_list({5, 2, 5, 2, 3, 3, 9, 0, 123}) , {6, 3, 6, 3, 4, 4, 10, 1, 124}));
}
| #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(incr_list({1, 2, 3}) , {2, 3, 4}));
assert (issame(incr_list({5, 2, 5, 2, 3, 3, 9, 0, 123}) , {6, 3, 6, 3, 4, 4, 10, 1, 124}));
}
| ; ModuleID = 'c_code_test/code_41.cpp'
source_filename = "c_code_test/code_41.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 }
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_ = comdat any
; Function Attrs: minsize mustprogress nounwind optsize
define void @_Z9incr_listNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !3
%5 = load ptr, ptr %1, 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 = %15, %2
%11 = phi i32 [ 0, %2 ], [ %19, %15 ]
%12 = icmp eq i32 %11, %9
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #2
ret void
15: ; preds = %10
%16 = getelementptr inbounds i32, ptr %5, i32 %11
%17 = load i32, ptr %16, align 4, !tbaa !11
%18 = add nsw i32 %17, 1
store i32 %18, ptr %16, align 4, !tbaa !11
%19 = add nuw i32 %11, 1
br label %10, !llvm.loop !13
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #1 comdat {
store ptr null, ptr %0, align 4, !tbaa !10
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !15
%5 = load ptr, ptr %1, align 4, !tbaa !10
store ptr %5, ptr %0, align 4, !tbaa !10
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !3
store ptr %7, ptr %3, align 4, !tbaa !3
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !16
store ptr %9, ptr %4, align 4, !tbaa !16
store ptr null, ptr %8, align 4, !tbaa !16
store ptr null, ptr %6, align 4, !tbaa !3
store ptr null, ptr %1, align 4, !tbaa !10
ret ptr %0
}
attributes #0 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { minsize nounwind optsize }
!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"}
!15 = !{!9, !5, i64 0}
!16 = !{!5, !5, i64 0}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32)
(local i32 i32 i32 i32)
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.set 4
loop ;; label = @1
local.get 2
local.get 4
i32.eq
if ;; label = @2
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.load
i32.store
local.get 0
local.get 1
i32.load offset=4
i32.store offset=4
local.get 0
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
else
local.get 3
local.get 2
i32.const 2
i32.shl
i32.add
local.tee 5
local.get 5
i32.load
i32.const 1
i32.add
i32.store
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z9incr_listNSt3__26vectorIiNS_9allocatorIiEEEE" (func 1)))
| 4 | 66 | 1,454 | 67 |
CPP/43 | /*
pairs_sum_to_zero takes a vector of integers as an input.
it returns true if there are two distinct elements in the vector that
sum to zero, and false otherwise.
>>> pairs_sum_to_zero({1, 3, 5, 0})
false
>>> pairs_sum_to_zero({1, 3, -2, 1})
false
>>> pairs_sum_to_zero({1, 2, 3, 7})
false
>>> pairs_sum_to_zero({2, 4, -5, 3, 5, 7})
true
>>> pairs_sum_to_zero({1})
false
*/
#include<stdio.h>
#include<vector>
using namespace std;
bool pairs_sum_to_zero(vector<int> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool pairs_sum_to_zero(vector<int> l){
| for (int i=0;i<l.size();i++)
for (int j=i+1;j<l.size();j++)
if (l[i]+l[j]==0) return true;
return false;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (pairs_sum_to_zero({1, 3, 5, 0}) == false);
assert (pairs_sum_to_zero({1, 3, -2, 1}) == false);
assert (pairs_sum_to_zero({1, 2, 3, 7}) == false);
assert (pairs_sum_to_zero({2, 4, -5, 3, 5, 7}) == true);
assert (pairs_sum_to_zero({1}) == false);
assert (pairs_sum_to_zero({-3, 9, -1, 3, 2, 30}) == true);
assert (pairs_sum_to_zero({-3, 9, -1, 3, 2, 31}) == true);
assert (pairs_sum_to_zero({-3, 9, -1, 4, 2, 30}) == false);
assert (pairs_sum_to_zero({-3, 9, -1, 4, 2, 31}) == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (pairs_sum_to_zero({1, 3, 5, 0}) == false);
assert (pairs_sum_to_zero({1, 3, -2, 1}) == false);
assert (pairs_sum_to_zero({1, 2, 3, 7}) == false);
assert (pairs_sum_to_zero({2, 4, -5, 3, 5, 7}) == true);
}
| ; ModuleID = 'c_code_test/code_42.cpp'
source_filename = "c_code_test/code_42.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 @_Z17pairs_sum_to_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 = %15, %1
%10 = phi i32 [ 0, %1 ], [ %13, %15 ]
%11 = icmp eq i32 %10, %8
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = add nuw i32 %10, 1
%14 = getelementptr inbounds i32, ptr %4, i32 %10
br label %15
15: ; preds = %18, %12
%16 = phi i32 [ %13, %12 ], [ %24, %18 ]
%17 = icmp eq i32 %16, %8
br i1 %17, label %9, label %18
18: ; preds = %15
%19 = load i32, ptr %14, align 4, !tbaa !11
%20 = getelementptr inbounds i32, ptr %4, i32 %16
%21 = load i32, ptr %20, align 4, !tbaa !11
%22 = sub i32 0, %21
%23 = icmp eq i32 %19, %22
%24 = add i32 %16, 1
br i1 %23, label %25, label %15, !llvm.loop !13
25: ; preds = %9, %18
%26 = icmp ult i32 %10, %8
ret i1 %26
}
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 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.set 2
loop ;; label = @1
block ;; label = @2
local.get 1
local.get 2
i32.eq
if ;; label = @3
local.get 2
local.set 1
br 1 (;@2;)
end
local.get 3
local.get 1
i32.const 2
i32.shl
i32.add
local.set 4
local.get 1
i32.const 1
i32.add
local.tee 5
local.set 0
loop ;; label = @3
local.get 0
local.get 2
i32.eq
if ;; label = @4
local.get 5
local.set 1
br 3 (;@1;)
end
local.get 0
i32.const 2
i32.shl
local.set 6
local.get 0
i32.const 1
i32.add
local.set 0
local.get 4
i32.load
i32.const 0
local.get 3
local.get 6
i32.add
i32.load
i32.sub
i32.ne
br_if 0 (;@3;)
end
end
end
local.get 1
local.get 2
i32.lt_u)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z17pairs_sum_to_zeroNSt3__26vectorIiNS_9allocatorIiEEEE" (func 1)))
| 5 | 123 | 1,605 | 73 |
CPP/44 | /*
Change numerical base of input number x to base.
return string representation after the conversion.
base numbers are less than 10.
>>> change_base(8, 3)
"22"
>>> change_base(8, 2)
"1000"
>>> change_base(7, 2)
"111"
*/
#include<stdio.h>
#include<string>
using namespace std;
string change_base(int x,int base){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string change_base(int x,int base){
| string out="";
while (x>0)
{
out=to_string(x%base)+out;
x=x/base;
}
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (change_base(8, 3) == "22");
assert (change_base(9, 3) == "100");
assert (change_base(234, 2) == "11101010");
assert (change_base(16, 2) == "10000");
assert (change_base(8, 2) == "1000");
assert (change_base(7, 2) == "111");
for (int x=2;x<8;x++)
assert (change_base(x, x + 1) == to_string(x));
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (change_base(8, 3) == "22");
assert (change_base(8, 2) == "1000");
assert (change_base(7, 2) == "111");
}
| ; ModuleID = 'c_code_test/code_43.cpp'
source_filename = "c_code_test/code_43.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
; Function Attrs: minsize mustprogress optsize
define void @_Z11change_baseii(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #11
br label %7
7: ; preds = %10, %3
%8 = phi i32 [ %1, %3 ], [ %12, %10 ]
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #12
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #12
%11 = freeze i32 %8
%12 = sdiv i32 %11, %2
%13 = mul i32 %12, %2
%14 = sub i32 %11, %13
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, i32 noundef %14) #11
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %0) #11
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4) #13
%15 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #13
%16 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #12
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #12
br label %7, !llvm.loop !3
17: ; preds = %7
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #1 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #13
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #11
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #3 comdat {
%4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #11
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__29to_stringEi(ptr sret(%"class.std::__2::basic_string") align 4, i32 noundef) local_unnamed_addr #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 #4
; 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 #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #3
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_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
%6 = load ptr, ptr %1, align 4
%7 = select i1 %5, ptr %6, ptr %1
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %7, i32 noundef %11) #11
ret ptr %12
}
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #1
; 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) #8
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #9
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #10 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !5
tail call void @_ZdlPv(ptr noundef %7) #14
br label %8
8: ; preds = %6, %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 !8
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !5
ret void
}
attributes #0 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize optsize }
attributes #12 = { nounwind }
attributes #13 = { minsize nounwind optsize }
attributes #14 = { builtin minsize nounwind optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{i64 0, i64 4, !9, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 11, i64 4, !11, i64 0, i64 11, !5, i64 11, i64 0, !5, i64 11, i64 1, !5, i64 11, i64 1, !5, i64 0, i64 12, !5}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !6, i64 0}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32)))
(type (;4;) (func (param i32 i32 i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__29to_stringEi" (func (;1;) (type 3)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;2;) (type 1)))
(import "env" "strlen" (func (;3;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;4;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm" (func (;5;) (type 4)))
(import "env" "_ZdlPv" (func (;6;) (type 5)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;7;) (type 6))
(func (;8;) (type 2) (param i32 i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 5
global.set 0
local.get 0
global.get 1
call 0
local.set 0
loop ;; label = @1
local.get 1
i32.const 0
i32.gt_s
if ;; label = @2
local.get 5
i32.const 8
i32.add
local.tee 6
local.get 1
local.get 1
local.get 2
i32.div_s
local.tee 1
local.get 2
i32.mul
i32.sub
call 1
local.get 5
i32.const 20
i32.add
local.tee 3
local.get 6
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.get 0
i32.load offset=4
local.get 4
local.get 7
select
call 5
local.tee 4
i64.load align=4
i64.store align=4
local.get 3
local.get 4
i32.load offset=8
i32.store offset=8
local.get 4
i64.const 0
i64.store align=4
local.get 4
i32.const 0
i32.store offset=8
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 0
i32.load
call 6
end
local.get 0
local.get 3
i64.load align=4
i64.store align=4
local.get 0
local.get 3
i32.load offset=8
i32.store offset=8
local.get 3
i32.const 0
i32.store8 offset=11
local.get 3
i32.const 0
i32.store8
local.get 3
call 2
drop
local.get 6
call 2
drop
br 1 (;@1;)
end
end
local.get 5
i32.const 32
i32.add
global.set 0)
(func (;9;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 3
call 4
local.get 0)
(export "__wasm_call_ctors" (func 7))
(export "__wasm_apply_data_relocs" (func 7))
(export "_Z11change_baseii" (func 8))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 9))
(data (;0;) (global.get 1) "\00"))
| 8 | 118 | 3,487 | 131 |
CPP/45 | /*
Given length of a side and high return area for a triangle.
>>> triangle_area(5, 3)
7.5
*/
#include<stdio.h>
#include<math.h>
using namespace std;
float triangle_area(float a,float h){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
float triangle_area(float a,float h){
| return (a*h)*0.5;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(triangle_area(5, 3) - 7.5)<1e-4);
assert (abs(triangle_area(2, 2) - 2.0)<1e-4);
assert (abs(triangle_area(10, 8) - 40.0)<1e-4);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(triangle_area(5, 3) - 7.5)<1e-4);
}
| ; ModuleID = 'c_code_test/code_44.cpp'
source_filename = "c_code_test/code_44.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 @_Z13triangle_areaff(float noundef %0, float noundef %1) local_unnamed_addr #0 {
%3 = fmul float %0, %1
%4 = fmul float %3, 5.000000e-01
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 f32) (result f32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param f32 f32) (result f32)
local.get 0
local.get 1
f32.mul
f32.const 0x1p-1 (;=0.5;)
f32.mul)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z13triangle_areaff" (func 1)))
| 3 | 21 | 374 | 13 |
CPP/46 | /*
The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:
fib4(0) -> 0
fib4(1) -> 0
fib4(2) -> 2
fib4(3) -> 0
fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).
Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.
>>> fib4(5)
4
>>> fib4(6)
8
>>> fib4(7)
14
*/
#include<stdio.h>
using namespace std;
int fib4(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int fib4(int n){
| int f[100];
f[0]=0;
f[1]=0;
f[2]=2;
f[3]=0;
for (int i=4;i<=n;i++)
{
f[i]=f[i-1]+f[i-2]+f[i-3]+f[i-4];
}
return f[n];
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fib4(5) == 4);
assert (fib4(8) == 28);
assert (fib4(10) == 104);
assert (fib4(12) == 386);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fib4(5) == 4);
assert (fib4(6) == 8);
assert (fib4(7) == 14);
}
| ; ModuleID = 'c_code_test/code_45.cpp'
source_filename = "c_code_test/code_45.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z4fib4i(i32 noundef %0) local_unnamed_addr #0 {
%2 = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %2) #3
store i32 0, ptr %2, align 16, !tbaa !3
%3 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 1
store i32 0, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 2
store i32 2, ptr %4, align 8, !tbaa !3
%5 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 3
store i32 0, ptr %5, align 4, !tbaa !3
%6 = tail call i32 @llvm.smax.i32(i32 %0, i32 3)
%7 = add nuw i32 %6, 1
br label %8
8: ; preds = %16, %1
%9 = phi i32 [ 0, %1 ], [ %19, %16 ]
%10 = phi i32 [ 0, %1 ], [ %25, %16 ]
%11 = phi i32 [ 4, %1 ], [ %27, %16 ]
%12 = icmp eq i32 %11, %7
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %0
%15 = load i32, ptr %14, align 4, !tbaa !3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %2) #3
ret i32 %15
16: ; preds = %8
%17 = add nsw i32 %11, -2
%18 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %17
%19 = load i32, ptr %18, align 4, !tbaa !3
%20 = add nsw i32 %19, %10
%21 = add nsw i32 %20, %9
%22 = add nsw i32 %11, -4
%23 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %22
%24 = load i32, ptr %23, align 4, !tbaa !3
%25 = add nsw i32 %21, %24
%26 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %11
store i32 %25, ptr %26, align 4, !tbaa !3
%27 = add nuw i32 %11, 1
br label %8, !llvm.loop !7
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #2
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(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 willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }
!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 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 400
i32.sub
local.tee 1
global.set 0
local.get 1
i64.const 2
i64.store offset=8
local.get 1
i64.const 0
i64.store
i32.const 3
local.get 0
local.get 0
i32.const 3
i32.le_s
select
i32.const 1
i32.add
local.set 6
i32.const 4
local.set 2
loop (result i32) ;; label = @1
local.get 2
local.get 6
i32.eq
if (result i32) ;; label = @2
local.get 1
local.get 0
i32.const 2
i32.shl
i32.add
i32.load
local.get 1
i32.const 400
i32.add
global.set 0
else
local.get 1
local.get 2
i32.const 2
i32.shl
i32.add
local.tee 5
local.get 5
i32.const 16
i32.sub
i32.load
local.get 3
local.get 4
i32.add
local.get 5
i32.const 8
i32.sub
i32.load
local.tee 3
i32.add
i32.add
local.tee 4
i32.store
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z4fib4i" (func 1)))
| 11 | 164 | 1,594 | 78 |
CPP/47 | /*
Return median of elements in the vector l.
>>> median({3, 1, 2, 4, 5})
3
>>> median({-10, 4, 6, 1000, 10, 20})
15.0
*/
#include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
float median(vector<float> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
float median(vector<float> l){
| sort(l.begin(),l.end());
if (l.size()%2==1) return l[l.size()/2];
return 0.5*(l[l.size()/2]+l[l.size()/2-1]);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(median({3, 1, 2, 4, 5}) - 3)<1e-4);
assert (abs(median({-10, 4, 6, 1000, 10, 20}) -8.0)<1e-4);
assert (abs(median({5}) - 5)<1e-4);
assert (abs(median({6, 5}) - 5.5)<1e-4);
assert (abs(median({8, 1, 3, 9, 9, 2, 7}) - 7)<1e-4 );
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(median({3, 1, 2, 4, 5}) - 3)<1e-4);
assert (abs(median({-10, 4, 6, 1000, 10, 20}) -8.0)<1e-4);
}
| ; ModuleID = 'c_code_test/code_46.cpp'
source_filename = "c_code_test/code_46.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::__less" = type { i8 }
$_ZNSt3__24sortB7v160006INS_11__wrap_iterIPfEENS_6__lessIffEEEEvT_S6_T0_ = comdat any
; Function Attrs: minsize optsize
define noundef float @_Z6medianNSt3__26vectorIfNS_9allocatorIfEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = load ptr, ptr %0, align 4, !tbaa !3
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !10
tail call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPfEENS_6__lessIffEEEEvT_S6_T0_(ptr %2, ptr %4) #2
%5 = load ptr, ptr %3, align 4, !tbaa !10
%6 = load ptr, ptr %0, align 4, !tbaa !3
%7 = ptrtoint ptr %5 to i32
%8 = ptrtoint ptr %6 to i32
%9 = sub i32 %7, %8
%10 = ashr exact i32 %9, 2
%11 = and i32 %9, 4
%12 = icmp eq i32 %11, 0
%13 = lshr i32 %10, 1
%14 = getelementptr inbounds float, ptr %6, i32 %13
%15 = load float, ptr %14, align 4, !tbaa !11
br i1 %12, label %16, label %22
16: ; preds = %1
%17 = add nsw i32 %13, -1
%18 = getelementptr inbounds float, ptr %6, i32 %17
%19 = load float, ptr %18, align 4, !tbaa !11
%20 = fadd float %15, %19
%21 = fmul float %20, 5.000000e-01
br label %22
22: ; preds = %1, %16
%23 = phi float [ %21, %16 ], [ %15, %1 ]
ret float %23
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPfEENS_6__lessIffEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #1 comdat {
%3 = alloca %"struct.std::__2::__less", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #2
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
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 mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { minsize optsize }
!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__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 4}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !6, i64 0}
| (module
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func))
(type (;2;) (func (param i32) (result f32)))
(import "env" "_ZNSt3__26__sortIRNS_6__lessIffEEPfEEvT0_S5_T_" (func (;0;) (type 0)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;1;) (type 1))
(func (;2;) (type 2) (param i32) (result f32)
(local i32 i32 i32 f32)
local.get 0
i32.load
local.get 0
i32.load offset=4
global.get 0
i32.const 16
i32.sub
local.tee 1
global.set 0
local.get 1
i32.const 15
i32.add
call 0
local.get 1
i32.const 16
i32.add
global.set 0
local.get 0
i32.load
local.tee 1
local.get 0
i32.load offset=4
local.get 1
i32.sub
local.tee 0
i32.const 2
i32.shr_s
i32.const 1
i32.shr_u
i32.const 2
i32.shl
i32.add
local.tee 1
f32.load
local.set 4
local.get 0
i32.const 4
i32.and
if (result f32) ;; label = @1
local.get 4
else
local.get 4
local.get 1
i32.const 4
i32.sub
f32.load
f32.add
f32.const 0x1p-1 (;=0.5;)
f32.mul
end)
(export "__wasm_call_ctors" (func 1))
(export "__wasm_apply_data_relocs" (func 1))
(export "_Z6medianNSt3__26vectorIfNS_9allocatorIfEEEE" (func 2)))
| 4 | 124 | 1,359 | 63 |
CPP/48 | /*
Checks if given string is a palindrome
>>> is_palindrome("")
true
>>> is_palindrome("aba")
true
>>> is_palindrome("aaaaa")
true
>>> is_palindrome("zbcd")
false
*/
#include<stdio.h>
#include<string>
using namespace std;
bool is_palindrome(string text){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool is_palindrome(string text){
| string pr(text.rbegin(),text.rend());
return pr==text;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_palindrome("") == true);
assert (is_palindrome("aba") == true);
assert (is_palindrome("aaaaa") == true);
assert (is_palindrome("zbcd") == false);
assert (is_palindrome("xywyx") == true);
assert (is_palindrome("xywyz") == false);
assert (is_palindrome("xywzx") == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_palindrome("") == true);
assert (is_palindrome("aba") == true);
assert (is_palindrome("aaaaa") == true);
assert (is_palindrome("zbcd") == false);
}
| ; ModuleID = 'c_code_test/code_47.cpp'
source_filename = "c_code_test/code_47.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__211char_traitsIcE7compareEPKcS3_m = comdat any
@.str = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define noundef zeroext i1 @_Z13is_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #11
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
%6 = load ptr, ptr %0, align 4
%7 = select i1 %5, ptr %6, ptr %0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = getelementptr inbounds i8, ptr %7, i32 %11
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr %12, ptr %7) #12
%13 = call noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %0) #13
%14 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #11
ret i1 %13
}
; 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 nounwind optsize
define linkonce_odr hidden noundef zeroext i1 @_ZNSt3__2eqB7v160006INS_9allocatorIcEEEEbRKNS_12basic_stringIcNS_11char_traitsIcEET_EES9_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%7 = load i32, ptr %6, align 4
%8 = zext i8 %4 to i32
%9 = select i1 %5, i32 %7, i32 %8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%11 = load i8, ptr %10, align 1
%12 = icmp slt i8 %11, 0
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%14 = load i32, ptr %13, align 4
%15 = zext i8 %11 to i32
%16 = select i1 %12, i32 %14, i32 %15
%17 = icmp eq i32 %9, %16
br i1 %17, label %18, label %38
18: ; preds = %2
%19 = load ptr, ptr %1, align 4
%20 = select i1 %12, ptr %19, ptr %1
br i1 %5, label %21, label %25
21: ; preds = %18
%22 = load ptr, ptr %0, align 4
%23 = tail call noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %22, ptr noundef %20, i32 noundef %7) #13
%24 = icmp eq i32 %23, 0
br label %38
25: ; preds = %18, %34
%26 = phi i32 [ %35, %34 ], [ %8, %18 ]
%27 = phi ptr [ %36, %34 ], [ %0, %18 ]
%28 = phi ptr [ %37, %34 ], [ %20, %18 ]
%29 = icmp eq i32 %26, 0
br i1 %29, label %38, label %30
30: ; preds = %25
%31 = load i8, ptr %27, align 1, !tbaa !3
%32 = load i8, ptr %28, align 1, !tbaa !3
%33 = icmp eq i8 %31, %32
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = add nsw i32 %26, -1
%36 = getelementptr inbounds i8, ptr %27, i32 1
%37 = getelementptr inbounds i8, ptr %28, i32 1
br label %25, !llvm.loop !6
38: ; preds = %30, %25, %21, %2
%39 = phi i1 [ false, %2 ], [ %24, %21 ], [ %29, %25 ], [ %29, %30 ]
ret i1 %39
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr %2) local_unnamed_addr #4 comdat {
%4 = ptrtoint ptr %1 to i32
%5 = ptrtoint ptr %2 to i32
%6 = sub i32 %4, %5
%7 = icmp ugt i32 %6, 2147483631
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #14
unreachable
9: ; preds = %3
%10 = icmp ult i32 %6, 11
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = trunc i32 %6 to i8
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %12, ptr %13, align 1
br label %21
14: ; preds = %9
%15 = or i32 %6, 15
%16 = add nuw i32 %15, 1
%17 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %16) #15, !noalias !8
store ptr %17, ptr %0, align 4, !tbaa !3
%18 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%19 = or i32 %16, -2147483648
store i32 %19, ptr %18, align 4
%20 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %6, ptr %20, align 4, !tbaa !3
br label %21
21: ; preds = %14, %11
%22 = phi ptr [ %0, %11 ], [ %17, %14 ]
br label %23
23: ; preds = %21, %27
%24 = phi ptr [ %28, %27 ], [ %1, %21 ]
%25 = phi ptr [ %30, %27 ], [ %22, %21 ]
%26 = icmp eq ptr %24, %2
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = getelementptr inbounds i8, ptr %24, i32 -1
%29 = load i8, ptr %28, align 1, !tbaa !3
store i8 %29, ptr %25, align 1, !tbaa !3
%30 = getelementptr inbounds i8, ptr %25, i32 1
br label %23, !llvm.loop !11
31: ; preds = %23
store i8 0, ptr %25, align 1, !tbaa !3
ret void
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #5 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #14
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #6 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #11
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #12
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #16
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) #12
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !12
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #8
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr noundef i32 @_ZNSt3__211char_traitsIcE7compareEPKcS3_m(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #9 comdat {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcmp(ptr noundef %0, ptr noundef %1, i32 noundef %2) #13
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i32 noundef) local_unnamed_addr #10
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 nounwind 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 = { 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 mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { inlinehint minsize mustprogress noreturn 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 nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { nounwind }
attributes #12 = { minsize optsize }
attributes #13 = { minsize nounwind optsize }
attributes #14 = { minsize noreturn optsize }
attributes #15 = { builtin minsize optsize allocsize(0) }
attributes #16 = { noreturn }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9}
!9 = distinct !{!9, !10, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!11 = distinct !{!11, !7}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !5, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32 i32)))
(type (;2;) (func (param i32 i32 i32) (result i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func (;2;) (type 2)))
(import "env" "_Znwm" (func (;3;) (type 0)))
(import "env" "__cxa_allocate_exception" (func (;4;) (type 0)))
(import "env" "__cxa_throw" (func (;5;) (type 1)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;6;) (type 3)))
(import "env" "memcmp" (func (;7;) (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 "env" "memory" (memory (;0;) 1))
(func (;8;) (type 4))
(func (;9;) (type 0) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
local.get 6
i32.const 4
i32.add
local.tee 7
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.tee 1
local.get 0
i32.load offset=4
local.get 4
local.get 2
select
i32.add
local.get 1
call 0
block ;; label = @1
local.get 7
local.tee 1
i32.load offset=4
local.tee 8
local.get 1
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
local.tee 4
i32.const 0
i32.lt_s
select
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
local.tee 2
i32.const 0
i32.lt_s
select
i32.ne
br_if 0 (;@1;)
local.get 0
i32.load
local.get 0
local.get 2
i32.const 0
i32.lt_s
select
local.set 0
local.get 4
i32.const 0
i32.ge_s
if ;; label = @2
loop ;; label = @3
local.get 3
i32.eqz
local.set 5
local.get 3
i32.eqz
br_if 2 (;@1;)
local.get 1
i32.load8_u
local.get 0
i32.load8_u
i32.ne
br_if 2 (;@1;)
local.get 0
i32.const 1
i32.add
local.set 0
local.get 1
i32.const 1
i32.add
local.set 1
local.get 3
i32.const 1
i32.sub
local.set 3
br 0 (;@3;)
end
unreachable
end
local.get 1
i32.load
local.get 0
local.get 8
call 2
i32.eqz
local.set 5
end
local.get 7
call 1
drop
local.get 6
i32.const 16
i32.add
global.set 0
local.get 5)
(func (;10;) (type 1) (param i32 i32 i32)
(local i32 i32 i32)
local.get 1
local.get 2
i32.sub
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @1
block ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
local.get 3
i32.store8 offset=11
br 1 (;@2;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 5
call 3
local.set 4
local.get 0
local.get 5
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
local.get 4
i32.store
local.get 0
local.get 3
i32.store offset=4
local.get 4
local.set 0
end
loop ;; label = @2
local.get 1
local.get 2
i32.ne
if ;; label = @3
local.get 0
local.get 1
i32.const 1
i32.sub
local.tee 1
i32.load8_u
i32.store8
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@2;)
end
end
local.get 0
i32.const 0
i32.store8
return
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 4
global.get 4
local.set 4
global.get 1
call 6
local.tee 2
local.get 4
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 5
unreachable)
(func (;11;) (type 2) (param i32 i32 i32) (result i32)
local.get 2
i32.eqz
if ;; label = @1
i32.const 0
return
end
local.get 0
local.get 1
local.get 2
call 7)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z13is_palindromeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 9))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_" (func 10))
(export "_ZNSt3__211char_traitsIcE7compareEPKcS3_m" (func 11))
(data (;0;) (global.get 1) "basic_string\00"))
| 3 | 65 | 5,747 | 238 |
CPP/49 | /*
Return 2^n modulo p (be aware of numerics).
>>> modp(3, 5)
3
>>> modp(1101, 101)
2
>>> modp(0, 101)
1
>>> modp(3, 11)
8
>>> modp(100, 101)
1
*/
#include<stdio.h>
using namespace std;
int modp(int n,int p){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int modp(int n,int p){
| int out=1;
for (int i=0;i<n;i++)
out=(out*2)%p;
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (modp(3, 5) == 3);
assert (modp(1101, 101) == 2);
assert (modp(0, 101) == 1);
assert (modp(3, 11) == 8);
assert (modp(100, 101) == 1);
assert (modp(30, 5) == 4);
assert (modp(31, 5) == 3);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (modp(3, 5) == 3);
assert (modp(1101, 101) == 2);
assert (modp(0, 101) == 1);
assert (modp(3, 11) == 8);
assert (modp(100, 101) == 1);
}
| ; ModuleID = 'c_code_test/code_48.cpp'
source_filename = "c_code_test/code_48.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z4modpii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
br label %4
4: ; preds = %9, %2
%5 = phi i32 [ 1, %2 ], [ %11, %9 ]
%6 = phi i32 [ 0, %2 ], [ %12, %9 ]
%7 = icmp eq i32 %6, %3
br i1 %7, label %8, label %9
8: ; preds = %4
ret i32 %5
9: ; preds = %4
%10 = shl nsw i32 %5, 1
%11 = srem i32 %10, %1
%12 = add nuw i32 %6, 1
br label %4, !llvm.loop !3
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
(local i32 i32)
local.get 0
i32.const 0
local.get 0
i32.const 0
i32.gt_s
select
local.set 3
i32.const 1
local.set 0
loop (result i32) ;; label = @1
local.get 2
local.get 3
i32.eq
if (result i32) ;; label = @2
local.get 0
else
local.get 2
i32.const 1
i32.add
local.set 2
local.get 0
i32.const 1
i32.shl
local.get 1
i32.rem_s
local.set 0
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z4modpii" (func 1)))
| 5 | 82 | 816 | 38 |
CPP/50 | #include<stdio.h>
#include<string>
using namespace std;
string encode_shift(string s){
// returns encoded string by shifting every character by 5 in the alphabet.
string out;
int i;
for (i=0;i<s.length();i++)
{
int w=((int)s[i]+5-(int)'a')%26+(int)'a';
out=out+(char)w;
}
return out;
}
string decode_shift(string s){
// takes as input string encoded with encode_shift function. Returns decoded string.
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string encode_shift(string s){
string out;
int i;
for (i=0;i<s.length();i++)
{
int w=((int)s[i]+5-(int)'a')%26+(int)'a';
out=out+(char)w;
}
return out;
}
string decode_shift(string s){
| string out;
int i;
for (i=0;i<s.length();i++)
{
int w=((int)s[i]+21-(int)'a')%26+(int)'a';
out=out+(char)w;
}
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
for (int i=0;i<100;i++)
{
int l=10+rand()%11;
string str="";
for (int j=0;j<l;j++)
{
char chr=97+rand()%26;
str+=chr;
}
string encoded_str = encode_shift(str);
assert (decode_shift(encoded_str) == str);
}
}
| ; ModuleID = 'c_code_test/code_49.cpp'
source_filename = "c_code_test/code_49.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z12encode_shiftNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %6
6: ; preds = %14, %2
%7 = phi i32 [ 0, %2 ], [ %25, %14 ]
%8 = load i8, ptr %4, align 1
%9 = icmp slt i8 %8, 0
%10 = load i32, ptr %5, align 4
%11 = zext i8 %8 to i32
%12 = select i1 %9, i32 %10, i32 %11
%13 = icmp ult i32 %7, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load ptr, ptr %1, align 4
%16 = select i1 %9, ptr %15, ptr %1
%17 = getelementptr inbounds i8, ptr %16, i32 %7
%18 = load i8, ptr %17, align 1, !tbaa !3
%19 = sext i8 %18 to i16
%20 = add nsw i16 %19, -92
%21 = srem i16 %20, 26
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #12
%22 = trunc i16 %21 to i8
%23 = add nsw i8 %22, 97
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %23) #13
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #14
%24 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #12
%25 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !6
26: ; preds = %6
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: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #12
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #13
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #12
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !8
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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 #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define void @_Z12decode_shiftNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %6
6: ; preds = %14, %2
%7 = phi i32 [ 0, %2 ], [ %25, %14 ]
%8 = load i8, ptr %4, align 1
%9 = icmp slt i8 %8, 0
%10 = load i32, ptr %5, align 4
%11 = zext i8 %8 to i32
%12 = select i1 %9, i32 %10, i32 %11
%13 = icmp ult i32 %7, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load ptr, ptr %1, align 4
%16 = select i1 %9, ptr %15, ptr %1
%17 = getelementptr inbounds i8, ptr %16, i32 %7
%18 = load i8, ptr %17, align 1, !tbaa !3
%19 = sext i8 %18 to i16
%20 = add nsw i16 %19, -76
%21 = srem i16 %20, 26
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #12
%22 = trunc i16 %21 to i8
%23 = add nsw i8 %22, 97
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %23) #13
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #14
%24 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #12
%25 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !19
26: ; preds = %6
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #4
; 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) #5
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #15
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #16
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__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) #15
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) #12
%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) #17
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 !20
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #8
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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #5
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #11 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #18
br label %8
8: ; preds = %6, %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 !22
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "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 = { nounwind }
attributes #13 = { minsize optsize }
attributes #14 = { minsize nounwind optsize }
attributes #15 = { minsize noreturn optsize }
attributes #16 = { builtin minsize optsize allocsize(0) }
attributes #17 = { noreturn }
attributes #18 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !11, !13, !15, !17}
!9 = distinct !{!9, !10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!11 = distinct !{!11, !12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!12 = distinct !{!12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!13 = distinct !{!13, !14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!14 = distinct !{!14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!15 = distinct !{!15, !16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!17 = distinct !{!17, !18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!19 = distinct !{!19, !7}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !5, i64 0}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !25, i64 8, i64 4, !25, i64 11, i64 4, !25, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!23 = !{!24, !24, i64 0}
!24 = !{!"any pointer", !4, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32 i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;0;) (type 0)))
(import "env" "memmove" (func (;1;) (type 3)))
(import "env" "_Znwm" (func (;2;) (type 0)))
(import "env" "__cxa_allocate_exception" (func (;3;) (type 0)))
(import "env" "__cxa_throw" (func (;4;) (type 1)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;5;) (type 4)))
(import "env" "_ZdlPv" (func (;6;) (type 5)))
(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 "env" "memory" (memory (;0;) 1))
(func (;7;) (type 6))
(func (;8;) (type 2) (param i32 i32)
local.get 0
local.get 1
i32.const 92
call 12)
(func (;9;) (type 1) (param i32 i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 5
global.set 0
block (result i32) ;; 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
select
local.tee 4
i32.const 1
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 3
i32.store8 offset=11
local.get 0
br 2 (;@1;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 6
call 2
local.set 7
local.get 0
local.get 3
i32.store offset=4
local.get 0
local.get 7
i32.store
local.get 0
local.get 6
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@1;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 3
global.get 4
local.set 3
global.get 1
call 5
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 4
unreachable
end
local.tee 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 4
call 1
local.get 4
i32.add
local.tee 0
local.get 2
i32.store8
local.get 0
i32.const 0
i32.store8 offset=1
local.get 5
i32.const 16
i32.add
global.set 0)
(func (;10;) (type 2) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 6
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(func (;11;) (type 2) (param i32 i32)
local.get 0
local.get 1
i32.const 76
call 12)
(func (;12;) (type 1) (param i32 i32 i32)
(local i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 5
global.set 0
local.get 0
i64.const 0
i64.store align=4
local.get 0
i32.const 0
i32.store offset=8
loop ;; label = @1
local.get 3
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 4
select
i32.ge_u
i32.eqz
if ;; label = @2
local.get 5
i32.const 4
i32.add
local.tee 6
local.get 0
local.get 1
i32.load
local.get 1
local.get 4
select
local.get 3
i32.add
i32.load8_s
local.get 2
i32.sub
i32.const 26
i32.rem_s
i32.const 97
i32.add
i32.extend8_s
call 9
local.get 0
local.get 6
call 10
local.get 3
i32.const 1
i32.add
local.set 3
local.get 6
call 0
drop
br 1 (;@1;)
end
end
local.get 5
i32.const 16
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 7))
(export "__wasm_apply_data_relocs" (func 7))
(export "_Z12encode_shiftNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 8))
(export "_Z12decode_shiftNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 11))
(data (;0;) (global.get 1) "basic_string\00"))
| 9 | 167 | 5,484 | 242 |
|
CPP/51 | /*
remove_vowels is a function that takes string and returns string without vowels.
>>> remove_vowels("")
""
>>> remove_vowels("abcdef\nghijklm")
"bcdf\nghjklm"
>>> remove_vowels("abcdef")
"bcdf"
>>> remove_vowels("aaaaa")
""
>>> remove_vowels("aaBAA")
"B"
>>> remove_vowels("zbcd")
"zbcd"
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
string remove_vowels(string text){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
string remove_vowels(string text){
| string out="";
string vowels="AEIOUaeiou";
for (int i=0;i<text.length();i++)
if (find(vowels.begin(),vowels.end(),text[i])==vowels.end())
out=out+text[i];
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (remove_vowels("") == "");
assert (remove_vowels("abcdef\nghijklm") == "bcdf\nghjklm");
assert (remove_vowels("fedcba") == "fdcb");
assert (remove_vowels("eeeee") == "");
assert (remove_vowels("acBAA") == "cB");
assert (remove_vowels("EcBOO") == "cB");
assert (remove_vowels("ybcd") == "ybcd");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (remove_vowels("") == "");
assert (remove_vowels("abcdef\nghijklm") == "bcdf\nghjklm");
assert (remove_vowels("abcdef") == "bcdf");
assert (remove_vowels("aaaaa") == "");
assert (remove_vowels("aaBAA") == "B");
assert (remove_vowels("zbcd") == "zbcd");
}
| ; ModuleID = 'c_code_test/code_50.cpp'
source_filename = "c_code_test/code_50.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"AEIOUaeiou\00", align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z13remove_vowelsNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #14
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #15
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str.1) #14
%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
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
br label %11
11: ; preds = %51, %2
%12 = phi i32 [ 0, %2 ], [ %52, %51 ]
%13 = load i8, ptr %7, align 1
%14 = icmp slt i8 %13, 0
%15 = load i32, ptr %8, align 4
%16 = zext i8 %13 to i32
%17 = select i1 %14, i32 %15, i32 %16
%18 = icmp ult i32 %12, %17
br i1 %18, label %21, label %19
19: ; preds = %11
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #15
ret void
21: ; preds = %11
%22 = load i8, ptr %9, align 1
%23 = icmp slt i8 %22, 0
%24 = load ptr, ptr %3, align 4
%25 = select i1 %23, ptr %24, ptr %3
%26 = load i32, ptr %10, align 4
%27 = zext i8 %22 to i32
%28 = select i1 %23, i32 %26, i32 %27
%29 = getelementptr inbounds i8, ptr %25, i32 %28
%30 = load ptr, ptr %1, align 4
%31 = select i1 %14, ptr %30, ptr %1
%32 = getelementptr inbounds i8, ptr %31, i32 %12
%33 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %25, ptr %29, ptr noundef nonnull align 1 dereferenceable(1) %32) #14
%34 = load i8, ptr %9, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %3, align 4
%37 = select i1 %35, ptr %36, ptr %3
%38 = load i32, ptr %10, align 4
%39 = zext i8 %34 to i32
%40 = select i1 %35, i32 %38, i32 %39
%41 = getelementptr inbounds i8, ptr %37, i32 %40
%42 = icmp eq ptr %33, %41
br i1 %42, label %43, label %51
43: ; preds = %21
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #15
%44 = load i8, ptr %7, align 1
%45 = icmp slt i8 %44, 0
%46 = load ptr, ptr %1, align 4
%47 = select i1 %45, ptr %46, ptr %1
%48 = getelementptr inbounds i8, ptr %47, i32 %12
%49 = load i8, ptr %48, align 1, !tbaa !3
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %49) #14
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4) #16
%50 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #15
br label %51
51: ; preds = %21, %43
%52 = add nuw nsw i32 %12, 1
br label %11, !llvm.loop !6
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #16
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #14
ret ptr %0
}
; 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 nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #2 comdat {
%4 = ptrtoint ptr %0 to i32
%5 = ptrtoint ptr %1 to i32
%6 = load i8, ptr %2, align 1
%7 = sub i32 %5, %4
%8 = getelementptr i8, ptr %0, i32 %7
br label %9
9: ; preds = %15, %3
%10 = phi ptr [ %0, %3 ], [ %16, %15 ]
%11 = icmp eq ptr %10, %1
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = load i8, ptr %10, align 1, !tbaa !3
%14 = icmp eq i8 %13, %6
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, ptr %10, i32 1
br label %9, !llvm.loop !8
17: ; preds = %12, %9
%18 = phi ptr [ %10, %12 ], [ %8, %9 ]
ret ptr %18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #15
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #15
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !9
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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 nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.2) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #15
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !20
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; 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) #11
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #19
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #20
br label %8
8: ; preds = %6, %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 !22
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
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 nounwind 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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #14 = { minsize optsize }
attributes #15 = { nounwind }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { minsize noreturn optsize }
attributes #18 = { noreturn }
attributes #19 = { builtin minsize optsize allocsize(0) }
attributes #20 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = distinct !{!8, !7}
!9 = !{!10, !12, !14, !16, !18}
!10 = distinct !{!10, !11, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!11 = distinct !{!11, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!12 = distinct !{!12, !13, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!13 = distinct !{!13, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!14 = distinct !{!14, !15, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!15 = distinct !{!15, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!16 = distinct !{!16, !17, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!17 = distinct !{!17, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!18 = distinct !{!18, !19, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!19 = distinct !{!19, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !5, i64 0}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !25, i64 8, i64 4, !25, i64 11, i64 4, !25, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!23 = !{!24, !24, i64 0}
!24 = !{!"any pointer", !4, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "memmove" (func (;4;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;5;) (type 0)))
(import "env" "__cxa_throw" (func (;6;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;7;) (type 1)))
(import "env" "_Znwm" (func (;8;) (type 0)))
(import "env" "_ZdlPv" (func (;9;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;10;) (type 5))
(func (;11;) (type 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 7
global.set 0
local.get 0
global.get 1
local.tee 0
i32.const 23
i32.add
call 0
local.set 3
local.get 7
i32.const 20
i32.add
local.get 0
call 0
local.set 4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 5
select
local.get 6
i32.gt_u
if ;; label = @2
block (result i32) ;; label = @3
local.get 4
i32.load
local.get 4
local.get 4
i32.load8_u offset=11
local.tee 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 8
select
local.set 0
local.get 0
local.get 4
i32.load offset=4
local.get 2
local.get 8
select
i32.add
local.set 2
local.get 1
i32.load
local.get 1
local.get 5
select
local.get 6
i32.add
i32.load8_u
local.set 5
loop ;; label = @4
block ;; label = @5
local.get 0
local.get 2
i32.ne
if (result i32) ;; label = @6
local.get 0
i32.load8_u
local.get 5
i32.ne
br_if 1 (;@5;)
local.get 0
else
local.get 2
end
br 2 (;@3;)
end
local.get 0
i32.const 1
i32.add
local.set 0
br 0 (;@4;)
end
unreachable
end
local.get 4
i32.load
local.get 4
local.get 4
i32.load8_u offset=11
local.tee 0
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.get 4
i32.load offset=4
local.get 0
local.get 2
select
i32.add
i32.eq
if ;; label = @3
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 6
i32.add
i32.load8_s
local.set 8
global.get 0
i32.const 16
i32.sub
local.tee 9
global.set 0
block (result i32) ;; label = @4
local.get 7
i32.const 8
i32.add
local.set 0
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 5
i32.const 1
i32.add
local.tee 2
i32.const 2147483632
i32.lt_u
if ;; label = @5
local.get 2
i32.const 10
i32.le_u
if ;; label = @6
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 2
i32.store8 offset=11
local.get 0
br 2 (;@4;)
end
local.get 2
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 10
call 8
local.set 11
local.get 0
local.get 2
i32.store offset=4
local.get 0
local.get 11
i32.store
local.get 0
local.get 10
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@4;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 5
global.get 4
local.set 4
global.get 1
i32.const 11
i32.add
call 7
local.tee 3
local.get 4
i32.const 8
i32.add
i32.store
local.get 3
local.get 1
local.get 0
call 6
unreachable
end
local.tee 2
i32.load
local.get 2
local.get 2
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 5
call 4
local.get 5
i32.add
local.tee 2
local.get 8
i32.store8
local.get 2
i32.const 0
i32.store8 offset=1
local.get 9
i32.const 16
i32.add
global.set 0
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @4
local.get 3
i32.load
call 9
end
local.get 3
local.get 0
i64.load align=4
i64.store align=4
local.get 3
local.get 0
i32.load offset=8
i32.store offset=8
local.get 0
i32.const 0
i32.store8 offset=11
local.get 0
i32.const 0
i32.store8
local.get 0
call 1
drop
end
local.get 6
i32.const 1
i32.add
local.set 6
br 1 (;@1;)
end
end
local.get 4
call 1
drop
local.get 7
i32.const 32
i32.add
global.set 0)
(func (;12;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 10))
(export "__wasm_apply_data_relocs" (func 10))
(export "_Z13remove_vowelsNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 11))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 12))
(data (;0;) (global.get 1) "AEIOUaeiou\00basic_string\00"))
| 8 | 206 | 8,183 | 317 |
CPP/52 | /*
Return true if all numbers in the vector l are below threshold t.
>>> below_threshold({1, 2, 4, 10}, 100)
true
>>> below_threshold({1, 20, 4, 10}, 5)
false
*/
#include<stdio.h>
#include<vector>
using namespace std;
bool below_threshold(vector<int>l, int t){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool below_threshold(vector<int>l, int t){
| for (int i=0;i<l.size();i++)
if (l[i]>=t) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (below_threshold({1, 2, 4, 10}, 100));
assert (not(below_threshold({1, 20, 4, 10}, 5)));
assert (below_threshold({1, 20, 4, 10}, 21));
assert (below_threshold({1, 20, 4, 10}, 22));
assert (below_threshold({1, 8, 4, 10}, 11));
assert (not(below_threshold({1, 8, 4, 10}, 10)));
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (below_threshold({1, 2, 4, 10}, 100));
assert (not(below_threshold({1, 20, 4, 10}, 5)));
}
| ; ModuleID = 'c_code_test/code_51.cpp'
source_filename = "c_code_test/code_51.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 @_Z15below_thresholdNSt3__26vectorIiNS_9allocatorIiEEEEi(ptr nocapture noundef readonly %0, i32 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 = %13, %2
%11 = phi i32 [ 0, %2 ], [ %17, %13 ]
%12 = icmp eq i32 %11, %9
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, ptr %5, i32 %11
%15 = load i32, ptr %14, align 4, !tbaa !11
%16 = icmp slt i32 %15, %1
%17 = add nuw i32 %11, 1
br i1 %16, label %10, label %18, !llvm.loop !13
18: ; preds = %13, %10
%19 = icmp uge i32 %11, %9
ret i1 %19
}
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 i32) (result i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
(local 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 2
loop ;; label = @1
block ;; label = @2
local.get 2
local.get 3
local.tee 0
i32.eq
if ;; label = @3
local.get 2
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 1
i32.lt_s
br_if 1 (;@1;)
end
end
local.get 0
local.get 2
i32.ge_u)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z15below_thresholdNSt3__26vectorIiNS_9allocatorIiEEEEi" (func 1)))
| 4 | 87 | 1,070 | 48 |
CPP/53 | /*
Add two numbers x and y
>>> add(2, 3)
5
>>> add(5, 7)
12
*/
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int add(int x,int y){
| #include<stdio.h>
#include<stdlib.h>
using namespace std;
#include<algorithm>
#include<math.h>
int add(int x,int y){
| return x+y;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (add(0, 1) == 1);
assert (add(1, 0) == 1);
assert (add(2, 3) == 5);
assert (add(5, 7) == 12);
assert (add(7, 5) == 12);
for (int i=0;i<100;i+=1)
{
int x=rand()%1000;
int y=rand()%1000;
assert (add(x, y) == x + y);
}
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (add(2, 3) == 5);
assert (add(5, 7) == 12);
}
| ; ModuleID = 'c_code_test/code_52.cpp'
source_filename = "c_code_test/code_52.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 i32 @_Z3addii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = add nsw i32 %1, %0
ret i32 %3
}
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 i32 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
i32.add)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z3addii" (func 1)))
| 2 | 18 | 321 | 11 |
CPP/54 | /*
Check if two words have the same characters.
>>> same_chars("eabcdzzzz", "dddzzzzzzzddeddabc")
true
>>> same_chars("abcd", "dddddddabc")
true
>>> same_chars("dddddddabc", "abcd")
true
>>> same_chars("eabcd", "dddddddabc")
false
>>> same_chars("abcd", "dddddddabce")
false
>>> same_chars("eabcdzzzz", "dddzzzzzzzddddabc")
false
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
bool same_chars(string s0,string s1){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
bool same_chars(string s0,string s1){
| for (int i=0;i<s0.length();i++)
if (find(s1.begin(),s1.end(),s0[i])==s1.end())
return false;
for (int i=0;i<s1.length();i++)
if (find(s0.begin(),s0.end(),s1[i])==s0.end())
return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (same_chars("eabcdzzzz", "dddzzzzzzzddeddabc") == true);
assert (same_chars("abcd", "dddddddabc") == true);
assert (same_chars("dddddddabc", "abcd") == true);
assert (same_chars("eabcd", "dddddddabc") == false);
assert (same_chars("abcd", "dddddddabcf") == false);
assert (same_chars("eabcdzzzz", "dddzzzzzzzddddabc") == false);
assert (same_chars("aabb", "aaccc") == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (same_chars("eabcdzzzz", "dddzzzzzzzddeddabc") == true);
assert (same_chars("abcd", "dddddddabc") == true);
assert (same_chars("dddddddabc", "abcd") == true);
assert (same_chars("eabcd", "dddddddabc") == false);
assert (same_chars("abcd", "dddddddabcf") == false);
assert (same_chars("eabcdzzzz", "dddzzzzzzzddddabc") == false);
}
| ; ModuleID = 'c_code_test/code_53.cpp'
source_filename = "c_code_test/code_53.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_ = comdat any
; Function Attrs: minsize nounwind optsize
define noundef zeroext i1 @_Z10same_charsNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %7
7: ; preds = %15, %2
%8 = phi i32 [ 0, %2 ], [ %37, %15 ]
%9 = load i8, ptr %3, align 1
%10 = icmp slt i8 %9, 0
%11 = load i32, ptr %4, align 4
%12 = zext i8 %9 to i32
%13 = select i1 %10, i32 %11, i32 %12
%14 = icmp ult i32 %8, %13
br i1 %14, label %15, label %38
15: ; preds = %7
%16 = load i8, ptr %5, align 1
%17 = icmp slt i8 %16, 0
%18 = load ptr, ptr %1, align 4
%19 = select i1 %17, ptr %18, ptr %1
%20 = load i32, ptr %6, align 4
%21 = zext i8 %16 to i32
%22 = select i1 %17, i32 %20, i32 %21
%23 = getelementptr inbounds i8, ptr %19, i32 %22
%24 = load ptr, ptr %0, align 4
%25 = select i1 %10, ptr %24, ptr %0
%26 = getelementptr inbounds i8, ptr %25, i32 %8
%27 = tail call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %19, ptr %23, ptr noundef nonnull align 1 dereferenceable(1) %26) #2
%28 = load i8, ptr %5, align 1
%29 = icmp slt i8 %28, 0
%30 = load ptr, ptr %1, align 4
%31 = select i1 %29, ptr %30, ptr %1
%32 = load i32, ptr %6, align 4
%33 = zext i8 %28 to i32
%34 = select i1 %29, i32 %32, i32 %33
%35 = getelementptr inbounds i8, ptr %31, i32 %34
%36 = icmp eq ptr %27, %35
%37 = add nuw nsw i32 %8, 1
br i1 %36, label %69, label %7, !llvm.loop !3
38: ; preds = %7, %48
%39 = phi i32 [ %63, %48 ], [ %11, %7 ]
%40 = phi i8 [ %59, %48 ], [ %9, %7 ]
%41 = phi i32 [ %68, %48 ], [ 0, %7 ]
%42 = load i8, ptr %5, align 1
%43 = icmp slt i8 %42, 0
%44 = load i32, ptr %6, align 4
%45 = zext i8 %42 to i32
%46 = select i1 %43, i32 %44, i32 %45
%47 = icmp uge i32 %41, %46
br i1 %47, label %69, label %48
48: ; preds = %38
%49 = icmp slt i8 %40, 0
%50 = load ptr, ptr %0, align 4
%51 = select i1 %49, ptr %50, ptr %0
%52 = zext i8 %40 to i32
%53 = select i1 %49, i32 %39, i32 %52
%54 = getelementptr inbounds i8, ptr %51, i32 %53
%55 = load ptr, ptr %1, align 4
%56 = select i1 %43, ptr %55, ptr %1
%57 = getelementptr inbounds i8, ptr %56, i32 %41
%58 = tail call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %51, ptr %54, ptr noundef nonnull align 1 dereferenceable(1) %57) #2
%59 = load i8, ptr %3, align 1
%60 = icmp slt i8 %59, 0
%61 = load ptr, ptr %0, align 4
%62 = select i1 %60, ptr %61, ptr %0
%63 = load i32, ptr %4, align 4
%64 = zext i8 %59 to i32
%65 = select i1 %60, i32 %63, i32 %64
%66 = getelementptr inbounds i8, ptr %62, i32 %65
%67 = icmp eq ptr %58, %66
%68 = add nuw nsw i32 %41, 1
br i1 %67, label %69, label %38, !llvm.loop !5
69: ; preds = %15, %38, %48
%70 = phi i1 [ %47, %48 ], [ %47, %38 ], [ false, %15 ]
ret i1 %70
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #1 comdat {
%4 = ptrtoint ptr %0 to i32
%5 = ptrtoint ptr %1 to i32
%6 = load i8, ptr %2, align 1
%7 = sub i32 %5, %4
%8 = getelementptr i8, ptr %0, i32 %7
br label %9
9: ; preds = %15, %3
%10 = phi ptr [ %0, %3 ], [ %16, %15 ]
%11 = icmp eq ptr %10, %1
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = load i8, ptr %10, align 1, !tbaa !6
%14 = icmp eq i8 %13, %6
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, ptr %10, i32 1
br label %9, !llvm.loop !9
17: ; preds = %12, %9
%18 = phi ptr [ %10, %12 ], [ %8, %9 ]
ret ptr %18
}
attributes #0 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { minsize optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = distinct !{!5, !4}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !4}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32) (result i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32)
loop ;; label = @1
block ;; label = @2
local.get 0
i32.load offset=4
local.tee 4
local.get 0
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
local.tee 3
i32.const 0
i32.lt_s
select
local.get 2
i32.le_u
if ;; label = @3
loop ;; label = @4
local.get 6
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
i32.ge_u
local.tee 8
br_if 2 (;@2;)
local.get 1
i32.load
local.get 1
local.get 2
select
local.get 6
i32.add
local.set 2
local.get 6
i32.const 1
i32.add
local.set 6
local.get 0
i32.load
local.get 0
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 5
select
local.tee 7
local.get 7
local.get 4
local.get 3
i32.const 255
i32.and
local.get 5
select
i32.add
local.get 2
call 2
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 2
i32.extend8_s
local.tee 3
i32.const 0
i32.lt_s
local.tee 5
select
local.get 0
i32.load offset=4
local.tee 4
local.get 2
local.get 5
select
i32.add
i32.ne
br_if 0 (;@4;)
br 2 (;@2;)
end
unreachable
end
local.get 0
i32.load
local.get 0
local.get 3
i32.const 0
i32.lt_s
select
local.get 2
i32.add
local.set 3
local.get 2
i32.const 1
i32.add
local.set 2
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 5
select
local.tee 7
local.get 7
local.get 1
i32.load offset=4
local.get 4
local.get 5
select
i32.add
local.get 3
call 2
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_u offset=11
local.tee 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 4
select
local.get 1
i32.load offset=4
local.get 3
local.get 4
select
i32.add
i32.ne
br_if 1 (;@1;)
end
end
local.get 8)
(func (;2;) (type 2) (param i32 i32 i32) (result i32)
local.get 2
i32.load8_u
local.set 2
loop ;; label = @1
block ;; label = @2
local.get 0
local.get 1
i32.ne
if (result i32) ;; label = @3
local.get 0
i32.load8_u
local.get 2
i32.ne
br_if 1 (;@2;)
local.get 0
else
local.get 1
end
return
end
local.get 0
i32.const 1
i32.add
local.set 0
br 0 (;@1;)
end
unreachable)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z10same_charsNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES5_" (func 1)))
| 8 | 240 | 4,195 | 186 |
CPP/55 | /*
Return n-th Fibonacci number.
>>> fib(10)
55
>>> fib(1)
1
>>> fib(8)
21
*/
#include<stdio.h>
using namespace std;
int fib(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int fib(int n){
| int f[1000];
f[0]=0;f[1]=1;
for (int i=2;i<=n; i++)
f[i]=f[i-1]+f[i-2];
return f[n];
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fib(10) == 55);
assert (fib(1) == 1);
assert (fib(8) == 21);
assert (fib(11) == 89);
assert (fib(12) == 144);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fib(10) == 55);
assert (fib(1) == 1);
assert (fib(8) == 21);
}
| ; ModuleID = 'c_code_test/code_54.cpp'
source_filename = "c_code_test/code_54.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z3fibi(i32 noundef %0) local_unnamed_addr #0 {
%2 = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %2) #3
store i32 0, ptr %2, align 16, !tbaa !3
%3 = getelementptr inbounds [1000 x i32], ptr %2, i32 0, i32 1
store i32 1, ptr %3, align 4, !tbaa !3
%4 = tail call i32 @llvm.smax.i32(i32 %0, i32 1)
%5 = add nuw i32 %4, 1
br label %6
6: ; preds = %13, %1
%7 = phi i32 [ 1, %1 ], [ %17, %13 ]
%8 = phi i32 [ 2, %1 ], [ %19, %13 ]
%9 = icmp eq i32 %8, %5
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = getelementptr inbounds [1000 x i32], ptr %2, i32 0, i32 %0
%12 = load i32, ptr %11, align 4, !tbaa !3
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %2) #3
ret i32 %12
13: ; preds = %6
%14 = add nsw i32 %8, -2
%15 = getelementptr inbounds [1000 x i32], ptr %2, i32 0, i32 %14
%16 = load i32, ptr %15, align 4, !tbaa !3
%17 = add nsw i32 %16, %7
%18 = getelementptr inbounds [1000 x i32], ptr %2, i32 0, i32 %8
store i32 %17, ptr %18, align 4, !tbaa !3
%19 = add nuw i32 %8, 1
br label %6, !llvm.loop !7
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #2
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(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 willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }
!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 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 4000
i32.sub
local.tee 1
global.set 0
local.get 1
i64.const 4294967296
i64.store
i32.const 1
local.get 0
local.get 0
i32.const 1
i32.le_s
select
i32.const 1
i32.add
local.set 4
i32.const 1
local.set 3
i32.const 2
local.set 2
loop (result i32) ;; label = @1
local.get 2
local.get 4
i32.eq
if (result i32) ;; label = @2
local.get 1
local.get 0
i32.const 2
i32.shl
i32.add
i32.load
local.get 1
i32.const 4000
i32.add
global.set 0
else
local.get 1
local.get 2
i32.const 2
i32.shl
i32.add
local.tee 5
local.get 5
i32.const 8
i32.sub
i32.load
local.get 3
i32.add
local.tee 3
i32.store
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z3fibi" (func 1)))
| 6 | 107 | 1,431 | 69 |
CPP/56 | /*
brackets is a string of '<' and '>'.
return true if every opening bracket has a corresponding closing bracket.
>>> correct_bracketing("<")
false
>>> correct_bracketing("<>")
true
>>> correct_bracketing("<<><>>")
true
>>> correct_bracketing("><<>")
false
*/
#include<stdio.h>
#include<string>
using namespace std;
bool correct_bracketing(string brackets){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool correct_bracketing(string brackets){
| int level=0;
for (int i=0;i<brackets.length();i++)
{
if (brackets[i]=='<') level+=1;
if (brackets[i]=='>') level-=1;
if (level<0) return false;
}
if (level!=0) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (correct_bracketing("<>"));
assert (correct_bracketing("<<><>>"));
assert (correct_bracketing("<><><<><>><>"));
assert (correct_bracketing("<><><<<><><>><>><<><><<>>>"));
assert (not (correct_bracketing("<<<><>>>>")));
assert (not (correct_bracketing("><<>")));
assert (not (correct_bracketing("<")));
assert (not (correct_bracketing("<<<<")));
assert (not (correct_bracketing(">")));
assert (not (correct_bracketing("<<>")));
assert (not (correct_bracketing("<><><<><>><>><<>")));
assert (not (correct_bracketing("<><><<><>><>>><>")));
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (correct_bracketing("<>"));
assert (correct_bracketing("<<><>>"));
assert (not (correct_bracketing("><<>")));
assert (not (correct_bracketing("<")));
}
| ; ModuleID = 'c_code_test/code_55.cpp'
source_filename = "c_code_test/code_55.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none)
define noundef zeroext i1 @_Z18correct_bracketingNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
br label %9
9: ; preds = %13, %1
%10 = phi i32 [ 0, %1 ], [ %23, %13 ]
%11 = phi i32 [ 0, %1 ], [ %25, %13 ]
%12 = icmp eq i32 %11, %8
br i1 %12, label %26, label %13
13: ; preds = %9
%14 = load ptr, ptr %0, align 4
%15 = select i1 %4, ptr %14, ptr %0
%16 = getelementptr inbounds i8, ptr %15, i32 %11
%17 = load i8, ptr %16, align 1, !tbaa !3
%18 = icmp eq i8 %17, 60
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %10, %19
%21 = icmp eq i8 %17, 62
%22 = sext i1 %21 to i32
%23 = add nsw i32 %20, %22
%24 = icmp slt i32 %23, 0
%25 = add nuw i32 %11, 1
br i1 %24, label %28, label %9, !llvm.loop !6
26: ; preds = %9
%27 = icmp eq i32 %10, 0
br label %28
28: ; preds = %13, %26
%29 = phi i1 [ %27, %26 ], [ false, %13 ]
ret i1 %29
}
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, !4, i64 0}
!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"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 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
local.tee 5
i32.const 0
i32.lt_s
select
local.set 6
i32.const 0
local.set 1
block ;; label = @1
loop ;; label = @2
local.get 1
local.get 6
i32.ne
if ;; label = @3
local.get 0
i32.load
local.get 0
local.get 5
i32.const 0
i32.lt_s
select
local.get 1
i32.add
local.set 3
local.get 1
i32.const 1
i32.add
local.set 1
local.get 2
local.get 3
i32.load8_u
local.tee 3
i32.const 60
i32.eq
i32.add
local.get 3
i32.const 62
i32.eq
i32.sub
local.tee 2
i32.const 0
i32.ge_s
br_if 1 (;@2;)
br 2 (;@1;)
end
end
local.get 2
i32.eqz
local.set 4
end
local.get 4)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z18correct_bracketingNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 10 | 237 | 1,511 | 67 |
CPP/57 | /*
Return true is vector elements are monotonically increasing or decreasing.
>>> monotonic({1, 2, 4, 20})
true
>>> monotonic({1, 20, 4, 10})
false
>>> monotonic({4, 1, 0, -10})
true
*/
#include<stdio.h>
#include<vector>
using namespace std;
bool monotonic(vector<float> l){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool monotonic(vector<float> l){
| int incr,decr;
incr=0;decr=0;
for (int i=1;i<l.size();i++)
{
if (l[i]>l[i-1]) incr=1;
if (l[i]<l[i-1]) decr=1;
}
if (incr+decr==2) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (monotonic({1, 2, 4, 10}) == true);
assert (monotonic({1, 2, 4, 20}) == true);
assert (monotonic({1, 20, 4, 10}) == false);
assert (monotonic({4, 1, 0, -10}) == true);
assert (monotonic({4, 1, 1, 0}) == true);
assert (monotonic({1, 2, 3, 2, 5, 60}) == false);
assert (monotonic({1, 2, 3, 4, 5, 60}) == true);
assert (monotonic({9, 9, 9, 9}) == true);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (monotonic({1, 2, 4, 10}) == true);
assert (monotonic({1, 20, 4, 10}) == false);
assert (monotonic({4, 1, 0, -10}) == true);
}
| ; ModuleID = 'c_code_test/code_56.cpp'
source_filename = "c_code_test/code_56.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 @_Z9monotonicNSt3__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
%9 = tail call i32 @llvm.umax.i32(i32 %8, i32 1)
br label %10
10: ; preds = %18, %1
%11 = phi i32 [ 0, %1 ], [ %25, %18 ]
%12 = phi i32 [ 0, %1 ], [ %27, %18 ]
%13 = phi i32 [ 1, %1 ], [ %28, %18 ]
%14 = icmp eq i32 %13, %9
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = add nuw nsw i32 %12, %11
%17 = icmp ne i32 %16, 2
ret i1 %17
18: ; preds = %10
%19 = getelementptr inbounds float, ptr %4, i32 %13
%20 = load float, ptr %19, align 4, !tbaa !11
%21 = add nsw i32 %13, -1
%22 = getelementptr inbounds float, ptr %4, i32 %21
%23 = load float, ptr %22, align 4, !tbaa !11
%24 = fcmp ogt float %20, %23
%25 = select i1 %24, i32 1, i32 %11
%26 = fcmp olt float %20, %23
%27 = select i1 %26, i32 1, i32 %12
%28 = add nuw i32 %13, 1
br label %10, !llvm.loop !13
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #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 = { 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"}
| (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 f32 f32)
i32.const 1
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.tee 0
local.get 0
i32.const 1
i32.le_u
select
local.set 4
i32.const 1
local.set 0
loop (result i32) ;; label = @1
local.get 0
local.get 4
i32.eq
if (result i32) ;; label = @2
local.get 1
local.get 2
i32.add
i32.const 2
i32.ne
else
i32.const 1
local.get 1
local.get 3
local.get 0
i32.const 2
i32.shl
i32.add
local.tee 1
f32.load
local.tee 5
local.get 1
i32.const 4
i32.sub
f32.load
local.tee 6
f32.lt
select
local.set 1
i32.const 1
local.get 2
local.get 5
local.get 6
f32.gt
select
local.set 2
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z9monotonicNSt3__26vectorIfNS_9allocatorIfEEEE" (func 1)))
| 10 | 204 | 1,449 | 70 |
CPP/58 | /*
Return sorted unique common elements for two vectors.
>>> common({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121})
{1, 5, 653}
>>> common({5, 3, 2, 8}, {3, 2})
{2, 3}
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> common(vector<int> l1,vector<int> l2){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<int> common(vector<int> l1,vector<int> l2){
| vector<int> out={};
for (int i=0;i<l1.size();i++)
if (find(out.begin(),out.end(),l1[i])==out.end())
if (find(l2.begin(),l2.end(),l1[i])!=l2.end())
out.push_back(l1[i]);
sort(out.begin(),out.end());
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(common({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121}) , {1, 5, 653}));
assert (issame(common({5, 3, 2, 8}, {3, 2}) , {2, 3}));
assert (issame(common({4, 3, 2, 8}, {3, 2, 4}) , {2, 3, 4}));
assert (issame(common({4, 3, 2, 8}, {}) , {}));
}
| #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(common({1, 4, 3, 34, 653, 2, 5}, {5, 7, 1, 5, 9, 653, 121}) , {1, 5, 653}));
assert (issame(common({5, 3, 2, 8}, {3, 2}) , {2, 3}));
}
| ; ModuleID = 'c_code_test/code_57.cpp'
source_filename = "c_code_test/code_57.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 }
%"struct.std::__2::__less.3" = type { i8 }
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_ = comdat any
$_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__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_ = 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 @_Z6commonNSt3__26vectorIiNS_9allocatorIiEEEES3_(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
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
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
br label %8
8: ; preds = %36, %3
%9 = phi i32 [ 0, %3 ], [ %37, %36 ]
%10 = load ptr, ptr %6, align 4, !tbaa !10
%11 = load ptr, ptr %1, align 4, !tbaa !3
%12 = ptrtoint ptr %10 to i32
%13 = ptrtoint ptr %11 to i32
%14 = sub i32 %12, %13
%15 = ashr exact i32 %14, 2
%16 = icmp ult i32 %9, %15
%17 = load ptr, ptr %0, align 4, !tbaa !3
%18 = load ptr, ptr %4, align 4, !tbaa !10
br i1 %16, label %20, label %19
19: ; preds = %8
tail call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %17, ptr %18) #13
ret void
20: ; preds = %8
%21 = getelementptr inbounds i32, ptr %11, i32 %9
%22 = tail call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %17, ptr %18, ptr noundef nonnull align 4 dereferenceable(4) %21) #13
%23 = load ptr, ptr %4, align 4, !tbaa !10
%24 = icmp eq ptr %22, %23
br i1 %24, label %25, label %36
25: ; preds = %20
%26 = load ptr, ptr %2, align 4, !tbaa !3
%27 = load ptr, ptr %7, align 4, !tbaa !10
%28 = load ptr, ptr %1, align 4, !tbaa !3
%29 = getelementptr inbounds i32, ptr %28, i32 %9
%30 = tail call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %26, ptr %27, ptr noundef nonnull align 4 dereferenceable(4) %29) #13
%31 = load ptr, ptr %7, align 4, !tbaa !10
%32 = icmp eq ptr %30, %31
br i1 %32, label %36, label %33
33: ; preds = %25
%34 = load ptr, ptr %1, align 4, !tbaa !3
%35 = getelementptr inbounds i32, ptr %34, i32 %9
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %35) #13
br label %36
36: ; preds = %20, %33, %25
%37 = add nuw nsw i32 %9, 1
br label %8, !llvm.loop !12
}
; 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 nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPiEEiEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 4 dereferenceable(4) %2) local_unnamed_addr #2 comdat {
%4 = load i32, ptr %2, align 4
br label %5
5: ; preds = %11, %3
%6 = phi ptr [ %0, %3 ], [ %12, %11 ]
%7 = icmp eq ptr %6, %1
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = load i32, ptr %6, align 4, !tbaa !14
%10 = icmp eq i32 %9, %4
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, ptr %6, i32 1
br label %5, !llvm.loop !16
13: ; preds = %8, %5
%14 = phi ptr [ %6, %8 ], [ %1, %5 ]
ret ptr %14
}
; 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 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 #3 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 !14
store i32 %9, ptr %4, align 4, !tbaa !14
%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) #13
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4
; 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 #5 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 !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) #13
%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) #13
%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 !14
store i32 %23, ptr %22, align 4, !tbaa !14
%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) #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 #5 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 !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) #13, !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 !14, !noalias !27
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !14, !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 #6 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 !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) #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 #7 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 #8 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 !33
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #6
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 #9 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 #8 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 #6
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #6
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; 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 #11 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) #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 #2 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: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #5 comdat {
%3 = alloca %"struct.std::__2::__less.3", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #13
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize 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 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { 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, !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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !6, i64 0}
!16 = distinct !{!16, !13}
!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, !13}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !7, i64 0}
!35 = distinct !{!35, !13}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32 i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32 i32) (result i32)))
(import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func (;0;) (type 2)))
(import "env" "_ZdlPv" (func (;1;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 0)))
(import "env" "__cxa_throw" (func (;3;) (type 1)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;4;) (type 4)))
(import "env" "_Znwm" (func (;5;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;6;) (type 0)))
(import "env" "_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_" (func (;7;) (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 (;8;) (type 5))
(func (;9;) (type 1) (param i32 i32 i32)
(local i32 i32 i32 i32)
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 6
i32.sub
i32.const 2
i32.shr_s
local.get 5
i32.gt_u
if ;; label = @2
block ;; label = @3
local.get 3
local.get 4
local.get 6
local.get 5
i32.const 2
i32.shl
local.tee 3
i32.add
call 10
local.get 0
i32.load offset=4
i32.ne
br_if 0 (;@3;)
local.get 2
i32.load
local.get 2
i32.load offset=4
local.get 1
i32.load
local.get 3
i32.add
call 10
local.get 2
i32.load offset=4
i32.eq
br_if 0 (;@3;)
local.get 1
i32.load
local.get 3
i32.add
local.set 3
block ;; label = @4
local.get 0
i32.load offset=4
local.tee 4
local.get 0
i32.load offset=8
i32.ne
if ;; label = @5
local.get 4
local.get 3
i32.load
i32.store
local.get 0
local.get 4
i32.const 4
i32.add
i32.store offset=4
br 1 (;@4;)
end
local.get 0
local.get 3
call 0
end
end
local.get 5
i32.const 1
i32.add
local.set 5
local.get 0
i32.load offset=4
local.set 4
local.get 0
i32.load
local.set 3
br 1 (;@1;)
end
end
global.get 0
i32.const 16
i32.sub
local.tee 0
global.set 0
local.get 3
local.get 4
local.get 0
i32.const 15
i32.add
call 7
local.get 0
i32.const 16
i32.add
global.set 0)
(func (;10;) (type 6) (param i32 i32 i32) (result i32)
local.get 2
i32.load
local.set 2
loop ;; label = @1
block ;; label = @2
local.get 0
local.get 1
i32.ne
if (result i32) ;; label = @3
local.get 0
i32.load
local.get 2
i32.ne
br_if 1 (;@2;)
local.get 0
else
local.get 1
end
return
end
local.get 0
i32.const 4
i32.add
local.set 0
br 0 (;@1;)
end
unreachable)
(func (;11;) (type 2) (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 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z6commonNSt3__26vectorIiNS_9allocatorIiEEEES3_" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 11))
(data (;0;) (global.get 1) "vector\00"))
| 8 | 264 | 8,358 | 391 |
CPP/59 | /*
Return the largest prime factor of n. Assume n > 1 and is not a prime.
>>> largest_prime_factor(13195)
29
>>> largest_prime_factor(2048)
2
*/
#include<stdio.h>
using namespace std;
int largest_prime_factor(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int largest_prime_factor(int n){
| for (int i=2;i*i<=n;i++)
while (n%i==0 and n>i) n=n/i;
return n;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (largest_prime_factor(15) == 5);
assert (largest_prime_factor(27) == 3);
assert (largest_prime_factor(63) == 7);
assert (largest_prime_factor(330) == 11);
assert (largest_prime_factor(13195) == 29);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (largest_prime_factor(2048) == 2);
assert (largest_prime_factor(13195) == 29);
}
| ; ModuleID = 'c_code_test/code_58.cpp'
source_filename = "c_code_test/code_58.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 i32 @_Z20largest_prime_factori(i32 noundef %0) local_unnamed_addr #0 {
br label %2
2: ; preds = %18, %1
%3 = phi i32 [ %0, %1 ], [ %9, %18 ]
%4 = phi i32 [ 2, %1 ], [ %19, %18 ]
%5 = mul nsw i32 %4, %4
%6 = icmp sgt i32 %5, %3
br i1 %6, label %7, label %8
7: ; preds = %2
ret i32 %3
8: ; preds = %8, %2
%9 = phi i32 [ %3, %2 ], [ %12, %8 ]
%10 = freeze i32 %9
%11 = freeze i32 %4
%12 = sdiv i32 %10, %11
%13 = mul i32 %12, %11
%14 = sub i32 %10, %13
%15 = icmp eq i32 %14, 0
%16 = icmp sgt i32 %9, %4
%17 = and i1 %16, %15
br i1 %17, label %8, label %18, !llvm.loop !3
18: ; preds = %8
%19 = add nuw nsw i32 %4, 1
br label %2, !llvm.loop !5
}
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)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = distinct !{!5, !4}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32)
i32.const 2
local.set 1
loop ;; label = @1
local.get 1
local.get 1
i32.mul
local.get 0
i32.gt_s
i32.eqz
if ;; label = @2
local.get 0
local.set 2
loop ;; label = @3
block ;; label = @4
local.get 2
local.tee 0
local.get 1
i32.div_s
local.set 2
local.get 0
local.get 1
i32.le_s
br_if 0 (;@4;)
local.get 0
local.get 1
local.get 2
i32.mul
i32.eq
br_if 1 (;@3;)
end
end
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end
local.get 0)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z20largest_prime_factori" (func 1)))
| 4 | 80 | 1,090 | 48 |
CPP/60 | /*
sum_to_n is a function that sums numbers from 1 to n.
>>> sum_to_n(30)
465
>>> sum_to_n(100)
5050
>>> sum_to_n(5)
15
>>> sum_to_n(10)
55
>>> sum_to_n(1)
1
*/
#include<stdio.h>
using namespace std;
int sum_to_n(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int sum_to_n(int n){
| return n*(n+1)/2;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (sum_to_n(1) == 1);
assert (sum_to_n(6) == 21);
assert (sum_to_n(11) == 66);
assert (sum_to_n(30) == 465);
assert (sum_to_n(100) == 5050);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (sum_to_n(1) == 1);
assert (sum_to_n(5) == 15);
assert (sum_to_n(10) == 55);
assert (sum_to_n(30) == 465);
assert (sum_to_n(100) == 5050);
}
| ; ModuleID = 'c_code_test/code_59.cpp'
source_filename = "c_code_test/code_59.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 i32 @_Z8sum_to_ni(i32 noundef %0) local_unnamed_addr #0 {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %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 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
local.get 0
i32.const 1
i32.add
local.get 0
i32.mul
i32.const 2
i32.div_s)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z8sum_to_ni" (func 1)))
| 2 | 24 | 375 | 15 |
CPP/61 | /*
brackets is a string of '(' and ')'.
return true if every opening bracket has a corresponding closing bracket.
>>> correct_bracketing("(")
false
>>> correct_bracketing("()")
true
>>> correct_bracketing("(()())")
true
>>> correct_bracketing(")(()")
false
*/
#include<stdio.h>
#include<string>
using namespace std;
bool correct_bracketing(string brackets){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool correct_bracketing(string brackets){
| int level=0;
for (int i=0;i<brackets.length();i++)
{
if (brackets[i]=='(') level+=1;
if (brackets[i]==')') level-=1;
if (level<0) return false;
}
if (level!=0) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (correct_bracketing("()"));
assert (correct_bracketing("(()())"));
assert (correct_bracketing("()()(()())()"));
assert (correct_bracketing("()()((()()())())(()()(()))"));
assert (not (correct_bracketing("((()())))")));
assert (not (correct_bracketing(")(()")));
assert (not (correct_bracketing("(")));
assert (not (correct_bracketing("((((")));
assert (not (correct_bracketing(")")));
assert (not (correct_bracketing("(()")));
assert (not (correct_bracketing("()()(()())())(()")));
assert (not (correct_bracketing("()()(()())()))()")));
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (correct_bracketing("()"));
assert (correct_bracketing("(()())"));
assert (not (correct_bracketing(")(()")));
assert (not (correct_bracketing("(")));
}
| ; ModuleID = 'c_code_test/code_60.cpp'
source_filename = "c_code_test/code_60.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none)
define noundef zeroext i1 @_Z18correct_bracketingNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
br label %9
9: ; preds = %13, %1
%10 = phi i32 [ 0, %1 ], [ %23, %13 ]
%11 = phi i32 [ 0, %1 ], [ %25, %13 ]
%12 = icmp eq i32 %11, %8
br i1 %12, label %26, label %13
13: ; preds = %9
%14 = load ptr, ptr %0, align 4
%15 = select i1 %4, ptr %14, ptr %0
%16 = getelementptr inbounds i8, ptr %15, i32 %11
%17 = load i8, ptr %16, align 1, !tbaa !3
%18 = icmp eq i8 %17, 40
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %10, %19
%21 = icmp eq i8 %17, 41
%22 = sext i1 %21 to i32
%23 = add nsw i32 %20, %22
%24 = icmp slt i32 %23, 0
%25 = add nuw i32 %11, 1
br i1 %24, label %28, label %9, !llvm.loop !6
26: ; preds = %9
%27 = icmp eq i32 %10, 0
br label %28
28: ; preds = %13, %26
%29 = phi i1 [ %27, %26 ], [ false, %13 ]
ret i1 %29
}
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, !4, i64 0}
!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"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 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
local.tee 5
i32.const 0
i32.lt_s
select
local.set 6
i32.const 0
local.set 1
block ;; label = @1
loop ;; label = @2
local.get 1
local.get 6
i32.ne
if ;; label = @3
local.get 0
i32.load
local.get 0
local.get 5
i32.const 0
i32.lt_s
select
local.get 1
i32.add
local.set 3
local.get 1
i32.const 1
i32.add
local.set 1
local.get 2
local.get 3
i32.load8_u
local.tee 3
i32.const 40
i32.eq
i32.add
local.get 3
i32.const 41
i32.eq
i32.sub
local.tee 2
i32.const 0
i32.ge_s
br_if 1 (;@2;)
br 2 (;@1;)
end
end
local.get 2
i32.eqz
local.set 4
end
local.get 4)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z18correct_bracketingNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 10 | 237 | 1,511 | 67 |
CPP/62 | /*
xs represent coefficients of a polynomial.
xs{0} + xs{1} * x + xs{2} * x^2 + ....
Return derivative of this polynomial in the same form.
>>> derivative({3, 1, 2, 4, 5})
{1, 4, 12, 20}
>>> derivative({1, 2, 3})
{2, 6}
*/
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
vector<float> derivative(vector<float> xs){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<float> derivative(vector<float> xs){
| vector<float> out={};
for (int i=1;i<xs.size();i++)
out.push_back(i*xs[i]);
return out;
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(derivative({3, 1, 2, 4, 5}) , {1, 4, 12, 20}));
assert (issame(derivative({1, 2, 3}) , {2, 6}));
assert (issame(derivative({3, 2, 1}) , {2, 2}));
assert (issame(derivative({3, 2, 1, 0, 4}) , {2, 2, 0, 16}));
assert (issame(derivative({1}) , {}));
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<float> a,vector<float>b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (abs(a[i]-b[i])>1e-4) return false;
}
return true;
}
int main(){
assert (issame(derivative({3, 1, 2, 4, 5}) , {1, 4, 12, 20}));
assert (issame(derivative({1, 2, 3}) , {2, 6}));
}
| ; ModuleID = 'c_code_test/code_61.cpp'
source_filename = "c_code_test/code_61.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__26vectorIfNS_9allocatorIfEEE9push_backB7v160006EOf = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIfEEvOT_ = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEEC2EmmS3_ = comdat any
$_ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev = comdat any
$_ZNKSt3__26vectorIfNS_9allocatorIfEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorIfE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev = comdat any
$_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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 @_Z10derivativeNSt3__26vectorIfNS_9allocatorIfEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca float, 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
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
br label %7
7: ; preds = %16, %2
%8 = phi i32 [ 1, %2 ], [ %21, %16 ]
%9 = load ptr, ptr %6, align 4, !tbaa !10
%10 = load ptr, ptr %1, align 4, !tbaa !3
%11 = ptrtoint ptr %9 to i32
%12 = ptrtoint ptr %10 to i32
%13 = sub i32 %11, %12
%14 = ashr exact i32 %13, 2
%15 = icmp ult i32 %8, %14
br i1 %15, label %16, label %22
16: ; preds = %7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #13
%17 = sitofp i32 %8 to float
%18 = getelementptr inbounds float, ptr %10, i32 %8
%19 = load float, ptr %18, align 4, !tbaa !12
%20 = fmul float %19, %17
store float %20, ptr %3, align 4, !tbaa !12
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE9push_backB7v160006EOf(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %3) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #13
%21 = add nuw nsw i32 %8, 1
br label %7, !llvm.loop !14
22: ; preds = %7
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__26vectorIfNS_9allocatorIfEEE9push_backB7v160006EOf(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 !16
%7 = icmp ult ptr %4, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load float, ptr %1, align 4, !tbaa !12
store float %9, ptr %4, align 4, !tbaa !12
%10 = getelementptr inbounds float, ptr %4, i32 1
store ptr %10, ptr %3, align 4, !tbaa !10
br label %12
11: ; preds = %2
tail call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIfEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #14
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: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIfEEvOT_(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) #13
%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__26vectorIfNS_9allocatorIfEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #14
%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_bufferIfRNS_9allocatorIfEEEC2EmmS3_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %13, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #14
%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 float, ptr %1, align 4, !tbaa !12
store float %23, ptr %22, align 4, !tbaa !12
%24 = getelementptr inbounds float, ptr %22, i32 1
store ptr %24, ptr %21, align 4, !tbaa !17
call void @_ZNSt3__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #14
%25 = call noundef ptr @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #15
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #13
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorIfNS_9allocatorIfEEE11__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__26vectorIfNS_9allocatorIfEEE20__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 !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_bufferIfRNS_9allocatorIfEEEC2EmmS3_(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 !16
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call noundef ptr @_ZNSt3__29allocatorIfE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #14, !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 float, 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 float, 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__26vectorIfNS_9allocatorIfEEE26__swap_out_circular_bufferERNS_14__split_bufferIfRS2_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 !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 float, ptr %9, i32 -1
%14 = load float, ptr %13, align 4, !tbaa !12, !noalias !26
%15 = getelementptr inbounds float, ptr %10, i32 -1
store float %14, ptr %15, align 4, !tbaa !12, !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_bufferIfRNS_9allocatorIfEEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #5 comdat {
tail call void @_ZNSt3__214__split_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev(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__26vectorIfNS_9allocatorIfEEE20__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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
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__29allocatorIfE8allocateB7v160006Em(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) #13
%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_bufferIfRNS_9allocatorIfEEE5clearB7v160006Ev(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_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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_bufferIfRNS_9allocatorIfEEE17__destruct_at_endB7v160006EPfNS_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 float, 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 = { 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 = { 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 = { nounwind }
attributes #14 = { minsize optsize }
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, !5, i64 0}
!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 4}
!11 = !{!9, !5, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!5, !5, i64 0}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferIfRNS_9allocatorIfEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPfRNS_9allocatorIfEEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIfEELi1ELb0EEE", !5, i64 0}
!21 = !{!22}
!22 = distinct !{!22, !23, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!23 = distinct !{!23, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIfEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!24 = !{!18, !5, i64 0}
!25 = !{!18, !5, i64 4}
!26 = !{!27, !29}
!27 = distinct !{!27, !28, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPfEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!28 = distinct !{!28, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPfEES6_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_iteratorIPfEES9_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_iteratorIPfEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!31 = distinct !{!31, !15}
!32 = !{!33, !33, i64 0}
!33 = !{!"vtable pointer", !7, 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)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func))
(import "env" "_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIfEEvOT_" (func (;0;) (type 0)))
(import "env" "_ZdlPv" (func (;1;) (type 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 1)))
(import "env" "__cxa_throw" (func (;3;) (type 3)))
(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 0) (param i32 i32)
(local i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
i32.const 1
local.set 2
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.get 2
i32.gt_u
if ;; label = @2
local.get 4
local.get 3
local.get 2
i32.const 2
i32.shl
i32.add
f32.load
local.get 2
f32.convert_i32_s
f32.mul
f32.store offset=12
local.get 4
i32.const 12
i32.add
local.set 3
block ;; label = @3
local.get 0
i32.load offset=4
local.tee 5
local.get 0
i32.load offset=8
i32.lt_u
if ;; label = @4
local.get 5
local.get 3
f32.load
f32.store
local.get 0
local.get 5
i32.const 4
i32.add
i32.store offset=4
br 1 (;@3;)
end
local.get 0
local.get 3
call 0
end
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
local.get 4
i32.const 16
i32.add
global.set 0)
(func (;9;) (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
f32.load
f32.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
f32.load
f32.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 "_Z10derivativeNSt3__26vectorIfNS_9allocatorIfEEEE" (func 8))
(export "_ZNSt3__26vectorIfNS_9allocatorIfEEE21__push_back_slow_pathIfEEvOT_" (func 9))
(data (;0;) (global.get 1) "vector\00"))
| 5 | 110 | 7,019 | 333 |
CPP/63 | /*
The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:
fibfib(0) == 0
fibfib(1) == 0
fibfib(2) == 1
fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).
Please write a function to efficiently compute the n-th element of the fibfib number sequence.
>>> fibfib(1)
0
>>> fibfib(5)
4
>>> fibfib(8)
24
*/
#include<stdio.h>
using namespace std;
int fibfib(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int fibfib(int n){
| int ff[100];
ff[0]=0;
ff[1]=0;
ff[2]=1;
for (int i=3;i<=n;i++)
ff[i]=ff[i-1]+ff[i-2]+ff[i-3];
return ff[n];
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fibfib(2) == 1);
assert (fibfib(1) == 0);
assert (fibfib(5) == 4);
assert (fibfib(8) == 24);
assert (fibfib(10) == 81);
assert (fibfib(12) == 274);
assert (fibfib(14) == 927);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fibfib(1) == 0);
assert (fibfib(5) == 4);
assert (fibfib(8) == 24);
}
| ; ModuleID = 'c_code_test/code_62.cpp'
source_filename = "c_code_test/code_62.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z6fibfibi(i32 noundef %0) local_unnamed_addr #0 {
%2 = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %2) #3
store i32 0, ptr %2, align 16, !tbaa !3
%3 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 1
store i32 0, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 2
store i32 1, ptr %4, align 8, !tbaa !3
%5 = tail call i32 @llvm.smax.i32(i32 %0, i32 2)
%6 = add nuw i32 %5, 1
br label %7
7: ; preds = %15, %1
%8 = phi i32 [ 0, %1 ], [ %18, %15 ]
%9 = phi i32 [ 1, %1 ], [ %20, %15 ]
%10 = phi i32 [ 3, %1 ], [ %22, %15 ]
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %0
%14 = load i32, ptr %13, align 4, !tbaa !3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %2) #3
ret i32 %14
15: ; preds = %7
%16 = add nsw i32 %10, -2
%17 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %16
%18 = load i32, ptr %17, align 4, !tbaa !3
%19 = add nsw i32 %18, %9
%20 = add nsw i32 %19, %8
%21 = getelementptr inbounds [100 x i32], ptr %2, i32 0, i32 %10
store i32 %20, ptr %21, align 4, !tbaa !3
%22 = add nuw i32 %10, 1
br label %7, !llvm.loop !7
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #2
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(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 willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }
!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 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 400
i32.sub
local.tee 1
global.set 0
local.get 1
i32.const 1
i32.store offset=8
local.get 1
i64.const 0
i64.store
i32.const 2
local.get 0
local.get 0
i32.const 2
i32.le_s
select
i32.const 1
i32.add
local.set 5
i32.const 3
local.set 2
i32.const 1
local.set 4
loop (result i32) ;; label = @1
local.get 2
local.get 5
i32.eq
if (result i32) ;; label = @2
local.get 1
local.get 0
i32.const 2
i32.shl
i32.add
i32.load
local.get 1
i32.const 400
i32.add
global.set 0
else
local.get 1
local.get 2
i32.const 2
i32.shl
i32.add
local.tee 6
local.get 3
local.get 4
i32.add
local.get 6
i32.const 8
i32.sub
i32.load
local.tee 3
i32.add
local.tee 4
i32.store
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z6fibfibi" (func 1)))
| 9 | 143 | 1,538 | 75 |
CPP/64 | /*
Write a function vowels_count which takes a string representing a word as input and returns the number of vowels in the string. Vowels in this case are 'a', 'e', 'i', 'o', 'u'.
Here, 'y' is also a vowel, but only when it is at the end of the given word.
Example:
>>> vowels_count("abcde")
2
>>> vowels_count("ACEDY")
3
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
int vowels_count(string s){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
int vowels_count(string s){
| string vowels="aeiouAEIOU";
int count=0;
for (int i=0;i<s.length();i++)
if (find(vowels.begin(),vowels.end(),s[i])!=vowels.end())
count+=1;
if (s[s.length()-1]=='y' or s[s.length()-1]=='Y') count+=1;
return count;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (vowels_count("abcde") == 2);
assert (vowels_count("Alone") == 3);
assert (vowels_count("key") == 2);
assert (vowels_count("bye") == 1);
assert (vowels_count("keY") == 2);
assert (vowels_count("bYe") == 1);
assert (vowels_count("ACEDY") == 3);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (vowels_count("abcde") == 2);
assert (vowels_count("ACEDY") == 3);
}
| ; ModuleID = 'c_code_test/code_63.cpp'
source_filename = "c_code_test/code_63.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_ = comdat any
@.str = private unnamed_addr constant [11 x i8] c"aeiouAEIOU\00", align 1
; Function Attrs: minsize optsize
define noundef i32 @_Z12vowels_countNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #7
%3 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull @.str) #8
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
br label %8
8: ; preds = %23, %1
%9 = phi i32 [ 0, %1 ], [ %47, %23 ]
%10 = phi i32 [ 0, %1 ], [ %46, %23 ]
%11 = load i8, ptr %4, align 1
%12 = icmp slt i8 %11, 0
%13 = load i32, ptr %5, align 4
%14 = zext i8 %11 to i32
%15 = select i1 %12, i32 %13, i32 %14
%16 = icmp ult i32 %9, %15
br i1 %16, label %23, label %17
17: ; preds = %8
%18 = add i32 %15, -1
%19 = load ptr, ptr %0, align 4
%20 = select i1 %12, ptr %19, ptr %0
%21 = getelementptr inbounds i8, ptr %20, i32 %18
%22 = load i8, ptr %21, align 1, !tbaa !3
switch i8 %22, label %50 [
i8 121, label %48
i8 89, label %48
]
23: ; preds = %8
%24 = load i8, ptr %6, align 1
%25 = icmp slt i8 %24, 0
%26 = load ptr, ptr %2, align 4
%27 = select i1 %25, ptr %26, ptr %2
%28 = load i32, ptr %7, align 4
%29 = zext i8 %24 to i32
%30 = select i1 %25, i32 %28, i32 %29
%31 = getelementptr inbounds i8, ptr %27, i32 %30
%32 = load ptr, ptr %0, align 4
%33 = select i1 %12, ptr %32, ptr %0
%34 = getelementptr inbounds i8, ptr %33, i32 %9
%35 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %27, ptr %31, ptr noundef nonnull align 1 dereferenceable(1) %34) #8
%36 = load i8, ptr %6, align 1
%37 = icmp slt i8 %36, 0
%38 = load ptr, ptr %2, align 4
%39 = select i1 %37, ptr %38, ptr %2
%40 = load i32, ptr %7, align 4
%41 = zext i8 %36 to i32
%42 = select i1 %37, i32 %40, i32 %41
%43 = getelementptr inbounds i8, ptr %39, i32 %42
%44 = icmp ne ptr %35, %43
%45 = zext i1 %44 to i32
%46 = add nuw nsw i32 %10, %45
%47 = add nuw nsw i32 %9, 1
br label %8, !llvm.loop !6
48: ; preds = %17, %17
%49 = add nuw nsw i32 %10, 1
br label %50
50: ; preds = %17, %48
%51 = phi i32 [ %49, %48 ], [ %10, %17 ]
%52 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #9
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
ret i32 %51
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #9
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #8
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #2 comdat {
%4 = ptrtoint ptr %0 to i32
%5 = ptrtoint ptr %1 to i32
%6 = load i8, ptr %2, align 1
%7 = sub i32 %5, %4
%8 = getelementptr i8, ptr %0, i32 %7
br label %9
9: ; preds = %15, %3
%10 = phi ptr [ %0, %3 ], [ %16, %15 ]
%11 = icmp eq ptr %10, %1
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = load i8, ptr %10, align 1, !tbaa !3
%14 = icmp eq i8 %13, %6
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, ptr %10, i32 1
br label %9, !llvm.loop !8
17: ; preds = %12, %9
%18 = phi ptr [ %10, %12 ], [ %8, %9 ]
ret ptr %18
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #5
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #6
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 nounwind 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { nounwind }
attributes #8 = { minsize optsize }
attributes #9 = { minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = distinct !{!8, !7}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;4;) (type 3))
(func (;5;) (type 0) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 7
global.set 0
local.get 7
i32.const 4
i32.add
global.get 1
call 0
local.set 2
loop (result i32) ;; label = @1
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
local.tee 1
i32.const 0
i32.lt_s
local.tee 5
select
local.tee 3
local.get 4
i32.le_u
if (result i32) ;; label = @2
local.get 6
i32.const 1
i32.add
local.get 6
local.get 3
local.get 0
i32.load
local.get 0
local.get 1
i32.const 0
i32.lt_s
select
i32.add
i32.const 1
i32.sub
i32.load8_u
i32.const 32
i32.or
i32.const 121
i32.eq
select
local.get 2
call 1
drop
local.get 7
i32.const 16
i32.add
global.set 0
else
local.get 6
block (result i32) ;; label = @3
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 8
select
local.set 1
local.get 1
local.get 2
i32.load offset=4
local.get 3
local.get 8
select
i32.add
local.set 3
local.get 0
i32.load
local.get 0
local.get 5
select
local.get 4
i32.add
i32.load8_u
local.set 5
loop ;; label = @4
block ;; label = @5
local.get 1
local.get 3
i32.ne
if (result i32) ;; label = @6
local.get 1
i32.load8_u
local.get 5
i32.ne
br_if 1 (;@5;)
local.get 1
else
local.get 3
end
br 2 (;@3;)
end
local.get 1
i32.const 1
i32.add
local.set 1
br 0 (;@4;)
end
unreachable
end
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.get 2
i32.load offset=4
local.get 1
local.get 3
select
i32.add
i32.ne
i32.add
local.set 6
local.get 4
i32.const 1
i32.add
local.set 4
br 1 (;@1;)
end
end)
(func (;6;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 4))
(export "__wasm_apply_data_relocs" (func 4))
(export "_Z12vowels_countNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 5))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 6))
(data (;0;) (global.get 1) "aeiouAEIOU\00"))
| 8 | 248 | 4,166 | 167 |
CPP/65 | /*
Circular shift the digits of the integer x, shift the digits right by shift
and return the result as a string.
If shift > number of digits, return digits reversed.
>>> circular_shift(12, 1)
"21"
>>> circular_shift(12, 2)
"12"
*/
#include<stdio.h>
#include<string>
using namespace std;
string circular_shift(int x,int shift){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string circular_shift(int x,int shift){
| string xs;
xs=to_string(x);
if (xs.length()<shift)
{
string s(xs.rbegin(),xs.rend());
return s;
}
xs=xs.substr(xs.length()-shift)+xs.substr(0,xs.length()-shift);
return xs;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (circular_shift(100, 2) == "001");
assert (circular_shift(12, 2) == "12");
assert (circular_shift(97, 8) == "79");
assert (circular_shift(12, 1) == "21");
assert (circular_shift(11, 101) == "11");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (circular_shift(12, 2) == "12");
assert (circular_shift(12, 1) == "21");
}
| ; ModuleID = 'c_code_test/code_64.cpp'
source_filename = "c_code_test/code_64.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_SA_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_ = comdat any
@.str = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z14circular_shiftii(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
%8 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #14
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #14
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, i32 noundef %1) #15
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5) #16
%9 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #14
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %4, i32 0, i32 2
%11 = load i8, ptr %10, align 1
%12 = icmp slt i8 %11, 0
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %4, i32 0, i32 1
%14 = load i32, ptr %13, align 4
%15 = zext i8 %11 to i32
%16 = select i1 %12, i32 %14, i32 %15
%17 = icmp ult i32 %16, %2
br i1 %17, label %18, label %22
18: ; preds = %3
%19 = load ptr, ptr %4, align 4
%20 = select i1 %12, ptr %19, ptr %4
%21 = getelementptr inbounds i8, ptr %20, i32 %16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %21, ptr %20) #15
br label %33
22: ; preds = %3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #14
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #14
%23 = sub i32 %16, %2
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 noundef %23, i32 noundef -1) #15
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #14
%24 = load i8, ptr %10, align 1
%25 = icmp slt i8 %24, 0
%26 = load i32, ptr %13, align 4
%27 = zext i8 %24 to i32
%28 = select i1 %25, i32 %26, i32 %27
%29 = sub i32 %28, %2
call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 noundef 0, i32 noundef %29) #15
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_SA_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8) #15
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6) #16
%30 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #16
%31 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #14
%32 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #14
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
br label %33
33: ; preds = %18, %22
%34 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #14
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: minsize optsize
declare void @_ZNSt3__29to_stringEi(ptr sret(%"class.std::__2::basic_string") align 4, i32 noundef) local_unnamed_addr #0
; 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 #2
; 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 optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_SA_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #3 comdat {
%4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #15
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrB7v160006Emm(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 comdat {
%5 = alloca %"class.std::__2::allocator", align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #14
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(1) %5) #15
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #14
ret void
}
; 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: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #7 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #17
br label %8
8: ; preds = %6, %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 !6
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr %1, ptr %2) local_unnamed_addr #8 comdat {
%4 = ptrtoint ptr %1 to i32
%5 = ptrtoint ptr %2 to i32
%6 = sub i32 %4, %5
%7 = icmp ugt i32 %6, 2147483631
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
unreachable
9: ; preds = %3
%10 = icmp ult i32 %6, 11
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = trunc i32 %6 to i8
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %12, ptr %13, align 1
br label %21
14: ; preds = %9
%15 = or i32 %6, 15
%16 = add nuw i32 %15, 1
%17 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %16) #19, !noalias !11
store ptr %17, ptr %0, align 4, !tbaa !3
%18 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%19 = or i32 %16, -2147483648
store i32 %19, ptr %18, align 4
%20 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %6, ptr %20, align 4, !tbaa !3
br label %21
21: ; preds = %14, %11
%22 = phi ptr [ %0, %11 ], [ %17, %14 ]
br label %23
23: ; preds = %21, %27
%24 = phi ptr [ %28, %27 ], [ %1, %21 ]
%25 = phi ptr [ %30, %27 ], [ %22, %21 ]
%26 = icmp eq ptr %24, %2
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = getelementptr inbounds i8, ptr %24, i32 -1
%29 = load i8, ptr %28, align 1, !tbaa !3
store i8 %29, ptr %25, align 1, !tbaa !3
%30 = getelementptr inbounds i8, ptr %25, i32 1
br label %23, !llvm.loop !14
31: ; preds = %23
store i8 0, ptr %25, align 1, !tbaa !3
ret void
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #9 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #18
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #10 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) #15
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #20
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) #15
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !16
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #11
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #12
; Function Attrs: minsize optsize
declare noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #13 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
%6 = load ptr, ptr %1, align 4
%7 = select i1 %5, ptr %6, ptr %1
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %7, i32 noundef %11) #15
ret ptr %12
}
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #0
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize 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 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { nounwind }
attributes #15 = { minsize optsize }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { builtin minsize nounwind optsize }
attributes #18 = { minsize noreturn optsize }
attributes #19 = { builtin minsize optsize allocsize(0) }
attributes #20 = { noreturn }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = !{i64 0, i64 4, !7, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 11, i64 4, !9, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !4, i64 0}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !4, i64 0}
!11 = !{!12}
!12 = distinct !{!12, !13, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!13 = distinct !{!13, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIcEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !5, i64 0}
| (module
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32 i32 i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func (param i32 i32) (result i32)))
(type (;6;) (func (param i32 i32 i32) (result i32)))
(type (;7;) (func))
(type (;8;) (func (param i32 i32 i32 i32)))
(import "env" "_ZNSt3__29to_stringEi" (func (;0;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_" (func (;3;) (type 3)))
(import "env" "_ZdlPv" (func (;4;) (type 4)))
(import "env" "_Znwm" (func (;5;) (type 1)))
(import "env" "__cxa_allocate_exception" (func (;6;) (type 1)))
(import "env" "__cxa_throw" (func (;7;) (type 0)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;8;) (type 5)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm" (func (;9;) (type 6)))
(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 "env" "memory" (memory (;0;) 1))
(func (;10;) (type 7))
(func (;11;) (type 0) (param i32 i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const -64
i32.add
local.tee 3
global.set 0
local.get 3
i32.const 0
i32.store offset=56
local.get 3
i64.const 0
i64.store offset=48
local.get 3
i32.const 36
i32.add
local.tee 4
local.get 1
call 0
local.get 3
i32.const 48
i32.add
local.tee 5
local.get 4
call 12
local.get 4
call 1
drop
block ;; label = @1
local.get 2
local.get 3
i32.load offset=52
local.get 3
i32.load8_s offset=59
local.tee 1
i32.const 255
i32.and
local.get 1
i32.const 0
i32.lt_s
local.tee 4
select
local.tee 1
i32.gt_u
if ;; label = @2
local.get 0
local.get 3
i32.load offset=48
local.get 5
local.get 4
select
local.tee 0
local.get 1
i32.add
local.get 0
call 2
br 1 (;@1;)
end
local.get 3
i32.const 24
i32.add
local.tee 5
local.get 3
i32.const 48
i32.add
local.tee 6
local.get 1
local.get 2
i32.sub
i32.const -1
call 14
local.get 3
i32.const 12
i32.add
local.tee 1
local.get 6
i32.const 0
local.get 3
i32.load offset=52
local.get 3
i32.load8_s offset=59
local.tee 4
i32.const 255
i32.and
local.get 4
i32.const 0
i32.lt_s
select
local.get 2
i32.sub
call 14
local.get 3
i32.const 36
i32.add
local.tee 2
local.get 5
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.get 1
i32.load offset=4
local.get 4
local.get 7
select
call 9
local.tee 4
i64.load align=4
i64.store align=4
local.get 2
local.get 4
i32.load offset=8
i32.store offset=8
local.get 4
i64.const 0
i64.store align=4
local.get 4
i32.const 0
i32.store offset=8
local.get 6
local.get 2
call 12
local.get 2
call 1
drop
local.get 1
call 1
drop
local.get 5
call 1
drop
local.get 0
local.get 3
i32.load offset=56
i32.store offset=8
local.get 0
local.get 3
i64.load offset=48
i64.store align=4
local.get 3
i32.const 0
i32.store offset=56
local.get 3
i64.const 0
i64.store offset=48
end
local.get 3
i32.const 48
i32.add
call 1
drop
local.get 3
i32.const -64
i32.sub
global.set 0)
(func (;12;) (type 2) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 4
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(func (;13;) (type 0) (param i32 i32 i32)
(local i32 i32 i32)
local.get 1
local.get 2
i32.sub
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @1
block ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
local.get 3
i32.store8 offset=11
br 1 (;@2;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 5
call 5
local.set 4
local.get 0
local.get 5
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
local.get 4
i32.store
local.get 0
local.get 3
i32.store offset=4
local.get 4
local.set 0
end
loop ;; label = @2
local.get 1
local.get 2
i32.ne
if ;; label = @3
local.get 0
local.get 1
i32.const 1
i32.sub
local.tee 1
i32.load8_u
i32.store8
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@2;)
end
end
local.get 0
i32.const 0
i32.store8
return
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 6
global.get 4
local.set 4
global.get 1
call 8
local.tee 2
local.get 4
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 7
unreachable)
(func (;14;) (type 8) (param i32 i32 i32 i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 0
local.get 1
local.get 2
local.get 3
local.get 4
i32.const 15
i32.add
call 3
drop
local.get 4
i32.const 16
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 10))
(export "__wasm_apply_data_relocs" (func 10))
(export "_Z14circular_shiftii" (func 11))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initINS_16reverse_iteratorINS_11__wrap_iterIPcEEEEEENS_9enable_ifIXsr27__is_cpp17_forward_iteratorIT_EE5valueEvE4typeESD_SD_" (func 13))
(data (;0;) (global.get 1) "basic_string\00"))
| 10 | 219 | 7,390 | 323 |
CPP/66 | /*
Task
Write a function that takes a string as input and returns the sum of the upper characters only's
ASCII codes.
Examples:
digitSum("") => 0
digitSum("abAB") => 131
digitSum("abcCd") => 67
digitSum("helloE") => 69
digitSum("woArBld") => 131
digitSum("aAaaaXa") => 153
*/
#include<stdio.h>
#include<string>
using namespace std;
int digitSum(string s){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int digitSum(string s){
| int sum=0;
for (int i=0;i<s.length();i++)
if (s[i]>=65 and s[i]<=90)
sum+=s[i];
return sum;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (digitSum("") == 0);
assert (digitSum("abAB") == 131);
assert (digitSum("abcCd") == 67);
assert (digitSum("helloE") == 69);
assert (digitSum("woArBld") == 131);
assert (digitSum("aAaaaXa") == 153);
assert (digitSum(" How are yOu?") == 151);
assert (digitSum("You arE Very Smart") == 327);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (digitSum("") == 0);
assert (digitSum("abAB") == 131);
assert (digitSum("abcCd") == 67);
assert (digitSum("helloE") == 69);
assert (digitSum("woArBld") == 131);
assert (digitSum("aAaaaXa") == 153);
}
| ; ModuleID = 'c_code_test/code_65.cpp'
source_filename = "c_code_test/code_65.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none)
define noundef i32 @_Z8digitSumNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
br label %9
9: ; preds = %14, %1
%10 = phi i32 [ 0, %1 ], [ %23, %14 ]
%11 = phi i32 [ 0, %1 ], [ %24, %14 ]
%12 = icmp eq i32 %11, %8
br i1 %12, label %13, label %14
13: ; preds = %9
ret i32 %10
14: ; preds = %9
%15 = load ptr, ptr %0, align 4
%16 = select i1 %4, ptr %15, ptr %0
%17 = getelementptr inbounds i8, ptr %16, i32 %11
%18 = load i8, ptr %17, align 1, !tbaa !3
%19 = add i8 %18, -65
%20 = icmp ult i8 %19, 26
%21 = select i1 %20, i8 %18, i8 0
%22 = zext i8 %21 to i32
%23 = add nuw nsw i32 %10, %22
%24 = add nuw i32 %11, 1
br label %9, !llvm.loop !6
}
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, !4, i64 0}
!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"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 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.set 4
i32.const 0
local.set 1
loop (result i32) ;; label = @1
local.get 1
local.get 4
i32.eq
if (result i32) ;; label = @2
local.get 2
else
local.get 2
local.get 0
i32.load
local.get 0
local.get 3
select
local.get 1
i32.add
i32.load8_u
local.tee 5
i32.const 0
local.get 5
i32.const 65
i32.sub
i32.const 255
i32.and
i32.const 26
i32.lt_u
select
i32.const 255
i32.and
i32.add
local.set 2
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z8digitSumNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 6 | 126 | 1,341 | 61 |
CPP/67 | /*
In this task, you will be given a string that represents a number of apples and oranges
that are distributed in a basket of fruit this basket contains
apples, oranges, and mango fruits. Given the string that represents the total number of
the oranges and apples and an integer that represent the total number of the fruits
in the basket return the number of the mango fruits in the basket.
for example:
fruit_distribution("5 apples and 6 oranges", 19) ->19 - 5 - 6 = 8
fruit_distribution("0 apples and 1 oranges",3) -> 3 - 0 - 1 = 2
fruit_distribution("2 apples and 3 oranges", 100) -> 100 - 2 - 3 = 95
fruit_distribution("100 apples and 1 oranges",120) -> 120 - 100 - 1 = 19
*/
#include<stdio.h>
#include<string>
using namespace std;
int fruit_distribution(string s,int n){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int fruit_distribution(string s,int n){
| string num1="",num2="";
int is12;
is12=0;
for (int i=0;i<s.size();i++)
if (s[i]>=48 and s[i]<=57)
{
if (is12==0) num1=num1+s[i];
if (is12==1) num2=num2+s[i];
}
else
if (is12==0 and num1.length()>0) is12=1;
return n-atoi(num1.c_str())-atoi(num2.c_str());
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fruit_distribution("5 apples and 6 oranges",19) == 8);
assert (fruit_distribution("5 apples and 6 oranges",21) == 10);
assert (fruit_distribution("0 apples and 1 oranges",3) == 2);
assert (fruit_distribution("1 apples and 0 oranges",3) == 2);
assert (fruit_distribution("2 apples and 3 oranges",100) == 95);
assert (fruit_distribution("2 apples and 3 oranges",5) == 0);
assert (fruit_distribution("1 apples and 100 oranges",120) == 19);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (fruit_distribution("5 apples and 6 oranges",19) == 8);
assert (fruit_distribution("0 apples and 1 oranges",3) == 2);
assert (fruit_distribution("2 apples and 3 oranges",100) == 95);
assert (fruit_distribution("1 apples and 100 oranges",120) == 19);
}
| ; ModuleID = 'c_code_test/code_66.cpp'
source_filename = "c_code_test/code_66.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize mustprogress optsize
define noundef i32 @_Z18fruit_distributionNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #16
%7 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #17
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #16
%8 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull @.str) #17
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%11 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
br label %13
13: ; preds = %60, %2
%14 = phi i32 [ 0, %2 ], [ %61, %60 ]
%15 = phi i32 [ 0, %2 ], [ %62, %60 ]
%16 = load i8, ptr %9, align 1
%17 = icmp slt i8 %16, 0
%18 = load i32, ptr %10, align 4
%19 = zext i8 %16 to i32
%20 = select i1 %17, i32 %18, i32 %19
%21 = icmp ult i32 %15, %20
br i1 %21, label %38, label %22
22: ; preds = %13
%23 = load i8, ptr %11, align 1
%24 = icmp slt i8 %23, 0
%25 = load ptr, ptr %3, align 4
%26 = select i1 %24, ptr %25, ptr %3
%27 = call i32 @atoi(ptr nocapture noundef %26) #17
%28 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %4, i32 0, i32 2
%29 = load i8, ptr %28, align 1
%30 = icmp slt i8 %29, 0
%31 = load ptr, ptr %4, align 4
%32 = select i1 %30, ptr %31, ptr %4
%33 = call i32 @atoi(ptr nocapture noundef %32) #17
%34 = add i32 %27, %33
%35 = sub i32 %1, %34
%36 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #16
%37 = 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 i32 %35
38: ; preds = %13
%39 = load ptr, ptr %0, align 4
%40 = select i1 %17, ptr %39, ptr %0
%41 = getelementptr inbounds i8, ptr %40, i32 %15
%42 = load i8, ptr %41, align 1, !tbaa !3
%43 = add i8 %42, -48
%44 = icmp ult i8 %43, 10
br i1 %44, label %45, label %50
45: ; preds = %38
switch i32 %14, label %60 [
i32 0, label %46
i32 1, label %48
]
46: ; preds = %45
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #16
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext %42) #17
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %5) #18
%47 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #16
br label %60
48: ; preds = %45
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #16
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %4, i8 noundef signext %42) #17
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6) #18
%49 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #16
br label %60
50: ; preds = %38
%51 = icmp eq i32 %14, 0
br i1 %51, label %52, label %60
52: ; preds = %50
%53 = load i8, ptr %11, align 1
%54 = icmp slt i8 %53, 0
%55 = load i32, ptr %12, align 4
%56 = zext i8 %53 to i32
%57 = select i1 %54, i32 %55, i32 %56
%58 = icmp ne i32 %57, 0
%59 = zext i1 %58 to i32
br label %60
60: ; preds = %52, %46, %45, %48, %50
%61 = phi i32 [ 1, %48 ], [ 0, %46 ], [ 1, %50 ], [ 0, %45 ], [ %59, %52 ]
%62 = add nuw nsw i32 %15, 1
br label %13, !llvm.loop !6
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #2 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #18
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #17
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #2 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #16
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #17
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #16
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !8
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(read)
declare i32 @atoi(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #7
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__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) #20
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 #2 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 !19
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #10
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 #2
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #11
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #12
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #2 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #19
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #21
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #14
; 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) #12
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #15 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #22
br label %8
8: ; preds = %6, %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 !21
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
attributes #0 = { minsize mustprogress 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 = { 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 mustprogress nofree nounwind optsize willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { inlinehint minsize 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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #13 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #15 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #16 = { nounwind }
attributes #17 = { minsize optsize }
attributes #18 = { minsize nounwind optsize }
attributes #19 = { minsize noreturn optsize }
attributes #20 = { noreturn }
attributes #21 = { builtin minsize optsize allocsize(0) }
attributes #22 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !11, !13, !15, !17}
!9 = distinct !{!9, !10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!11 = distinct !{!11, !12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!12 = distinct !{!12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!13 = distinct !{!13, !14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!14 = distinct !{!14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!15 = distinct !{!15, !16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!17 = distinct !{!17, !18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !5, i64 0}
!21 = !{i64 0, i64 4, !22, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 11, i64 4, !24, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !4, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "atoi" (func (;2;) (type 0)))
(import "env" "strlen" (func (;3;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;4;) (type 2)))
(import "env" "memmove" (func (;5;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;6;) (type 0)))
(import "env" "__cxa_throw" (func (;7;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;8;) (type 1)))
(import "env" "_Znwm" (func (;9;) (type 0)))
(import "env" "_ZdlPv" (func (;10;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;11;) (type 5))
(func (;12;) (type 1) (param i32 i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 6
global.set 0
local.get 6
i32.const 36
i32.add
global.get 1
i32.const 12
i32.add
local.tee 2
call 0
local.set 4
local.get 6
i32.const 24
i32.add
local.get 2
call 0
local.set 5
i32.const 0
local.set 2
loop ;; label = @1
local.get 7
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 8
select
i32.ge_u
i32.eqz
if ;; label = @2
local.get 2
local.set 3
block ;; label = @3
local.get 0
i32.load
local.get 0
local.get 8
select
local.get 7
i32.add
i32.load8_u
local.tee 8
i32.const 48
i32.sub
i32.const 255
i32.and
i32.const 9
i32.le_u
if ;; label = @4
i32.const 0
local.set 2
block ;; label = @5
block ;; label = @6
local.get 3
br_table 0 (;@6;) 1 (;@5;) 3 (;@3;)
end
local.get 6
i32.const 12
i32.add
local.tee 3
local.get 4
local.get 8
i32.extend8_s
call 14
local.get 4
local.get 3
call 15
local.get 3
call 1
drop
br 2 (;@3;)
end
local.get 6
i32.const 12
i32.add
local.tee 3
local.get 5
local.get 8
i32.extend8_s
call 14
local.get 5
local.get 3
call 15
local.get 3
call 1
drop
i32.const 1
local.set 2
br 1 (;@3;)
end
i32.const 1
local.set 2
local.get 3
br_if 0 (;@3;)
local.get 4
i32.load offset=4
local.get 4
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
i32.const 0
i32.ne
local.set 2
end
local.get 7
i32.const 1
i32.add
local.set 7
br 1 (;@1;)
end
end
local.get 4
i32.load
local.get 4
local.get 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
call 2
local.set 0
local.get 5
i32.load
local.get 5
local.get 5
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
call 2
local.set 2
local.get 5
call 1
drop
local.get 4
call 1
drop
local.get 6
i32.const 48
i32.add
global.set 0
local.get 1
local.get 0
local.get 2
i32.add
i32.sub)
(func (;13;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 3
call 4
local.get 0)
(func (;14;) (type 2) (param i32 i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 5
global.set 0
block (result i32) ;; 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
select
local.tee 4
i32.const 1
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @2
local.get 3
i32.const 10
i32.le_u
if ;; label = @3
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 3
i32.store8 offset=11
local.get 0
br 2 (;@1;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 6
call 9
local.set 7
local.get 0
local.get 3
i32.store offset=4
local.get 0
local.get 7
i32.store
local.get 0
local.get 6
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
br 1 (;@1;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 6
global.get 4
local.set 3
global.get 1
call 8
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 7
unreachable
end
local.tee 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 4
call 5
local.get 4
i32.add
local.tee 0
local.get 2
i32.store8
local.get 0
i32.const 0
i32.store8 offset=1
local.get 5
i32.const 16
i32.add
global.set 0)
(func (;15;) (type 6) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 10
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(export "__wasm_call_ctors" (func 11))
(export "__wasm_apply_data_relocs" (func 11))
(export "_Z18fruit_distributionNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi" (func 12))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 13))
(data (;0;) (global.get 1) "basic_string\00"))
| 15 | 352 | 7,696 | 336 |
CPP/68 | /*
Given a vector representing a branch of a tree that has non-negative integer nodes
your task is to pluck one of the nodes and return it.
The plucked node should be the node with the smallest even value.
If multiple nodes with the same smallest even value are found return the node that has smallest index.
The plucked node should be returned in a vector, { smalest_value, its index },
If there are no even values or the given vector is empty, return {}.
Example 1:
Input: {4,2,3}
Output: {2, 1}
Explanation: 2 has the smallest even value, and 2 has the smallest index.
Example 2:
Input: {1,2,3}
Output: {2, 1}
Explanation: 2 has the smallest even value, and 2 has the smallest index.
Example 3:
Input: {}
Output: {}
Example 4:
Input: {5, 0, 3, 0, 4, 2}
Output: {0, 1}
Explanation: 0 is the smallest value, but there are two zeros,
so we will choose the first zero, which has the smallest index.
Constraints:
* 1 <= nodes.length <= 10000
* 0 <= node.value
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> pluck(vector<int> arr){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<int> pluck(vector<int> arr){
| vector<int> out={};
for (int i=0;i<arr.size();i++)
if (arr[i]%2==0 and (out.size()==0 or arr[i]<out[0]))
out={arr[i],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(pluck({4,2,3}) , {2, 1}));
assert (issame(pluck({1,2,3}) , {2, 1}));
assert (issame(pluck({}) , {}));
assert (issame(pluck({5, 0, 3, 0, 4, 2}) , {0, 1}));
assert (issame(pluck({1, 2, 3, 0, 5, 3}) , {0, 3}));
assert (issame(pluck({5, 4, 8, 4 ,8}) , {4, 1}));
assert (issame(pluck({7, 6, 7, 1}) , {6, 1}));
assert (issame(pluck({7, 9, 7, 1}) , {}));
}
| #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(pluck({4,2,3}) , {2, 1}));
assert (issame(pluck({1,2,3}) , {2, 1}));
assert (issame(pluck({}) , {}));
assert (issame(pluck({5, 0, 3, 0, 4, 2}) , {0, 1}));
}
| ; ModuleID = 'c_code_test/code_67.cpp'
source_filename = "c_code_test/code_67.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 }
$_ZNSt3__26vectorIiNS_9allocatorIiEEE6assignIPKiLi0EEEvT_S7_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE13__vdeallocateEv = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em = comdat any
$_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em = 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
@.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 @_Z5pluckNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca [2 x i32], 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
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = getelementptr inbounds i32, ptr %3, i32 1
%8 = getelementptr inbounds i32, ptr %3, i32 2
br label %9
9: ; preds = %31, %2
%10 = phi i32 [ 0, %2 ], [ %32, %31 ]
%11 = load ptr, ptr %6, align 4, !tbaa !10
%12 = load ptr, ptr %1, align 4, !tbaa !3
%13 = ptrtoint ptr %11 to i32
%14 = ptrtoint ptr %12 to i32
%15 = sub i32 %13, %14
%16 = ashr exact i32 %15, 2
%17 = icmp ult i32 %10, %16
br i1 %17, label %18, label %33
18: ; preds = %9
%19 = getelementptr inbounds i32, ptr %12, i32 %10
%20 = load i32, ptr %19, align 4, !tbaa !12
%21 = and i32 %20, 1
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %18
%24 = load ptr, ptr %4, align 4, !tbaa !10
%25 = load ptr, ptr %0, align 4, !tbaa !3
%26 = icmp eq ptr %24, %25
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = load i32, ptr %25, align 4, !tbaa !12
%29 = icmp slt i32 %20, %28
br i1 %29, label %30, label %31
30: ; preds = %27, %23
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #12
store i32 %20, ptr %3, align 4, !tbaa !12
store i32 %10, ptr %7, align 4, !tbaa !12
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE6assignIPKiLi0EEEvT_S7_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %3, ptr noundef nonnull %8) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #12
br label %31
31: ; preds = %18, %27, %30
%32 = add nuw nsw i32 %10, 1
br label %9, !llvm.loop !14
33: ; preds = %9
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #2
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26vectorIiNS_9allocatorIiEEE6assignIPKiLi0EEEvT_S7_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 comdat {
%4 = ptrtoint ptr %2 to i32
%5 = ptrtoint ptr %1 to i32
%6 = sub i32 %4, %5
%7 = ashr exact i32 %6, 2
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !16
%10 = load ptr, ptr %0, align 4, !tbaa !3
%11 = ptrtoint ptr %9 to i32
%12 = ptrtoint ptr %10 to i32
%13 = sub i32 %11, %12
%14 = ashr exact i32 %13, 2
%15 = icmp ugt i32 %7, %14
br i1 %15, label %35, label %16
16: ; preds = %3
%17 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%18 = load ptr, ptr %17, align 4, !tbaa !10
%19 = ptrtoint ptr %18 to i32
%20 = sub i32 %19, %12
%21 = ashr exact i32 %20, 2
%22 = icmp ugt i32 %7, %21
%23 = getelementptr inbounds i32, ptr %1, i32 %21
%24 = select i1 %22, ptr %23, ptr %2
%25 = ptrtoint ptr %24 to i32
%26 = sub i32 %25, %5
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %10, ptr align 4 %1, i32 %26, i1 false), !noalias !17
br i1 %22, label %27, label %32
27: ; preds = %16
%28 = load ptr, ptr %17, align 4, !tbaa !10
%29 = sub i32 %4, %25
%30 = ashr exact i32 %29, 2
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %28, ptr align 4 %23, i32 %29, i1 false), !noalias !28
%31 = getelementptr inbounds i32, ptr %28, i32 %30
store ptr %31, ptr %17, align 4, !tbaa !10
br label %40
32: ; preds = %16
%33 = ashr exact i32 %26, 2
%34 = getelementptr inbounds i32, ptr %10, i32 %33
store ptr %34, ptr %17, align 4, !tbaa !10
br label %40
35: ; preds = %3
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE13__vdeallocateEv(ptr noundef nonnull align 4 dereferenceable(12) %0) #14
%36 = tail call noundef i32 @_ZNKSt3__26vectorIiNS_9allocatorIiEEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %7) #13
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %36) #13
%37 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%38 = load ptr, ptr %37, align 4, !tbaa !10
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %38, ptr align 4 %1, i32 %6, i1 false), !noalias !39
%39 = getelementptr inbounds i32, ptr %38, i32 %7
store ptr %39, ptr %37, align 4, !tbaa !10
br label %40
40: ; preds = %27, %32, %35
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE13__vdeallocateEv(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #3 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !3
%3 = icmp eq ptr %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %2, ptr %5, align 4, !tbaa !10
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
tail call void @_ZdlPv(ptr noundef nonnull %2) #15
store ptr null, ptr %6, align 4, !tbaa !16
store ptr null, ptr %5, align 4, !tbaa !10
store ptr null, ptr %0, align 4, !tbaa !3
br label %7
7: ; preds = %4, %1
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(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 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #13, !noalias !50
store ptr %7, ptr %0, align 4, !tbaa !3
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !10
%9 = getelementptr inbounds i32, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !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 #5 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 !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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #6
; 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 #7 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 #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #12
%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) #17
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 !53
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 #4 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) #18
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #8 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #12
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #14
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #17
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #11
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 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind }
attributes #13 = { minsize optsize }
attributes #14 = { minsize nounwind optsize }
attributes #15 = { builtin minsize nounwind optsize }
attributes #16 = { minsize noreturn optsize }
attributes #17 = { noreturn }
attributes #18 = { 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 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!5, !5, i64 0}
!17 = !{!18, !20, !22, !24, !26}
!18 = distinct !{!18, !19, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!19 = distinct !{!19, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!20 = distinct !{!20, !21, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!21 = distinct !{!21, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!22 = distinct !{!22, !23, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!23 = distinct !{!23, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!24 = distinct !{!24, !25, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!25 = distinct !{!25, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!26 = distinct !{!26, !27, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!28 = !{!29, !31, !33, !35, !37}
!29 = distinct !{!29, !30, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!30 = distinct !{!30, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!31 = distinct !{!31, !32, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!32 = distinct !{!32, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!33 = distinct !{!33, !34, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!34 = distinct !{!34, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!35 = distinct !{!35, !36, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!36 = distinct !{!36, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!37 = distinct !{!37, !38, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!38 = distinct !{!38, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!39 = !{!40, !42, !44, !46, !48}
!40 = distinct !{!40, !41, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!41 = distinct !{!41, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!42 = distinct !{!42, !43, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!43 = distinct !{!43, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!44 = distinct !{!44, !45, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!45 = distinct !{!45, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!46 = distinct !{!46, !47, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!47 = distinct !{!47, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!48 = distinct !{!48, !49, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!49 = distinct !{!49, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!50 = !{!51}
!51 = distinct !{!51, !52, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!52 = distinct !{!52, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!53 = !{!54, !54, i64 0}
!54 = !{!"vtable pointer", !7, i64 0}
| (module
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func (param i32 i32) (result i32)))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE6assignIPKiLi0EEEvT_S7_" (func (;0;) (type 0)))
(import "env" "memmove" (func (;1;) (type 3)))
(import "env" "_ZdlPv" (func (;2;) (type 4)))
(import "env" "__cxa_allocate_exception" (func (;3;) (type 1)))
(import "env" "__cxa_throw" (func (;4;) (type 0)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;5;) (type 5)))
(import "env" "_Znwm" (func (;6;) (type 1)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;7;) (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 (;8;) (type 2))
(func (;9;) (type 6) (param i32 i32)
(local i32 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 16
i32.add
local.set 5
loop ;; label = @1
local.get 3
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 4
i32.sub
i32.const 2
i32.shr_s
i32.ge_u
i32.eqz
if ;; label = @2
block ;; label = @3
local.get 4
local.get 3
i32.const 2
i32.shl
i32.add
i32.load
local.tee 4
i32.const 1
i32.and
br_if 0 (;@3;)
local.get 0
i32.load
local.tee 6
local.get 0
i32.load offset=4
i32.ne
if ;; label = @4
local.get 4
local.get 6
i32.load
i32.ge_s
br_if 1 (;@3;)
end
local.get 2
local.get 3
i32.store offset=12
local.get 2
local.get 4
i32.store offset=8
local.get 0
local.get 2
i32.const 8
i32.add
local.get 5
call 0
end
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@1;)
end
end
local.get 2
i32.const 16
i32.add
global.set 0)
(func (;10;) (type 0) (param i32 i32 i32)
(local i32 i32 i32 i32 i32)
local.get 2
local.get 1
i32.sub
local.tee 5
i32.const 2
i32.shr_s
local.tee 4
local.get 0
i32.load offset=8
local.get 0
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
i32.le_u
if ;; label = @1
local.get 3
local.get 1
local.get 1
local.get 0
i32.load offset=4
local.get 3
i32.sub
local.tee 3
i32.add
local.tee 5
local.get 2
local.get 4
local.get 3
i32.const 2
i32.shr_s
local.tee 3
i32.gt_u
select
local.tee 6
local.get 1
i32.sub
local.tee 1
call 1
local.set 7
local.get 3
local.get 4
i32.lt_u
if ;; label = @2
local.get 0
local.get 0
i32.load offset=4
local.get 5
local.get 2
local.get 6
i32.sub
local.tee 0
call 1
local.get 0
i32.add
i32.store offset=4
return
end
local.get 0
local.get 1
local.get 7
i32.add
i32.store offset=4
return
end
local.get 0
i32.load
local.tee 2
if ;; label = @1
local.get 0
local.get 2
i32.store offset=4
local.get 2
call 2
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
end
local.get 4
i32.const 1073741824
i32.ge_u
if ;; label = @1
call 11
unreachable
end
i32.const 1073741823
local.get 0
i32.load offset=8
local.get 0
i32.load
i32.sub
local.tee 2
i32.const 1
i32.shr_s
local.tee 3
local.get 4
local.get 3
local.get 4
i32.gt_u
select
local.get 2
i32.const 2147483644
i32.ge_u
select
local.tee 2
i32.const 1073741824
i32.ge_u
if ;; label = @1
call 11
unreachable
end
local.get 0
local.get 2
i32.const 1073741824
i32.ge_u
if ;; label = @1
global.get 5
local.set 0
global.get 6
local.set 1
i32.const 4
call 3
call 7
local.get 1
local.get 0
call 4
unreachable
end
local.get 2
i32.const 2
i32.shl
local.tee 2
call 6
local.tee 3
i32.store offset=4
local.get 0
local.get 3
i32.store
local.get 0
local.get 2
local.get 3
i32.add
i32.store offset=8
local.get 0
local.get 0
i32.load offset=4
local.get 1
local.get 5
call 1
local.get 4
i32.const 2
i32.shl
i32.add
i32.store offset=4)
(func (;11;) (type 2)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 3
global.get 4
local.set 3
global.get 1
call 5
local.tee 0
local.get 3
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 4
unreachable)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z5pluckNSt3__26vectorIiNS_9allocatorIiEEEE" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE6assignIPKiLi0EEEvT_S7_" (func 10))
(data (;0;) (global.get 1) "vector\00"))
| 6 | 159 | 6,255 | 290 |
CPP/69 | /*
You are given a non-empty vector of positive integers. Return the greatest integer that is greater than
zero, and has a frequency greater than or equal to the value of the integer itself.
The frequency of an integer is the number of times it appears in the vector.
If no such a value exist, return -1.
Examples:
search({4, 1, 2, 2, 3, 1}) == 2
search({1, 2, 2, 3, 3, 3, 4, 4, 4}) == 3
search({5, 5, 4, 4, 4}) == -1
*/
#include<stdio.h>
#include<vector>
using namespace std;
int search(vector<int> lst){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int search(vector<int> lst){
| vector<vector<int>> freq={};
int max=-1;
for (int i=0;i<lst.size();i++)
{
bool has=false;
for (int j=0;j<freq.size();j++)
if (lst[i]==freq[j][0])
{
freq[j][1]+=1;
has=true;
if (freq[j][1]>=freq[j][0] and freq[j][0]>max) max=freq[j][0];
}
if (not(has))
{
freq.push_back({lst[i],1});
if (max==-1 and lst[i]==1) max=1;
}
}
return max;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (search({5, 5, 5, 5, 1}) == 1);
assert (search({4, 1, 4, 1, 4, 4}) == 4);
assert (search({3, 3}) == -1);
assert (search({8, 8, 8, 8, 8, 8, 8, 8}) == 8);
assert (search({2, 3, 3, 2, 2}) == 2);
assert (search({2, 7, 8, 8, 4, 8, 7, 3, 9, 6, 5, 10, 4, 3, 6, 7, 1, 7, 4, 10, 8, 1}) == 1);
assert (search({3, 2, 8, 2}) == 2);
assert (search({6, 7, 1, 8, 8, 10, 5, 8, 5, 3, 10}) == 1);
assert (search({8, 8, 3, 6, 5, 6, 4}) == -1);
assert (search({6, 9, 6, 7, 1, 4, 7, 1, 8, 8, 9, 8, 10, 10, 8, 4, 10, 4, 10, 1, 2, 9, 5, 7, 9}) == 1);
assert (search({1, 9, 10, 1, 3}) == 1);
assert (search({6, 9, 7, 5, 8, 7, 5, 3, 7, 5, 10, 10, 3, 6, 10, 2, 8, 6, 5, 4, 9, 5, 3, 10}) == 5);
assert (search({1}) == 1);
assert (search({8, 8, 10, 6, 4, 3, 5, 8, 2, 4, 2, 8, 4, 6, 10, 4, 2, 1, 10, 2, 1, 1, 5}) == 4);
assert (search({2, 10, 4, 8, 2, 10, 5, 1, 2, 9, 5, 5, 6, 3, 8, 6, 4, 10}) == 2);
assert (search({1, 6, 10, 1, 6, 9, 10, 8, 6, 8, 7, 3}) == 1);
assert (search({9, 2, 4, 1, 5, 1, 5, 2, 5, 7, 7, 7, 3, 10, 1, 5, 4, 2, 8, 4, 1, 9, 10, 7, 10, 2, 8, 10, 9, 4}) == 4);
assert (search({2, 6, 4, 2, 8, 7, 5, 6, 4, 10, 4, 6, 3, 7, 8, 8, 3, 1, 4, 2, 2, 10, 7}) == 4);
assert (search({9, 8, 6, 10, 2, 6, 10, 2, 7, 8, 10, 3, 8, 2, 6, 2, 3, 1}) == 2);
assert (search({5, 5, 3, 9, 5, 6, 3, 2, 8, 5, 6, 10, 10, 6, 8, 4, 10, 7, 7, 10, 8}) == -1);
assert (search({10}) == -1);
assert (search({9, 7, 7, 2, 4, 7, 2, 10, 9, 7, 5, 7, 2}) == 2);
assert (search({5, 4, 10, 2, 1, 1, 10, 3, 6, 1, 8}) == 1);
assert (search({7, 9, 9, 9, 3, 4, 1, 5, 9, 1, 2, 1, 1, 10, 7, 5, 6, 7, 6, 7, 7, 6}) == 1);
assert (search({3, 10, 10, 9, 2}) == -1);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (search({4, 1, 2, 2, 3, 1}) == 2);
assert (search({1, 2, 2, 3, 3, 3, 4, 4, 4}) == 3);
assert (search({5, 5, 4, 4, 4}) == -1);
}
| ; ModuleID = 'c_code_test/code_68.cpp'
source_filename = "c_code_test/code_68.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.1" = type { ptr, ptr, %"class.std::__2::__compressed_pair.2" }
%"class.std::__2::__compressed_pair.2" = type { %"struct.std::__2::__compressed_pair_elem.3" }
%"struct.std::__2::__compressed_pair_elem.3" = type { ptr }
%"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::initializer_list" = type { ptr, i32 }
%"struct.std::__2::__exception_guard_exceptions.11" = type <{ %"class.std::__2::vector<int>::__destroy_vector", i8, [3 x i8] }>
%"class.std::__2::vector<int>::__destroy_vector" = type { ptr }
%"class.std::__2::vector<std::__2::vector<int>>::__destroy_vector" = type { ptr }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.8" }
%"class.std::__2::__compressed_pair.8" = type { %"struct.std::__2::__compressed_pair_elem.3", %"struct.std::__2::__compressed_pair_elem.9" }
%"struct.std::__2::__compressed_pair_elem.9" = 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE9push_backB7v160006EOS3_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE16__destroy_vectorclB7v160006Ev = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE7__clearB7v160006Ev = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__base_destruct_at_endB7v160006EPS3_ = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_ = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_ = comdat any
$_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE11__recommendB7v160006Em = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEC2EmmS6_ = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_EE = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEED2Ev = comdat any
$_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorINS_6vectorIiNS0_IiEEEEE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_ = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEED2B7v160006Ev = comdat any
$_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEclB7v160006Ev = comdat any
$_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorINS6_IPS4_EEEES9_EEvRT_T0_T1_ = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE5clearB7v160006Ev = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE17__destruct_at_endB7v160006EPS4_NS_17integral_constantIbLb0EEE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev = comdat any
$_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__29allocatorIiE8allocateB7v160006Em = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev = 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 noundef i32 @_Z6searchNSt3__26vectorIiNS_9allocatorIiEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::vector.1", align 4
%3 = alloca %"class.std::__2::vector", align 4
%4 = alloca %"class.std::initializer_list", align 4
%5 = alloca [2 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #15
store ptr null, ptr %2, align 4, !tbaa !3
%6 = getelementptr inbounds %"class.std::__2::vector.1", ptr %2, i32 0, i32 1
store ptr null, ptr %6, align 4, !tbaa !10
%7 = getelementptr inbounds %"class.std::__2::vector.1", ptr %2, i32 0, i32 2
store ptr null, ptr %7, align 4, !tbaa !11
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%9 = getelementptr inbounds i32, ptr %5, i32 1
%10 = getelementptr inbounds %"class.std::initializer_list", ptr %4, i32 0, i32 1
br label %11
11: ; preds = %66, %1
%12 = phi i32 [ -1, %1 ], [ %67, %66 ]
%13 = phi i32 [ 0, %1 ], [ %68, %66 ]
%14 = load ptr, ptr %8, align 4, !tbaa !12
%15 = load ptr, ptr %0, align 4, !tbaa !16
%16 = ptrtoint ptr %14 to i32
%17 = ptrtoint ptr %15 to i32
%18 = sub i32 %16, %17
%19 = ashr exact i32 %18, 2
%20 = icmp ult i32 %13, %19
br i1 %20, label %21, label %29
21: ; preds = %11
%22 = load ptr, ptr %6, align 4, !tbaa !10
%23 = load ptr, ptr %2, align 4, !tbaa !3
%24 = ptrtoint ptr %22 to i32
%25 = ptrtoint ptr %23 to i32
%26 = sub i32 %24, %25
%27 = sdiv exact i32 %26, 12
%28 = getelementptr inbounds i32, ptr %15, i32 %13
br label %31
29: ; preds = %11
%30 = call noundef ptr @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #15
ret i32 %12
31: ; preds = %21, %51
%32 = phi i32 [ %52, %51 ], [ %12, %21 ]
%33 = phi i1 [ %53, %51 ], [ false, %21 ]
%34 = phi i32 [ %54, %51 ], [ 0, %21 ]
%35 = icmp eq i32 %34, %27
br i1 %35, label %36, label %37
36: ; preds = %31
br i1 %33, label %66, label %55
37: ; preds = %31
%38 = load i32, ptr %28, align 4, !tbaa !17
%39 = getelementptr inbounds %"class.std::__2::vector", ptr %23, i32 %34
%40 = load ptr, ptr %39, align 4, !tbaa !16
%41 = load i32, ptr %40, align 4, !tbaa !17
%42 = icmp eq i32 %38, %41
br i1 %42, label %43, label %51
43: ; preds = %37
%44 = getelementptr inbounds i32, ptr %40, i32 1
%45 = load i32, ptr %44, align 4, !tbaa !17
%46 = add nsw i32 %45, 1
store i32 %46, ptr %44, align 4, !tbaa !17
%47 = icmp sge i32 %46, %38
%48 = icmp sgt i32 %38, %32
%49 = select i1 %47, i1 %48, i1 false
%50 = select i1 %49, i32 %38, i32 %32
br label %51
51: ; preds = %43, %37
%52 = phi i32 [ %32, %37 ], [ %50, %43 ]
%53 = phi i1 [ %33, %37 ], [ true, %43 ]
%54 = add nuw i32 %34, 1
br label %31, !llvm.loop !19
55: ; preds = %36
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #15
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #15
%56 = load i32, ptr %28, align 4, !tbaa !17
store i32 %56, ptr %5, align 4, !tbaa !17
store i32 1, ptr %9, align 4, !tbaa !17
store ptr %5, ptr %4, align 4, !tbaa !21
store i32 2, ptr %10, align 4, !tbaa !24
%57 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull byval(%"class.std::initializer_list") align 4 %4) #17
call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE9push_backB7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3) #17
%58 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #16
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #15
%59 = icmp eq i32 %32, -1
br i1 %59, label %60, label %66
60: ; preds = %55
%61 = load ptr, ptr %0, align 4, !tbaa !16
%62 = getelementptr inbounds i32, ptr %61, i32 %13
%63 = load i32, ptr %62, align 4, !tbaa !17
%64 = icmp eq i32 %63, 1
%65 = select i1 %64, i32 1, i32 -1
br label %66
66: ; preds = %60, %55, %36
%67 = phi i32 [ %32, %36 ], [ %32, %55 ], [ %65, %60 ]
%68 = add nuw nsw i32 %13, 1
br label %11, !llvm.loop !25
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; 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 mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE9push_backB7v160006EOS3_(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.1", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !10
%5 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 2
%6 = load ptr, ptr %5, align 4, !tbaa !26
%7 = icmp ult ptr %4, %6
br i1 %7, label %8, label %9
8: ; preds = %2
tail call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_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: inlinehint minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef byval(%"class.std::initializer_list") align 4 %1) unnamed_addr #3 comdat {
%3 = alloca %"struct.std::__2::__exception_guard_exceptions.11", align 4
store ptr null, ptr %0, align 4, !tbaa !16
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !12
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %5, align 4, !tbaa !27
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #15
store ptr %0, ptr %3, align 4, !tbaa.struct !28, !alias.scope !29
%6 = getelementptr inbounds %"class.std::initializer_list", ptr %1, i32 0, i32 1
%7 = load i32, ptr %6, align 4, !tbaa !24
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %7) #17
%10 = load ptr, ptr %1, align 4, !tbaa !21
%11 = load ptr, ptr %4, align 4, !tbaa !12
%12 = shl nsw i32 %7, 2
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %11, ptr align 4 %10, i32 %12, i1 false), !noalias !32
%13 = getelementptr inbounds i32, ptr %11, i32 %7
store ptr %13, ptr %4, align 4, !tbaa !12
br label %14
14: ; preds = %9, %2
%15 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions.11", ptr %3, i32 0, i32 1
store i8 1, ptr %15, align 4, !tbaa !43
%16 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(5) %3) #16
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #15
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #4 comdat {
%2 = alloca %"class.std::__2::vector<int>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #15
store ptr %0, ptr %2, align 4, !tbaa !26
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #15
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #4 comdat {
%2 = alloca %"class.std::__2::vector<std::__2::vector<int>>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #15
store ptr %0, ptr %2, align 4, !tbaa !26
call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #15
ret ptr %0
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #5 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !47
%3 = load ptr, ptr %2, align 4, !tbaa !3
%4 = icmp eq ptr %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
tail call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE7__clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #16
%6 = load ptr, ptr %0, align 4, !tbaa !47
%7 = load ptr, ptr %6, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #18
br label %8
8: ; preds = %5, %1
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE7__clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #6 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__base_destruct_at_endB7v160006EPS3_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %2) #16
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__base_destruct_at_endB7v160006EPS3_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %1) local_unnamed_addr #6 comdat {
%3 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !10
br label %5
5: ; preds = %8, %2
%6 = phi ptr [ %4, %2 ], [ %9, %8 ]
%7 = icmp eq ptr %6, %1
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = getelementptr inbounds %"class.std::__2::vector", ptr %6, i32 -1
%10 = tail call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #16
br label %5, !llvm.loop !49
11: ; preds = %5
store ptr %1, ptr %3, align 4, !tbaa !10
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #7
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_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.1", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !10
%5 = tail call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %1) #16
%6 = getelementptr inbounds %"class.std::__2::vector", 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_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.1", ptr %0, i32 0, i32 2
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #15
%5 = getelementptr inbounds %"class.std::__2::vector.1", 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_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_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEC2EmmS6_(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 !50
%23 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %1) #16
%24 = load ptr, ptr %21, align 4, !tbaa !50
%25 = getelementptr inbounds %"class.std::__2::vector", ptr %24, i32 1
store ptr %25, ptr %21, align 4, !tbaa !50
call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_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_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #16
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #15
ret void
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #8 comdat {
store ptr null, ptr %0, align 4, !tbaa !16
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !12
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !27
%5 = load ptr, ptr %1, align 4, !tbaa !16
store ptr %5, ptr %0, align 4, !tbaa !16
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !12
store ptr %7, ptr %3, align 4, !tbaa !12
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !26
store ptr %9, ptr %4, align 4, !tbaa !26
store ptr null, ptr %8, align 4, !tbaa !26
store ptr null, ptr %6, align 4, !tbaa !12
store ptr null, ptr %1, align 4, !tbaa !16
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #19
unreachable
5: ; preds = %2
%6 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 2
%7 = load ptr, ptr %6, align 4, !tbaa !26
%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_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEC2EmmS6_(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 !26
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call noundef ptr @_ZNSt3__29allocatorINS_6vectorIiNS0_IiEEEEE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #17, !noalias !54
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !57
%12 = getelementptr inbounds %"class.std::__2::vector", 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 !50
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !58
%15 = getelementptr inbounds %"class.std::__2::vector", ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !26
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_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.1", ptr %0, i32 0, i32 2
%4 = getelementptr inbounds %"class.std::__2::vector.1", 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 !58
%9 = tail call ptr @_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr %5, ptr %6, ptr %8) #17
store ptr %9, ptr %7, align 4, !tbaa !58
%10 = load ptr, ptr %0, align 4, !tbaa !26
store ptr %9, ptr %0, align 4, !tbaa !26
store ptr %10, ptr %7, align 4, !tbaa !26
%11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%12 = load ptr, ptr %4, align 4, !tbaa !26
%13 = load ptr, ptr %11, align 4, !tbaa !26
store ptr %13, ptr %4, align 4, !tbaa !26
store ptr %12, ptr %11, align 4, !tbaa !26
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3
%15 = load ptr, ptr %3, align 4, !tbaa !26
%16 = load ptr, ptr %14, align 4, !tbaa !26
store ptr %16, ptr %3, align 4, !tbaa !26
store ptr %15, ptr %14, align 4, !tbaa !26
%17 = load ptr, ptr %7, align 4, !tbaa !58
store ptr %17, ptr %1, align 4, !tbaa !57
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #4 comdat {
tail call void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #16
%2 = load ptr, ptr %0, align 4, !tbaa !57
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #18
br label %5
5: ; preds = %4, %1
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #9 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #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 #10 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #15
%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) #20
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 !59
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #4
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_6vectorIiNS0_IiEEEEE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #5 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) #21
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #10 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #15
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #16
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #20
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #4
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #4
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #11
; Function Attrs: minsize optsize
define linkonce_odr hidden ptr @_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_(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
store ptr %3, ptr %5, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #15
%8 = ptrtoint ptr %3 to i32
store i32 %8, ptr %6, align 4, !tbaa !26
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #15
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
%11 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %7, i32 0, i32 1
store i8 0, ptr %11, align 4, !tbaa !61, !alias.scope !64
br label %12
12: ; preds = %16, %4
%13 = phi ptr [ %3, %4 ], [ %21, %16 ]
%14 = phi ptr [ %1, %4 ], [ %18, %16 ]
%15 = icmp eq ptr %14, %2
br i1 %15, label %22, label %16
16: ; preds = %12
%17 = getelementptr inbounds %"class.std::__2::vector", ptr %13, i32 -1
%18 = getelementptr inbounds %"class.std::__2::vector", ptr %14, i32 -1
%19 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %18) #16
%20 = load ptr, ptr %5, align 4, !tbaa !67
%21 = getelementptr inbounds %"class.std::__2::vector", ptr %20, i32 -1
store ptr %21, ptr %5, align 4, !tbaa !67
br label %12, !llvm.loop !69
22: ; preds = %12
store i8 1, ptr %11, align 4, !tbaa !61
%23 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(13) %7) #16
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #15
ret ptr %13
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(13) %0) unnamed_addr #4 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !61, !range !70, !noundef !71
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #16
br label %6
6: ; preds = %5, %1
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #0 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !72
%3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !73
%5 = load ptr, ptr %4, align 4, !tbaa.struct !28
%6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !74
%8 = load ptr, ptr %7, align 4, !tbaa.struct !28
tail call void @_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorINS6_IPS4_EEEES9_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_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorINS6_IPS4_EEEES9_EEvRT_T0_T1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr %1, ptr %2) local_unnamed_addr #5 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__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #16
%9 = getelementptr inbounds %"class.std::__2::vector", ptr %5, i32 1
br label %4, !llvm.loop !75
10: ; preds = %4
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #6 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !58
tail call void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE17__destruct_at_endB7v160006EPS4_NS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #16
ret void
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE17__destruct_at_endB7v160006EPS4_NS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %1) local_unnamed_addr #12 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 !50
%6 = icmp eq ptr %5, %1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %5, i32 -1
store ptr %8, ptr %3, align 4, !tbaa !50
%9 = tail call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #16
br label %4, !llvm.loop !76
10: ; preds = %4
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #5 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 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #17, !noalias !77
store ptr %7, ptr %0, align 4, !tbaa !16
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !12
%9 = getelementptr inbounds i32, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !26
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(5) %0) unnamed_addr #4 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions.11", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !43, !range !70, !noundef !71
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #16
br label %6
6: ; preds = %5, %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 #9 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #19
unreachable
}
; 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 #5 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) #21
ret ptr %7
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #13
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #5 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !80
%3 = load ptr, ptr %2, align 4, !tbaa !16
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !12
tail call void @_ZdlPv(ptr noundef nonnull %3) #18
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #14
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 optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { nounwind }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { minsize optsize }
attributes #18 = { builtin minsize nounwind optsize }
attributes #19 = { minsize noreturn optsize }
attributes #20 = { noreturn }
attributes #21 = { 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_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_6vectorIiNS_9allocatorIiEEEENS2_IS4_EEEE", !9, i64 0}
!9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPNS_6vectorIiNS_9allocatorIiEEEELi0ELb0EEE", !5, i64 0}
!10 = !{!4, !5, i64 4}
!11 = !{!9, !5, i64 0}
!12 = !{!13, !5, i64 4}
!13 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !14, i64 8}
!14 = !{!"_ZTSNSt3__217__compressed_pairIPiNS_9allocatorIiEEEE", !15, i64 0}
!15 = !{!"_ZTSNSt3__222__compressed_pair_elemIPiLi0ELb0EEE", !5, i64 0}
!16 = !{!13, !5, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !6, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !5, i64 0}
!22 = !{!"_ZTSSt16initializer_listIiE", !5, i64 0, !23, i64 4}
!23 = !{!"long", !6, i64 0}
!24 = !{!22, !23, i64 4}
!25 = distinct !{!25, !20}
!26 = !{!5, !5, i64 0}
!27 = !{!15, !5, i64 0}
!28 = !{i64 0, i64 4, !26}
!29 = !{!30}
!30 = distinct !{!30, !31, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_: argument 0"}
!31 = distinct !{!31, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_"}
!32 = !{!33, !35, !37, !39, !41}
!33 = distinct !{!33, !34, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!34 = distinct !{!34, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!35 = distinct !{!35, !36, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!36 = distinct !{!36, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!37 = distinct !{!37, !38, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!38 = distinct !{!38, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!39 = distinct !{!39, !40, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!40 = distinct !{!40, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!41 = distinct !{!41, !42, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!42 = distinct !{!42, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!43 = !{!44, !46, i64 4}
!44 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEE", !45, i64 0, !46, i64 4}
!45 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorE", !5, i64 0}
!46 = !{!"bool", !6, i64 0}
!47 = !{!48, !5, i64 0}
!48 = !{!"_ZTSNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE16__destroy_vectorE", !5, i64 0}
!49 = distinct !{!49, !20}
!50 = !{!51, !5, i64 8}
!51 = !{!"_ZTSNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !52, i64 12}
!52 = !{!"_ZTSNSt3__217__compressed_pairIPNS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEE", !9, i64 0, !53, i64 4}
!53 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_6vectorIiNS1_IiEEEEEELi1ELb0EEE", !5, i64 0}
!54 = !{!55}
!55 = distinct !{!55, !56, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS8_m: argument 0"}
!56 = distinct !{!56, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS8_m"}
!57 = !{!51, !5, i64 0}
!58 = !{!51, !5, i64 4}
!59 = !{!60, !60, i64 0}
!60 = !{!"vtable pointer", !7, i64 0}
!61 = !{!62, !46, i64 12}
!62 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEEE", !63, i64 0, !46, i64 12}
!63 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEE", !5, i64 0, !5, i64 4, !5, i64 8}
!64 = !{!65}
!65 = distinct !{!65, !66, !"_ZNSt3__222__make_exception_guardB7v160006INS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEEENS_28__exception_guard_exceptionsIT_EESC_: argument 0"}
!66 = distinct !{!66, !"_ZNSt3__222__make_exception_guardB7v160006INS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEEENS_28__exception_guard_exceptionsIT_EESC_"}
!67 = !{!68, !5, i64 0}
!68 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_6vectorIiNS_9allocatorIiEEEEEE", !5, i64 0}
!69 = distinct !{!69, !20}
!70 = !{i8 0, i8 2}
!71 = !{}
!72 = !{!63, !5, i64 0}
!73 = !{!63, !5, i64 8}
!74 = !{!63, !5, i64 4}
!75 = distinct !{!75, !20}
!76 = distinct !{!76, !20}
!77 = !{!78}
!78 = distinct !{!78, !79, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!79 = distinct !{!79, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!80 = !{!45, !5, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func))
(type (;3;) (func (param i32)))
(type (;4;) (func (param i32 i32) (result i32)))
(type (;5;) (func (param i32 i32 i32) (result i32)))
(type (;6;) (func (param i32 i32 i32)))
(import "env" "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_" (func (;0;) (type 1)))
(import "env" "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_" (func (;1;) (type 1)))
(import "env" "memmove" (func (;2;) (type 5)))
(import "env" "_ZdlPv" (func (;3;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;4;) (type 0)))
(import "env" "__cxa_throw" (func (;5;) (type 6)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;6;) (type 4)))
(import "env" "_Znwm" (func (;7;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;8;) (type 0)))
(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 (;9;) (type 2))
(func (;10;) (type 0) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 0
i32.store offset=44
local.get 2
i64.const 0
i64.store offset=36 align=4
i32.const -1
local.set 5
loop ;; label = @1
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 1
i32.sub
i32.const 2
i32.shr_s
local.get 6
i32.gt_u
if ;; label = @2
local.get 1
local.get 6
i32.const 2
i32.shl
local.tee 9
i32.add
local.set 4
local.get 2
i32.load offset=40
local.get 2
i32.load offset=36
local.tee 10
i32.sub
i32.const 12
i32.div_s
local.set 11
i32.const 0
local.set 7
i32.const 0
local.set 1
loop ;; label = @3
local.get 1
local.get 11
i32.eq
if ;; label = @4
block ;; label = @5
local.get 7
br_if 0 (;@5;)
local.get 4
i32.load
local.set 1
local.get 2
i32.const 2
i32.store offset=20
local.get 2
i32.const 1
i32.store offset=12
local.get 2
local.get 1
i32.store offset=8
local.get 2
local.get 2
i32.const 8
i32.add
i32.store offset=16
local.get 2
local.get 2
i64.load offset=16 align=4
i64.store
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 2
i32.const 24
i32.add
local.tee 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
local.get 3
local.get 1
i32.store offset=8
local.get 2
i32.load offset=4
local.tee 4
if ;; label = @6
local.get 4
i32.const 1073741824
i32.ge_u
if ;; label = @7
call 16
unreachable
end
local.get 4
i32.const 1073741824
i32.ge_u
if ;; label = @7
call 17
unreachable
end
local.get 1
local.get 4
i32.const 2
i32.shl
local.tee 4
call 7
local.tee 7
i32.store offset=4
local.get 1
local.get 7
i32.store
local.get 1
local.get 4
local.get 7
i32.add
i32.store offset=8
local.get 1
local.get 1
i32.load offset=4
local.get 2
i32.load
local.get 4
call 2
local.get 4
i32.add
i32.store offset=4
end
local.get 3
i32.const 1
i32.store8 offset=12
local.get 3
i32.const 8
i32.add
local.tee 4
i32.load8_u offset=4
i32.eqz
if ;; label = @6
local.get 4
call 14
end
local.get 3
i32.const 16
i32.add
global.set 0
block ;; label = @6
local.get 2
i32.const 36
i32.add
local.tee 3
i32.load offset=4
local.get 3
i32.load offset=8
i32.lt_u
if ;; label = @7
local.get 3
local.get 1
call 0
br 1 (;@6;)
end
local.get 3
local.get 1
call 1
end
local.get 1
call 11
drop
local.get 5
i32.const -1
i32.ne
br_if 0 (;@5;)
i32.const 1
i32.const -1
local.get 0
i32.load
local.get 9
i32.add
i32.load
i32.const 1
i32.eq
select
local.set 5
end
local.get 6
i32.const 1
i32.add
local.set 6
br 3 (;@1;)
else
local.get 4
i32.load
local.tee 3
local.get 10
local.get 1
i32.const 12
i32.mul
i32.add
i32.load
local.tee 8
i32.load
i32.eq
if ;; label = @5
i32.const 1
local.set 7
local.get 8
local.get 8
i32.load offset=4
i32.const 1
i32.add
local.tee 8
i32.store offset=4
local.get 3
local.get 5
local.get 3
local.get 5
i32.gt_s
select
local.get 5
local.get 3
local.get 8
i32.le_s
select
local.set 5
end
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@3;)
end
unreachable
end
unreachable
end
end
global.get 0
i32.const 16
i32.sub
local.tee 1
global.set 0
local.get 1
local.get 2
i32.const 36
i32.add
i32.store offset=12
local.get 1
i32.load offset=12
local.tee 0
i32.load
if ;; label = @1
local.get 0
i32.load
local.set 6
local.get 0
i32.load offset=4
local.set 3
loop ;; label = @2
local.get 3
local.get 6
i32.ne
if ;; label = @3
local.get 3
i32.const 12
i32.sub
call 11
local.set 3
br 1 (;@2;)
end
end
local.get 0
local.get 6
i32.store offset=4
local.get 1
i32.load offset=12
i32.load
call 3
end
local.get 1
i32.const 16
i32.add
global.set 0
local.get 2
i32.const 48
i32.add
global.set 0
local.get 5)
(func (;11;) (type 0) (param i32) (result i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 1
global.set 0
local.get 1
local.get 0
i32.store offset=12
local.get 1
i32.const 12
i32.add
call 14
local.get 1
i32.const 16
i32.add
global.set 0
local.get 0)
(func (;12;) (type 1) (param i32 i32)
local.get 0
local.get 0
i32.load offset=4
local.get 1
call 15
i32.const 12
i32.add
i32.store offset=4)
(func (;13;) (type 1) (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
call 16
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 3
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 4
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 3
if ;; label = @1
local.get 3
i32.const 357913942
i32.ge_u
if ;; label = @2
call 17
unreachable
end
local.get 3
i32.const 12
i32.mul
call 7
local.set 4
end
local.get 2
local.get 4
i32.store offset=12
local.get 2
local.get 4
local.get 5
i32.const 12
i32.mul
i32.add
local.tee 5
i32.store offset=20
local.get 2
local.get 4
local.get 3
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 15
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 4
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 3
global.set 0
local.get 3
local.get 5
i32.store offset=28
local.get 3
local.get 5
i32.store offset=24
local.get 3
i32.const 0
i32.store8 offset=20
local.get 3
local.get 0
i32.const 8
i32.add
i32.store offset=8
local.get 3
local.get 3
i32.const 28
i32.add
i32.store offset=16
local.get 3
local.get 3
i32.const 24
i32.add
i32.store offset=12
loop ;; label = @1
local.get 1
local.get 4
i32.ne
if ;; label = @2
local.get 5
i32.const 12
i32.sub
local.get 4
i32.const 12
i32.sub
local.tee 4
call 15
drop
local.get 3
local.get 3
i32.load offset=28
i32.const 12
i32.sub
local.tee 5
i32.store offset=28
br 1 (;@1;)
end
end
local.get 3
i32.const 1
i32.store8 offset=20
local.get 3
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 4
local.get 1
i32.load offset=4
i32.load
local.set 1
loop ;; label = @2
local.get 1
local.get 4
i32.ne
if ;; label = @3
local.get 4
call 11
i32.const 12
i32.add
local.set 4
br 1 (;@2;)
end
end
end
local.get 3
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 11
drop
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.tee 0
if ;; label = @1
local.get 0
call 3
end
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;14;) (type 3) (param i32)
(local i32)
local.get 0
i32.load
local.tee 1
i32.load
local.tee 0
if ;; label = @1
local.get 1
local.get 0
i32.store offset=4
local.get 0
call 3
end)
(func (;15;) (type 4) (param i32 i32) (result i32)
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.load
i32.store
local.get 0
local.get 1
i32.load offset=4
i32.store offset=4
local.get 0
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
local.get 0)
(func (;16;) (type 2)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 4
global.get 4
local.set 3
global.get 1
call 6
local.tee 0
local.get 3
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 5
unreachable)
(func (;17;) (type 2)
(local i32 i32)
global.get 5
local.set 0
global.get 6
local.set 1
i32.const 4
call 4
call 8
local.get 1
local.get 0
call 5
unreachable)
(export "__wasm_call_ctors" (func 9))
(export "__wasm_apply_data_relocs" (func 9))
(export "_Z6searchNSt3__26vectorIiNS_9allocatorIiEEEE" (func 10))
(export "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_" (func 12))
(export "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_" (func 13))
(data (;0;) (global.get 1) "vector\00"))
| 20 | 488 | 15,646 | 711 |
CPP/70 | /*
Given vector of integers, return vector in strange order.
Strange sorting, is when you start with the minimum value,
then maximum of the remaining integers, then minimum and so on.
Examples:
strange_sort_vector({1, 2, 3, 4}) == {1, 4, 2, 3}
strange_sort_vector({5, 5, 5, 5}) == {5, 5, 5, 5}
strange_sort_vector({}) == {}
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> strange_sort_list(vector<int> lst){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<int> strange_sort_list(vector<int> lst){
| vector<int> out={};
sort(lst.begin(),lst.end());
int l=0,r=lst.size()-1;
while (l<r)
{
out.push_back(lst[l]);
l+=1;
out.push_back(lst[r]);
r-=1;
}
if (l==r) out.push_back(lst[l]);
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(strange_sort_list({1, 2, 3, 4}) , {1, 4, 2, 3}));
assert (issame(strange_sort_list({5, 6, 7, 8, 9}) , {5, 9, 6, 8, 7}));
assert (issame(strange_sort_list({1, 2, 3, 4, 5}) , {1, 5, 2, 4, 3}));
assert (issame(strange_sort_list({5, 6, 7, 8, 9, 1}) , {1, 9, 5, 8, 6, 7}));
assert (issame(strange_sort_list({5, 5, 5, 5}) , {5, 5, 5, 5}));
assert (issame(strange_sort_list({}) , {}));
assert (issame(strange_sort_list({1,2,3,4,5,6,7,8}) , {1, 8, 2, 7, 3, 6, 4, 5}));
assert (issame(strange_sort_list({0,2,2,2,5,5,-5,-5}) , {-5, 5, -5, 5, 0, 2, 2, 2}));
assert (issame(strange_sort_list({111111}) , {111111}));
}
| #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(strange_sort_list({1, 2, 3, 4}) , {1, 4, 2, 3}));
assert (issame(strange_sort_list({5, 5, 5, 5}) , {5, 5, 5, 5}));
assert (issame(strange_sort_list({}) , {}));
}
| ; ModuleID = 'c_code_test/code_69.cpp'
source_filename = "c_code_test/code_69.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::__less" = type { i8 }
%"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__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_ = 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 @_Z17strange_sort_listNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
store ptr null, ptr %0, align 4, !tbaa !3
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !10
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !11
%5 = load ptr, ptr %1, align 4, !tbaa !3
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !10
tail call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %5, ptr %7) #13
%8 = load ptr, ptr %6, align 4, !tbaa !10
%9 = load ptr, ptr %1, align 4, !tbaa !3
%10 = ptrtoint ptr %8 to i32
%11 = ptrtoint ptr %9 to i32
%12 = sub i32 %10, %11
%13 = ashr exact i32 %12, 2
br label %14
14: ; preds = %19, %2
%15 = phi i32 [ 0, %2 ], [ %22, %19 ]
%16 = phi i32 [ %13, %2 ], [ %17, %19 ]
%17 = add nsw i32 %16, -1
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load ptr, ptr %1, align 4, !tbaa !3
%21 = getelementptr inbounds i32, ptr %20, i32 %15
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %21) #13
%22 = add nuw nsw i32 %15, 1
%23 = load ptr, ptr %1, align 4, !tbaa !3
%24 = getelementptr inbounds i32, ptr %23, i32 %17
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %24) #13
br label %14, !llvm.loop !12
25: ; preds = %14
%26 = icmp eq i32 %15, %17
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = load ptr, ptr %1, align 4, !tbaa !3
%29 = getelementptr inbounds i32, ptr %28, i32 %15
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %29) #13
br label %30
30: ; preds = %25, %27
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 !14
%7 = icmp eq ptr %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, ptr %1, align 4, !tbaa !15
store i32 %9, ptr %4, align 4, !tbaa !15
%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) #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.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #4 comdat {
%3 = alloca %"struct.std::__2::__less", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #13
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) 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 #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 !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) #13
%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) #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 !15
store i32 %23, ptr %22, align 4, !tbaa !15
%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 !14
%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 !14
%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 !14
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 !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 !15, !noalias !26
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !15, !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 !14
store ptr %10, ptr %0, align 4, !tbaa !14
store ptr %17, ptr %6, align 4, !tbaa !14
%18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%19 = load ptr, ptr %3, align 4, !tbaa !14
%20 = load ptr, ptr %18, align 4, !tbaa !14
store ptr %20, ptr %3, align 4, !tbaa !14
store ptr %19, ptr %18, align 4, !tbaa !14
%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 !14
%24 = load ptr, ptr %22, align 4, !tbaa !14
store ptr %24, ptr %21, align 4, !tbaa !14
store ptr %23, ptr %22, align 4, !tbaa !14
%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 = { 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 = { 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, !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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!5, !5, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !6, i64 0}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, 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, !5, i64 0}
!25 = !{!18, !5, 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, !13}
!32 = !{!33, !33, i64 0}
!33 = !{!"vtable pointer", !7, i64 0}
!34 = distinct !{!34, !13}
| (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" "_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_" (func (;1;) (type 2)))
(import "env" "_ZdlPv" (func (;2;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;3;) (type 1)))
(import "env" "__cxa_throw" (func (;4;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;5;) (type 4)))
(import "env" "_Znwm" (func (;6;) (type 1)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;7;) (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 (;8;) (type 5))
(func (;9;) (type 0) (param i32 i32)
(local i32 i32 i32 i32)
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.get 1
i32.load offset=4
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 15
i32.add
call 1
local.get 2
i32.const 16
i32.add
global.set 0
local.get 1
i32.load offset=4
local.get 1
i32.load
i32.sub
i32.const 2
i32.shr_s
local.set 2
loop ;; label = @1
local.get 2
i32.const 1
i32.sub
local.tee 2
local.get 3
i32.gt_s
if ;; label = @2
local.get 0
local.get 1
i32.load
local.get 3
i32.const 2
i32.shl
i32.add
call 10
local.get 0
local.get 1
i32.load
local.get 2
i32.const 2
i32.shl
i32.add
call 10
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@1;)
end
end
local.get 2
local.get 3
i32.eq
if ;; label = @1
local.get 0
local.get 1
i32.load
local.get 3
i32.const 2
i32.shl
i32.add
call 10
end)
(func (;10;) (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 (;11;) (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 3
global.get 4
local.set 3
global.get 1
call 5
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 4
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 3
call 7
local.get 1
local.get 0
call 4
unreachable
end
local.get 4
i32.const 2
i32.shl
call 6
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 2
end
local.get 2
i32.const 32
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z17strange_sort_listNSt3__26vectorIiNS_9allocatorIiEEEE" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 11))
(data (;0;) (global.get 1) "vector\00"))
| 14 | 259 | 7,342 | 358 |
CPP/71 | /*
Given the lengths of the three sides of a triangle. Return the area of
the triangle rounded to 2 decimal points if the three sides form a valid triangle.
Otherwise return -1
Three sides make a valid triangle when the sum of any two sides is greater
than the third side.
Example:
triangle_area(3, 4, 5) == 6.00
triangle_area(1, 2, 10) == -1
*/
#include<stdio.h>
#include<math.h>
using namespace std;
float triangle_area(float a,float b,float c){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
float triangle_area(float a,float b,float c){
| if (a+b<=c or a+c<=b or b+c<=a) return -1;
float h=(a+b+c)/2;
float area;
area=pow(h*(h-a)*(h-b)*(h-c),0.5);
return area;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(triangle_area(3, 4, 5)-6.00)<0.01);
assert (abs(triangle_area(1, 2, 10) +1)<0.01);
assert (abs(triangle_area(4, 8, 5) -8.18)<0.01);
assert (abs(triangle_area(2, 2, 2) -1.73)<0.01);
assert (abs(triangle_area(1, 2, 3) +1)<0.01);
assert (abs(triangle_area(10, 5, 7) - 16.25)<0.01);
assert (abs(triangle_area(2, 6, 3) +1)<0.01);
assert (abs(triangle_area(1, 1, 1) -0.43)<0.01);
assert (abs(triangle_area(2, 2, 10) +1)<0.01);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (abs(triangle_area(3, 4, 5)-6.00)<0.01);
assert (abs(triangle_area(1, 2, 10) +1)<0.01);
}
| ; ModuleID = 'c_code_test/code_70.cpp'
source_filename = "c_code_test/code_70.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 nosync nounwind optsize willreturn memory(none)
define noundef float @_Z13triangle_areafff(float noundef %0, float noundef %1, float noundef %2) local_unnamed_addr #0 {
%4 = fadd float %0, %1
%5 = fcmp ugt float %4, %2
%6 = fadd float %0, %2
%7 = fcmp ugt float %6, %1
%8 = and i1 %5, %7
%9 = fadd float %1, %2
%10 = fcmp ugt float %9, %0
%11 = and i1 %10, %8
br i1 %11, label %12, label %25
12: ; preds = %3
%13 = fadd float %4, %2
%14 = fmul float %13, 5.000000e-01
%15 = fsub float %14, %0
%16 = fmul float %14, %15
%17 = fsub float %14, %1
%18 = fmul float %17, %16
%19 = fsub float %14, %2
%20 = fmul float %19, %18
%21 = tail call float @llvm.sqrt.f32(float %20)
%22 = fcmp oeq float %20, 0xFFF0000000000000
%23 = tail call float @llvm.fabs.f32(float %21)
%24 = select i1 %22, float 0x7FF0000000000000, float %23
br label %25
25: ; preds = %3, %12
%26 = phi float [ %24, %12 ], [ -1.000000e+00, %3 ]
ret float %26
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.sqrt.f32(float) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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)"}
| (module
(type (;0;) (func))
(type (;1;) (func (param f32 f32 f32) (result f32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param f32 f32 f32) (result f32)
(local f32 f32)
f32.const -0x1p+0 (;=-1;)
local.set 3
block ;; label = @1
local.get 1
local.get 2
f32.add
local.get 0
f32.le
br_if 0 (;@1;)
local.get 0
local.get 1
f32.add
local.tee 4
local.get 2
f32.le
local.get 0
local.get 2
f32.add
local.get 1
f32.le
i32.or
br_if 0 (;@1;)
f32.const inf (;=inf;)
local.get 4
local.get 2
f32.add
f32.const 0x1p-1 (;=0.5;)
f32.mul
local.tee 3
local.get 2
f32.sub
local.get 3
local.get 1
f32.sub
local.get 3
local.get 3
local.get 0
f32.sub
f32.mul
f32.mul
f32.mul
local.tee 0
f32.sqrt
f32.abs
local.get 0
f32.const -inf (;=-inf;)
f32.eq
select
local.set 3
end
local.get 3)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z13triangle_areafff" (func 1)))
| 6 | 144 | 1,203 | 60 |
CPP/72 | /*
Write a function that returns true if the object q will fly, and false otherwise.
The object q will fly if it's balanced (it is a palindromic vector) and the sum of its elements is less than or equal the maximum possible weight w.
Example:
will_it_fly({1, 2}, 5) ➞ false
// 1+2 is less than the maximum possible weight, but it's unbalanced.
will_it_fly({3, 2, 3}, 1) ➞ false
// it's balanced, but 3+2+3 is more than the maximum possible weight.
will_it_fly({3, 2, 3}, 9) ➞ true
// 3+2+3 is less than the maximum possible weight, and it's balanced.
will_it_fly({3}, 5) ➞ true
// 3 is less than the maximum possible weight, and it's balanced.
*/
#include<stdio.h>
#include<vector>
using namespace std;
bool will_it_fly(vector<int> q,int w){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool will_it_fly(vector<int> q,int w){
| int sum=0;
for (int i=0;i<q.size();i++)
{
if (q[i]!=q[q.size()-1-i]) return false;
sum+=q[i];
}
if (sum>w) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (will_it_fly({3, 2, 3}, 9)==true);
assert (will_it_fly({1, 2}, 5) == false);
assert (will_it_fly({3}, 5) == true);
assert (will_it_fly({3, 2, 3}, 1) == false);
assert (will_it_fly({1, 2, 3}, 6) ==false);
assert (will_it_fly({5}, 5) == true);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (will_it_fly({3, 2, 3}, 9)==true);
assert (will_it_fly({1, 2}, 5) == false);
assert (will_it_fly({3}, 5) == true);
assert (will_it_fly({3, 2, 3}, 1) == false);
}
| ; ModuleID = 'c_code_test/code_71.cpp'
source_filename = "c_code_test/code_71.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 @_Z11will_it_flyNSt3__26vectorIiNS_9allocatorIiEEEEi(ptr nocapture noundef readonly %0, i32 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 = %22, %2
%11 = phi i32 [ 0, %2 ], [ %23, %22 ]
%12 = phi i32 [ 0, %2 ], [ %24, %22 ]
%13 = icmp eq i32 %12, %9
br i1 %13, label %25, label %14
14: ; preds = %10
%15 = getelementptr inbounds i32, ptr %5, i32 %12
%16 = load i32, ptr %15, align 4, !tbaa !11
%17 = xor i32 %12, -1
%18 = add i32 %9, %17
%19 = getelementptr inbounds i32, ptr %5, i32 %18
%20 = load i32, ptr %19, align 4, !tbaa !11
%21 = icmp eq i32 %16, %20
br i1 %21, label %22, label %27
22: ; preds = %14
%23 = add nsw i32 %16, %11
%24 = add nuw i32 %12, 1
br label %10, !llvm.loop !13
25: ; preds = %10
%26 = icmp sle i32 %11, %1
br label %27
27: ; preds = %14, %25
%28 = phi i1 [ %26, %25 ], [ false, %14 ]
ret i1 %28
}
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 i32) (result i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
(local i32 i32 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 3
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.ne
if ;; label = @2
local.get 3
local.get 0
i32.const 2
i32.shl
i32.add
i32.load
local.tee 5
local.get 3
local.get 4
local.get 0
i32.const -1
i32.xor
i32.add
i32.const 2
i32.shl
i32.add
i32.load
i32.ne
if ;; label = @3
i32.const 0
return
else
local.get 0
i32.const 1
i32.add
local.set 0
local.get 2
local.get 5
i32.add
local.set 2
br 2 (;@1;)
end
unreachable
end
end
local.get 1
local.get 2
i32.ge_s)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z11will_it_flyNSt3__26vectorIiNS_9allocatorIiEEEEi" (func 1)))
| 9 | 176 | 1,350 | 64 |
CPP/73 | /*
Given a vector arr of integers, find the minimum number of elements that
need to be changed to make the vector palindromic. A palindromic vector is a vector that
is read the same backwards and forwards. In one change, you can change one element to any other element.
For example:
smallest_change({1,2,3,5,4,7,9,6}) == 4
smallest_change({1, 2, 3, 4, 3, 2, 2}) == 1
smallest_change({1, 2, 3, 2, 1}) == 0
*/
#include<stdio.h>
#include<vector>
using namespace std;
int smallest_change(vector<int> arr){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int smallest_change(vector<int> arr){
| int out=0;
for (int i=0;i<arr.size()-1-i;i++)
if (arr[i]!=arr[arr.size()-1-i])
out+=1;
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (smallest_change({1,2,3,5,4,7,9,6}) == 4);
assert (smallest_change({1, 2, 3, 4, 3, 2, 2}) == 1);
assert (smallest_change({1, 4, 2}) == 1);
assert (smallest_change({1, 4, 4, 2}) == 1);
assert (smallest_change({1, 2, 3, 2, 1}) == 0);
assert (smallest_change({3, 1, 1, 3}) == 0);
assert (smallest_change({1}) == 0);
assert (smallest_change({0, 1}) == 1);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (smallest_change({1,2,3,5,4,7,9,6}) == 4);
assert (smallest_change({1, 2, 3, 4, 3, 2, 2}) == 1);
assert (smallest_change({1, 2, 3, 2, 1}) == 0);
assert (smallest_change({3, 1, 1, 3}) == 0);
}
| ; ModuleID = 'c_code_test/code_72.cpp'
source_filename = "c_code_test/code_72.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 i32 @_Z15smallest_changeNSt3__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 = %16, %1
%10 = phi i32 [ 0, %1 ], [ %23, %16 ]
%11 = phi i32 [ 0, %1 ], [ %24, %16 ]
%12 = xor i32 %11, -1
%13 = add i32 %8, %12
%14 = icmp ult i32 %11, %13
br i1 %14, label %16, label %15
15: ; preds = %9
ret i32 %10
16: ; preds = %9
%17 = getelementptr inbounds i32, ptr %4, i32 %11
%18 = load i32, ptr %17, align 4, !tbaa !11
%19 = getelementptr inbounds i32, ptr %4, i32 %13
%20 = load i32, ptr %19, align 4, !tbaa !11
%21 = icmp ne i32 %18, %20
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %10, %22
%24 = add nuw nsw i32 %11, 1
br label %9, !llvm.loop !13
}
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 2
i32.sub
i32.const 2
i32.shr_s
local.set 3
i32.const 0
local.set 0
loop (result i32) ;; label = @1
local.get 3
local.get 0
i32.const -1
i32.xor
i32.add
local.tee 4
local.get 0
i32.le_u
if (result i32) ;; label = @2
local.get 1
else
local.get 1
local.get 2
local.get 0
i32.const 2
i32.shl
i32.add
i32.load
local.get 2
local.get 4
i32.const 2
i32.shl
i32.add
i32.load
i32.ne
i32.add
local.set 1
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z15smallest_changeNSt3__26vectorIiNS_9allocatorIiEEEE" (func 1)))
| 6 | 133 | 1,201 | 56 |
CPP/74 | /*
Write a function that accepts two vectors of strings and returns the vector that has
total number of chars in the all strings of the vector less than the other vector.
if the two vectors have the same number of chars, return the first vector.
Examples
total_match({}, {}) ➞ {}
total_match({"hi", "admin"}, {"hI", "Hi"}) ➞ {"hI", "Hi"}
total_match({"hi", "admin"}, {"hi", "hi", "admin", "project"}) ➞ {"hi", "admin"}
total_match({"hi", "admin"}, {"hI", "hi", "hi"}) ➞ {"hI", "hi", "hi"}
total_match({"4"}, {"1", "2", "3", "4", "5"}) ➞ {"4"}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<string> total_match(vector<string> lst1,vector<string> lst2){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<string> total_match(vector<string> lst1,vector<string> lst2){
| int num1,num2,i;
num1=0;num2=0;
for (i=0;i<lst1.size();i++)
num1+=lst1[i].length();
for (i=0;i<lst2.size();i++)
num2+=lst2[i].length();
if (num1>num2) return lst2;
return lst1;
}
| #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(total_match({}, {}) , {}));
assert (issame(total_match({"hi", "admin"}, {"hi", "hi"}) , {"hi", "hi"}));
assert (issame(total_match({"hi", "admin"}, {"hi", "hi", "admin", "project"}) , {"hi", "admin"}));
assert (issame(total_match({"4"}, {"1", "2", "3", "4", "5"}) , {"4"}));
assert (issame(total_match({"hi", "admin"}, {"hI", "Hi"}) , {"hI", "Hi"}));
assert (issame(total_match({"hi", "admin"}, {"hI", "hi", "hi"}) , {"hI", "hi", "hi"}));
assert (issame(total_match({"hi", "admin"}, {"hI", "hi", "hii"}) , {"hi", "admin"}));
assert (issame(total_match({}, {"this"}) , {}));
assert (issame(total_match({"this"}, {}) , {}));
}
| #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(total_match({}, {}) , {}));
assert (issame(total_match({"hi", "admin"}, {"hi", "hi", "admin", "project"}) , {"hi", "admin"}));
assert (issame(total_match({"4"}, {"1", "2", "3", "4", "5"}) , {"4"}));
assert (issame(total_match({"hi", "admin"}, {"hI", "Hi"}) , {"hI", "Hi"}));
assert (issame(total_match({"hi", "admin"}, {"hI", "hi", "hi"}) , {"hI", "hi", "hi"}));
}
| ; ModuleID = 'c_code_test/code_73.cpp'
source_filename = "c_code_test/code_73.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 }
$_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEC2B7v160006EOS8_ = comdat any
; Function Attrs: minsize mustprogress nounwind optsize
define void @_Z11total_matchNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEES8_(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%5 = load ptr, ptr %4, align 4, !tbaa !3
%6 = load ptr, ptr %1, align 4, !tbaa !10
%7 = ptrtoint ptr %5 to i32
%8 = ptrtoint ptr %6 to i32
%9 = sub i32 %7, %8
%10 = sdiv exact i32 %9, 12
br label %11
11: ; preds = %23, %3
%12 = phi i32 [ 0, %3 ], [ %32, %23 ]
%13 = phi i32 [ 0, %3 ], [ %33, %23 ]
%14 = icmp eq i32 %13, %10
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
%17 = load ptr, ptr %16, align 4, !tbaa !3
%18 = load ptr, ptr %2, align 4, !tbaa !10
%19 = ptrtoint ptr %17 to i32
%20 = ptrtoint ptr %18 to i32
%21 = sub i32 %19, %20
%22 = sdiv exact i32 %21, 12
br label %34
23: ; preds = %11
%24 = getelementptr inbounds %"class.std::__2::basic_string", ptr %6, i32 %13
%25 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %24, i32 0, i32 2
%26 = load i8, ptr %25, align 1
%27 = icmp slt i8 %26, 0
%28 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %24, i32 0, i32 1
%29 = load i32, ptr %28, align 4
%30 = zext i8 %26 to i32
%31 = select i1 %27, i32 %29, i32 %30
%32 = add i32 %31, %12
%33 = add nuw i32 %13, 1
br label %11, !llvm.loop !11
34: ; preds = %15, %38
%35 = phi i32 [ %47, %38 ], [ 0, %15 ]
%36 = phi i32 [ %48, %38 ], [ 0, %15 ]
%37 = icmp eq i32 %36, %22
br i1 %37, label %49, label %38
38: ; preds = %34
%39 = getelementptr inbounds %"class.std::__2::basic_string", ptr %18, i32 %36
%40 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %39, i32 0, i32 2
%41 = load i8, ptr %40, align 1
%42 = icmp slt i8 %41, 0
%43 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %39, i32 0, i32 1
%44 = load i32, ptr %43, align 4
%45 = zext i8 %41 to i32
%46 = select i1 %42, i32 %44, i32 %45
%47 = add i32 %46, %35
%48 = add nuw i32 %36, 1
br label %34, !llvm.loop !13
49: ; preds = %34
%50 = icmp sgt i32 %12, %35
%51 = select i1 %50, ptr %2, ptr %1
%52 = tail call noundef ptr @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEC2B7v160006EOS8_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %51) #2
ret void
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEC2B7v160006EOS8_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #1 comdat {
store ptr null, ptr %0, align 4, !tbaa !10
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !14
%5 = load ptr, ptr %1, align 4, !tbaa !10
store ptr %5, ptr %0, align 4, !tbaa !10
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !3
store ptr %7, ptr %3, align 4, !tbaa !3
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !15
store ptr %9, ptr %4, align 4, !tbaa !15
store ptr null, ptr %8, align 4, !tbaa !15
store ptr null, ptr %6, align 4, !tbaa !3
store ptr null, ptr %1, align 4, !tbaa !10
ret ptr %0
}
attributes #0 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { minsize nounwind optsize }
!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__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 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!9, !5, i64 0}
!15 = !{!5, !5, i64 0}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32 i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32 i32)
(local i32 i32 i32 i32 i32 i32)
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 4
i32.sub
i32.const 12
i32.div_s
local.set 6
loop ;; label = @1
local.get 3
local.get 6
i32.eq
if ;; label = @2
local.get 2
i32.load offset=4
local.get 2
i32.load
local.tee 6
i32.sub
i32.const 12
i32.div_s
local.set 5
i32.const 0
local.set 4
i32.const 0
local.set 3
loop ;; label = @3
local.get 3
local.get 5
i32.ne
if ;; label = @4
local.get 4
local.get 6
local.get 3
i32.const 12
i32.mul
i32.add
local.tee 7
i32.load offset=4
local.get 7
i32.load8_u offset=11
local.tee 7
local.get 7
i32.extend8_s
i32.const 0
i32.lt_s
select
i32.add
local.set 4
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@3;)
end
end
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 2
local.get 1
local.get 4
local.get 8
i32.lt_s
select
local.tee 1
i32.load
i32.store
local.get 0
local.get 1
i32.load offset=4
i32.store offset=4
local.get 0
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
else
local.get 8
local.get 4
local.get 3
i32.const 12
i32.mul
i32.add
local.tee 5
i32.load offset=4
local.get 5
i32.load8_u offset=11
local.tee 5
local.get 5
i32.extend8_s
i32.const 0
i32.lt_s
select
i32.add
local.set 8
local.get 3
i32.const 1
i32.add
local.set 3
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z11total_matchNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEES8_" (func 1)))
| 9 | 219 | 2,743 | 123 |
CPP/75 | /*
Write a function that returns true if the given number is the multiplication of 3 prime numbers
and false otherwise.
Knowing that (a) is less then 100.
Example:
is_multiply_prime(30) == true
30 = 2 * 3 * 5
*/
#include<stdio.h>
using namespace std;
bool is_multiply_prime(int a){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool is_multiply_prime(int a){
| int num=0;
for (int i=2;i*i<=a;i++)
while (a%i==0 and a>i)
{
a=a/i;
num+=1;
}
if (num==2) return true;
return false;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_multiply_prime(5) == false);
assert (is_multiply_prime(30) == true);
assert (is_multiply_prime(8) == true);
assert (is_multiply_prime(10) == false);
assert (is_multiply_prime(125) == true);
assert (is_multiply_prime(3 * 5 * 7) == true);
assert (is_multiply_prime(3 * 6 * 7) == false);
assert (is_multiply_prime(9 * 9 * 9) == false);
assert (is_multiply_prime(11 * 9 * 9) == false);
assert (is_multiply_prime(11 * 13 * 7) == true);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_multiply_prime(30) == true);
}
| ; ModuleID = 'c_code_test/code_74.cpp'
source_filename = "c_code_test/code_74.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 zeroext i1 @_Z17is_multiply_primei(i32 noundef %0) local_unnamed_addr #0 {
br label %2
2: ; preds = %23, %1
%3 = phi i32 [ %0, %1 ], [ %11, %23 ]
%4 = phi i32 [ 0, %1 ], [ %12, %23 ]
%5 = phi i32 [ 2, %1 ], [ %24, %23 ]
%6 = mul nsw i32 %5, %5
%7 = icmp sgt i32 %6, %3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = icmp eq i32 %4, 2
ret i1 %9
10: ; preds = %2, %21
%11 = phi i32 [ %15, %21 ], [ %3, %2 ]
%12 = phi i32 [ %22, %21 ], [ %4, %2 ]
%13 = freeze i32 %11
%14 = freeze i32 %5
%15 = sdiv i32 %13, %14
%16 = mul i32 %15, %14
%17 = sub i32 %13, %16
%18 = icmp eq i32 %17, 0
%19 = icmp sgt i32 %11, %5
%20 = and i1 %19, %18
br i1 %20, label %21, label %23
21: ; preds = %10
%22 = add nsw i32 %12, 1
br label %10, !llvm.loop !3
23: ; preds = %10
%24 = add nuw nsw i32 %5, 1
br label %2, !llvm.loop !5
}
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)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = distinct !{!5, !4}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32)
i32.const 2
local.set 1
loop ;; label = @1
local.get 1
local.get 1
i32.mul
local.get 0
i32.gt_s
i32.eqz
if ;; label = @2
local.get 0
local.set 3
local.get 2
local.set 4
loop ;; label = @3
block ;; label = @4
local.get 4
local.set 2
local.get 3
local.tee 0
local.get 1
i32.div_s
local.set 3
local.get 0
local.get 1
i32.le_s
br_if 0 (;@4;)
local.get 2
i32.const 1
i32.add
local.set 4
local.get 0
local.get 1
local.get 3
i32.mul
i32.eq
br_if 1 (;@3;)
end
end
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end
local.get 2
i32.const 2
i32.eq)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z17is_multiply_primei" (func 1)))
| 10 | 164 | 1,302 | 58 |
CPP/76 | /*
Your task is to write a function that returns true if a number x is a simple
power of n and false in other cases.
x is a simple power of n if n**int=x
For example:
is_simple_power(1, 4) => true
is_simple_power(2, 2) => true
is_simple_power(8, 2) => true
is_simple_power(3, 2) => false
is_simple_power(3, 1) => false
is_simple_power(5, 3) => false
*/
#include<stdio.h>
#include<math.h>
using namespace std;
bool is_simple_power(int x,int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool is_simple_power(int x,int n){
| int p=1,count=0;
while (p<=x and count<100)
{
if (p==x) return true;
p=p*n;count+=1;
}
return false;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_simple_power(1, 4)== true);
assert (is_simple_power(2, 2)==true);
assert (is_simple_power(8, 2)==true);
assert (is_simple_power(3, 2)==false);
assert (is_simple_power(3, 1)==false);
assert (is_simple_power(5, 3)==false);
assert (is_simple_power(16, 2)== true);
assert (is_simple_power(143214, 16)== false);
assert (is_simple_power(4, 2)==true);
assert (is_simple_power(9, 3)==true);
assert (is_simple_power(16, 4)==true);
assert (is_simple_power(24, 2)==false);
assert (is_simple_power(128, 4)==false);
assert (is_simple_power(12, 6)==false);
assert (is_simple_power(1, 1)==true);
assert (is_simple_power(1, 12)==true);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_simple_power(1, 4)== true);
assert (is_simple_power(2, 2)==true);
assert (is_simple_power(8, 2)==true);
assert (is_simple_power(3, 2)==false);
assert (is_simple_power(3, 1)==false);
assert (is_simple_power(5, 3)==false);
}
| ; ModuleID = 'c_code_test/code_75.cpp'
source_filename = "c_code_test/code_75.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 zeroext i1 @_Z15is_simple_powerii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
br label %3
3: ; preds = %11, %2
%4 = phi i32 [ 1, %2 ], [ %12, %11 ]
%5 = phi i32 [ 0, %2 ], [ %13, %11 ]
%6 = icmp sle i32 %4, %0
%7 = icmp ult i32 %5, 100
%8 = select i1 %6, i1 %7, i1 false
%9 = icmp ne i32 %4, %0
%10 = and i1 %9, %8
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = mul nsw i32 %4, %1
%13 = add nuw nsw i32 %5, 1
br label %3, !llvm.loop !3
14: ; preds = %3
ret i1 %8
}
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)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
(local i32 i32 i32)
i32.const 1
local.set 2
loop ;; label = @1
local.get 3
i32.const 100
i32.lt_u
local.get 0
local.get 2
i32.ge_s
i32.and
local.tee 4
i32.eqz
local.get 0
local.get 2
i32.eq
i32.or
i32.eqz
if ;; label = @2
local.get 3
i32.const 1
i32.add
local.set 3
local.get 1
local.get 2
i32.mul
local.set 2
br 1 (;@1;)
end
end
local.get 4)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z15is_simple_powerii" (func 1)))
| 8 | 139 | 826 | 39 |
CPP/77 | /*
Write a function that takes an integer a and returns true
if this ingeger is a cube of some integer number.
Note: you may assume the input is always valid.
Examples:
iscube(1) ==> true
iscube(2) ==> false
iscube(-1) ==> true
iscube(64) ==> true
iscube(0) ==> true
iscube(180) ==> false
*/
#include<stdio.h>
#include<math.h>
using namespace std;
bool iscuber(int a){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool iscuber(int a){
| for (int i=0;i*i*i<=abs(a);i++)
if (i*i*i==abs(a)) return true;
return false;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (iscuber(1) == true);
assert (iscuber(2) == false);
assert (iscuber(-1) == true);
assert (iscuber(64) == true);
assert (iscuber(180) == false);
assert (iscuber(1000) == true);
assert (iscuber(0) == true);
assert (iscuber(1729) == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (iscuber(1) == true);
assert (iscuber(2) == false);
assert (iscuber(-1) == true);
assert (iscuber(64) == true);
assert (iscuber(180) == false);
assert (iscuber(0) == true);
}
| ; ModuleID = 'c_code_test/code_76.cpp'
source_filename = "c_code_test/code_76.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 nosync nounwind optsize willreturn memory(none)
define noundef zeroext i1 @_Z7iscuberi(i32 noundef %0) local_unnamed_addr #0 {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %8, %3 ]
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = icmp ult i32 %6, %2
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %3, label %9, !llvm.loop !3
9: ; preds = %3
%10 = icmp ule i32 %6, %2
ret i1 %10
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32)
local.get 0
local.get 0
i32.const 31
i32.shr_s
local.tee 1
i32.xor
local.get 1
i32.sub
local.set 1
i32.const 0
local.set 0
loop ;; label = @1
local.get 0
local.get 0
i32.mul
local.get 0
i32.mul
local.set 2
local.get 0
i32.const 1
i32.add
local.set 0
local.get 1
local.get 2
i32.gt_u
br_if 0 (;@1;)
end
local.get 1
local.get 2
i32.ge_u)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z7iscuberi" (func 1)))
| 4 | 96 | 776 | 39 |
CPP/78 | /*
You have been tasked to write a function that receives
a hexadecimal number as a string and counts the number of hexadecimal
digits that are primes (prime number, or a prime, is a natural number
greater than 1 that is not a product of two smaller natural numbers).
Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
So you have to determine a number of the following digits: 2, 3, 5, 7,
B (=decimal 11), D (=decimal 13).
Note: you may assume the input is always correct or empty string,
and symbols A,B,C,D,E,F are always uppercase.
Examples:
For num = "AB" the output should be 1.
For num = "1077E" the output should be 2.
For num = "ABED1A33" the output should be 4.
For num = "123456789ABCDEF0" the output should be 6.
For num = "2020" the output should be 2.
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
int hex_key(string num){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
int hex_key(string num){
| string key="2357BD";
int out=0;
for (int i=0;i<num.length();i++)
if (find(key.begin(),key.end(),num[i])!=key.end()) out+=1;
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (hex_key("AB") == 1 );
assert (hex_key("1077E") == 2 );
assert (hex_key("ABED1A33") == 4 );
assert (hex_key("2020") == 2 );
assert (hex_key("123456789ABCDEF0") == 6 );
assert (hex_key("112233445566778899AABBCCDDEEFF00") == 12 );
assert (hex_key("") == 0);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (hex_key("AB") == 1 );
assert (hex_key("1077E") == 2 );
assert (hex_key("ABED1A33") == 4 );
assert (hex_key("2020") == 2 );
assert (hex_key("123456789ABCDEF0") == 6 );
}
| ; ModuleID = 'c_code_test/code_77.cpp'
source_filename = "c_code_test/code_77.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_ = comdat any
@.str = private unnamed_addr constant [7 x i8] c"2357BD\00", align 1
; Function Attrs: minsize optsize
define noundef i32 @_Z7hex_keyNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #7
%3 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull @.str) #8
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
br label %8
8: ; preds = %19, %1
%9 = phi i32 [ 0, %1 ], [ %43, %19 ]
%10 = phi i32 [ 0, %1 ], [ %42, %19 ]
%11 = load i8, ptr %4, align 1
%12 = icmp slt i8 %11, 0
%13 = load i32, ptr %5, align 4
%14 = zext i8 %11 to i32
%15 = select i1 %12, i32 %13, i32 %14
%16 = icmp ult i32 %9, %15
br i1 %16, label %19, label %17
17: ; preds = %8
%18 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #9
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
ret i32 %10
19: ; preds = %8
%20 = load i8, ptr %6, align 1
%21 = icmp slt i8 %20, 0
%22 = load ptr, ptr %2, align 4
%23 = select i1 %21, ptr %22, ptr %2
%24 = load i32, ptr %7, align 4
%25 = zext i8 %20 to i32
%26 = select i1 %21, i32 %24, i32 %25
%27 = getelementptr inbounds i8, ptr %23, i32 %26
%28 = load ptr, ptr %0, align 4
%29 = select i1 %12, ptr %28, ptr %0
%30 = getelementptr inbounds i8, ptr %29, i32 %9
%31 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %23, ptr %27, ptr noundef nonnull align 1 dereferenceable(1) %30) #8
%32 = load i8, ptr %6, align 1
%33 = icmp slt i8 %32, 0
%34 = load ptr, ptr %2, align 4
%35 = select i1 %33, ptr %34, ptr %2
%36 = load i32, ptr %7, align 4
%37 = zext i8 %32 to i32
%38 = select i1 %33, i32 %36, i32 %37
%39 = getelementptr inbounds i8, ptr %35, i32 %38
%40 = icmp ne ptr %31, %39
%41 = zext i1 %40 to i32
%42 = add nuw nsw i32 %10, %41
%43 = add nuw nsw i32 %9, 1
br label %8, !llvm.loop !3
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #9
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #8
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #2 comdat {
%4 = ptrtoint ptr %0 to i32
%5 = ptrtoint ptr %1 to i32
%6 = load i8, ptr %2, align 1
%7 = sub i32 %5, %4
%8 = getelementptr i8, ptr %0, i32 %7
br label %9
9: ; preds = %15, %3
%10 = phi ptr [ %0, %3 ], [ %16, %15 ]
%11 = icmp eq ptr %10, %1
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = load i8, ptr %10, align 1, !tbaa !5
%14 = icmp eq i8 %13, %6
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, ptr %10, i32 1
br label %9, !llvm.loop !8
17: ; preds = %12, %9
%18 = phi ptr [ %10, %12 ], [ %8, %9 ]
ret ptr %18
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #5
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #6
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 nounwind 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { nounwind }
attributes #8 = { minsize optsize }
attributes #9 = { minsize nounwind optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !4}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;4;) (type 3))
(func (;5;) (type 0) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 6
global.set 0
local.get 6
i32.const 4
i32.add
global.get 1
call 0
local.set 2
loop (result i32) ;; label = @1
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 5
select
local.get 4
i32.le_u
if (result i32) ;; label = @2
local.get 2
call 1
drop
local.get 6
i32.const 16
i32.add
global.set 0
local.get 7
else
local.get 7
block (result i32) ;; label = @3
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 8
select
local.set 1
local.get 1
local.get 2
i32.load offset=4
local.get 3
local.get 8
select
i32.add
local.set 3
local.get 0
i32.load
local.get 0
local.get 5
select
local.get 4
i32.add
i32.load8_u
local.set 5
loop ;; label = @4
block ;; label = @5
local.get 1
local.get 3
i32.ne
if (result i32) ;; label = @6
local.get 1
i32.load8_u
local.get 5
i32.ne
br_if 1 (;@5;)
local.get 1
else
local.get 3
end
br 2 (;@3;)
end
local.get 1
i32.const 1
i32.add
local.set 1
br 0 (;@4;)
end
unreachable
end
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.get 2
i32.load offset=4
local.get 1
local.get 3
select
i32.add
i32.ne
i32.add
local.set 7
local.get 4
i32.const 1
i32.add
local.set 4
br 1 (;@1;)
end
end)
(func (;6;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 4))
(export "__wasm_apply_data_relocs" (func 4))
(export "_Z7hex_keyNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 5))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 6))
(data (;0;) (global.get 1) "2357BD\00"))
| 6 | 158 | 3,755 | 145 |
CPP/79 | /*
You will be given a number in decimal form and your task is to convert it to
binary format. The function should return a string, with each character representing a binary
number. Each character in the string will be '0' or '1'.
There will be an extra couple of characters "db" at the beginning and at the end of the string.
The extra characters are there to help with the format.
Examples:
decimal_to_binary(15) // returns "db1111db"
decimal_to_binary(32) // returns "db100000db"
*/
#include<stdio.h>
#include<string>
using namespace std;
string decimal_to_binary(int decimal){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string decimal_to_binary(int decimal){
| string out="";
if (decimal==0) return "db0db";
while (decimal>0)
{
out=to_string(decimal%2)+out;
decimal=decimal/2;
}
out="db"+out+"db";
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (decimal_to_binary(0) == "db0db");
assert (decimal_to_binary(32) == "db100000db");
assert (decimal_to_binary(103) == "db1100111db");
assert (decimal_to_binary(15) == "db1111db");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (decimal_to_binary(32) == "db100000db");
assert (decimal_to_binary(15) == "db1111db");
}
| ; ModuleID = 'c_code_test/code_78.cpp'
source_filename = "c_code_test/code_78.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_PKS6_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"db0db\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"db\00", align 1
; Function Attrs: minsize optsize
define void @_Z17decimal_to_binaryi(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #11
%8 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #12
%9 = icmp eq i32 %1, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str.1) #12
br label %23
12: ; preds = %2, %15
%13 = phi i32 [ %19, %15 ], [ %1, %2 ]
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #11
%16 = and i32 %13, 1
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, i32 noundef %16) #12
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %3) #12
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4) #13
%17 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #13
%18 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #11
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #11
%19 = lshr i32 %13, 1
br label %12, !llvm.loop !3
20: ; preds = %12
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #11
call void @_ZNSt3__2plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %7, ptr noundef nonnull @.str.2, ptr noundef nonnull align 4 dereferenceable(12) %3) #12
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_PKS6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull @.str.2) #12
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %6) #13
%21 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #13
%22 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #11
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #11
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3, i32 12, i1 false)
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 0, i32 12, i1 false)
br label %23
23: ; preds = %20, %10
%24 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #11
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: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #13
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #12
ret ptr %0
}
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #2 comdat {
%4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #12
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__29to_stringEi(ptr sret(%"class.std::__2::basic_string") align 4, i32 noundef) local_unnamed_addr #0
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_PKS6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %2) local_unnamed_addr #2 comdat {
%4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef %2) #12
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__2plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_(ptr sret(%"class.std::__2::basic_string") align 4, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #2
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #7 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
%6 = load ptr, ptr %1, align 4
%7 = select i1 %5, ptr %6, ptr %1
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %7, i32 noundef %11) #12
ret ptr %12
}
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #0
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #8 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !5
tail call void @_ZdlPv(ptr noundef %7) #14
br label %8
8: ; preds = %6, %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 !8
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !5
ret void
}
; 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) #9
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) local_unnamed_addr #0
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #10
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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { nounwind }
attributes #12 = { minsize optsize }
attributes #13 = { minsize nounwind optsize }
attributes #14 = { builtin minsize nounwind optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{i64 0, i64 4, !9, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 11, i64 4, !11, i64 0, i64 11, !5, i64 11, i64 0, !5, i64 11, i64 1, !5, i64 11, i64 1, !5, i64 0, i64 12, !5}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !6, i64 0}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func (param i32) (result i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32 i32 i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__29to_stringEi" (func (;1;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;2;) (type 2)))
(import "env" "_ZNSt3__2plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_" (func (;3;) (type 3)))
(import "env" "strlen" (func (;4;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;5;) (type 3)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc" (func (;6;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm" (func (;7;) (type 4)))
(import "env" "_ZdlPv" (func (;8;) (type 5)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;9;) (type 6))
(func (;10;) (type 1) (param i32 i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 5
global.set 0
local.get 5
i32.const 36
i32.add
global.get 1
i32.const 5
i32.add
call 0
local.set 2
block ;; label = @1
local.get 1
if ;; label = @2
loop ;; label = @3
local.get 1
i32.const 0
i32.gt_s
if ;; label = @4
local.get 5
i32.const 12
i32.add
local.tee 6
local.get 1
i32.const 1
i32.and
call 1
local.get 5
i32.const 24
i32.add
local.tee 3
local.get 6
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 4
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.get 2
i32.load offset=4
local.get 4
local.get 7
select
call 7
local.tee 4
i64.load align=4
i64.store align=4
local.get 3
local.get 4
i32.load offset=8
i32.store offset=8
local.get 4
i64.const 0
i64.store align=4
local.get 4
i32.const 0
i32.store offset=8
local.get 2
local.get 3
call 12
local.get 1
i32.const 1
i32.shr_u
local.set 1
local.get 3
call 2
drop
local.get 6
call 2
drop
br 1 (;@3;)
end
end
local.get 5
i32.const 12
i32.add
local.tee 4
global.get 1
i32.const 3
i32.add
local.tee 3
local.get 2
call 3
local.get 5
i32.const 24
i32.add
local.tee 1
local.get 4
local.get 3
call 6
local.tee 3
i64.load align=4
i64.store align=4
local.get 1
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
local.get 2
local.get 1
call 12
local.get 1
call 2
drop
local.get 4
call 2
drop
local.get 0
local.get 2
i32.load offset=8
i32.store offset=8
local.get 0
local.get 2
i64.load align=4
i64.store align=4
local.get 2
i64.const 0
i64.store align=4
local.get 2
i32.const 0
i32.store offset=8
br 1 (;@1;)
end
local.get 0
global.get 1
call 0
drop
end
local.get 2
call 2
drop
local.get 5
i32.const 48
i32.add
global.set 0)
(func (;11;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 4
call 5
local.get 0)
(func (;12;) (type 1) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 8
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(export "__wasm_call_ctors" (func 9))
(export "__wasm_apply_data_relocs" (func 9))
(export "_Z17decimal_to_binaryi" (func 10))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 11))
(data (;0;) (global.get 1) "db0db\00"))
| 10 | 195 | 5,341 | 206 |
CPP/80 | /*
You are given a string s.
Your task is to check if the string is happy or not.
A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
For example:
is_happy("a") => false
is_happy("aa") => false
is_happy("abcd") => true
is_happy("aabb") => false
is_happy("adb") => true
is_happy("xyy") => false
*/
#include<stdio.h>
#include<string>
using namespace std;
bool is_happy(string s){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool is_happy(string s){
| if (s.length()<3) return false;
for (int i=2;i<s.length();i++)
if (s[i]==s[i-1] or s[i]==s[i-2]) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_happy("a") == false );
assert (is_happy("aa") == false );
assert (is_happy("abcd") == true );
assert (is_happy("aabb") == false );
assert (is_happy("adb") == true );
assert (is_happy("xyy") == false );
assert (is_happy("iopaxpoi") == true );
assert (is_happy("iopaxioi") == false );
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_happy("a") == false );
assert (is_happy("aa") == false );
assert (is_happy("abcd") == true );
assert (is_happy("aabb") == false );
assert (is_happy("adb") == true );
assert (is_happy("xyy") == false );
}
| ; ModuleID = 'c_code_test/code_79.cpp'
source_filename = "c_code_test/code_79.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none)
define noundef zeroext i1 @_Z8is_happyNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
%9 = icmp ult i32 %8, 3
br i1 %9, label %30, label %10
10: ; preds = %1, %22
%11 = phi i32 [ %27, %22 ], [ 2, %1 ]
%12 = icmp eq i32 %11, %8
br i1 %12, label %28, label %13
13: ; preds = %10
%14 = load ptr, ptr %0, align 4
%15 = select i1 %4, ptr %14, ptr %0
%16 = getelementptr inbounds i8, ptr %15, i32 %11
%17 = load i8, ptr %16, align 1, !tbaa !3
%18 = add nsw i32 %11, -1
%19 = getelementptr inbounds i8, ptr %15, i32 %18
%20 = load i8, ptr %19, align 1, !tbaa !3
%21 = icmp eq i8 %17, %20
br i1 %21, label %28, label %22
22: ; preds = %13
%23 = add nsw i32 %11, -2
%24 = getelementptr inbounds i8, ptr %15, i32 %23
%25 = load i8, ptr %24, align 1, !tbaa !3
%26 = icmp eq i8 %17, %25
%27 = add nuw i32 %11, 1
br i1 %26, label %28, label %10, !llvm.loop !6
28: ; preds = %13, %22, %10
%29 = icmp uge i32 %11, %8
br label %30
30: ; preds = %28, %1
%31 = phi i1 [ false, %1 ], [ %29, %28 ]
ret i1 %31
}
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, !4, i64 0}
!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"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 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
local.tee 3
i32.const 0
i32.lt_s
select
local.tee 2
i32.const 3
i32.ge_u
if (result i32) ;; label = @1
i32.const 2
local.set 4
local.get 3
i32.const 0
i32.lt_s
local.set 5
loop ;; label = @2
block ;; label = @3
local.get 2
local.get 4
local.tee 1
i32.eq
if ;; label = @4
local.get 2
local.set 1
br 1 (;@3;)
end
local.get 0
i32.load
local.get 0
local.get 5
select
local.get 1
i32.add
local.tee 3
i32.load8_u
local.tee 6
local.get 3
i32.const 1
i32.sub
i32.load8_u
i32.eq
br_if 0 (;@3;)
local.get 1
i32.const 1
i32.add
local.set 4
local.get 6
local.get 3
i32.const 2
i32.sub
i32.load8_u
i32.ne
br_if 1 (;@2;)
end
end
local.get 1
local.get 2
i32.ge_u
else
i32.const 0
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z8is_happyNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 5 | 142 | 1,710 | 77 |
CPP/81 | /*
It is the last week of the semester and the teacher has to give the grades
to students. The teacher has been making her own algorithm for grading.
The only problem is, she has lost the code she used for grading.
She has given you a vector of GPAs for some students and you have to write
a function that can output a vector of letter grades using the following table:
GPA | Letter grade
4.0 A+
> 3.7 A
> 3.3 A-
> 3.0 B+
> 2.7 B
> 2.3 B-
> 2.0 C+
> 1.7 C
> 1.3 C-
> 1.0 D+
> 0.7 D
> 0.0 D-
0.0 E
Example:
grade_equation({4.0, 3, 1.7, 2, 3.5}) ==> {"A+", "B", "C-", "C", "A-"}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<string> numerical_letter_grade(vector<float> grades){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<string> numerical_letter_grade(vector<float> grades){
| vector<string> out={};
for (int i=0;i<grades.size();i++)
{
if (grades[i]>=3.9999) out.push_back("A+");
if (grades[i]>3.7001 and grades[i]<3.9999) out.push_back("A");
if (grades[i]>3.3001 and grades[i]<=3.7001) out.push_back("A-");
if (grades[i]>3.0001 and grades[i]<=3.3001) out.push_back("B+");
if (grades[i]>2.7001 and grades[i]<=3.0001) out.push_back("B");
if (grades[i]>2.3001 and grades[i]<=2.7001) out.push_back("B-");
if (grades[i]>2.0001 and grades[i]<=2.3001) out.push_back("C+");
if (grades[i]>1.7001 and grades[i]<=2.0001) out.push_back("C");
if (grades[i]>1.3001 and grades[i]<=1.7001) out.push_back("C-");
if (grades[i]>1.0001 and grades[i]<=1.3001) out.push_back("D+");
if (grades[i]>0.7001 and grades[i]<=1.0001) out.push_back("D");
if (grades[i]>0.0001 and grades[i]<=0.7001) out.push_back("D-");
if (grades[i]<=0.0001) out.push_back("E");
}
return out;
}
| #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(numerical_letter_grade({4.0, 3, 1.7, 2, 3.5}) , {"A+", "B", "C-", "C", "A-"}));
assert (issame(numerical_letter_grade({1.2}) , {"D+"}));
assert (issame(numerical_letter_grade({0.5}) , {"D-"}));
assert (issame(numerical_letter_grade({0.0}) , {"E"}));
assert (issame(numerical_letter_grade({1, 0.3, 1.5, 2.8, 3.3}) , {"D", "D-", "C-", "B", "B+"}));
assert (issame(numerical_letter_grade({0, 0.7}) , {"E", "D-"}));
}
| #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(numerical_letter_grade({4.0, 3, 1.7, 2, 3.5}) , {"A+", "B", "C-", "C", "A-"}));
}
| ; ModuleID = 'c_code_test/code_80.cpp'
source_filename = "c_code_test/code_80.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.8" }
%"class.std::__2::__compressed_pair.8" = type { %"struct.std::__2::__compressed_pair_elem.9" }
%"struct.std::__2::__compressed_pair_elem.9" = 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 }
%"class.std::__2::vector.1" = type { ptr, ptr, %"class.std::__2::__compressed_pair.2" }
%"class.std::__2::__compressed_pair.2" = type { %"struct.std::__2::__compressed_pair_elem.3" }
%"struct.std::__2::__compressed_pair_elem.3" = type { ptr }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.14" }
%"class.std::__2::__compressed_pair.14" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.15" }
%"struct.std::__2::__compressed_pair_elem.15" = 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_backB7v160006EOS6_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIS6_EEvOT_ = 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
@.str = private unnamed_addr constant [3 x i8] c"A+\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"A-\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"B+\00", align 1
@.str.4 = private unnamed_addr constant [2 x i8] c"B\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"B-\00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"C+\00", align 1
@.str.7 = private unnamed_addr constant [2 x i8] c"C\00", align 1
@.str.8 = private unnamed_addr constant [3 x i8] c"C-\00", align 1
@.str.9 = private unnamed_addr constant [3 x i8] c"D+\00", align 1
@.str.10 = private unnamed_addr constant [2 x i8] c"D\00", align 1
@.str.11 = private unnamed_addr constant [3 x i8] c"D-\00", align 1
@.str.12 = private unnamed_addr constant [2 x i8] c"E\00", align 1
@.str.13 = 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 @_Z22numerical_letter_gradeNSt3__26vectorIfNS_9allocatorIfEEEE(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 %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
%8 = alloca %"class.std::__2::basic_string", align 4
%9 = alloca %"class.std::__2::basic_string", align 4
%10 = alloca %"class.std::__2::basic_string", align 4
%11 = alloca %"class.std::__2::basic_string", align 4
%12 = alloca %"class.std::__2::basic_string", align 4
%13 = alloca %"class.std::__2::basic_string", align 4
%14 = alloca %"class.std::__2::basic_string", align 4
%15 = alloca %"class.std::__2::basic_string", align 4
store ptr null, ptr %0, align 4, !tbaa !3
%16 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %16, align 4, !tbaa !10
%17 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %17, align 4, !tbaa !11
%18 = getelementptr inbounds %"class.std::__2::vector.1", ptr %1, i32 0, i32 1
br label %19
19: ; preds = %178, %2
%20 = phi i32 [ 0, %2 ], [ %179, %178 ]
%21 = load ptr, ptr %18, align 4, !tbaa !12
%22 = load ptr, ptr %1, align 4, !tbaa !16
%23 = ptrtoint ptr %21 to i32
%24 = ptrtoint ptr %22 to i32
%25 = sub i32 %23, %24
%26 = ashr exact i32 %25, 2
%27 = icmp ult i32 %20, %26
br i1 %27, label %28, label %180
28: ; preds = %19
%29 = getelementptr inbounds float, ptr %22, i32 %20
%30 = load float, ptr %29, align 4, !tbaa !17
%31 = fpext float %30 to double
%32 = fcmp ult double %31, 3.999900e+00
br i1 %32, label %40, label %33
33: ; preds = %28
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #18
%34 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #19
%35 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #18
%36 = load ptr, ptr %1, align 4, !tbaa !16
%37 = getelementptr inbounds float, ptr %36, i32 %20
%38 = load float, ptr %37, align 4, !tbaa !17
%39 = fpext float %38 to double
br label %40
40: ; preds = %33, %28
%41 = phi double [ %39, %33 ], [ %31, %28 ]
%42 = fcmp ogt double %41, 3.700100e+00
%43 = fcmp olt double %41, 3.999900e+00
%44 = and i1 %42, %43
br i1 %44, label %45, label %52
45: ; preds = %40
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #18
%46 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull @.str.1) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4) #19
%47 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #18
%48 = load ptr, ptr %1, align 4, !tbaa !16
%49 = getelementptr inbounds float, ptr %48, i32 %20
%50 = load float, ptr %49, align 4, !tbaa !17
%51 = fpext float %50 to double
br label %52
52: ; preds = %45, %40
%53 = phi double [ %51, %45 ], [ %41, %40 ]
%54 = fcmp ule double %53, 3.300100e+00
%55 = fcmp ugt double %53, 3.700100e+00
%56 = or i1 %54, %55
br i1 %56, label %64, label %57
57: ; preds = %52
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #18
%58 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull @.str.2) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %5) #19
%59 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #18
%60 = load ptr, ptr %1, align 4, !tbaa !16
%61 = getelementptr inbounds float, ptr %60, i32 %20
%62 = load float, ptr %61, align 4, !tbaa !17
%63 = fpext float %62 to double
br label %64
64: ; preds = %57, %52
%65 = phi double [ %63, %57 ], [ %53, %52 ]
%66 = fcmp ule double %65, 3.000100e+00
%67 = fcmp ugt double %65, 3.300100e+00
%68 = or i1 %66, %67
br i1 %68, label %76, label %69
69: ; preds = %64
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #18
%70 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull @.str.3) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %6) #19
%71 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #18
%72 = load ptr, ptr %1, align 4, !tbaa !16
%73 = getelementptr inbounds float, ptr %72, i32 %20
%74 = load float, ptr %73, align 4, !tbaa !17
%75 = fpext float %74 to double
br label %76
76: ; preds = %69, %64
%77 = phi double [ %75, %69 ], [ %65, %64 ]
%78 = fcmp ule double %77, 2.700100e+00
%79 = fcmp ugt double %77, 3.000100e+00
%80 = or i1 %78, %79
br i1 %80, label %88, label %81
81: ; preds = %76
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #18
%82 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull @.str.4) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %7) #19
%83 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #18
%84 = load ptr, ptr %1, align 4, !tbaa !16
%85 = getelementptr inbounds float, ptr %84, i32 %20
%86 = load float, ptr %85, align 4, !tbaa !17
%87 = fpext float %86 to double
br label %88
88: ; preds = %81, %76
%89 = phi double [ %87, %81 ], [ %77, %76 ]
%90 = fcmp ule double %89, 2.300100e+00
%91 = fcmp ugt double %89, 2.700100e+00
%92 = or i1 %90, %91
br i1 %92, label %100, label %93
93: ; preds = %88
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #18
%94 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull @.str.5) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %8) #19
%95 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #18
%96 = load ptr, ptr %1, align 4, !tbaa !16
%97 = getelementptr inbounds float, ptr %96, i32 %20
%98 = load float, ptr %97, align 4, !tbaa !17
%99 = fpext float %98 to double
br label %100
100: ; preds = %93, %88
%101 = phi double [ %99, %93 ], [ %89, %88 ]
%102 = fcmp ule double %101, 2.000100e+00
%103 = fcmp ugt double %101, 2.300100e+00
%104 = or i1 %102, %103
br i1 %104, label %112, label %105
105: ; preds = %100
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #18
%106 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull @.str.6) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %9) #19
%107 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #18
%108 = load ptr, ptr %1, align 4, !tbaa !16
%109 = getelementptr inbounds float, ptr %108, i32 %20
%110 = load float, ptr %109, align 4, !tbaa !17
%111 = fpext float %110 to double
br label %112
112: ; preds = %105, %100
%113 = phi double [ %111, %105 ], [ %101, %100 ]
%114 = fcmp ule double %113, 1.700100e+00
%115 = fcmp ugt double %113, 2.000100e+00
%116 = or i1 %114, %115
br i1 %116, label %124, label %117
117: ; preds = %112
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #18
%118 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull @.str.7) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %10) #19
%119 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #18
%120 = load ptr, ptr %1, align 4, !tbaa !16
%121 = getelementptr inbounds float, ptr %120, i32 %20
%122 = load float, ptr %121, align 4, !tbaa !17
%123 = fpext float %122 to double
br label %124
124: ; preds = %117, %112
%125 = phi double [ %123, %117 ], [ %113, %112 ]
%126 = fcmp ule double %125, 1.300100e+00
%127 = fcmp ugt double %125, 1.700100e+00
%128 = or i1 %126, %127
br i1 %128, label %136, label %129
129: ; preds = %124
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #18
%130 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull @.str.8) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %11) #19
%131 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #18
%132 = load ptr, ptr %1, align 4, !tbaa !16
%133 = getelementptr inbounds float, ptr %132, i32 %20
%134 = load float, ptr %133, align 4, !tbaa !17
%135 = fpext float %134 to double
br label %136
136: ; preds = %129, %124
%137 = phi double [ %135, %129 ], [ %125, %124 ]
%138 = fcmp ule double %137, 1.000100e+00
%139 = fcmp ugt double %137, 1.300100e+00
%140 = or i1 %138, %139
br i1 %140, label %148, label %141
141: ; preds = %136
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #18
%142 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull @.str.9) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %12) #19
%143 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #18
%144 = load ptr, ptr %1, align 4, !tbaa !16
%145 = getelementptr inbounds float, ptr %144, i32 %20
%146 = load float, ptr %145, align 4, !tbaa !17
%147 = fpext float %146 to double
br label %148
148: ; preds = %141, %136
%149 = phi double [ %147, %141 ], [ %137, %136 ]
%150 = fcmp ule double %149, 7.001000e-01
%151 = fcmp ugt double %149, 1.000100e+00
%152 = or i1 %150, %151
br i1 %152, label %160, label %153
153: ; preds = %148
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #18
%154 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull @.str.10) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %13) #19
%155 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #18
%156 = load ptr, ptr %1, align 4, !tbaa !16
%157 = getelementptr inbounds float, ptr %156, i32 %20
%158 = load float, ptr %157, align 4, !tbaa !17
%159 = fpext float %158 to double
br label %160
160: ; preds = %153, %148
%161 = phi double [ %159, %153 ], [ %149, %148 ]
%162 = fcmp ule double %161, 1.000000e-04
%163 = fcmp ugt double %161, 7.001000e-01
%164 = or i1 %162, %163
br i1 %164, label %172, label %165
165: ; preds = %160
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #18
%166 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull @.str.11) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %14) #19
%167 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #18
%168 = load ptr, ptr %1, align 4, !tbaa !16
%169 = getelementptr inbounds float, ptr %168, i32 %20
%170 = load float, ptr %169, align 4, !tbaa !17
%171 = fpext float %170 to double
br label %172
172: ; preds = %165, %160
%173 = phi double [ %171, %165 ], [ %161, %160 ]
%174 = fcmp ugt double %173, 1.000000e-04
br i1 %174, label %178, label %175
175: ; preds = %172
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #18
%176 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %15, ptr noundef nonnull @.str.12) #19
call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %15) #19
%177 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #20
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #18
br label %178
178: ; preds = %172, %175
%179 = add nuw nsw i32 %20, 1
br label %19, !llvm.loop !19
180: ; preds = %19
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__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE9push_backB7v160006EOS6_(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 !21
%7 = icmp ult ptr %4, %6
br i1 %7, label %8, label %10
8: ; preds = %2
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %1, i8 0, i32 12, i1 false)
%9 = getelementptr inbounds %"class.std::__2::basic_string", ptr %4, i32 1
store ptr %9, ptr %3, align 4, !tbaa !10
br label %11
10: ; preds = %2
tail call void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIS6_EEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #19
br label %11
11: ; preds = %10, %8
ret void
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #20
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #19
ret ptr %0
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #4
; Function Attrs: inlinehint minsize optsize
define linkonce_odr void @_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIS6_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) #18
%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) #19
%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) #19
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !22
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %1, i32 12, i1 false)
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %1, i8 0, i32 12, i1 false)
%23 = load ptr, ptr %21, align 4, !tbaa !22
%24 = getelementptr inbounds %"class.std::__2::basic_string", ptr %23, i32 1
store ptr %24, ptr %21, align 4, !tbaa !22
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) #19
%25 = call noundef ptr @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #20
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #18
ret void
}
; 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) #5
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #6
; 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 #7 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) #21
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 !21
%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 !21
%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) #19, !noalias !26
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !29
%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 !22
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !30
%15 = getelementptr inbounds %"class.std::__2::basic_string", ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !21
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 !30
%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) #19
store ptr %9, ptr %7, align 4, !tbaa !30
%10 = load ptr, ptr %0, align 4, !tbaa !21
store ptr %9, ptr %0, align 4, !tbaa !21
store ptr %10, ptr %7, align 4, !tbaa !21
%11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%12 = load ptr, ptr %4, align 4, !tbaa !21
%13 = load ptr, ptr %11, align 4, !tbaa !21
store ptr %13, ptr %4, align 4, !tbaa !21
store ptr %12, ptr %11, align 4, !tbaa !21
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3
%15 = load ptr, ptr %3, align 4, !tbaa !21
%16 = load ptr, ptr %14, align 4, !tbaa !21
store ptr %16, ptr %3, align 4, !tbaa !21
store ptr %15, ptr %14, align 4, !tbaa !21
%17 = load ptr, ptr %7, align 4, !tbaa !30
store ptr %17, ptr %1, align 4, !tbaa !29
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 #8 comdat {
tail call void @_ZNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #20
%2 = load ptr, ptr %0, align 4, !tbaa !29
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #22
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 #9 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.13) #21
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #10 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #18
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #19
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #23
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) #19
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !31
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #8
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 #11 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() #21
unreachable
5: ; preds = %2
%6 = mul nuw i32 %1, 12
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #24
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #10 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #18
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #20
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #23
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #8
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #8
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #12
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #13
; 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) #18
%8 = ptrtoint ptr %3 to i32
store i32 %8, ptr %6, align 4, !tbaa !21
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #18
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 !33
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 !34
store i8 1, ptr %19, align 4, !tbaa !36
%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) #20
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #18
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #18
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 #8 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !36, !range !40, !noundef !41
%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) #20
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 !42
%3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !43
%5 = load ptr, ptr %4, align 4, !tbaa.struct !44
%6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !45
%8 = load ptr, ptr %7, align 4, !tbaa.struct !44
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) #19
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 #11 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) #20
%9 = getelementptr inbounds %"class.std::__2::basic_string", ptr %5, i32 1
br label %4, !llvm.loop !46
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 #14 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !30
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) #20
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 #15 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 !22
%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 !22
%9 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #20
br label %4, !llvm.loop !47
10: ; preds = %4
ret void
}
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #2
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #16
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #17
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: readwrite) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #13 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #14 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #15 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #16 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #17 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #18 = { nounwind }
attributes #19 = { minsize optsize }
attributes #20 = { minsize nounwind optsize }
attributes #21 = { minsize noreturn optsize }
attributes #22 = { builtin minsize nounwind optsize }
attributes #23 = { noreturn }
attributes #24 = { 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 = !{!13, !5, i64 4}
!13 = !{!"_ZTSNSt3__26vectorIfNS_9allocatorIfEEEE", !5, i64 0, !5, i64 4, !14, i64 8}
!14 = !{!"_ZTSNSt3__217__compressed_pairIPfNS_9allocatorIfEEEE", !15, i64 0}
!15 = !{!"_ZTSNSt3__222__compressed_pair_elemIPfLi0ELb0EEE", !5, i64 0}
!16 = !{!13, !5, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !6, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!5, !5, i64 0}
!22 = !{!23, !5, i64 8}
!23 = !{!"_ZTSNSt3__214__split_bufferINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !24, i64 12}
!24 = !{!"_ZTSNSt3__217__compressed_pairIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS4_IS6_EEEE", !9, i64 0, !25, i64 4}
!25 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEELi1ELb0EEE", !5, i64 0}
!26 = !{!27}
!27 = distinct !{!27, !28, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m: argument 0"}
!28 = distinct !{!28, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERSA_m"}
!29 = !{!23, !5, i64 0}
!30 = !{!23, !5, i64 4}
!31 = !{!32, !32, i64 0}
!32 = !{!"vtable pointer", !7, i64 0}
!33 = distinct !{!33, !20}
!34 = !{!35, !5, i64 0}
!35 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEE", !5, i64 0}
!36 = !{!37, !39, i64 12}
!37 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEEENS_16reverse_iteratorIPS7_EEEEEE", !38, i64 0, !39, i64 12}
!38 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEEEENS_16reverse_iteratorIPS6_EEEE", !5, i64 0, !5, i64 4, !5, i64 8}
!39 = !{!"bool", !6, i64 0}
!40 = !{i8 0, i8 2}
!41 = !{}
!42 = !{!38, !5, i64 0}
!43 = !{!38, !5, i64 8}
!44 = !{i64 0, i64 4, !21}
!45 = !{!38, !5, i64 4}
!46 = distinct !{!46, !20}
!47 = distinct !{!47, !20}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func (param i32 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_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIS6_EEvOT_" (func (;2;) (type 1)))
(import "env" "strlen" (func (;3;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;4;) (type 3)))
(import "env" "_ZdlPv" (func (;5;) (type 4)))
(import "env" "__cxa_allocate_exception" (func (;6;) (type 0)))
(import "env" "__cxa_throw" (func (;7;) (type 3)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;8;) (type 2)))
(import "env" "_Znwm" (func (;9;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;10;) (type 0)))
(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 (;11;) (type 5))
(func (;12;) (type 1) (param i32 i32)
(local f64 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 2
i32.shr_s
local.get 6
i32.gt_u
if ;; label = @2
local.get 3
local.get 6
i32.const 2
i32.shl
local.tee 5
i32.add
f32.load
f64.promote_f32
local.tee 2
f64.const 0x1.fffcb923a29c7p+1 (;=3.9999;)
f64.ge
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 38
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.d99ce075f6fd2p+1 (;=3.7001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.fffcb923a29c7p+1 (;=3.9999;)
f64.lt
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 15
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.a669ad42c3c9fp+1 (;=3.3001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.d99ce075f6fd2p+1 (;=3.7001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 26
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.800346dc5d639p+1 (;=3.0001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.a669ad42c3c9fp+1 (;=3.3001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 35
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.599ce075f6fd2p+1 (;=2.7001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.800346dc5d639p+1 (;=3.0001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 13
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.2669ad42c3c9fp+1 (;=2.3001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.599ce075f6fd2p+1 (;=2.7001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 23
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.000346dc5d639p+1 (;=2.0001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.2669ad42c3c9fp+1 (;=2.3001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 32
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.b339c0ebedfa4p+0 (;=1.7001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.000346dc5d639p+1 (;=2.0001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 11
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.4cd35a858793ep+0 (;=1.3001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.b339c0ebedfa4p+0 (;=1.7001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 20
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.00068db8bac71p+0 (;=1.0001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.4cd35a858793ep+0 (;=1.3001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 29
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.667381d7dbf48p-1 (;=0.7001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.00068db8bac71p+0 (;=1.0001;)
f64.le
i32.eqz
i32.or
i32.eqz
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 9
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
local.set 2
end
local.get 2
f64.const 0x1.a36e2eb1c432dp-14 (;=0.0001;)
f64.gt
i32.eqz
local.get 2
f64.const 0x1.667381d7dbf48p-1 (;=0.7001;)
f64.le
i32.eqz
i32.or
if (result f64) ;; label = @3
local.get 2
else
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 17
i32.add
call 0
local.tee 3
call 14
local.get 3
call 1
drop
local.get 1
i32.load
local.get 5
i32.add
f32.load
f64.promote_f32
end
f64.const 0x1.a36e2eb1c432dp-14 (;=0.0001;)
f64.le
if ;; label = @3
local.get 0
local.get 4
i32.const 4
i32.add
global.get 1
i32.const 7
i32.add
call 0
local.tee 5
call 14
local.get 5
call 1
drop
end
local.get 6
i32.const 1
i32.add
local.set 6
br 1 (;@1;)
end
end
local.get 4
i32.const 16
i32.add
global.set 0)
(func (;13;) (type 2) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 3
call 4
local.get 0)
(func (;14;) (type 1) (param i32 i32)
(local i32)
local.get 0
i32.load offset=4
local.tee 2
local.get 0
i32.load offset=8
i32.lt_u
if ;; label = @1
local.get 2
local.get 1
i64.load align=4
i64.store align=4
local.get 2
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
local.get 1
i32.const 0
i32.store offset=8
local.get 0
local.get 2
i32.const 12
i32.add
i32.store offset=4
return
end
local.get 0
local.get 1
call 2)
(func (;15;) (type 1) (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 6
global.get 4
local.set 3
global.get 1
call 8
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 7
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 6
call 10
local.get 1
local.get 0
call 7
unreachable
end
local.get 4
i32.const 12
i32.mul
call 9
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.tee 3
local.get 1
i64.load align=4
i64.store align=4
local.get 3
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
local.get 1
i32.const 0
i32.store offset=8
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 1
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 1
drop
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.tee 0
if ;; label = @1
local.get 0
call 5
end
local.get 2
i32.const 32
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 11))
(export "__wasm_apply_data_relocs" (func 11))
(export "_Z22numerical_letter_gradeNSt3__26vectorIfNS_9allocatorIfEEEE" (func 12))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 13))
(export "_ZNSt3__26vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEE21__push_back_slow_pathIS6_EEvOT_" (func 15))
(data (;0;) (global.get 1) "vector\00E\00D\00C\00B\00A\00D-\00C-\00B-\00A-\00D+\00C+\00B+\00A+\00"))
| 19 | 996 | 17,844 | 830 |
CPP/82 | /*
Write a function that takes a string and returns true if the string
length is a prime number or false otherwise
Examples
prime_length("Hello") == true
prime_length("abcdcba") == true
prime_length("kittens") == true
prime_length("orange") == false
*/
#include<stdio.h>
#include<string>
using namespace std;
bool prime_length(string str){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool prime_length(string str){
| int l,i;
l=str.length();
if (l<2) return false;
for (i=2;i*i<=l;i++)
if (l%i==0) return false;
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (prime_length("Hello") == true);
assert (prime_length("abcdcba") == true);
assert (prime_length("kittens") == true);
assert (prime_length("orange") == false);
assert (prime_length("wow") == true);
assert (prime_length("world") == true);
assert (prime_length("MadaM") == true);
assert (prime_length("Wow") == true);
assert (prime_length("") == false);
assert (prime_length("HI") == true);
assert (prime_length("go") == true);
assert (prime_length("gogo") == false);
assert (prime_length("aaaaaaaaaaaaaaa") == false);
assert (prime_length("Madam") == true);
assert (prime_length("M") == false);
assert (prime_length("0") == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (prime_length("Hello") == true);
assert (prime_length("abcdcba") == true);
assert (prime_length("kittens") == true);
assert (prime_length("orange") == false);
}
| ; ModuleID = 'c_code_test/code_81.cpp'
source_filename = "c_code_test/code_81.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(argmem: read)
define noundef zeroext i1 @_Z12prime_lengthNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
%9 = icmp slt i32 %8, 2
br i1 %9, label %18, label %10
10: ; preds = %1, %14
%11 = phi i32 [ %17, %14 ], [ 2, %1 ]
%12 = mul nsw i32 %11, %11
%13 = icmp sgt i32 %12, %8
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = srem i32 %8, %11
%16 = icmp eq i32 %15, 0
%17 = add nuw nsw i32 %11, 1
br i1 %16, label %18, label %10, !llvm.loop !3
18: ; preds = %10, %14, %1
%19 = phi i1 [ false, %1 ], [ %13, %14 ], [ %13, %10 ]
ret i1 %19
}
attributes #0 = { minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(argmem: read) "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 = distinct !{!3, !4}
!4 = !{!"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.const 2
local.set 1
block ;; label = @1
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 0
i32.const 2
i32.lt_s
br_if 0 (;@1;)
loop ;; label = @2
local.get 1
local.get 1
i32.mul
local.get 0
i32.gt_s
local.tee 2
br_if 1 (;@1;)
local.get 0
local.get 1
i32.rem_s
local.get 1
i32.const 1
i32.add
local.set 1
br_if 0 (;@2;)
end
end
local.get 2)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z12prime_lengthNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 7 | 134 | 1,078 | 46 |
CPP/83 | /*
Given a positive integer n, return the count of the numbers of n-digit
positive integers that start or end with 1.
*/
#include<stdio.h>
using namespace std;
int starts_one_ends(int n){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int starts_one_ends(int n){
| if (n<1) return 0;
if (n==1) return 1;
int out=18;
for (int i=2;i<n;i++)
out=out*10;
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (starts_one_ends(1) == 1);
assert (starts_one_ends(2) == 18);
assert (starts_one_ends(3) == 180);
assert (starts_one_ends(4) == 1800);
assert (starts_one_ends(5) == 18000);
}
| ; ModuleID = 'c_code_test/code_82.cpp'
source_filename = "c_code_test/code_82.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 i32 @_Z15starts_one_endsi(i32 noundef %0) local_unnamed_addr #0 {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %12, label %5
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ 18, %3 ]
%7 = phi i32 [ %11, %9 ], [ 2, %3 ]
%8 = icmp eq i32 %7, %0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = mul nsw i32 %6, 10
%11 = add nuw i32 %7, 1
br label %5, !llvm.loop !3
12: ; preds = %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %6, %5 ]
ret i32 %13
}
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)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32) (result i32)
(local i32 i32)
i32.const 1
local.set 1
block ;; label = @1
local.get 0
i32.const 0
i32.le_s
if ;; label = @2
i32.const 0
local.set 1
br 1 (;@1;)
end
local.get 0
i32.const 1
i32.eq
br_if 0 (;@1;)
i32.const 2
local.set 2
i32.const 18
local.set 1
loop ;; label = @2
local.get 0
local.get 2
i32.eq
br_if 1 (;@1;)
local.get 2
i32.const 1
i32.add
local.set 2
local.get 1
i32.const 10
i32.mul
local.set 1
br 0 (;@2;)
end
unreachable
end
local.get 1)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z15starts_one_endsi" (func 1)))
| 7 | 127 | 975 | 46 |
|
CPP/84 | /*
Given a positive integer N, return the total sum of its digits in binary.
Example
For N = 1000, the sum of digits will be 1 the output should be "1".
For N = 150, the sum of digits will be 6 the output should be "110".
For N = 147, the sum of digits will be 12 the output should be "1100".
Variables:
@N integer
Constraints: 0 ≤ N ≤ 10000.
Output:
a string of binary number
*/
#include<stdio.h>
#include<string>
using namespace std;
string solve(int N){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string solve(int N){
| string str,bi="";
str=to_string(N);
int i,sum=0;
for (int i=0;i<str.length();i++)
sum+=str[i]-48;
while (sum>0)
{
bi=to_string(sum%2)+bi;
sum=sum/2;
}
return bi;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (solve(1000) == "1");
assert (solve(150) == "110");
assert (solve(147) == "1100");
assert (solve(333) == "1001");
assert (solve(963) == "10010");
}
| ; ModuleID = 'c_code_test/code_83.cpp'
source_filename = "c_code_test/code_83.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_ = comdat any
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
; Function Attrs: minsize optsize
define void @_Z5solvei(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #11
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %3, i8 0, i32 12, i1 false)
%7 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #12
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #11
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, i32 noundef %1) #12
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4) #13
%8 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #11
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%10 = load i8, ptr %9, align 1
%11 = icmp slt i8 %10, 0
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
%13 = load i32, ptr %12, align 4
%14 = zext i8 %10 to i32
%15 = select i1 %11, i32 %13, i32 %14
%16 = load ptr, ptr %3, align 4
%17 = select i1 %11, ptr %16, ptr %3
br label %18
18: ; preds = %22, %2
%19 = phi i32 [ 0, %2 ], [ %27, %22 ]
%20 = phi i32 [ 0, %2 ], [ %28, %22 ]
%21 = icmp eq i32 %20, %15
br i1 %21, label %29, label %22
22: ; preds = %18
%23 = getelementptr inbounds i8, ptr %17, i32 %20
%24 = load i8, ptr %23, align 1, !tbaa !3
%25 = sext i8 %24 to i32
%26 = add i32 %19, -48
%27 = add i32 %26, %25
%28 = add nuw i32 %20, 1
br label %18, !llvm.loop !6
29: ; preds = %18, %32
%30 = phi i32 [ %36, %32 ], [ %19, %18 ]
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %29
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #11
%33 = and i32 %30, 1
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, i32 noundef %33) #12
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %0) #12
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %5) #13
%34 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #13
%35 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #11
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #11
%36 = lshr i32 %30, 1
br label %29, !llvm.loop !8
37: ; preds = %29
%38 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #13
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #11
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: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #13
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #12
ret ptr %0
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__29to_stringEi(ptr sret(%"class.std::__2::basic_string") align 4, i32 noundef) local_unnamed_addr #0
; 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 #2
; 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 optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEOS9_RKS9_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #3 comdat {
%4 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #12
tail call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4, i32 12, i1 false)
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %4, i8 0, i32 12, i1 false)
ret void
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #7
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #3
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #9 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #14
br label %8
8: ; preds = %6, %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 !9
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendB7v160006ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #10 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
%6 = load ptr, ptr %1, align 4
%7 = select i1 %5, ptr %6, ptr %1
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %4 to i32
%11 = select i1 %5, i32 %9, i32 %10
%12 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef %7, i32 noundef %11) #12
ret ptr %12
}
; Function Attrs: minsize optsize
declare noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #0
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #3 = { inlinehint minsize 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #8 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { inlinehint minsize mustprogress nounwind 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 = { nounwind }
attributes #12 = { minsize optsize }
attributes #13 = { minsize nounwind optsize }
attributes #14 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = distinct !{!8, !7}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !12, i64 8, i64 4, !12, i64 11, i64 4, !12, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !4, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !4, i64 0}
| (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 (param i32 i32 i32) (result i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__29to_stringEi" (func (;1;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;2;) (type 2)))
(import "env" "strlen" (func (;3;) (type 2)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;4;) (type 3)))
(import "env" "_ZdlPv" (func (;5;) (type 4)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm" (func (;6;) (type 5)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;7;) (type 6))
(func (;8;) (type 0) (param i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 0
i32.store offset=40
local.get 2
i64.const 0
i64.store offset=32
local.get 0
global.get 1
call 0
local.set 3
local.get 2
i32.const 20
i32.add
local.tee 0
local.get 1
call 1
local.get 2
i32.const 32
i32.add
local.tee 1
local.get 0
call 10
local.get 0
call 2
drop
local.get 2
i32.load offset=36
local.get 2
i32.load8_s offset=43
local.tee 0
i32.const 255
i32.and
local.get 0
i32.const 0
i32.lt_s
local.tee 0
select
local.set 5
local.get 2
i32.load offset=32
local.get 1
local.get 0
select
local.set 1
i32.const 0
local.set 0
loop ;; label = @1
local.get 0
local.get 5
i32.eq
if ;; label = @2
loop ;; label = @3
local.get 4
i32.const 0
i32.gt_s
if ;; label = @4
local.get 2
i32.const 8
i32.add
local.tee 5
local.get 4
i32.const 1
i32.and
call 1
local.get 2
i32.const 20
i32.add
local.tee 6
local.get 5
local.get 3
i32.load
local.get 3
local.get 3
i32.load8_u offset=11
local.tee 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 0
select
local.get 3
i32.load offset=4
local.get 1
local.get 0
select
call 6
local.tee 0
i64.load align=4
i64.store align=4
local.get 6
local.get 0
i32.load offset=8
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
i32.const 0
i32.store offset=8
local.get 3
local.get 6
call 10
local.get 4
i32.const 1
i32.shr_u
local.set 4
local.get 6
call 2
drop
local.get 5
call 2
drop
br 1 (;@3;)
end
end
local.get 2
i32.const 32
i32.add
call 2
drop
local.get 2
i32.const 48
i32.add
global.set 0
else
local.get 4
local.get 0
local.get 1
i32.add
i32.load8_s
i32.add
i32.const 48
i32.sub
local.set 4
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end)
(func (;9;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 3
call 4
local.get 0)
(func (;10;) (type 0) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 5
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(export "__wasm_call_ctors" (func 7))
(export "__wasm_apply_data_relocs" (func 7))
(export "_Z5solvei" (func 8))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 9))
(data (;0;) (global.get 1) "\00"))
| 12 | 220 | 4,882 | 203 |
|
CPP/85 | /*
Given a non-empty vector of integers lst. add the even elements that are at odd indices..
Examples:
add({4, 2, 6, 7}) ==> 2
*/
#include<stdio.h>
#include<vector>
using namespace std;
int add(vector<int> lst){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int add(vector<int> lst){
| int sum=0;
for (int i=0;i*2+1<lst.size();i++)
if (lst[i*2+1]%2==0) sum+=lst[i*2+1];
return sum;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (add({4, 88}) == 88);
assert (add({4, 5, 6, 7, 2, 122}) == 122);
assert (add({4, 0, 6, 7}) == 0);
assert (add({4, 4, 6, 8}) == 12);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (add({4, 2, 6, 7}) == 2);
}
| ; ModuleID = 'c_code_test/code_84.cpp'
source_filename = "c_code_test/code_84.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 i32 @_Z3addNSt3__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
%9 = lshr i32 %8, 1
br label %10
10: ; preds = %15, %1
%11 = phi i32 [ 0, %1 ], [ %23, %15 ]
%12 = phi i32 [ 0, %1 ], [ %24, %15 ]
%13 = icmp eq i32 %12, %9
br i1 %13, label %14, label %15
14: ; preds = %10
ret i32 %11
15: ; preds = %10
%16 = shl nuw nsw i32 %12, 1
%17 = or i32 %16, 1
%18 = getelementptr inbounds i32, ptr %4, i32 %17
%19 = load i32, ptr %18, align 4, !tbaa !11
%20 = and i32 %19, 1
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i32 %19, i32 0
%23 = add nsw i32 %22, %11
%24 = add nuw i32 %12, 1
br label %10, !llvm.loop !13
}
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)
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 2
i32.sub
i32.const 2
i32.shr_s
i32.const 1
i32.shr_u
local.set 3
i32.const 0
local.set 0
loop (result i32) ;; label = @1
local.get 0
local.get 3
i32.eq
if (result i32) ;; label = @2
local.get 1
else
local.get 1
i32.const 0
local.get 2
local.get 0
i32.const 3
i32.shl
i32.add
i32.load offset=4
local.tee 1
local.get 1
i32.const 1
i32.and
select
i32.add
local.set 1
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@1;)
end
end)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z3addNSt3__26vectorIiNS_9allocatorIiEEEE" (func 1)))
| 5 | 118 | 1,125 | 52 |
CPP/86 | /*
Write a function that takes a string and returns an ordered version of it.
Ordered version of string, is a string where all words (separated by space)
are replaced by a new word where all the characters arranged in
ascending order based on ascii value.
Note: You should keep the order of words and blank spaces in the sentence.
For example:
anti_shuffle("Hi") returns "Hi"
anti_shuffle("hello") returns "ehllo"
anti_shuffle("Hello World!!!") returns "Hello !!!Wdlor"
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
string anti_shuffle(string s){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
string anti_shuffle(string s){
| string out="";
string current="";
s=s+' ';
for (int i=0;i<s.length();i++)
if (s[i]==' ')
{
sort(current.begin(),current.end());
if (out.length()>0) out=out+' ';
out=out+current;
current="";
}
else current=current+s[i];
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (anti_shuffle("Hi") == "Hi");
assert (anti_shuffle("hello") == "ehllo");
assert (anti_shuffle("number") == "bemnru");
assert (anti_shuffle("abcd") == "abcd");
assert (anti_shuffle("Hello World!!!") == "Hello !!!Wdlor");
assert (anti_shuffle("") == "");
assert (anti_shuffle("Hi. My name is Mister Robot. How are you?") == ".Hi My aemn is Meirst .Rboot How aer ?ouy");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (anti_shuffle("Hi") == "Hi");
assert (anti_shuffle("hello") == "ehllo");
assert (anti_shuffle("Hello World!!!") == "Hello !!!Wdlor");
}
| ; ModuleID = 'c_code_test/code_85.cpp'
source_filename = "c_code_test/code_85.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
%"struct.std::__2::__less" = type { i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
$_ZNSt3__24sortB7v160006INS_11__wrap_iterIPcEENS_6__lessIccEEEEvT_S6_T0_ = 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 [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z12anti_shuffleNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias nonnull sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca %"class.std::__2::basic_string", align 4
%5 = alloca %"class.std::__2::basic_string", align 4
%6 = alloca %"class.std::__2::basic_string", align 4
%7 = alloca %"class.std::__2::basic_string", align 4
%8 = tail call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str) #16
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #17
%9 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #16
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #17
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %4, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext 32) #16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %4) #18
%10 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #17
%11 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%13 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%16 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
br label %17
17: ; preds = %55, %2
%18 = phi i32 [ 0, %2 ], [ %56, %55 ]
%19 = load i8, ptr %11, align 1
%20 = icmp slt i8 %19, 0
%21 = load i32, ptr %12, align 4
%22 = zext i8 %19 to i32
%23 = select i1 %20, i32 %21, i32 %22
%24 = icmp ult i32 %18, %23
br i1 %24, label %27, label %25
25: ; preds = %17
%26 = 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) #17
ret void
27: ; preds = %17
%28 = load ptr, ptr %1, align 4
%29 = select i1 %20, ptr %28, ptr %1
%30 = getelementptr inbounds i8, ptr %29, i32 %18
%31 = load i8, ptr %30, align 1, !tbaa !3
%32 = icmp eq i8 %31, 32
br i1 %32, label %33, label %53
33: ; preds = %27
%34 = load i8, ptr %13, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %3, align 4
%37 = select i1 %35, ptr %36, ptr %3
%38 = load i32, ptr %14, align 4
%39 = zext i8 %34 to i32
%40 = select i1 %35, i32 %38, i32 %39
%41 = getelementptr inbounds i8, ptr %37, i32 %40
call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPcEENS_6__lessIccEEEEvT_S6_T0_(ptr %37, ptr %41) #16
%42 = load i8, ptr %15, align 1
%43 = icmp slt i8 %42, 0
%44 = load i32, ptr %16, align 4
%45 = zext i8 %42 to i32
%46 = select i1 %43, i32 %44, i32 %45
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %33
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #17
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext 32) #16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %5) #18
%49 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #17
br label %50
50: ; preds = %48, %33
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #17
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %6) #18
%51 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #17
%52 = 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) #16
br label %55
53: ; preds = %27
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #17
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %3, i8 noundef signext %31) #16
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %7) #18
%54 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #18
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #17
br label %55
55: ; preds = %50, %53
%56 = add nuw nsw i32 %18, 1
br label %17, !llvm.loop !6
}
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #18
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #16
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #17
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #16
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #17
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !8
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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 #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_SB_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%13 = load i8, ptr %12, align 1
%14 = icmp slt i8 %13, 0
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
%16 = load i32, ptr %15, align 4
%17 = zext i8 %13 to i32
%18 = select i1 %14, i32 %16, i32 %17
%19 = add i32 %18, %11
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #17
%20 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #16
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #17
%21 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%22 = load i8, ptr %21, align 1
%23 = icmp slt i8 %22, 0
%24 = load ptr, ptr %0, align 4
%25 = select i1 %23, ptr %24, ptr %0
%26 = load i8, ptr %5, align 1
%27 = icmp slt i8 %26, 0
%28 = load ptr, ptr %1, align 4
%29 = select i1 %27, ptr %28, ptr %1
%30 = icmp ult ptr %29, %25
%31 = getelementptr inbounds i8, ptr %25, i32 %11
%32 = icmp ule ptr %31, %29
%33 = or i1 %30, %32
call void @llvm.assume(i1 %33)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %25, ptr align 1 %29, i32 %11, i1 false), !noalias !19
%34 = load i8, ptr %12, align 1
%35 = icmp slt i8 %34, 0
%36 = load ptr, ptr %2, align 4
%37 = select i1 %35, ptr %36, ptr %2
%38 = icmp ult ptr %37, %31
%39 = getelementptr inbounds i8, ptr %31, i32 %18
%40 = icmp ule ptr %39, %37
%41 = or i1 %38, %40
call void @llvm.assume(i1 %41)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %31, ptr align 1 %37, i32 %18, i1 false), !noalias !30
store i8 0, ptr %39, align 1, !tbaa !3
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #5
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__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.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 #7 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #17
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #16
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #20
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) #16
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !41
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #8
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #9
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #10
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #11
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #19
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #21
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #12
; 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) #10
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #13 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #22
br label %8
8: ; preds = %6, %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 !43
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPcEENS_6__lessIccEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #14 comdat {
%3 = alloca %"struct.std::__2::__less", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIccEEPcEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #16
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIccEEPcEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; 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 #15 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) #16
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
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { inlinehint minsize 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 nounwind 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #11 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { inlinehint 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 optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #15 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #16 = { minsize optsize }
attributes #17 = { nounwind }
attributes #18 = { minsize nounwind optsize }
attributes #19 = { minsize noreturn optsize }
attributes #20 = { noreturn }
attributes #21 = { builtin minsize optsize allocsize(0) }
attributes #22 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !11, !13, !15, !17}
!9 = distinct !{!9, !10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!11 = distinct !{!11, !12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!12 = distinct !{!12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!13 = distinct !{!13, !14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!14 = distinct !{!14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!15 = distinct !{!15, !16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!17 = distinct !{!17, !18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!19 = !{!20, !22, !24, !26, !28}
!20 = distinct !{!20, !21, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!21 = distinct !{!21, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!22 = distinct !{!22, !23, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!23 = distinct !{!23, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!24 = distinct !{!24, !25, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!25 = distinct !{!25, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!26 = distinct !{!26, !27, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!28 = distinct !{!28, !29, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!29 = distinct !{!29, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!30 = !{!31, !33, !35, !37, !39}
!31 = distinct !{!31, !32, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!32 = distinct !{!32, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!33 = distinct !{!33, !34, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!34 = distinct !{!34, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!35 = distinct !{!35, !36, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!36 = distinct !{!36, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!37 = distinct !{!37, !38, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!38 = distinct !{!38, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!39 = distinct !{!39, !40, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!40 = distinct !{!40, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!41 = !{!42, !42, i64 0}
!42 = !{!"vtable pointer", !5, i64 0}
!43 = !{i64 0, i64 4, !44, i64 4, i64 4, !46, i64 8, i64 4, !46, i64 11, i64 4, !46, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!44 = !{!45, !45, i64 0}
!45 = !{!"any pointer", !4, i64 0}
!46 = !{!47, !47, i64 0}
!47 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32)))
(type (;4;) (func (param i32 i32 i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKc" (func (;2;) (type 0)))
(import "env" "strlen" (func (;3;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;4;) (type 2)))
(import "env" "memmove" (func (;5;) (type 4)))
(import "env" "__cxa_allocate_exception" (func (;6;) (type 1)))
(import "env" "__cxa_throw" (func (;7;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;8;) (type 0)))
(import "env" "_Znwm" (func (;9;) (type 1)))
(import "env" "_ZdlPv" (func (;10;) (type 5)))
(import "env" "_ZNSt3__26__sortIRNS_6__lessIccEEPcEEvT0_S5_T_" (func (;11;) (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 "env" "memory" (memory (;0;) 1))
(func (;12;) (type 6))
(func (;13;) (type 3) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 6
global.set 0
local.get 0
global.get 1
i32.const 12
i32.add
local.tee 0
call 0
local.set 3
local.get 6
i32.const 20
i32.add
local.get 0
call 0
local.set 0
local.get 6
i32.const 8
i32.add
local.tee 2
local.get 1
i32.const 32
call 15
local.get 1
local.get 2
call 16
local.get 2
call 1
drop
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.get 7
i32.gt_u
if ;; label = @2
block ;; label = @3
local.get 1
i32.load
local.get 1
local.get 2
select
local.get 7
i32.add
i32.load8_u
local.tee 4
i32.const 32
i32.eq
if ;; label = @4
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_u offset=11
local.tee 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 4
select
local.set 5
local.get 5
local.get 0
i32.load offset=4
local.get 2
local.get 4
select
i32.add
local.set 4
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 5
local.get 4
local.get 2
i32.const 15
i32.add
call 11
local.get 2
i32.const 16
i32.add
global.set 0
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
select
if ;; label = @5
local.get 6
i32.const 8
i32.add
local.tee 2
local.get 3
i32.const 32
call 15
local.get 3
local.get 2
call 16
local.get 2
call 1
drop
end
global.get 0
i32.const 16
i32.sub
local.tee 9
global.set 0
local.get 6
i32.const 8
i32.add
local.tee 2
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 4
local.get 4
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 4
local.get 3
i32.load offset=4
local.get 3
i32.load8_u offset=11
local.tee 5
local.get 5
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 5
i32.add
call 17
local.tee 8
i32.load
local.get 8
local.get 8
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 5
call 5
local.get 5
i32.add
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 4
call 5
local.get 4
i32.add
i32.const 0
i32.store8
local.get 9
i32.const 16
i32.add
global.set 0
local.get 3
local.get 2
call 16
local.get 2
call 1
drop
local.get 0
global.get 1
i32.const 12
i32.add
call 2
drop
br 1 (;@3;)
end
local.get 6
i32.const 8
i32.add
local.tee 2
local.get 0
local.get 4
i32.extend8_s
call 15
local.get 0
local.get 2
call 16
local.get 2
call 1
drop
end
local.get 7
i32.const 1
i32.add
local.set 7
br 1 (;@1;)
end
end
local.get 0
call 1
drop
local.get 6
i32.const 32
i32.add
global.set 0)
(func (;14;) (type 0) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 3
call 4
local.get 0)
(func (;15;) (type 2) (param i32 i32 i32)
(local i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 3
global.set 0
local.get 0
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 0
local.get 0
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 0
i32.const 1
i32.add
call 17
local.tee 4
i32.load
local.get 4
local.get 4
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 1
i32.load
local.get 1
local.get 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 0
call 5
local.get 0
i32.add
local.tee 0
local.get 2
i32.store8
local.get 0
i32.const 0
i32.store8 offset=1
local.get 3
i32.const 16
i32.add
global.set 0)
(func (;16;) (type 3) (param i32 i32)
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @1
local.get 0
i32.load
call 10
end
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 1
i32.const 0
i32.store8 offset=11
local.get 1
i32.const 0
i32.store8)
(func (;17;) (type 0) (param i32 i32) (result i32)
(local i32 i32)
local.get 1
i32.const 2147483632
i32.lt_u
if ;; label = @1
local.get 1
i32.const 10
i32.le_u
if ;; label = @2
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.store8 offset=11
local.get 0
return
end
local.get 1
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 2
call 9
local.set 3
local.get 0
local.get 1
i32.store offset=4
local.get 0
local.get 3
i32.store
local.get 0
local.get 2
i32.const -2147483648
i32.or
i32.store offset=8
local.get 0
return
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 6
global.get 4
local.set 3
global.get 1
call 8
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 7
unreachable)
(export "__wasm_call_ctors" (func 12))
(export "__wasm_apply_data_relocs" (func 12))
(export "_Z12anti_shuffleNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 13))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 14))
(data (;0;) (global.get 1) "basic_string\00"))
| 14 | 301 | 9,631 | 414 |
CPP/87 | /*
You are given a 2 dimensional data, as a nested vectors,
which is similar to matrix, however, unlike matrices,
each row may contain a different number of columns.
Given lst, and integer x, find integers x in the vector,
and return vector of vectors, {{x1, y1}, {x2, y2} ...} such that
each vector is a coordinate - {row, columns}, starting with 0.
Sort coordinates initially by rows in ascending order.
Also, sort coordinates of the row by columns in descending order.
Examples:
get_row({
{1,2,3,4,5,6},
{1,2,3,4,1,6},
{1,2,3,4,5,1}
}, 1) == {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}}
get_row({}, 1) == {}
get_row({{}, {1}, {1, 2, 3}}, 3) == {{2, 2}}
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<vector<int>> get_row(vector<vector<int>> lst, int x){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<vector<int>> get_row(vector<vector<int>> lst, int x){
| vector<vector<int>> out={};
for (int i=0;i<lst.size();i++)
for (int j=lst[i].size()-1;j>=0;j-=1)
if (lst[i][j]==x) out.push_back({i,j});
return out;
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<vector<int>> a,vector<vector<int>> b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (a[i].size()!=b[i].size()) return false;
for (int j=0;j<a[i].size();j++)
if (a[i][j]!=b[i][j]) return false;
}
return true;
}
int main(){
assert (issame(get_row({
{1,2,3,4,5,6},
{1,2,3,4,1,6},
{1,2,3,4,5,1}}, 1) , {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}}));
assert (issame(get_row({
{1,2,3,4,5,6},
{1,2,3,4,5,6},
{1,2,3,4,5,6},
{1,2,3,4,5,6},
{1,2,3,4,5,6},
{1,2,3,4,5,6}}, 2) , {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}));
assert (issame(get_row({
{1,2,3,4,5,6},
{1,2,3,4,5,6},
{1,1,3,4,5,6},
{1,2,1,4,5,6},
{1,2,3,1,5,6},
{1,2,3,4,1,6},
{1,2,3,4,5,1}
}, 1) , {{0, 0}, {1, 0}, {2, 1}, {2, 0}, {3, 2}, {3, 0}, {4, 3}, {4, 0}, {5, 4}, {5, 0}, {6, 5}, {6, 0}}));
assert (issame(get_row({}, 1) , {}));
assert (issame(get_row({{1}}, 2) , {}));
assert (issame(get_row({{}, {1}, {1, 2, 3}}, 3) , {{2, 2}}));
}
| #undef NDEBUG
#include<assert.h>
bool issame(vector<vector<int>> a,vector<vector<int>> b){
if (a.size()!=b.size()) return false;
for (int i=0;i<a.size();i++)
{
if (a[i].size()!=b[i].size()) return false;
for (int j=0;j<a[i].size();j++)
if (a[i][j]!=b[i][j]) return false;
}
return true;
}
int main(){
assert (issame(get_row({
{1,2,3,4,5,6},
{1,2,3,4,1,6},
{1,2,3,4,5,1}}, 1) , {{0, 0}, {1, 4}, {1, 0}, {2, 5}, {2, 0}}));
assert (issame(get_row({}, 1) , {}));
assert (issame(get_row({{}, {1}, {1, 2, 3}}, 3) , {{2, 2}}));
}
| ; ModuleID = 'c_code_test/code_86.cpp'
source_filename = "c_code_test/code_86.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::vector.1" = type { ptr, ptr, %"class.std::__2::__compressed_pair.2" }
%"class.std::__2::__compressed_pair.2" = type { %"struct.std::__2::__compressed_pair_elem.3" }
%"struct.std::__2::__compressed_pair_elem.3" = type { ptr }
%"class.std::initializer_list" = type { ptr, i32 }
%"struct.std::__2::__exception_guard_exceptions.11" = type <{ %"class.std::__2::vector<int>::__destroy_vector", i8, [3 x i8] }>
%"class.std::__2::vector<int>::__destroy_vector" = type { ptr }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.8" }
%"class.std::__2::__compressed_pair.8" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.9" }
%"struct.std::__2::__compressed_pair_elem.9" = 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE9push_backB7v160006EOS3_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_ = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_ = comdat any
$_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE11__recommendB7v160006Em = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEC2EmmS6_ = comdat any
$_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_EE = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEED2Ev = comdat any
$_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__29allocatorINS_6vectorIiNS0_IiEEEEE8allocateB7v160006Em = comdat any
$_ZSt28__throw_bad_array_new_lengthB7v160006v = comdat any
$_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_ = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEED2B7v160006Ev = comdat any
$_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEclB7v160006Ev = comdat any
$_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorINS6_IPS4_EEEES9_EEvRT_T0_T1_ = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE5clearB7v160006Ev = comdat any
$_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE17__destruct_at_endB7v160006EPS4_NS_17integral_constantIbLb0EEE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev = comdat any
$_ZNKSt3__26vectorIiNS_9allocatorIiEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__29allocatorIiE8allocateB7v160006Em = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev = 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 @_Z7get_rowNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEEEi(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
%4 = alloca %"class.std::__2::vector.1", align 4
%5 = alloca %"class.std::initializer_list", align 4
%6 = alloca [2 x i32], align 4
store ptr null, ptr %0, align 4, !tbaa !3
%7 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %7, align 4, !tbaa !10
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %8, align 4, !tbaa !11
%9 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%10 = getelementptr inbounds i32, ptr %6, i32 1
%11 = getelementptr inbounds %"class.std::initializer_list", ptr %5, i32 0, i32 1
br label %12
12: ; preds = %34, %3
%13 = phi i32 [ 0, %3 ], [ %35, %34 ]
%14 = load ptr, ptr %9, align 4, !tbaa !10
%15 = load ptr, ptr %1, 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 = icmp ult i32 %13, %19
br i1 %20, label %21, label %47
21: ; preds = %12
%22 = getelementptr inbounds %"class.std::__2::vector.1", ptr %15, i32 %13
%23 = getelementptr inbounds %"class.std::__2::vector.1", ptr %15, i32 %13, i32 1
%24 = load ptr, ptr %23, align 4, !tbaa !12
%25 = load ptr, ptr %22, align 4, !tbaa !16
%26 = ptrtoint ptr %24 to i32
%27 = ptrtoint ptr %25 to i32
%28 = sub i32 %26, %27
%29 = ashr exact i32 %28, 2
br label %30
30: ; preds = %43, %21
%31 = phi i32 [ %29, %21 ], [ %32, %43 ]
%32 = add nsw i32 %31, -1
%33 = icmp sgt i32 %31, 0
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = add nuw nsw i32 %13, 1
br label %12, !llvm.loop !17
36: ; preds = %30
%37 = load ptr, ptr %1, align 4, !tbaa !3
%38 = getelementptr inbounds %"class.std::__2::vector.1", ptr %37, i32 %13
%39 = load ptr, ptr %38, align 4, !tbaa !16
%40 = getelementptr inbounds i32, ptr %39, i32 %32
%41 = load i32, ptr %40, align 4, !tbaa !19
%42 = icmp eq i32 %41, %2
br i1 %42, label %44, label %43
43: ; preds = %36, %44
br label %30, !llvm.loop !21
44: ; preds = %36
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #15
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #15
store i32 %13, ptr %6, align 4, !tbaa !19
store i32 %32, ptr %10, align 4, !tbaa !19
store ptr %6, ptr %5, align 4, !tbaa !22
store i32 2, ptr %11, align 4, !tbaa !25
%45 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull byval(%"class.std::initializer_list") align 4 %5) #16
call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE9push_backB7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %4) #16
%46 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #17
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #15
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #15
br label %43
47: ; preds = %12
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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE9push_backB7v160006EOS3_(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 !26
%7 = icmp ult ptr %4, %6
br i1 %7, label %8, label %9
8: ; preds = %2
tail call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #16
br label %10
9: ; preds = %2
tail call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #16
br label %10
10: ; preds = %9, %8
ret void
}
; Function Attrs: inlinehint minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef byval(%"class.std::initializer_list") align 4 %1) unnamed_addr #3 comdat {
%3 = alloca %"struct.std::__2::__exception_guard_exceptions.11", align 4
store ptr null, ptr %0, align 4, !tbaa !16
%4 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !12
%5 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 2
store ptr null, ptr %5, align 4, !tbaa !27
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #15
store ptr %0, ptr %3, align 4, !tbaa.struct !28, !alias.scope !29
%6 = getelementptr inbounds %"class.std::initializer_list", ptr %1, i32 0, i32 1
%7 = load i32, ptr %6, align 4, !tbaa !25
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %7) #16
%10 = load ptr, ptr %1, align 4, !tbaa !22
%11 = load ptr, ptr %4, align 4, !tbaa !12
%12 = shl nsw i32 %7, 2
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %11, ptr align 4 %10, i32 %12, i1 false), !noalias !32
%13 = getelementptr inbounds i32, ptr %11, i32 %7
store ptr %13, ptr %4, align 4, !tbaa !12
br label %14
14: ; preds = %9, %2
%15 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions.11", ptr %3, i32 0, i32 1
store i8 1, ptr %15, align 4, !tbaa !43
%16 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(5) %3) #17
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #15
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(12) %0) unnamed_addr #4 comdat {
%2 = alloca %"class.std::__2::vector<int>::__destroy_vector", align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #15
store ptr %0, ptr %2, align 4, !tbaa !26
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %2) #17
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #15
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; Function Attrs: minsize optsize
define linkonce_odr void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_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__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %1) #17
%6 = getelementptr inbounds %"class.std::__2::vector.1", 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_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) #15
%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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE11__recommendB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12) #16
%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_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEC2EmmS6_(ptr noundef nonnull align 4 dereferenceable(20) %3, i32 noundef %13, i32 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4) #16
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !47
%23 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(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 !47
%25 = getelementptr inbounds %"class.std::__2::vector.1", ptr %24, i32 1
store ptr %25, ptr %21, align 4, !tbaa !47
call void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_EE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(20) %3) #16
%26 = call noundef ptr @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #17
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #15
ret void
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #6 comdat {
store ptr null, ptr %0, align 4, !tbaa !16
%3 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !12
%4 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !27
%5 = load ptr, ptr %1, align 4, !tbaa !16
store ptr %5, ptr %0, align 4, !tbaa !16
%6 = getelementptr inbounds %"class.std::__2::vector.1", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !12
store ptr %7, ptr %3, align 4, !tbaa !12
%8 = getelementptr inbounds %"class.std::__2::vector.1", ptr %1, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !26
store ptr %9, ptr %4, align 4, !tbaa !26
store ptr null, ptr %8, align 4, !tbaa !26
store ptr null, ptr %6, align 4, !tbaa !12
store ptr null, ptr %1, align 4, !tbaa !16
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden noundef i32 @_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #18
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 !26
%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_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEC2EmmS6_(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 !26
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call noundef ptr @_ZNSt3__29allocatorINS_6vectorIiNS0_IiEEEEE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %1) #16, !noalias !51
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !54
%12 = getelementptr inbounds %"class.std::__2::vector.1", 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 !47
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !55
%15 = getelementptr inbounds %"class.std::__2::vector.1", ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !26
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS4_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 !55
%9 = tail call ptr @_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr %5, ptr %6, ptr %8) #16
store ptr %9, ptr %7, align 4, !tbaa !55
%10 = load ptr, ptr %0, align 4, !tbaa !26
store ptr %9, ptr %0, align 4, !tbaa !26
store ptr %10, ptr %7, align 4, !tbaa !26
%11 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%12 = load ptr, ptr %4, align 4, !tbaa !26
%13 = load ptr, ptr %11, align 4, !tbaa !26
store ptr %13, ptr %4, align 4, !tbaa !26
store ptr %12, ptr %11, align 4, !tbaa !26
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 3
%15 = load ptr, ptr %3, align 4, !tbaa !26
%16 = load ptr, ptr %14, align 4, !tbaa !26
store ptr %16, ptr %3, align 4, !tbaa !26
store ptr %15, ptr %14, align 4, !tbaa !26
%17 = load ptr, ptr %7, align 4, !tbaa !55
store ptr %17, ptr %1, align 4, !tbaa !54
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEED2Ev(ptr noundef nonnull returned align 4 dereferenceable(20) %0) unnamed_addr #4 comdat {
tail call void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #17
%2 = load ptr, ptr %0, align 4, !tbaa !54
%3 = icmp eq ptr %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @_ZdlPv(ptr noundef nonnull %2) #19
br label %5
5: ; preds = %4, %1
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #18
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 comdat {
%2 = tail call ptr @__cxa_allocate_exception(i32 8) #15
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #16
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #20
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) #16
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !56
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #4
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_6vectorIiNS0_IiEEEEE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %0, i32 noundef %1) local_unnamed_addr #9 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() #18
unreachable
5: ; preds = %2
%6 = mul nuw i32 %1, 12
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #21
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #8 comdat {
%1 = tail call ptr @__cxa_allocate_exception(i32 4) #15
%2 = tail call noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %1) #17
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #20
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #4
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #4
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: minsize optsize
define linkonce_odr hidden ptr @_ZNSt3__242__uninitialized_allocator_move_if_noexceptB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EES8_S8_EET2_RT_T0_T1_S9_(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
store ptr %3, ptr %5, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #15
%8 = ptrtoint ptr %3 to i32
store i32 %8, ptr %6, align 4, !tbaa !26
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #15
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
%11 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %7, i32 0, i32 1
store i8 0, ptr %11, align 4, !tbaa !58, !alias.scope !61
br label %12
12: ; preds = %16, %4
%13 = phi ptr [ %3, %4 ], [ %21, %16 ]
%14 = phi ptr [ %1, %4 ], [ %18, %16 ]
%15 = icmp eq ptr %14, %2
br i1 %15, label %22, label %16
16: ; preds = %12
%17 = getelementptr inbounds %"class.std::__2::vector.1", ptr %13, i32 -1
%18 = getelementptr inbounds %"class.std::__2::vector.1", ptr %14, i32 -1
%19 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %18) #17
%20 = load ptr, ptr %5, align 4, !tbaa !64
%21 = getelementptr inbounds %"class.std::__2::vector.1", ptr %20, i32 -1
store ptr %21, ptr %5, align 4, !tbaa !64
br label %12, !llvm.loop !66
22: ; preds = %12
store i8 1, ptr %11, align 4, !tbaa !58
%23 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(13) %7) #17
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #15
ret ptr %13
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(13) %0) unnamed_addr #4 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !58, !range !67, !noundef !68
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
br label %6
6: ; preds = %5, %1
ret ptr %0
}
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNKSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #0 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !69
%3 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !70
%5 = load ptr, ptr %4, align 4, !tbaa.struct !28
%6 = getelementptr inbounds %"class.std::__2::_AllocatorDestroyRangeReverse", ptr %0, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !71
%8 = load ptr, ptr %7, align 4, !tbaa.struct !28
tail call void @_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorINS6_IPS4_EEEES9_EEvRT_T0_T1_(ptr noundef nonnull align 1 dereferenceable(1) %2, ptr %5, ptr %8) #16
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__219__allocator_destroyB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorINS6_IPS4_EEEES9_EEvRT_T0_T1_(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr %1, ptr %2) local_unnamed_addr #9 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__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #17
%9 = getelementptr inbounds %"class.std::__2::vector.1", ptr %5, i32 1
br label %4, !llvm.loop !72
10: ; preds = %4
ret void
}
; Function Attrs: minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #11 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !55
tail call void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE17__destruct_at_endB7v160006EPS4_NS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #17
ret void
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEE17__destruct_at_endB7v160006EPS4_NS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %1) local_unnamed_addr #12 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 !47
%6 = icmp eq ptr %5, %1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = getelementptr inbounds %"class.std::__2::vector.1", ptr %5, i32 -1
store ptr %8, ptr %3, align 4, !tbaa !47
%9 = tail call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #17
br label %4, !llvm.loop !73
10: ; preds = %4
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #9 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) #18
unreachable
5: ; preds = %2
%6 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 2
%7 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #16, !noalias !74
store ptr %7, ptr %0, align 4, !tbaa !16
%8 = getelementptr inbounds %"class.std::__2::vector.1", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !12
%9 = getelementptr inbounds i32, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !26
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(5) %0) unnamed_addr #4 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions.11", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !43, !range !67, !noundef !68
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #17
br label %6
6: ; preds = %5, %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 #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #18
unreachable
}
; 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 #9 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() #18
unreachable
5: ; preds = %2
%6 = shl nuw i32 %1, 2
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #21
ret ptr %7
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #13
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #9 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !77
%3 = load ptr, ptr %2, align 4, !tbaa !16
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector.1", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !12
tail call void @_ZdlPv(ptr noundef nonnull %3) #19
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #14
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 optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { inlinehint minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #15 = { nounwind }
attributes #16 = { minsize optsize }
attributes #17 = { minsize nounwind optsize }
attributes #18 = { minsize noreturn optsize }
attributes #19 = { builtin minsize nounwind optsize }
attributes #20 = { noreturn }
attributes #21 = { 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__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_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_6vectorIiNS_9allocatorIiEEEENS2_IS4_EEEE", !9, i64 0}
!9 = !{!"_ZTSNSt3__222__compressed_pair_elemIPNS_6vectorIiNS_9allocatorIiEEEELi0ELb0EEE", !5, i64 0}
!10 = !{!4, !5, i64 4}
!11 = !{!9, !5, i64 0}
!12 = !{!13, !5, i64 4}
!13 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !14, i64 8}
!14 = !{!"_ZTSNSt3__217__compressed_pairIPiNS_9allocatorIiEEEE", !15, i64 0}
!15 = !{!"_ZTSNSt3__222__compressed_pair_elemIPiLi0ELb0EEE", !5, i64 0}
!16 = !{!13, !5, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !6, i64 0}
!21 = distinct !{!21, !18}
!22 = !{!23, !5, i64 0}
!23 = !{!"_ZTSSt16initializer_listIiE", !5, i64 0, !24, i64 4}
!24 = !{!"long", !6, i64 0}
!25 = !{!23, !24, i64 4}
!26 = !{!5, !5, i64 0}
!27 = !{!15, !5, i64 0}
!28 = !{i64 0, i64 4, !26}
!29 = !{!30}
!30 = distinct !{!30, !31, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_: argument 0"}
!31 = distinct !{!31, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_"}
!32 = !{!33, !35, !37, !39, !41}
!33 = distinct !{!33, !34, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!34 = distinct !{!34, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!35 = distinct !{!35, !36, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!36 = distinct !{!36, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!37 = distinct !{!37, !38, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!38 = distinct !{!38, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!39 = distinct !{!39, !40, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!40 = distinct !{!40, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!41 = distinct !{!41, !42, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!42 = distinct !{!42, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!43 = !{!44, !46, i64 4}
!44 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEE", !45, i64 0, !46, i64 4}
!45 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorE", !5, i64 0}
!46 = !{!"bool", !6, i64 0}
!47 = !{!48, !5, i64 8}
!48 = !{!"_ZTSNSt3__214__split_bufferINS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEE", !5, i64 0, !5, i64 4, !5, i64 8, !49, i64 12}
!49 = !{!"_ZTSNSt3__217__compressed_pairIPNS_6vectorIiNS_9allocatorIiEEEERNS2_IS4_EEEE", !9, i64 0, !50, i64 4}
!50 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorINS_6vectorIiNS1_IiEEEEEELi1ELb0EEE", !5, i64 0}
!51 = !{!52}
!52 = distinct !{!52, !53, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS8_m: argument 0"}
!53 = distinct !{!53, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorINS_6vectorIiNS1_IiEEEEEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS8_m"}
!54 = !{!48, !5, i64 0}
!55 = !{!48, !5, i64 4}
!56 = !{!57, !57, i64 0}
!57 = !{!"vtable pointer", !7, i64 0}
!58 = !{!59, !46, i64 12}
!59 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEEE", !60, i64 0, !46, i64 12}
!60 = !{!"_ZTSNSt3__229_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS1_IiEEEEEENS_16reverse_iteratorIPS4_EEEE", !5, i64 0, !5, i64 4, !5, i64 8}
!61 = !{!62}
!62 = distinct !{!62, !63, !"_ZNSt3__222__make_exception_guardB7v160006INS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEEENS_28__exception_guard_exceptionsIT_EESC_: argument 0"}
!63 = distinct !{!63, !"_ZNSt3__222__make_exception_guardB7v160006INS_29_AllocatorDestroyRangeReverseINS_9allocatorINS_6vectorIiNS2_IiEEEEEENS_16reverse_iteratorIPS5_EEEEEENS_28__exception_guard_exceptionsIT_EESC_"}
!64 = !{!65, !5, i64 0}
!65 = !{!"_ZTSNSt3__216reverse_iteratorIPNS_6vectorIiNS_9allocatorIiEEEEEE", !5, i64 0}
!66 = distinct !{!66, !18}
!67 = !{i8 0, i8 2}
!68 = !{}
!69 = !{!60, !5, i64 0}
!70 = !{!60, !5, i64 8}
!71 = !{!60, !5, i64 4}
!72 = distinct !{!72, !18}
!73 = distinct !{!73, !18}
!74 = !{!75}
!75 = distinct !{!75, !76, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!76 = distinct !{!76, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!77 = !{!45, !5, i64 0}
| (module
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func))
(type (;3;) (func (param i32)))
(type (;4;) (func (param i32 i32 i32)))
(type (;5;) (func (param i32 i32) (result i32)))
(type (;6;) (func (param i32 i32 i32) (result i32)))
(import "env" "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_" (func (;0;) (type 0)))
(import "env" "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_" (func (;1;) (type 0)))
(import "env" "memmove" (func (;2;) (type 6)))
(import "env" "_ZdlPv" (func (;3;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;4;) (type 1)))
(import "env" "__cxa_throw" (func (;5;) (type 4)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;6;) (type 5)))
(import "env" "_Znwm" (func (;7;) (type 1)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;8;) (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 (;9;) (type 2))
(func (;10;) (type 4) (param i32 i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 48
i32.sub
local.tee 4
global.set 0
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load
local.tee 3
i32.sub
i32.const 12
i32.div_s
local.get 6
i32.gt_u
if ;; label = @2
local.get 3
local.get 6
i32.const 12
i32.mul
local.tee 10
i32.add
local.tee 3
i32.load offset=4
local.get 3
i32.load
i32.sub
i32.const 2
i32.shr_s
local.set 7
loop ;; label = @3
local.get 7
i32.const 0
i32.le_s
if ;; label = @4
local.get 6
i32.const 1
i32.add
local.set 6
br 3 (;@1;)
end
local.get 1
i32.load
local.get 10
i32.add
i32.load
local.get 7
i32.const 1
i32.sub
local.tee 7
i32.const 2
i32.shl
i32.add
i32.load
local.get 2
i32.ne
br_if 0 (;@3;)
local.get 4
i32.const 2
i32.store offset=32
local.get 4
local.get 7
i32.store offset=24
local.get 4
local.get 6
i32.store offset=20
local.get 4
local.get 4
i32.const 20
i32.add
i32.store offset=28
local.get 4
local.get 4
i64.load offset=28 align=4
i64.store offset=8
global.get 0
i32.const 16
i32.sub
local.tee 8
global.set 0
local.get 4
i32.const 36
i32.add
local.tee 3
i32.const 0
i32.store offset=8
local.get 3
i64.const 0
i64.store align=4
local.get 8
local.get 3
i32.store offset=8
local.get 4
i32.load offset=12
local.tee 5
if ;; label = @4
local.get 5
i32.const 1073741824
i32.ge_u
if ;; label = @5
call 16
unreachable
end
local.get 5
i32.const 1073741824
i32.ge_u
if ;; label = @5
call 17
unreachable
end
local.get 3
local.get 5
i32.const 2
i32.shl
local.tee 5
call 7
local.tee 9
i32.store offset=4
local.get 3
local.get 9
i32.store
local.get 3
local.get 5
local.get 9
i32.add
i32.store offset=8
local.get 3
local.get 3
i32.load offset=4
local.get 4
i32.load offset=8
local.get 5
call 2
local.get 5
i32.add
i32.store offset=4
end
local.get 8
i32.const 1
i32.store8 offset=12
local.get 8
i32.const 8
i32.add
local.tee 5
i32.load8_u offset=4
i32.eqz
if ;; label = @4
local.get 5
call 14
end
local.get 8
i32.const 16
i32.add
global.set 0
block ;; label = @4
local.get 0
i32.load offset=4
local.get 0
i32.load offset=8
i32.lt_u
if ;; label = @5
local.get 0
local.get 3
call 0
br 1 (;@4;)
end
local.get 0
local.get 3
call 1
end
local.get 3
call 11
drop
br 0 (;@3;)
end
unreachable
end
end
local.get 4
i32.const 48
i32.add
global.set 0)
(func (;11;) (type 1) (param i32) (result i32)
(local i32)
global.get 0
i32.const 16
i32.sub
local.tee 1
global.set 0
local.get 1
local.get 0
i32.store offset=12
local.get 1
i32.const 12
i32.add
call 14
local.get 1
i32.const 16
i32.add
global.set 0
local.get 0)
(func (;12;) (type 0) (param i32 i32)
local.get 0
local.get 0
i32.load offset=4
local.get 1
call 15
i32.const 12
i32.add
i32.store offset=4)
(func (;13;) (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
call 16
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 3
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 4
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 3
if ;; label = @1
local.get 3
i32.const 357913942
i32.ge_u
if ;; label = @2
call 17
unreachable
end
local.get 3
i32.const 12
i32.mul
call 7
local.set 4
end
local.get 2
local.get 4
i32.store offset=12
local.get 2
local.get 4
local.get 5
i32.const 12
i32.mul
i32.add
local.tee 5
i32.store offset=20
local.get 2
local.get 4
local.get 3
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 15
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 4
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 3
global.set 0
local.get 3
local.get 5
i32.store offset=28
local.get 3
local.get 5
i32.store offset=24
local.get 3
i32.const 0
i32.store8 offset=20
local.get 3
local.get 0
i32.const 8
i32.add
i32.store offset=8
local.get 3
local.get 3
i32.const 28
i32.add
i32.store offset=16
local.get 3
local.get 3
i32.const 24
i32.add
i32.store offset=12
loop ;; label = @1
local.get 1
local.get 4
i32.ne
if ;; label = @2
local.get 5
i32.const 12
i32.sub
local.get 4
i32.const 12
i32.sub
local.tee 4
call 15
drop
local.get 3
local.get 3
i32.load offset=28
i32.const 12
i32.sub
local.tee 5
i32.store offset=28
br 1 (;@1;)
end
end
local.get 3
i32.const 1
i32.store8 offset=20
local.get 3
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 4
local.get 1
i32.load offset=4
i32.load
local.set 1
loop ;; label = @2
local.get 1
local.get 4
i32.ne
if ;; label = @3
local.get 4
call 11
i32.const 12
i32.add
local.set 4
br 1 (;@2;)
end
end
end
local.get 3
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 11
drop
br 1 (;@1;)
end
end
local.get 2
i32.load offset=12
local.tee 0
if ;; label = @1
local.get 0
call 3
end
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;14;) (type 3) (param i32)
(local i32)
local.get 0
i32.load
local.tee 1
i32.load
local.tee 0
if ;; label = @1
local.get 1
local.get 0
i32.store offset=4
local.get 0
call 3
end)
(func (;15;) (type 5) (param i32 i32) (result i32)
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.load
i32.store
local.get 0
local.get 1
i32.load offset=4
i32.store offset=4
local.get 0
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
local.get 0)
(func (;16;) (type 2)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 4
global.get 4
local.set 3
global.get 1
call 6
local.tee 0
local.get 3
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 5
unreachable)
(func (;17;) (type 2)
(local i32 i32)
global.get 5
local.set 0
global.get 6
local.set 1
i32.const 4
call 4
call 8
local.get 1
local.get 0
call 5
unreachable)
(export "__wasm_call_ctors" (func 9))
(export "__wasm_apply_data_relocs" (func 9))
(export "_Z7get_rowNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEEEi" (func 10))
(export "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE22__construct_one_at_endB7v160006IJS3_EEEvDpOT_" (func 12))
(export "_ZNSt3__26vectorINS0_IiNS_9allocatorIiEEEENS1_IS3_EEE21__push_back_slow_pathIS3_EEvOT_" (func 13))
(data (;0;) (global.get 1) "vector\00"))
| 6 | 171 | 12,906 | 606 |
CPP/88 | /*
Given a vector of non-negative integers, return a copy of the given vector after sorting,
you will sort the given vector in ascending order if the sum( first index value, last index value) is odd,
or sort it in descending order if the sum( first index value, last index value) is even.
Note:
* don't change the given vector.
Examples:
* sort_vector({}) => {}
* sort_vector({5}) => {5}
* sort_vector({2, 4, 3, 0, 1, 5}) => {0, 1, 2, 3, 4, 5}
* sort_vector({2, 4, 3, 0, 1, 5, 6}) => {6, 5, 4, 3, 2, 1, 0}
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> sort_array(vector<int> array){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
vector<int> sort_array(vector<int> array){
| if (array.size()==0) return {};
if ((array[0]+array[array.size()-1]) %2==1)
{
sort(array.begin(),array.end());
return array;
}
else
{
sort(array.begin(),array.end());
vector<int> out={};
for (int i=array.size()-1;i>=0;i-=1)
out.push_back(array[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(sort_array({}) , {}));
assert (issame(sort_array({5}) , {5}));
assert (issame(sort_array({2, 4, 3, 0, 1, 5}) , {0, 1, 2, 3, 4, 5}));
assert (issame(sort_array({2, 4, 3, 0, 1, 5, 6}) , {6, 5, 4, 3, 2, 1, 0}));
assert (issame(sort_array({2, 1}) , {1, 2}));
assert (issame(sort_array({15, 42, 87, 32 ,11, 0}) , {0, 11, 15, 32, 42, 87}));
assert (issame(sort_array({21, 14, 23, 11}) , {23, 21, 14, 11}));
}
| #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(sort_array({}) , {}));
assert (issame(sort_array({5}) , {5}));
assert (issame(sort_array({2, 4, 3, 0, 1, 5}) , {0, 1, 2, 3, 4, 5}));
assert (issame(sort_array({2, 4, 3, 0, 1, 5, 6}) , {6, 5, 4, 3, 2, 1, 0}));
}
| ; ModuleID = 'c_code_test/code_87.cpp'
source_filename = "c_code_test/code_87.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::__less" = type { i8 }
%"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_9allocatorIiEEEC2B7v160006EOS3_ = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi = comdat any
$_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_ = 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 @_Z10sort_arrayNSt3__26vectorIiNS_9allocatorIiEEEE(ptr noalias sret(%"class.std::__2::vector") align 4 %0, ptr noundef %1) local_unnamed_addr #0 {
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !3
%5 = load ptr, ptr %1, align 4, !tbaa !10
%6 = icmp eq ptr %4, %5
br i1 %6, label %7, label %10
7: ; preds = %2
store ptr null, ptr %0, align 4, !tbaa !10
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %8, align 4, !tbaa !3
%9 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %9, align 4, !tbaa !11
br label %40
10: ; preds = %2
%11 = ptrtoint ptr %5 to i32
%12 = ptrtoint ptr %4 to i32
%13 = sub i32 %12, %11
%14 = ashr exact i32 %13, 2
%15 = load i32, ptr %5, align 4, !tbaa !12
%16 = add nsw i32 %14, -1
%17 = getelementptr inbounds i32, ptr %5, i32 %16
%18 = load i32, ptr %17, align 4, !tbaa !12
%19 = add nsw i32 %18, %15
%20 = and i32 %19, -2147483647
%21 = icmp eq i32 %20, 1
tail call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr nonnull %5, ptr %4) #14
br i1 %21, label %22, label %24
22: ; preds = %10
%23 = tail call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #15
br label %40
24: ; preds = %10
store ptr null, ptr %0, align 4, !tbaa !10
%25 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %25, align 4, !tbaa !3
%26 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %26, align 4, !tbaa !11
%27 = load ptr, ptr %3, align 4, !tbaa !3
%28 = load ptr, ptr %1, align 4, !tbaa !10
%29 = ptrtoint ptr %27 to i32
%30 = ptrtoint ptr %28 to i32
%31 = sub i32 %29, %30
%32 = ashr exact i32 %31, 2
br label %33
33: ; preds = %36, %24
%34 = phi i32 [ %32, %24 ], [ %37, %36 ]
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = add nsw i32 %34, -1
%38 = load ptr, ptr %1, align 4, !tbaa !10
%39 = getelementptr inbounds i32, ptr %38, i32 %37
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %39) #14
br label %33, !llvm.loop !14
40: ; preds = %33, %22, %7
ret void
}
; Function Attrs: inlinehint minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006EOS3_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) unnamed_addr #1 comdat {
store ptr null, ptr %0, align 4, !tbaa !10
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %3, align 4, !tbaa !3
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %4, align 4, !tbaa !11
%5 = load ptr, ptr %1, align 4, !tbaa !10
store ptr %5, ptr %0, align 4, !tbaa !10
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !3
store ptr %7, ptr %3, align 4, !tbaa !3
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %1, i32 0, i32 2
%9 = load ptr, ptr %8, align 4, !tbaa !16
store ptr %9, ptr %4, align 4, !tbaa !16
store ptr null, ptr %8, align 4, !tbaa !16
store ptr null, ptr %6, align 4, !tbaa !3
store ptr null, ptr %1, align 4, !tbaa !10
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; 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 #3 comdat {
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !3
%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 !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 !3
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) #14
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) #2
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #4 comdat {
%3 = alloca %"struct.std::__2::__less", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #14
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #5
; 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) #16
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%6 = load ptr, ptr %5, align 4, !tbaa !3
%7 = load ptr, ptr %0, align 4, !tbaa !10
%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) #14
%14 = load ptr, ptr %5, align 4, !tbaa !3
%15 = load ptr, ptr %0, align 4, !tbaa !10
%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) #14
%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 !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 !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) #14
%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) #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 #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) #17
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 !10
%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 !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) #14, !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 !3
%5 = load ptr, ptr %0, align 4, !tbaa !10
%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 !12, !noalias !26
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !12, !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 #6 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) #18
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 #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 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) #14
tail call void @__cxa_throw(ptr nonnull %2, ptr nonnull @_ZTISt12length_error, ptr nonnull @_ZNSt12length_errorD1Ev) #19
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) #14
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 #6
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 #9 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() #17
unreachable
5: ; preds = %2
%6 = shl nuw i32 %1, 2
%7 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %6) #20
ret ptr %7
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZSt28__throw_bad_array_new_lengthB7v160006v() local_unnamed_addr #8 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) #15
tail call void @__cxa_throw(ptr nonnull %1, ptr nonnull @_ZTISt20bad_array_new_length, ptr nonnull @_ZNSt20bad_array_new_lengthD1Ev) #19
unreachable
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthC1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #6
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #6
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; 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 #11 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 #12 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) #13
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 nounwind 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 = { inlinehint minsize 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 nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { minsize optsize }
attributes #15 = { minsize nounwind optsize }
attributes #16 = { nounwind }
attributes #17 = { minsize noreturn optsize }
attributes #18 = { builtin minsize nounwind optsize }
attributes #19 = { noreturn }
attributes #20 = { 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 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 = !{!9, !5, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!5, !5, i64 0}
!17 = !{!18, !5, i64 8}
!18 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !5, i64 0, !5, i64 4, !5, i64 8, !19, i64 12}
!19 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !5, 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, !5, i64 0}
!25 = !{!18, !5, 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", !7, 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" "_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_" (func (;1;) (type 2)))
(import "env" "_ZdlPv" (func (;2;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;3;) (type 1)))
(import "env" "__cxa_throw" (func (;4;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;5;) (type 4)))
(import "env" "_Znwm" (func (;6;) (type 1)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;7;) (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 (;8;) (type 5))
(func (;9;) (type 0) (param i32 i32)
(local i32 i32 i32 i32 i32)
local.get 1
i32.load offset=4
local.tee 2
local.get 1
i32.load
local.tee 3
i32.eq
if ;; label = @1
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
return
end
local.get 2
i32.const 4
i32.sub
i32.load
local.set 5
local.get 3
i32.load
local.set 6
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 3
local.get 2
local.get 4
i32.const 15
i32.add
call 1
local.get 4
i32.const 16
i32.add
global.set 0
block ;; label = @1
local.get 5
local.get 6
i32.add
i32.const -2147483647
i32.and
i32.const 1
i32.eq
if ;; label = @2
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
local.get 0
local.get 1
i32.load
i32.store
local.get 0
local.get 1
i32.load offset=4
i32.store offset=4
local.get 0
local.get 1
i32.load offset=8
i32.store offset=8
local.get 1
i32.const 0
i32.store offset=8
local.get 1
i64.const 0
i64.store align=4
br 1 (;@1;)
end
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 offset=4
local.get 1
i32.load
i32.sub
i32.const 2
i32.shr_s
local.set 2
loop ;; label = @2
local.get 2
i32.const 0
i32.le_s
br_if 1 (;@1;)
local.get 1
i32.load
local.get 2
i32.const 1
i32.sub
local.tee 2
i32.const 2
i32.shl
i32.add
local.set 3
block ;; label = @3
local.get 0
i32.load offset=4
local.tee 4
local.get 0
i32.load offset=8
i32.ne
if ;; label = @4
local.get 4
local.get 3
i32.load
i32.store
local.get 0
local.get 4
i32.const 4
i32.add
i32.store offset=4
br 1 (;@3;)
end
local.get 0
local.get 3
call 0
end
br 0 (;@2;)
end
unreachable
end)
(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 3
global.get 4
local.set 3
global.get 1
call 5
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 4
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 3
call 7
local.get 1
local.get 0
call 4
unreachable
end
local.get 4
i32.const 2
i32.shl
call 6
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 2
end
local.get 2
i32.const 32
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z10sort_arrayNSt3__26vectorIiNS_9allocatorIiEEEE" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 10))
(data (;0;) (global.get 1) "vector\00"))
| 16 | 354 | 8,160 | 390 |
CPP/89 | /*
Create a function encrypt that takes a string as an argument and
returns a string encrypted with the alphabet being rotated.
The alphabet should be rotated in a manner such that the letters
shift down by two multiplied to two places.
For example:
encrypt("hi") returns "lm"
encrypt("asdfghjkl") returns "ewhjklnop"
encrypt("gf") returns "kj"
encrypt("et") returns "ix"
*/
#include<stdio.h>
#include<string>
using namespace std;
string encrypt(string s){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
string encrypt(string s){
| string out;
int i;
for (i=0;i<s.length();i++)
{
int w=((int)s[i]+4-(int)'a')%26+(int)'a';
out=out+(char)w;
}
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (encrypt("hi") == "lm");
assert (encrypt("asdfghjkl") == "ewhjklnop");
assert (encrypt("gf") == "kj");
assert (encrypt("et") == "ix");
assert (encrypt("faewfawefaewg")=="jeiajeaijeiak");
assert (encrypt("hellomyfriend")=="lippsqcjvmirh");
assert (encrypt("dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh")=="hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl");
assert (encrypt("a")=="e");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (encrypt("hi") == "lm");
assert (encrypt("asdfghjkl") == "ewhjklnop");
assert (encrypt("gf") == "kj");
assert (encrypt("et") == "ix");
}
| ; ModuleID = 'c_code_test/code_88.cpp'
source_filename = "c_code_test/code_88.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z7encryptNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
br label %6
6: ; preds = %14, %2
%7 = phi i32 [ 0, %2 ], [ %25, %14 ]
%8 = load i8, ptr %4, align 1
%9 = icmp slt i8 %8, 0
%10 = load i32, ptr %5, align 4
%11 = zext i8 %8 to i32
%12 = select i1 %9, i32 %10, i32 %11
%13 = icmp ult i32 %7, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load ptr, ptr %1, align 4
%16 = select i1 %9, ptr %15, ptr %1
%17 = getelementptr inbounds i8, ptr %16, i32 %7
%18 = load i8, ptr %17, align 1, !tbaa !3
%19 = sext i8 %18 to i16
%20 = add nsw i16 %19, -93
%21 = srem i16 %20, 26
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #12
%22 = trunc i16 %21 to i8
%23 = add nsw i8 %22, 97
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %23) #13
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %3) #14
%24 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #12
%25 = add nuw nsw i32 %7, 1
br label %6, !llvm.loop !6
26: ; preds = %6
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: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #12
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #13
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #12
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !8
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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 #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #4
; 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) #5
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #15
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #16
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__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) #15
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) #12
%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) #17
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 !19
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #8
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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #9
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #5
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #11 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #18
br label %8
8: ; preds = %6, %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 !21
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "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 = { nounwind }
attributes #13 = { minsize optsize }
attributes #14 = { minsize nounwind optsize }
attributes #15 = { minsize noreturn optsize }
attributes #16 = { builtin minsize optsize allocsize(0) }
attributes #17 = { noreturn }
attributes #18 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !11, !13, !15, !17}
!9 = distinct !{!9, !10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!10 = distinct !{!10, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!11 = distinct !{!11, !12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!12 = distinct !{!12, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!13 = distinct !{!13, !14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!14 = distinct !{!14, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!15 = distinct !{!15, !16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!16 = distinct !{!16, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!17 = distinct !{!17, !18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!18 = distinct !{!18, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !5, i64 0}
!21 = !{i64 0, i64 4, !22, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 11, i64 4, !24, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !4, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;0;) (type 0)))
(import "env" "memmove" (func (;1;) (type 1)))
(import "env" "_Znwm" (func (;2;) (type 0)))
(import "env" "__cxa_allocate_exception" (func (;3;) (type 0)))
(import "env" "__cxa_throw" (func (;4;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;5;) (type 3)))
(import "env" "_ZdlPv" (func (;6;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;7;) (type 5))
(func (;8;) (type 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 5
global.set 0
local.get 0
i64.const 0
i64.store align=4
local.get 0
i32.const 0
i32.store offset=8
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.get 4
i32.gt_u
if ;; label = @2
local.get 1
i32.load
local.get 1
local.get 2
select
local.get 4
i32.add
i32.load8_s
i32.const 93
i32.sub
i32.const 26
i32.rem_s
i32.const 97
i32.add
i32.extend8_s
local.set 7
global.get 0
i32.const 16
i32.sub
local.tee 8
global.set 0
block (result i32) ;; label = @3
local.get 5
i32.const 4
i32.add
local.set 2
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 6
i32.const 1
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @4
local.get 3
i32.const 10
i32.le_u
if ;; label = @5
local.get 2
i32.const 0
i32.store offset=8
local.get 2
i64.const 0
i64.store align=4
local.get 2
local.get 3
i32.store8 offset=11
local.get 2
br 2 (;@3;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 9
call 2
local.set 10
local.get 2
local.get 3
i32.store offset=4
local.get 2
local.get 10
i32.store
local.get 2
local.get 9
i32.const -2147483648
i32.or
i32.store offset=8
local.get 2
br 1 (;@3;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 3
global.get 4
local.set 3
global.get 1
call 5
local.tee 2
local.get 3
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 4
unreachable
end
local.tee 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 6
call 1
local.get 6
i32.add
local.tee 3
local.get 7
i32.store8
local.get 3
i32.const 0
i32.store8 offset=1
local.get 8
i32.const 16
i32.add
global.set 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 0
i32.load
call 6
end
local.get 0
local.get 2
i64.load align=4
i64.store align=4
local.get 0
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 4
i32.const 1
i32.add
local.set 4
local.get 2
call 0
drop
br 1 (;@1;)
end
end
local.get 5
i32.const 16
i32.add
global.set 0)
(export "__wasm_call_ctors" (func 7))
(export "__wasm_apply_data_relocs" (func 7))
(export "_Z7encryptNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 8))
(data (;0;) (global.get 1) "basic_string\00"))
| 9 | 166 | 5,537 | 223 |
CPP/90 | /*
You are given a vector of integers.
Write a function next_smallest() that returns the 2nd smallest element of the vector.
Return None if there is no such element.
next_smallest({1, 2, 3, 4, 5}) == 2
next_smallest({5, 1, 4, 3, 2}) == 2
next_smallest({}) == None
next_smallest({1, 1}) == None
*/
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int next_smallest(vector<int> lst){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<algorithm>
using namespace std;
#include<stdlib.h>
int next_smallest(vector<int> lst){
| sort(lst.begin(),lst.end());
for (int i=1;i<lst.size();i++)
if (lst[i]!=lst[i-1]) return lst[i];
return -1;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (next_smallest({1, 2, 3, 4, 5}) == 2);
assert (next_smallest({5, 1, 4, 3, 2}) == 2);
assert (next_smallest({}) == -1);
assert (next_smallest({1, 1}) == -1);
assert (next_smallest({1,1,1,1,0}) == 1);
assert (next_smallest({-35, 34, 12, -45}) == -35);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (next_smallest({1, 2, 3, 4, 5}) == 2);
assert (next_smallest({5, 1, 4, 3, 2}) == 2);
assert (next_smallest({}) == -1);
assert (next_smallest({1, 1}) == -1);
}
| ; ModuleID = 'c_code_test/code_89.cpp'
source_filename = "c_code_test/code_89.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::__less" = type { i8 }
$_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_ = comdat any
; Function Attrs: minsize optsize
define noundef i32 @_Z13next_smallestNSt3__26vectorIiNS_9allocatorIiEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = load ptr, ptr %0, align 4, !tbaa !3
%3 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !10
tail call void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %2, ptr %4) #3
%5 = load ptr, ptr %3, align 4, !tbaa !10
%6 = load ptr, ptr %0, align 4, !tbaa !3
%7 = ptrtoint ptr %5 to i32
%8 = ptrtoint ptr %6 to i32
%9 = sub i32 %7, %8
%10 = ashr exact i32 %9, 2
%11 = tail call i32 @llvm.umax.i32(i32 %10, i32 1)
br label %12
12: ; preds = %15, %1
%13 = phi i32 [ 1, %1 ], [ %22, %15 ]
%14 = icmp eq i32 %13, %11
br i1 %14, label %23, label %15
15: ; preds = %12
%16 = getelementptr inbounds i32, ptr %6, i32 %13
%17 = load i32, ptr %16, align 4, !tbaa !11
%18 = add nsw i32 %13, -1
%19 = getelementptr inbounds i32, ptr %6, i32 %18
%20 = load i32, ptr %19, align 4, !tbaa !11
%21 = icmp eq i32 %17, %20
%22 = add nuw i32 %13, 1
br i1 %21, label %12, label %23, !llvm.loop !13
23: ; preds = %15, %12
%24 = phi i32 [ %17, %15 ], [ -1, %12 ]
ret i32 %24
}
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__24sortB7v160006INS_11__wrap_iterIPiEENS_6__lessIiiEEEEvT_S6_T0_(ptr %0, ptr %1) local_unnamed_addr #1 comdat {
%3 = alloca %"struct.std::__2::__less", align 1
call void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef %0, ptr noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %3) #3
ret void
}
; Function Attrs: minsize optsize
declare void @_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #2
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 mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { minsize optsize }
!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 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
| (module
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func))
(type (;2;) (func (param i32) (result i32)))
(import "env" "_ZNSt3__26__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_" (func (;0;) (type 0)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;1;) (type 1))
(func (;2;) (type 2) (param i32) (result i32)
(local i32 i32 i32 i32)
local.get 0
i32.load
local.get 0
i32.load offset=4
global.get 0
i32.const 16
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 15
i32.add
call 0
local.get 2
i32.const 16
i32.add
global.set 0
i32.const 1
local.get 0
i32.load offset=4
local.get 0
i32.load
local.tee 2
i32.sub
i32.const 2
i32.shr_s
local.tee 0
local.get 0
i32.const 1
i32.le_u
select
local.set 3
i32.const 1
local.set 0
loop ;; label = @1
local.get 0
local.get 3
i32.eq
if ;; label = @2
i32.const -1
return
end
local.get 0
i32.const 2
i32.shl
local.get 0
i32.const 1
i32.add
local.set 0
local.get 2
i32.add
local.tee 1
i32.load
local.tee 4
local.get 1
i32.const 4
i32.sub
i32.load
i32.eq
br_if 0 (;@1;)
end
local.get 4)
(export "__wasm_call_ctors" (func 1))
(export "__wasm_apply_data_relocs" (func 1))
(export "_Z13next_smallestNSt3__26vectorIiNS_9allocatorIiEEEE" (func 2)))
| 5 | 130 | 1,566 | 75 |
CPP/91 | /*
You'll be given a string of words, and your task is to count the number
of boredoms. A boredom is a sentence that starts with the word "I".
Sentences are delimited by '.', '?' or '!'.
For example:
>>> is_bored("Hello world")
0
>>> is_bored("The sky is blue. The sun is shining. I love this weather")
1
*/
#include<stdio.h>
#include<string>
using namespace std;
int is_bored(string S){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int is_bored(string S){
| bool isstart=true;
bool isi=false;
int sum=0;
for (int i=0;i<S.length();i++)
{
if (S[i]==' ' and isi) {isi=false; sum+=1;}
if (S[i]=='I' and isstart) {isi=true; }
else isi=false;
if (S[i]!=' ') { isstart=false;}
if (S[i]=='.' or S[i]=='?' or S[i]=='!') isstart=true;
}
return sum;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_bored("Hello world") == 0);
assert (is_bored("Is the sky blue?") == 0);
assert (is_bored("I love It !") == 1);
assert (is_bored("bIt") == 0);
assert (is_bored("I feel good today. I will be productive. will kill It") == 2);
assert (is_bored("You and I are going for a walk") == 0);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (is_bored("Hello world") == 0);
assert (is_bored("The sky is blue. The sun is shining. I love this weather") == 1);
}
| ; ModuleID = 'c_code_test/code_90.cpp'
source_filename = "c_code_test/code_90.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"struct.std::__2::basic_string<char>::__long" = type { ptr, i32, i32 }
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize willreturn memory(read, inaccessiblemem: none)
define noundef i32 @_Z8is_boredNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = load i32, ptr %5, align 4
%7 = zext i8 %3 to i32
%8 = select i1 %4, i32 %6, i32 %7
br label %9
9: ; preds = %29, %1
%10 = phi i1 [ true, %1 ], [ %30, %29 ]
%11 = phi i32 [ 0, %1 ], [ %26, %29 ]
%12 = phi i32 [ 0, %1 ], [ %23, %29 ]
%13 = phi i32 [ 0, %1 ], [ %31, %29 ]
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %16
15: ; preds = %9
ret i32 %12
16: ; preds = %9
%17 = load ptr, ptr %0, align 4
%18 = select i1 %4, ptr %17, ptr %0
%19 = getelementptr inbounds i8, ptr %18, i32 %13
%20 = load i8, ptr %19, align 1, !tbaa !3
%21 = icmp eq i8 %20, 32
%22 = select i1 %21, i32 %11, i32 0
%23 = add nuw nsw i32 %22, %12
%24 = icmp eq i8 %20, 73
%25 = select i1 %24, i1 %10, i1 false
%26 = zext i1 %25 to i32
%27 = select i1 %21, i1 %10, i1 false
switch i8 %20, label %29 [
i8 46, label %28
i8 63, label %28
i8 33, label %28
]
28: ; preds = %16, %16, %16
br label %29
29: ; preds = %16, %28
%30 = phi i1 [ true, %28 ], [ %27, %16 ]
%31 = add nuw i32 %13, 1
br label %9, !llvm.loop !6
}
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, !4, i64 0}
!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"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 i32 i32 i32 i32 i32)
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.set 8
i32.const 1
local.set 1
loop ;; label = @1
local.get 2
local.get 8
i32.eq
i32.eqz
if ;; label = @2
local.get 0
i32.load
local.get 0
local.get 7
select
local.get 2
i32.add
i32.load8_u
local.tee 6
i32.const 32
i32.eq
local.tee 4
local.get 1
i32.and
local.set 9
local.get 5
i32.const 0
local.get 4
select
local.set 4
local.get 6
i32.const 73
i32.eq
local.get 1
i32.and
local.set 5
local.get 3
local.get 4
i32.add
local.set 3
local.get 2
i32.const 1
i32.add
local.set 2
local.get 6
i32.const 33
i32.sub
local.tee 1
i32.const 30
i32.gt_u
i32.const 1
local.get 1
i32.shl
i32.const 1073750017
i32.and
i32.eqz
i32.or
i32.eqz
local.get 9
i32.or
local.set 1
br 1 (;@1;)
end
end
local.get 3)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z8is_boredNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 1)))
| 13 | 355 | 1,781 | 85 |
CPP/92 | /*
Create a function that takes 3 numbers.
Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.
Returns false in any other cases.
Examples
any_int(5, 2, 7) ➞ true
any_int(3, 2, 2) ➞ false
any_int(3, -2, 1) ➞ true
any_int(3.6, -2.2, 2) ➞ false
*/
#include<stdio.h>
#include<math.h>
using namespace std;
bool any_int(float a,float b,float c){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool any_int(float a,float b,float c){
| if (round(a)!=a) return false;
if (round(b)!=b) return false;
if (round(c)!=c) return false;
if (a+b==c or a+c==b or b+c==a) return true;
return false;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (any_int(2, 3, 1)==true);
assert (any_int(2.5, 2, 3)==false);
assert (any_int(1.5, 5, 3.5)==false);
assert (any_int(2, 6, 2)==false);
assert (any_int(4, 2, 2)==true);
assert (any_int(2.2, 2.2, 2.2)==false);
assert (any_int(-4, 6, 2)==true);
assert (any_int(2,1,1)==true);
assert (any_int(3,4,7)==true);
assert (any_int(3.01,4,7)==false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (any_int(5, 2, 7)==true);
assert (any_int(3, 2, 2)==false);
assert (any_int(3, -2, 1)==true);
assert (any_int(3.6, -2.2, 2)==false);
}
| ; ModuleID = 'c_code_test/code_91.cpp'
source_filename = "c_code_test/code_91.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 nosync nounwind optsize willreturn memory(none)
define noundef zeroext i1 @_Z7any_intfff(float noundef %0, float noundef %1, float noundef %2) local_unnamed_addr #0 {
%4 = tail call float @llvm.round.f32(float %0)
%5 = fcmp une float %4, %0
%6 = tail call float @llvm.round.f32(float %1)
%7 = fcmp une float %6, %1
%8 = or i1 %5, %7
%9 = tail call float @llvm.round.f32(float %2)
%10 = fcmp une float %9, %2
%11 = or i1 %8, %10
br i1 %11, label %21, label %12
12: ; preds = %3
%13 = fadd float %0, %1
%14 = fcmp oeq float %13, %2
%15 = fadd float %0, %2
%16 = fcmp oeq float %15, %1
%17 = or i1 %14, %16
%18 = fadd float %1, %2
%19 = fcmp oeq float %18, %0
%20 = or i1 %19, %17
br label %21
21: ; preds = %12, %3
%22 = phi i1 [ false, %3 ], [ %20, %12 ]
ret i1 %22
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.round.f32(float) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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)"}
| (module
(type (;0;) (func (param f32) (result f32)))
(type (;1;) (func))
(type (;2;) (func (param f32 f32 f32) (result i32)))
(import "env" "roundf" (func (;0;) (type 0)))
(func (;1;) (type 1))
(func (;2;) (type 2) (param f32 f32 f32) (result i32)
(local f32 f32 i32)
local.get 0
call 0
local.set 3
local.get 2
call 0
local.set 4
local.get 0
local.get 3
f32.ne
local.get 1
call 0
local.get 1
f32.ne
i32.or
local.get 2
local.get 4
f32.ne
i32.or
i32.eqz
local.get 0
local.get 1
f32.add
local.get 2
f32.eq
local.get 0
local.get 2
f32.add
local.get 1
f32.eq
i32.or
local.get 1
local.get 2
f32.add
local.get 0
f32.eq
i32.or
i32.and)
(export "__wasm_call_ctors" (func 1))
(export "__wasm_apply_data_relocs" (func 1))
(export "_Z7any_intfff" (func 2)))
| 6 | 174 | 916 | 48 |
CPP/93 | /*
Write a function that takes a message, and encodes in such a
way that it swaps case of all letters, replaces all vowels in
the message with the letter that appears 2 places ahead of that
vowel in the english alphabet.
Assume only letters.
Examples:
>>> encode('test")
"TGST"
>>> encode("This is a message")
'tHKS KS C MGSSCGG"
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
string encode(string message){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
string encode(string message){
| string vowels="aeiouAEIOU";
string out="";
for (int i=0;i<message.length();i++)
{
char w=message[i];
if (w>=97 and w<=122){w=w-32;}
else if (w>=65 and w<=90) w=w+32;
if (find(vowels.begin(),vowels.end(),w)!=vowels.end()) w=w+2;
out=out+w;
}
return out;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (encode("TEST") == "tgst");
assert (encode("Mudasir") == "mWDCSKR");
assert (encode("YES") == "ygs");
assert (encode("This is a message") == "tHKS KS C MGSSCGG");
assert (encode("I DoNt KnOw WhAt tO WrItE") == "k dQnT kNqW wHcT Tq wRkTg");
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (encode("test") == "TGST");
assert (encode("This is a message") == "tHKS KS C MGSSCGG");
}
| ; ModuleID = 'c_code_test/code_92.cpp'
source_filename = "c_code_test/code_92.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
%"class.std::__2::allocator" = type { i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_ = comdat any
$_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_ = comdat any
$_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev = comdat any
$_ZNSt3__220__throw_length_errorB7v160006EPKc = comdat any
$_ZNSt12length_errorC2B7v160006EPKc = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_ = comdat any
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
@.str = private unnamed_addr constant [11 x i8] c"aeiouAEIOU\00", align 1
@.str.1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"basic_string\00", align 1
@_ZTISt12length_error = external constant ptr
@_ZTVSt12length_error = external unnamed_addr constant { [5 x ptr] }, align 4
; Function Attrs: minsize optsize
define void @_Z6encodeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = alloca i8, align 1
%5 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #14
%6 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull @.str) #15
%7 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull @.str.1) #15
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %3, i32 0, i32 2
%11 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %3, i32 0, i32 1
br label %12
12: ; preds = %56, %2
%13 = phi i32 [ 0, %2 ], [ %59, %56 ]
%14 = load i8, ptr %8, align 1
%15 = icmp slt i8 %14, 0
%16 = load i32, ptr %9, align 4
%17 = zext i8 %14 to i32
%18 = select i1 %15, i32 %16, i32 %17
%19 = icmp ult i32 %13, %18
br i1 %19, label %20, label %60
20: ; preds = %12
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #14
%21 = load ptr, ptr %1, align 4
%22 = select i1 %15, ptr %21, ptr %1
%23 = getelementptr inbounds i8, ptr %22, i32 %13
%24 = load i8, ptr %23, align 1, !tbaa !3
store i8 %24, ptr %4, align 1, !tbaa !3
%25 = add i8 %24, -97
%26 = icmp ult i8 %25, 26
br i1 %26, label %27, label %29
27: ; preds = %20
%28 = add nsw i8 %24, -32
store i8 %28, ptr %4, align 1, !tbaa !3
br label %34
29: ; preds = %20
%30 = add i8 %24, -65
%31 = icmp ult i8 %30, 26
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = add nuw nsw i8 %24, 32
store i8 %33, ptr %4, align 1, !tbaa !3
br label %34
34: ; preds = %29, %32, %27
%35 = load i8, ptr %10, align 1
%36 = icmp slt i8 %35, 0
%37 = load ptr, ptr %3, align 4
%38 = select i1 %36, ptr %37, ptr %3
%39 = load i32, ptr %11, align 4
%40 = zext i8 %35 to i32
%41 = select i1 %36, i32 %39, i32 %40
%42 = getelementptr inbounds i8, ptr %38, i32 %41
%43 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %38, ptr %42, ptr noundef nonnull align 1 dereferenceable(1) %4) #15
%44 = load i8, ptr %10, align 1
%45 = icmp slt i8 %44, 0
%46 = load ptr, ptr %3, align 4
%47 = select i1 %45, ptr %46, ptr %3
%48 = load i32, ptr %11, align 4
%49 = zext i8 %44 to i32
%50 = select i1 %45, i32 %48, i32 %49
%51 = getelementptr inbounds i8, ptr %47, i32 %50
%52 = icmp eq ptr %43, %51
%53 = load i8, ptr %4, align 1, !tbaa !3
br i1 %52, label %56, label %54
54: ; preds = %34
%55 = add i8 %53, 2
store i8 %55, ptr %4, align 1, !tbaa !3
br label %56
56: ; preds = %54, %34
%57 = phi i8 [ %55, %54 ], [ %53, %34 ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #14
call void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %0, i8 noundef signext %57) #15
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %5) #16
%58 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #14
%59 = add nuw nsw i32 %13, 1
br label %12, !llvm.loop !6
60: ; preds = %12
%61 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #16
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #14
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: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #16
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #15
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #2 comdat {
%4 = ptrtoint ptr %0 to i32
%5 = ptrtoint ptr %1 to i32
%6 = load i8, ptr %2, align 1
%7 = sub i32 %5, %4
%8 = getelementptr i8, ptr %0, i32 %7
br label %9
9: ; preds = %15, %3
%10 = phi ptr [ %0, %3 ], [ %16, %15 ]
%11 = icmp eq ptr %10, %1
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = load i8, ptr %10, align 1, !tbaa !3
%14 = icmp eq i8 %13, %6
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, ptr %10, i32 1
br label %9, !llvm.loop !8
17: ; preds = %12, %9
%18 = phi ptr [ %10, %12 ], [ %8, %9 ]
ret ptr %18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr hidden void @_ZNSt3__2plB7v160006IcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_S6_(ptr noalias sret(%"class.std::__2::basic_string") align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1, i8 noundef signext %2) local_unnamed_addr #0 comdat {
%4 = alloca %"class.std::__2::allocator", align 1
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
%6 = load i8, ptr %5, align 1
%7 = icmp slt i8 %6, 0
%8 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%9 = load i32, ptr %8, align 4
%10 = zext i8 %6 to i32
%11 = select i1 %7, i32 %9, i32 %10
%12 = add i32 %11, 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #14
%13 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %12, ptr noundef nonnull align 1 dereferenceable(1) %4) #15
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #14
%14 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%15 = load i8, ptr %14, align 1
%16 = icmp slt i8 %15, 0
%17 = load ptr, ptr %0, align 4
%18 = select i1 %16, ptr %17, ptr %0
%19 = load i8, ptr %5, align 1
%20 = icmp slt i8 %19, 0
%21 = load ptr, ptr %1, align 4
%22 = select i1 %20, ptr %21, ptr %1
%23 = icmp ult ptr %22, %18
%24 = getelementptr inbounds i8, ptr %18, i32 %11
%25 = icmp ule ptr %24, %22
%26 = or i1 %23, %25
call void @llvm.assume(i1 %26)
call void @llvm.memmove.p0.p0.i32(ptr align 1 %18, ptr align 1 %22, i32 %11, i1 false), !noalias !9
store i8 %2, ptr %24, align 1, !tbaa !3
%27 = getelementptr inbounds i8, ptr %18, i32 1
%28 = getelementptr inbounds i8, ptr %27, i32 %11
store i8 0, ptr %28, align 1, !tbaa !3
ret void
}
; 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 nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) local_unnamed_addr #7 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str.2) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #8 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) #15
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) #15
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !20
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #9
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 nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #10
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #11
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; 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) #11
; Function Attrs: minsize optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006ENS_24__uninitialized_size_tagEmRKS4_(ptr noundef nonnull returned align 4 dereferenceable(12) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2) unnamed_addr #0 comdat {
%4 = icmp ugt i32 %1, 2147483631
br i1 %4, label %5, label %6
5: ; preds = %3
tail call void @_ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE20__throw_length_errorB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #17
unreachable
6: ; preds = %3
%7 = icmp ult i32 %1, 11
br i1 %7, label %8, label %11
8: ; preds = %6
tail call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %0, i8 0, i32 12, i1 false)
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
store i8 %9, ptr %10, align 1
br label %18
11: ; preds = %6
%12 = or i32 %1, 15
%13 = add nuw i32 %12, 1
%14 = tail call noalias noundef nonnull ptr @_Znwm(i32 noundef %13) #19
%15 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 2
%16 = or i32 %13, -2147483648
store i32 %16, ptr %15, align 4
store ptr %14, ptr %0, align 4, !tbaa !3
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
store i32 %1, ptr %17, align 4, !tbaa !3
br label %18
18: ; preds = %11, %8
ret ptr %0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #13
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !3
tail call void @_ZdlPv(ptr noundef %7) #20
br label %8
8: ; preds = %6, %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 !22
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !3
ret void
}
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 nounwind 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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #9 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #12 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #14 = { nounwind }
attributes #15 = { minsize optsize }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { minsize noreturn optsize }
attributes #18 = { noreturn }
attributes #19 = { builtin minsize optsize allocsize(0) }
attributes #20 = { builtin minsize nounwind optsize }
!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 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C++ TBAA"}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = distinct !{!8, !7}
!9 = !{!10, !12, !14, !16, !18}
!10 = distinct !{!10, !11, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!11 = distinct !{!11, !"_ZNSt3__219__copy_trivial_implB7v160006IKccEENS_4pairIPT_PT0_EES4_S4_S6_"}
!12 = distinct !{!12, !13, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!13 = distinct !{!13, !"_ZNKSt3__214__copy_trivialclB7v160006IKccLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!14 = distinct !{!14, !15, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!15 = distinct !{!15, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKcS8_PcLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!16 = distinct !{!16, !17, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!17 = distinct !{!17, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKcS6_PcEENS_4pairIT2_T4_EES9_T3_SA_"}
!18 = distinct !{!18, !19, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!19 = distinct !{!19, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKcS3_PcEENS_4pairIT0_T2_EES6_T1_S7_"}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !5, i64 0}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !25, i64 8, i64 4, !25, i64 11, i64 4, !25, i64 0, i64 11, !3, i64 11, i64 0, !3, i64 11, i64 1, !3, i64 11, i64 1, !3, i64 0, i64 12, !3}
!23 = !{!24, !24, i64 0}
!24 = !{!"any pointer", !4, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"long", !4, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32)))
(type (;5;) (func))
(type (;6;) (func (param i32 i32)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "memmove" (func (;4;) (type 3)))
(import "env" "__cxa_allocate_exception" (func (;5;) (type 0)))
(import "env" "__cxa_throw" (func (;6;) (type 2)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;7;) (type 1)))
(import "env" "_Znwm" (func (;8;) (type 0)))
(import "env" "_ZdlPv" (func (;9;) (type 4)))
(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 "env" "memory" (memory (;0;) 1))
(func (;10;) (type 5))
(func (;11;) (type 6) (param i32 i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 4
global.set 0
local.get 4
i32.const 20
i32.add
global.get 1
local.tee 2
i32.const 13
i32.add
call 0
local.set 5
local.get 0
local.get 2
i32.const 23
i32.add
call 0
local.set 6
i32.const 0
local.set 0
loop ;; label = @1
local.get 1
i32.load offset=4
local.get 1
i32.load8_u offset=11
local.tee 2
local.get 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 2
select
local.get 0
i32.gt_u
if ;; label = @2
local.get 4
local.get 1
i32.load
local.get 1
local.get 2
select
local.get 0
i32.add
i32.load8_u
local.tee 2
i32.store8 offset=19
block ;; label = @3
local.get 2
i32.const 97
i32.sub
i32.const 255
i32.and
i32.const 25
i32.le_u
if ;; label = @4
local.get 4
local.get 2
i32.const 32
i32.sub
i32.store8 offset=19
br 1 (;@3;)
end
local.get 2
i32.const 65
i32.sub
i32.const 255
i32.and
i32.const 25
i32.gt_u
br_if 0 (;@3;)
local.get 4
local.get 2
i32.const 32
i32.add
i32.store8 offset=19
end
local.get 4
i32.load8_u offset=19
local.set 8
block (result i32) ;; label = @3
local.get 5
i32.load
local.get 5
local.get 5
i32.load8_u offset=11
local.tee 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 7
select
local.set 2
local.get 2
local.get 5
i32.load offset=4
local.get 3
local.get 7
select
i32.add
local.set 3
local.get 4
i32.load8_u offset=19
local.set 7
loop ;; label = @4
block ;; label = @5
local.get 2
local.get 3
i32.ne
if (result i32) ;; label = @6
local.get 2
i32.load8_u
local.get 7
i32.ne
br_if 1 (;@5;)
local.get 2
else
local.get 3
end
br 2 (;@3;)
end
local.get 2
i32.const 1
i32.add
local.set 2
br 0 (;@4;)
end
unreachable
end
local.get 5
i32.load
local.get 5
local.get 5
i32.load8_u offset=11
local.tee 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.get 5
i32.load offset=4
local.get 2
local.get 3
select
i32.add
i32.ne
if ;; label = @3
local.get 4
local.get 8
i32.const 2
i32.add
local.tee 8
i32.store8 offset=19
end
global.get 0
i32.const 16
i32.sub
local.tee 9
global.set 0
block (result i32) ;; label = @3
local.get 4
i32.const 4
i32.add
local.set 2
local.get 6
i32.load offset=4
local.get 6
i32.load8_u offset=11
local.tee 3
local.get 3
i32.extend8_s
i32.const 0
i32.lt_s
select
local.tee 7
i32.const 1
i32.add
local.tee 3
i32.const 2147483632
i32.lt_u
if ;; label = @4
local.get 3
i32.const 10
i32.le_u
if ;; label = @5
local.get 2
i32.const 0
i32.store offset=8
local.get 2
i64.const 0
i64.store align=4
local.get 2
local.get 3
i32.store8 offset=11
local.get 2
br 2 (;@3;)
end
local.get 3
i32.const 15
i32.or
i32.const 1
i32.add
local.tee 10
call 8
local.set 11
local.get 2
local.get 3
i32.store offset=4
local.get 2
local.get 11
i32.store
local.get 2
local.get 10
i32.const -2147483648
i32.or
i32.store offset=8
local.get 2
br 1 (;@3;)
end
global.get 2
local.set 0
global.get 3
local.set 1
i32.const 8
call 5
global.get 4
local.set 4
global.get 1
call 7
local.tee 2
local.get 4
i32.const 8
i32.add
i32.store
local.get 2
local.get 1
local.get 0
call 6
unreachable
end
local.tee 3
i32.load
local.get 3
local.get 3
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 6
i32.load
local.get 6
local.get 6
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
local.get 7
call 4
local.get 7
i32.add
local.tee 3
local.get 8
i32.extend8_s
i32.store8
local.get 3
i32.const 0
i32.store8 offset=1
local.get 9
i32.const 16
i32.add
global.set 0
local.get 6
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @3
local.get 6
i32.load
call 9
end
local.get 6
local.get 2
i64.load align=4
i64.store align=4
local.get 6
local.get 2
i32.load offset=8
i32.store offset=8
local.get 2
i32.const 0
i32.store8 offset=11
local.get 2
i32.const 0
i32.store8
local.get 0
i32.const 1
i32.add
local.set 0
local.get 2
call 1
drop
br 1 (;@1;)
end
end
local.get 5
call 1
drop
local.get 4
i32.const 32
i32.add
global.set 0)
(func (;12;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 10))
(export "__wasm_apply_data_relocs" (func 10))
(export "_Z6encodeNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 11))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 12))
(data (;0;) (global.get 1) "basic_string\00aeiouAEIOU\00"))
| 12 | 319 | 8,652 | 352 |
CPP/94 | /*
You are given a vector of integers.
You need to find the largest prime value and return the sum of its digits.
Examples:
For lst = {0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3} the output should be 10
For lst = {1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1} the output should be 25
For lst = {1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3} the output should be 13
For lst = {0,724,32,71,99,32,6,0,5,91,83,0,5,6} the output should be 11
For lst = {0,81,12,3,1,21} the output should be 3
For lst = {0,8,1,2,1,7} the output should be 7
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
int skjkasdkd(vector<int> lst){
| #include<stdio.h>
#include<math.h>
#include<vector>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int skjkasdkd(vector<int> lst){
| int largest=0;
for (int i=0;i<lst.size();i++)
if (lst[i]>largest)
{
bool prime=true;
for (int j=2;j*j<=lst[i];j++)
if (lst[i]%j==0) prime=false;
if (prime) largest=lst[i];
}
int sum=0;
string s;
s=to_string(largest);
for (int i=0;i<s.length();i++)
sum+=s[i]-48;
return sum;
}
#undef NDEBUG
#include<assert.h>
| #undef NDEBUG
#include<assert.h>
int main(){
assert (skjkasdkd({0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3}) == 10);
assert (skjkasdkd({1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1}) == 25);
assert (skjkasdkd({1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3}) == 13);
assert (skjkasdkd({0,724,32,71,99,32,6,0,5,91,83,0,5,6}) == 11);
assert (skjkasdkd({0,81,12,3,1,21}) == 3);
assert (skjkasdkd({0,8,1,2,1,7}) == 7);
assert (skjkasdkd({8191}) == 19);
assert (skjkasdkd({8191, 123456, 127, 7}) == 19);
assert (skjkasdkd({127, 97, 8192}) == 10);
}
| #undef NDEBUG
#include<assert.h>
#undef NDEBUG
#include<assert.h>
#undef NDEBUG
#include<assert.h>
int main(){
assert (skjkasdkd({0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3}) == 10);
assert (skjkasdkd({1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1}) == 25);
assert (skjkasdkd({1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3}) == 13);
assert (skjkasdkd({0,724,32,71,99,32,6,0,5,91,83,0,5,6}) == 11);
assert (skjkasdkd({0,81,12,3,1,21}) == 3);
assert (skjkasdkd({0,8,1,2,1,7}) == 7);
}
| ; ModuleID = 'c_code_test/code_93.cpp'
source_filename = "c_code_test/code_93.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::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 }
%"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::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE = comdat any
; Function Attrs: minsize optsize
define noundef i32 @_Z9skjkasdkdNSt3__26vectorIiNS_9allocatorIiEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
%3 = alloca %"class.std::__2::basic_string", align 4
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%5 = load ptr, ptr %4, align 4, !tbaa !3
%6 = load ptr, ptr %0, align 4, !tbaa !10
%7 = ptrtoint ptr %5 to i32
%8 = ptrtoint ptr %6 to i32
%9 = sub i32 %7, %8
%10 = ashr exact i32 %9, 2
br label %11
11: ; preds = %42, %1
%12 = phi i32 [ 0, %1 ], [ %43, %42 ]
%13 = phi i32 [ 0, %1 ], [ %44, %42 ]
%14 = icmp eq i32 %13, %10
br i1 %14, label %15, label %26
15: ; preds = %11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #7
call void @llvm.memset.p0.i32(ptr noundef nonnull align 4 dereferenceable(12) %2, i8 0, i32 12, i1 false)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
call void @_ZNSt3__29to_stringEi(ptr nonnull sret(%"class.std::__2::basic_string") align 4 %3, i32 noundef %12) #8
call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %3) #9
%16 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #9
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
%17 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%18 = load i8, ptr %17, align 1
%19 = icmp slt i8 %18, 0
%20 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
%21 = load i32, ptr %20, align 4
%22 = zext i8 %18 to i32
%23 = select i1 %19, i32 %21, i32 %22
%24 = load ptr, ptr %2, align 4
%25 = select i1 %19, ptr %24, ptr %2
br label %45
26: ; preds = %11
%27 = getelementptr inbounds i32, ptr %6, i32 %13
%28 = load i32, ptr %27, align 4, !tbaa !11
%29 = icmp sgt i32 %28, %12
br i1 %29, label %30, label %42
30: ; preds = %26, %37
%31 = phi i1 [ %40, %37 ], [ true, %26 ]
%32 = phi i32 [ %41, %37 ], [ 2, %26 ]
%33 = mul nsw i32 %32, %32
%34 = icmp sgt i32 %33, %28
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = select i1 %31, i32 %28, i32 %12
br label %42
37: ; preds = %30
%38 = srem i32 %28, %32
%39 = icmp ne i32 %38, 0
%40 = select i1 %39, i1 %31, i1 false
%41 = add nuw nsw i32 %32, 1
br label %30, !llvm.loop !13
42: ; preds = %35, %26
%43 = phi i32 [ %12, %26 ], [ %36, %35 ]
%44 = add nuw i32 %13, 1
br label %11, !llvm.loop !15
45: ; preds = %51, %15
%46 = phi i32 [ 0, %15 ], [ %56, %51 ]
%47 = phi i32 [ 0, %15 ], [ %57, %51 ]
%48 = icmp eq i32 %47, %23
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #9
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
ret i32 %46
51: ; preds = %45
%52 = getelementptr inbounds i8, ptr %25, i32 %47
%53 = load i8, ptr %52, align 1, !tbaa !16
%54 = sext i8 %53 to i32
%55 = add i32 %46, -48
%56 = add i32 %55, %54
%57 = add nuw i32 %47, 1
br label %45, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
declare void @_ZNSt3__29to_stringEi(ptr sret(%"class.std::__2::basic_string") align 4, i32 noundef) local_unnamed_addr #0
; 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 #2
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #4
; 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) #5
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13__move_assignB7v160006ERS5_NS_17integral_constantIbLb1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #6 comdat {
%3 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%4 = load i8, ptr %3, align 1
%5 = icmp slt i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load ptr, ptr %0, align 4, !tbaa !16
tail call void @_ZdlPv(ptr noundef %7) #10
br label %8
8: ; preds = %6, %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 !18
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %1, i32 0, i32 2
store i8 0, ptr %9, align 1
store i8 0, ptr %1, align 4, !tbaa !16
ret void
}
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 nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { nounwind }
attributes #8 = { minsize optsize }
attributes #9 = { minsize nounwind optsize }
attributes #10 = { builtin minsize nounwind optsize }
!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"}
!15 = distinct !{!15, !14}
!16 = !{!6, !6, i64 0}
!17 = distinct !{!17, !14}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !20, i64 8, i64 4, !20, i64 11, i64 4, !20, i64 0, i64 11, !16, i64 11, i64 0, !16, i64 11, i64 1, !16, i64 11, i64 1, !16, i64 0, i64 12, !16}
!19 = !{!5, !5, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !6, i64 0}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func (param i32)))
(type (;3;) (func))
(import "env" "_ZNSt3__29to_stringEi" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "_ZdlPv" (func (;2;) (type 2)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;3;) (type 3))
(func (;4;) (type 0) (param i32) (result i32)
(local i32 i32 i32 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
local.tee 6
i32.sub
i32.const 2
i32.shr_s
local.set 7
loop ;; label = @1
block ;; label = @2
block ;; label = @3
local.get 3
local.get 7
i32.eq
if ;; label = @4
i32.const 0
local.set 3
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 4
i32.add
local.tee 0
local.get 1
call 0
local.get 2
i32.const 16
i32.add
local.tee 1
i32.load8_s offset=11
i32.const 0
i32.lt_s
if ;; label = @5
local.get 1
i32.load
call 2
end
local.get 1
local.get 0
i64.load align=4
i64.store align=4
local.get 1
local.get 0
i32.load offset=8
i32.store offset=8
local.get 0
i32.const 0
i32.store8 offset=11
local.get 0
i32.const 0
i32.store8
local.get 0
call 1
drop
local.get 2
i32.load offset=20
local.get 2
i32.load8_s offset=27
local.tee 0
i32.const 255
i32.and
local.get 0
i32.const 0
i32.lt_s
local.tee 0
select
local.set 4
local.get 2
i32.load offset=16
local.get 1
local.get 0
select
local.set 1
i32.const 0
local.set 0
loop ;; label = @5
local.get 0
local.get 4
i32.eq
br_if 2 (;@3;)
local.get 3
local.get 0
local.get 1
i32.add
i32.load8_s
i32.add
i32.const 48
i32.sub
local.set 3
local.get 0
i32.const 1
i32.add
local.set 0
br 0 (;@5;)
end
unreachable
end
i32.const 2
local.set 0
i32.const 1
local.set 4
local.get 6
local.get 3
i32.const 2
i32.shl
i32.add
i32.load
local.tee 5
local.get 1
i32.le_s
br_if 1 (;@2;)
loop ;; label = @4
local.get 5
local.get 0
local.get 0
i32.mul
i32.lt_s
if ;; label = @5
local.get 5
local.get 1
local.get 4
select
local.set 1
br 3 (;@2;)
else
local.get 5
local.get 0
i32.rem_s
i32.const 0
i32.ne
local.get 4
i32.and
local.set 4
local.get 0
i32.const 1
i32.add
local.set 0
br 1 (;@4;)
end
unreachable
end
unreachable
end
local.get 2
i32.const 16
i32.add
call 1
drop
local.get 2
i32.const 32
i32.add
global.set 0
local.get 3
return
end
local.get 3
i32.const 1
i32.add
local.set 3
br 0 (;@1;)
end
unreachable)
(export "__wasm_call_ctors" (func 3))
(export "__wasm_apply_data_relocs" (func 3))
(export "_Z9skjkasdkdNSt3__26vectorIiNS_9allocatorIiEEEE" (func 4)))
| 18 | 421 | 4,608 | 188 |
CPP/95 | /*
Given a map, return true if all keys are strings in lower
case or all keys are strings in upper case, else return false.
The function should return false is the given map is empty.
Examples:
check_map_case({{"a","apple"}, {"b","banana"}}) should return true.
check_map_case({{"a","apple"}, {"A","banana"}, {"B","banana"}}) should return false.
check_map_case({{"a","apple"}, {"8","banana"}, {"a","apple"}}) should return false.
check_map_case({{"Name","John"}, {"Age","36"}, {"City","Houston"}}) should return false.
check_map_case({{"STATE","NC"}, {"ZIP","12345"} }) should return true.
*/
#include<stdio.h>
#include<string>
#include<map>
using namespace std;
bool check_dict_case(map<string,string> dict){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<map>
using namespace std;
#include<algorithm>
#include<stdlib.h>
bool check_dict_case(map<string,string> dict){
| map<string,string>::iterator it;
int islower=0,isupper=0;
if (dict.size()==0) return false;
for (it=dict.begin();it!=dict.end();it++)
{
string key=it->first;
for (int i=0;i<key.length();i++)
{
if (key[i]<65 or (key[i]>90 and key[i]<97) or key[i]>122) return false;
if (key[i]>=65 and key[i]<=90) isupper=1;
if (key[i]>=97 and key[i]<=122) islower=1;
if (isupper+islower==2) return false;
}
}
return true;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (check_dict_case({{"p","pineapple"}, {"b","banana"}}) == true);
assert (check_dict_case({{"p","pineapple"}, {"A","banana"}, {"B","banana"}}) == false);
assert (check_dict_case({{"p","pineapple"}, {"5","banana"}, {"a","apple"}}) == false);
assert (check_dict_case({{"Name","John"}, {"Age","36"}, {"City","Houston"}}) == false);
assert (check_dict_case({{"STATE","NC"}, {"ZIP","12345"} }) == true );
assert (check_dict_case({{"fruit","Orange"}, {"taste","Sweet"} }) == true );
assert (check_dict_case({}) == false);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (check_dict_case({{"p","pineapple"}, {"b","banana"}}) == true);
assert (check_dict_case({{"p","pineapple"}, {"A","banana"}, {"B","banana"}}) == false);
assert (check_dict_case({{"p","pineapple"}, {"5","banana"}, {"a","apple"}}) == false);
assert (check_dict_case({{"Name","John"}, {"Age","36"}, {"City","Houston"}}) == false);
assert (check_dict_case({{"STATE","NC"}, {"ZIP","12345"} }) == true );
}
| ; ModuleID = 'c_code_test/code_94.cpp'
source_filename = "c_code_test/code_94.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::basic_string" = type { %"class.std::__2::__compressed_pair.4" }
%"class.std::__2::__compressed_pair.4" = type { %"struct.std::__2::__compressed_pair_elem.5" }
%"struct.std::__2::__compressed_pair_elem.5" = 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 }
%"class.std::__2::__tree" = type { ptr, %"class.std::__2::__compressed_pair", %"class.std::__2::__compressed_pair.1" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = type { %"class.std::__2::__tree_end_node" }
%"class.std::__2::__tree_end_node" = type { ptr }
%"class.std::__2::__compressed_pair.1" = type { %"struct.std::__2::__compressed_pair_elem.2" }
%"struct.std::__2::__compressed_pair_elem.2" = type { i32 }
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
%"class.std::__2::__tree_node" = type { %"class.std::__2::__tree_node_base.base", %"struct.std::__2::__value_type" }
%"class.std::__2::__tree_node_base.base" = type <{ %"class.std::__2::__tree_end_node", ptr, ptr, i8 }>
%"struct.std::__2::__value_type" = type { %"struct.std::__2::pair" }
%"struct.std::__2::pair" = type { %"class.std::__2::basic_string", %"class.std::__2::basic_string" }
%"class.std::__2::__tree_node_base" = type <{ %"class.std::__2::__tree_end_node", ptr, ptr, i8, [3 x i8] }>
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_ = comdat any
$_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_ = comdat any
$_ZNSt3__210__tree_minB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_ = comdat any
; Function Attrs: minsize optsize
define noundef zeroext i1 @_Z15check_dict_caseNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES6_NS_4lessIS6_EENS4_INS_4pairIKS6_S6_EEEEEE(ptr noundef readonly %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
%3 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 2
%4 = load i32, ptr %3, align 4, !tbaa !3
%5 = icmp eq i32 %4, 0
br i1 %5, label %53, label %6
6: ; preds = %1
%7 = load ptr, ptr %0, align 4, !tbaa !7
%8 = getelementptr inbounds %"class.std::__2::__tree", ptr %0, i32 0, i32 1
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%10 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
br label %11
11: ; preds = %51, %6
%12 = phi ptr [ %7, %6 ], [ %52, %51 ]
%13 = phi i32 [ 0, %6 ], [ %47, %51 ]
%14 = phi i32 [ 0, %6 ], [ %48, %51 ]
%15 = icmp eq ptr %12, %8
br i1 %15, label %53, label %16
16: ; preds = %11
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #6
%17 = getelementptr inbounds %"class.std::__2::__tree_node", ptr %12, i32 0, i32 1
%18 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %17) #7
%19 = load i8, ptr %9, align 1
%20 = icmp slt i8 %19, 0
%21 = load i32, ptr %10, align 4
%22 = zext i8 %19 to i32
%23 = select i1 %20, i32 %21, i32 %22
%24 = load ptr, ptr %2, align 4
%25 = select i1 %20, ptr %24, ptr %2
br label %26
26: ; preds = %40, %16
%27 = phi i32 [ %13, %16 ], [ %41, %40 ]
%28 = phi i32 [ %14, %16 ], [ %42, %40 ]
%29 = phi i32 [ 0, %16 ], [ %45, %40 ]
%30 = icmp eq i32 %29, %23
br i1 %30, label %46, label %31
31: ; preds = %26
%32 = getelementptr inbounds i8, ptr %25, i32 %29
%33 = load i8, ptr %32, align 1, !tbaa !9
%34 = icmp slt i8 %33, 65
br i1 %34, label %46, label %35
35: ; preds = %31
%36 = icmp ugt i8 %33, 90
br i1 %36, label %37, label %40
37: ; preds = %35
%38 = add nsw i8 %33, -123
%39 = icmp ult i8 %38, -26
br i1 %39, label %46, label %40
40: ; preds = %37, %35
%41 = phi i32 [ 1, %35 ], [ %27, %37 ]
%42 = phi i32 [ %28, %35 ], [ 1, %37 ]
%43 = add nuw nsw i32 %42, %41
%44 = icmp eq i32 %43, 2
%45 = add nuw i32 %29, 1
br i1 %44, label %46, label %26, !llvm.loop !10
46: ; preds = %40, %31, %37, %26
%47 = phi i32 [ %27, %26 ], [ %27, %37 ], [ %27, %31 ], [ %41, %40 ]
%48 = phi i32 [ %28, %26 ], [ %28, %37 ], [ %28, %31 ], [ %42, %40 ]
%49 = icmp ult i32 %29, %23
%50 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #8
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #6
br i1 %49, label %53, label %51
51: ; preds = %46
%52 = call noundef ptr @_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_(ptr noundef %12) #8
br label %11, !llvm.loop !12
53: ; preds = %11, %46, %1
%54 = phi i1 [ false, %1 ], [ true, %11 ], [ %15, %46 ]
ret i1 %54
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; 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) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; 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 !13
br label %11
7: ; preds = %2
%8 = load ptr, ptr %1, align 4, !tbaa !9
%9 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %1, i32 0, i32 1
%10 = load i32, ptr %9, align 4, !tbaa !9
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) #7
br label %11
11: ; preds = %7, %6
ret ptr %0
}
; 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: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__216__tree_next_iterB7v160006IPNS_15__tree_end_nodeIPNS_16__tree_node_baseIPvEEEES5_EET_T0_(ptr noundef %0) local_unnamed_addr #4 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
%3 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %0, i32 0, i32 1
%4 = load ptr, ptr %3, align 4, !tbaa !14
%5 = icmp eq ptr %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call noundef ptr @_ZNSt3__210__tree_minB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_(ptr noundef nonnull %4) #8
br label %14
8: ; preds = %1, %8
%9 = phi ptr [ %11, %8 ], [ %0, %1 ]
%10 = getelementptr inbounds %"class.std::__2::__tree_node_base", ptr %9, i32 0, i32 2
%11 = load ptr, ptr %10, align 4, !tbaa !18
%12 = load ptr, ptr %11, align 4, !tbaa !19
%13 = icmp eq ptr %12, %9
br i1 %13, label %14, label %8, !llvm.loop !20
14: ; preds = %8, %6
%15 = phi ptr [ %7, %6 ], [ %11, %8 ]
ret ptr %15
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__210__tree_minB7v160006IPNS_16__tree_node_baseIPvEEEET_S5_(ptr noundef %0) local_unnamed_addr #4 comdat {
%2 = icmp ne ptr %0, null
tail call void @llvm.assume(i1 %2)
br label %3
3: ; preds = %3, %1
%4 = phi ptr [ %0, %1 ], [ %5, %3 ]
%5 = load ptr, ptr %4, align 4, !tbaa !19
%6 = icmp eq ptr %5, null
br i1 %6, label %7, label %3, !llvm.loop !21
7: ; preds = %3
ret ptr %4
}
; 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
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint minsize mustprogress 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 nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { nounwind }
attributes #7 = { minsize optsize }
attributes #8 = { minsize nounwind optsize }
!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 = !{!"long", !5, i64 0}
!5 = !{!"omnipotent char", !6, i64 0}
!6 = !{!"Simple C++ TBAA"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !5, i64 0}
!9 = !{!5, !5, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{i64 0, i64 4, !7, i64 4, i64 4, !3, i64 8, i64 4, !3, i64 11, i64 4, !3, i64 0, i64 11, !9, i64 11, i64 0, !9, i64 11, i64 1, !9, i64 11, i64 1, !9, i64 0, i64 12, !9}
!14 = !{!15, !8, i64 4}
!15 = !{!"_ZTSNSt3__216__tree_node_baseIPvEE", !16, i64 0, !8, i64 4, !8, i64 8, !17, i64 12}
!16 = !{!"_ZTSNSt3__215__tree_end_nodeIPNS_16__tree_node_baseIPvEEEE", !8, i64 0}
!17 = !{!"bool", !5, i64 0}
!18 = !{!15, !8, i64 8}
!19 = !{!16, !8, i64 0}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
| (module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func (;0;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm" (func (;2;) (type 2)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(func (;3;) (type 3))
(func (;4;) (type 1) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
block ;; label = @1
local.get 0
i32.load offset=8
i32.eqz
br_if 0 (;@1;)
local.get 0
i32.const 4
i32.add
local.set 9
local.get 0
i32.load
local.set 5
loop ;; label = @2
local.get 5
local.get 9
i32.eq
local.tee 7
if ;; label = @3
i32.const 1
local.set 7
br 2 (;@1;)
end
i32.const 0
local.set 3
local.get 4
i32.const 4
i32.add
local.get 5
i32.const 16
i32.add
call 0
local.tee 8
i32.load
local.get 8
local.get 4
i32.load8_u offset=15
local.tee 2
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 0
select
local.set 10
local.get 4
i32.load offset=8
local.get 2
local.get 0
select
local.set 6
block ;; label = @3
loop ;; label = @4
block ;; label = @5
local.get 6
local.get 3
local.tee 0
i32.eq
if ;; label = @6
local.get 6
local.set 0
br 1 (;@5;)
end
local.get 0
local.get 10
i32.add
i32.load8_s
local.tee 3
i32.const 65
i32.lt_s
br_if 0 (;@5;)
block ;; label = @6
local.get 3
i32.const 91
i32.lt_u
if ;; label = @7
i32.const 1
local.set 11
local.get 1
local.set 2
br 1 (;@6;)
end
i32.const 1
local.set 2
local.get 3
i32.const 123
i32.sub
i32.const 255
i32.and
i32.const 230
i32.lt_u
br_if 1 (;@5;)
end
local.get 0
i32.const 1
i32.add
local.set 3
local.get 11
local.get 2
local.tee 1
i32.add
i32.const 2
i32.ne
br_if 1 (;@4;)
br 2 (;@3;)
end
end
local.get 1
local.set 2
end
local.get 8
call 1
drop
local.get 0
local.get 6
i32.lt_u
br_if 1 (;@1;)
block (result i32) ;; label = @3
local.get 5
local.tee 0
i32.load offset=4
local.tee 1
if ;; label = @4
local.get 1
local.set 0
loop ;; label = @5
local.get 0
local.tee 1
i32.load
local.tee 0
br_if 0 (;@5;)
end
local.get 1
br 1 (;@3;)
end
loop ;; label = @4
local.get 0
local.get 0
i32.load offset=8
local.tee 0
i32.load
i32.ne
br_if 0 (;@4;)
end
local.get 0
end
local.set 5
local.get 2
local.set 1
br 0 (;@2;)
end
unreachable
end
local.get 4
i32.const 16
i32.add
global.set 0
local.get 7)
(func (;5;) (type 0) (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 2
local.get 0)
(export "__wasm_call_ctors" (func 3))
(export "__wasm_apply_data_relocs" (func 3))
(export "_Z15check_dict_caseNSt3__23mapINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES6_NS_4lessIS6_EENS4_INS_4pairIKS6_S6_EEEEEE" (func 4))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_" (func 5)))
| 18 | 521 | 5,157 | 202 |
CPP/96 | /*
Implement a function that takes an non-negative integer and returns a vector of the first n
integers that are prime numbers and less than n.
for example:
count_up_to(5) => {2,3}
count_up_to(11) => {2,3,5,7}
count_up_to(0) => {}
count_up_to(20) => {2,3,5,7,11,13,17,19}
count_up_to(1) => {}
count_up_to(18) => {2,3,5,7,11,13,17}
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> count_up_to(int n){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<int> count_up_to(int n){
| vector<int> out={};
int i,j;
for (i=2;i<n;i++)
if (out.size()==0) {out.push_back(i);}
else
{
bool isp=true;
for (j=0;out[j]*out[j]<=i;j++)
if (i%out[j]==0) isp=false;
if (isp) out.push_back(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(count_up_to(5) , {2,3}));
assert (issame(count_up_to(6) , {2,3,5}));
assert (issame(count_up_to(7) , {2,3,5}));
assert (issame(count_up_to(10) , {2,3,5,7}));
assert (issame(count_up_to(0) , {}));
assert (issame(count_up_to(22) , {2,3,5,7,11,13,17,19}));
assert (issame(count_up_to(1) , {}));
assert (issame(count_up_to(18) , {2,3,5,7,11,13,17}));
assert (issame(count_up_to(47) , {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43}));
assert (issame(count_up_to(101) , {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}));
}
| #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(count_up_to(5) , {2,3}));
assert (issame(count_up_to(11) , {2,3,5,7}));
assert (issame(count_up_to(0) , {}));
assert (issame(count_up_to(20) , {2,3,5,7,11,13,17,19}));
assert (issame(count_up_to(1) , {}));
assert (issame(count_up_to(18) , {2,3,5,7,11,13,17}));
}
| ; ModuleID = 'c_code_test/code_95.cpp'
source_filename = "c_code_test/code_95.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 @_Z11count_up_toi(ptr noalias sret(%"class.std::__2::vector") align 4 %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca i32, 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 4, ptr nonnull %3) #13
br label %6
6: ; preds = %27, %2
%7 = phi i32 [ 2, %2 ], [ %29, %27 ]
store i32 %7, ptr %3, align 4, !tbaa !12
%8 = icmp slt i32 %7, %1
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load ptr, ptr %4, align 4, !tbaa !10
%11 = load ptr, ptr %0, align 4, !tbaa !3
%12 = icmp eq ptr %10, %11
br i1 %12, label %26, label %13
13: ; preds = %9, %20
%14 = phi i32 [ %24, %20 ], [ 0, %9 ]
%15 = phi i1 [ %23, %20 ], [ true, %9 ]
%16 = getelementptr inbounds i32, ptr %11, i32 %14
%17 = load i32, ptr %16, align 4, !tbaa !12
%18 = mul nsw i32 %17, %17
%19 = icmp sgt i32 %18, %7
br i1 %19, label %25, label %20
20: ; preds = %13
%21 = srem i32 %7, %17
%22 = icmp ne i32 %21, 0
%23 = select i1 %22, i1 %15, i1 false
%24 = add nuw nsw i32 %14, 1
br label %13, !llvm.loop !14
25: ; preds = %13
br i1 %15, label %26, label %27
26: ; preds = %25, %9
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006ERKi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %3) #14
br label %27
27: ; preds = %26, %25
%28 = load i32, ptr %3, align 4, !tbaa !12
%29 = add nsw i32 %28, 1
br label %6, !llvm.loop !16
30: ; preds = %6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #13
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) #14
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: 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) #13
%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) #14
%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) #14
%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) #14
%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) #13
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 !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) #14, !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 #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 !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) #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) #13
%3 = tail call noundef ptr @_ZNSt12length_errorC2B7v160006EPKc(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef %0) #14
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) #14
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 #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) #13
%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 !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) #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 !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: 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 = { 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 = { 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 = { nounwind }
attributes #14 = { minsize optsize }
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, !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 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!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, !15}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !7, i64 0}
!35 = distinct !{!35, !15}
| (module
(type (;0;) (func (param i32 i32)))
(type (;1;) (func (param i32) (result i32)))
(type (;2;) (func (param i32)))
(type (;3;) (func (param i32 i32 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 2)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 1)))
(import "env" "__cxa_throw" (func (;3;) (type 3)))
(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 0) (param i32 i32)
(local i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 4
global.set 0
local.get 0
i32.const 0
i32.store offset=8
local.get 0
i64.const 0
i64.store align=4
i32.const 2
local.set 2
loop ;; label = @1
local.get 4
local.get 2
i32.store offset=12
local.get 1
local.get 2
i32.gt_s
if ;; label = @2
block ;; label = @3
local.get 0
i32.load
local.tee 7
local.get 0
i32.load offset=4
i32.ne
if ;; label = @4
i32.const 1
local.set 3
i32.const 0
local.set 5
loop ;; label = @5
local.get 2
local.get 7
local.get 5
i32.const 2
i32.shl
i32.add
i32.load
local.tee 6
local.get 6
i32.mul
i32.ge_s
if ;; label = @6
local.get 5
i32.const 1
i32.add
local.set 5
local.get 2
local.get 6
i32.rem_s
i32.const 0
i32.ne
local.get 3
i32.and
local.set 3
br 1 (;@5;)
end
end
local.get 3
i32.eqz
br_if 1 (;@3;)
end
local.get 4
i32.const 12
i32.add
local.set 2
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 2
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 2
call 0
end
local.get 4
i32.load offset=12
local.set 2
end
local.get 2
i32.const 1
i32.add
local.set 2
br 1 (;@1;)
end
end
local.get 4
i32.const 16
i32.add
global.set 0)
(func (;9;) (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 "_Z11count_up_toi" (func 8))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIRKiEEvOT_" (func 9))
(data (;0;) (global.get 1) "vector\00"))
| 13 | 310 | 7,938 | 366 |
CPP/97 | /*
Complete the function that takes two integers and returns
the product of their unit digits.
Assume the input is always valid.
Examples:
multiply(148, 412) should return 16.
multiply(19, 28) should return 72.
multiply(2020, 1851) should return 0.
multiply(14,-15) should return 20.
*/
#include<stdio.h>
#include<math.h>
using namespace std;
int multiply(int a,int b){
| #include<stdio.h>
#include<math.h>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int multiply(int a,int b){
| return (abs(a)%10)*(abs(b)%10);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (multiply(148, 412) == 16 );
assert (multiply(19, 28) == 72 );
assert (multiply(2020, 1851) == 0);
assert (multiply(14,-15) == 20 );
assert (multiply(76, 67) == 42 );
assert (multiply(17, 27) == 49 );
assert (multiply(0, 1) == 0);
assert (multiply(0, 0) == 0);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (multiply(148, 412) == 16 );
assert (multiply(19, 28) == 72 );
assert (multiply(2020, 1851) == 0);
assert (multiply(14,-15) == 20 );
}
| ; ModuleID = 'c_code_test/code_96.cpp'
source_filename = "c_code_test/code_96.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 nosync nounwind optsize willreturn memory(none)
define noundef i32 @_Z8multiplyii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = urem i32 %3, 10
%5 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%6 = urem i32 %5, 10
%7 = mul nuw nsw i32 %6, %4
ret i32 %7
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #1
attributes #0 = { minsize mustprogress nofree nosync nounwind optsize willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #1 = { 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)"}
| (module
(type (;0;) (func))
(type (;1;) (func (param i32 i32) (result i32)))
(func (;0;) (type 0))
(func (;1;) (type 1) (param i32 i32) (result i32)
(local i32)
local.get 1
local.get 1
i32.const 31
i32.shr_s
local.tee 2
i32.xor
local.get 2
i32.sub
i32.const 10
i32.rem_u
local.get 0
local.get 0
i32.const 31
i32.shr_s
local.tee 1
i32.xor
local.get 1
i32.sub
i32.const 10
i32.rem_u
i32.mul)
(export "__wasm_call_ctors" (func 0))
(export "__wasm_apply_data_relocs" (func 0))
(export "_Z8multiplyii" (func 1)))
| 2 | 38 | 610 | 30 |
CPP/98 | /*
Given a string s, count the number of uppercase vowels in even indices.
For example:
count_upper("aBCdEf") returns 1
count_upper("abcdefg") returns 0
count_upper("dBBE") returns 0
*/
#include<stdio.h>
#include<string>
#include<algorithm>
using namespace std;
int count_upper(string s){
| #include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
int count_upper(string s){
| string uvowel="AEIOU";
int count=0;
for (int i=0;i*2<s.length();i++)
if (find(uvowel.begin(),uvowel.end(),s[i*2])!=uvowel.end())
count+=1;
return count;
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (count_upper("aBCdEf") == 1);
assert (count_upper("abcdefg") == 0);
assert (count_upper("dBBE") == 0);
assert (count_upper("B") == 0);
assert (count_upper("U") == 1);
assert (count_upper("") == 0);
assert (count_upper("EEEE") == 2);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (count_upper("aBCdEf") == 1);
assert (count_upper("abcdefg") == 0);
assert (count_upper("dBBE") == 0);
}
| ; ModuleID = 'c_code_test/code_97.cpp'
source_filename = "c_code_test/code_97.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::basic_string" = type { %"class.std::__2::__compressed_pair" }
%"class.std::__2::__compressed_pair" = type { %"struct.std::__2::__compressed_pair_elem" }
%"struct.std::__2::__compressed_pair_elem" = 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 }
$_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc = comdat any
$_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_ = comdat any
@.str = private unnamed_addr constant [6 x i8] c"AEIOU\00", align 1
; Function Attrs: minsize optsize
define noundef i32 @_Z11count_upperNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr noundef %0) local_unnamed_addr #0 {
%2 = alloca %"class.std::__2::basic_string", align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #7
%3 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull @.str) #8
%4 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%5 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %0, i32 0, i32 1
%6 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %2, i32 0, i32 2
%7 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__long", ptr %2, i32 0, i32 1
br label %8
8: ; preds = %20, %1
%9 = phi i32 [ 0, %1 ], [ %44, %20 ]
%10 = phi i32 [ 0, %1 ], [ %43, %20 ]
%11 = shl nuw nsw i32 %9, 1
%12 = load i8, ptr %4, align 1
%13 = icmp slt i8 %12, 0
%14 = load i32, ptr %5, 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 %20, label %18
18: ; preds = %8
%19 = call noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2) #9
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
ret i32 %10
20: ; preds = %8
%21 = load i8, ptr %6, align 1
%22 = icmp slt i8 %21, 0
%23 = load ptr, ptr %2, align 4
%24 = select i1 %22, ptr %23, ptr %2
%25 = load i32, ptr %7, align 4
%26 = zext i8 %21 to i32
%27 = select i1 %22, i32 %25, i32 %26
%28 = getelementptr inbounds i8, ptr %24, i32 %27
%29 = load ptr, ptr %0, align 4
%30 = select i1 %13, ptr %29, ptr %0
%31 = getelementptr inbounds i8, ptr %30, i32 %11
%32 = call ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %24, ptr %28, ptr noundef nonnull align 1 dereferenceable(1) %31) #8
%33 = load i8, ptr %6, align 1
%34 = icmp slt i8 %33, 0
%35 = load ptr, ptr %2, align 4
%36 = select i1 %34, ptr %35, ptr %2
%37 = load i32, ptr %7, align 4
%38 = zext i8 %33 to i32
%39 = select i1 %34, i32 %37, i32 %38
%40 = getelementptr inbounds i8, ptr %36, i32 %39
%41 = icmp ne ptr %32, %40
%42 = zext i1 %41 to i32
%43 = add nuw nsw i32 %10, %42
%44 = add nuw nsw i32 %9, 1
br label %8, !llvm.loop !3
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: minsize optsize
define linkonce_odr noundef ptr @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef %1) unnamed_addr #0 comdat {
%3 = icmp ne ptr %1, null
tail call void @llvm.assume(i1 %3)
%4 = tail call i32 @strlen(ptr noundef nonnull dereferenceable(1) %1) #9
tail call void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull %1, i32 noundef %4) #8
ret ptr %0
}
; Function Attrs: inlinehint minsize mustprogress nounwind optsize
define linkonce_odr hidden ptr @_ZNSt3__24findB7v160006INS_11__wrap_iterIPcEEcEET_S4_S4_RKT0_(ptr %0, ptr %1, ptr noundef nonnull align 1 dereferenceable(1) %2) local_unnamed_addr #2 comdat {
%4 = ptrtoint ptr %0 to i32
%5 = ptrtoint ptr %1 to i32
%6 = load i8, ptr %2, align 1
%7 = sub i32 %5, %4
%8 = getelementptr i8, ptr %0, i32 %7
br label %9
9: ; preds = %15, %3
%10 = phi ptr [ %0, %3 ], [ %16, %15 ]
%11 = icmp eq ptr %10, %1
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = load i8, ptr %10, align 1, !tbaa !5
%14 = icmp eq i8 %13, %6
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, ptr %10, i32 1
br label %9, !llvm.loop !8
17: ; preds = %12, %9
%18 = phi ptr [ %10, %12 ], [ %8, %9 ]
ret ptr %18
}
; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
; Function Attrs: inlinehint minsize optsize
declare void @_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef, i32 noundef) local_unnamed_addr #5
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read)
declare i32 @strlen(ptr nocapture noundef) local_unnamed_addr #6
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 nounwind 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { inlinehint minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize mustprogress nofree nounwind optsize willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { nounwind }
attributes #8 = { minsize optsize }
attributes #9 = { minsize nounwind optsize }
!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 = distinct !{!3, !4}
!4 = !{!"llvm.loop.mustprogress"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !4}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32)))
(type (;3;) (func))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func (;0;) (type 1)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev" (func (;1;) (type 0)))
(import "env" "strlen" (func (;2;) (type 0)))
(import "env" "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm" (func (;3;) (type 2)))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "memory" (memory (;0;) 1))
(func (;4;) (type 3))
(func (;5;) (type 0) (param i32) (result i32)
(local i32 i32 i32 i32 i32 i32 i32 i32 i32)
global.get 0
i32.const 16
i32.sub
local.tee 5
global.set 0
local.get 5
i32.const 4
i32.add
global.get 1
call 0
local.set 2
loop (result i32) ;; label = @1
local.get 6
i32.const 1
i32.shl
local.tee 4
local.get 0
i32.load offset=4
local.get 0
i32.load8_u offset=11
local.tee 1
local.get 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 8
select
i32.ge_u
if (result i32) ;; label = @2
local.get 2
call 1
drop
local.get 5
i32.const 16
i32.add
global.set 0
local.get 7
else
local.get 7
block (result i32) ;; label = @3
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 3
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 9
select
local.set 1
local.get 1
local.get 2
i32.load offset=4
local.get 3
local.get 9
select
i32.add
local.set 3
local.get 0
i32.load
local.get 0
local.get 8
select
local.get 4
i32.add
i32.load8_u
local.set 4
loop ;; label = @4
block ;; label = @5
local.get 1
local.get 3
i32.ne
if (result i32) ;; label = @6
local.get 1
i32.load8_u
local.get 4
i32.ne
br_if 1 (;@5;)
local.get 1
else
local.get 3
end
br 2 (;@3;)
end
local.get 1
i32.const 1
i32.add
local.set 1
br 0 (;@4;)
end
unreachable
end
local.get 2
i32.load
local.get 2
local.get 2
i32.load8_u offset=11
local.tee 1
i32.extend8_s
i32.const 0
i32.lt_s
local.tee 3
select
local.get 2
i32.load offset=4
local.get 1
local.get 3
select
i32.add
i32.ne
i32.add
local.set 7
local.get 6
i32.const 1
i32.add
local.set 6
br 1 (;@1;)
end
end)
(func (;6;) (type 1) (param i32 i32) (result i32)
local.get 0
local.get 1
local.get 1
call 2
call 3
local.get 0)
(export "__wasm_call_ctors" (func 4))
(export "__wasm_apply_data_relocs" (func 4))
(export "_Z11count_upperNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 5))
(export "_ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2B7v160006IDnEEPKc" (func 6))
(data (;0;) (global.get 1) "AEIOU\00"))
| 7 | 183 | 3,813 | 148 |
CPP/99 | /*
Create a function that takes a value (string) representing a number
and returns the closest integer to it. If the number is equidistant
from two integers, round it away from zero.
Examples
>>> closest_integer("10")
10
>>> closest_integer("15.3")
15
Note:
Rounding away from zero means that if the given number is equidistant
from two integers, the one you should return is the one that is the
farthest from zero. For example closest_integer("14.5") should
return 15 and closest_integer("-14.5") should return -15.
*/
#include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
int closest_integer(string value){
| #include<stdio.h>
#include<math.h>
#include<string>
using namespace std;
#include<algorithm>
#include<stdlib.h>
int closest_integer(string value){
| double w;
w=atof(value.c_str());
return round(w);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (closest_integer("10") == 10);
assert (closest_integer("14.5") == 15);
assert (closest_integer("-15.5") == -16);
assert (closest_integer("15.3") == 15);
assert (closest_integer("0") == 0);
}
| #undef NDEBUG
#include<assert.h>
int main(){
assert (closest_integer("10") == 10);
assert (closest_integer("15.3") == 15);
}
| ; ModuleID = 'c_code_test/code_98.cpp'
source_filename = "c_code_test/code_98.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"
%"struct.std::__2::basic_string<char>::__short" = type { [11 x i8], [0 x i8], i8 }
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(read)
define noundef i32 @_Z15closest_integerNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
%2 = getelementptr inbounds %"struct.std::__2::basic_string<char>::__short", ptr %0, i32 0, i32 2
%3 = load i8, ptr %2, align 1
%4 = icmp slt i8 %3, 0
%5 = load ptr, ptr %0, align 4
%6 = select i1 %4, ptr %5, ptr %0
%7 = tail call double @atof(ptr noundef %6) #2
%8 = tail call double @llvm.round.f64(double %7)
%9 = fptosi double %8 to i32
ret i32 %9
}
; Function Attrs: minsize mustprogress nofree nounwind optsize willreturn memory(read)
declare double @atof(ptr nocapture noundef) local_unnamed_addr #0
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #1
attributes #0 = { minsize mustprogress nofree nounwind optsize willreturn memory(read) "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) }
attributes #2 = { minsize optsize }
!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 (param i32) (result f64)))
(type (;1;) (func (param f64) (result f64)))
(type (;2;) (func))
(type (;3;) (func (param i32) (result i32)))
(import "env" "atof" (func (;0;) (type 0)))
(import "env" "round" (func (;1;) (type 1)))
(import "env" "memory" (memory (;0;) 0))
(func (;2;) (type 2))
(func (;3;) (type 3) (param i32) (result i32)
(local f64)
local.get 0
i32.load
local.get 0
local.get 0
i32.load8_s offset=11
i32.const 0
i32.lt_s
select
call 0
call 1
local.tee 1
f64.abs
f64.const 0x1p+31 (;=2.14748e+09;)
f64.lt
if ;; label = @1
local.get 1
i32.trunc_f64_s
return
end
i32.const -2147483648)
(export "__wasm_call_ctors" (func 2))
(export "__wasm_apply_data_relocs" (func 2))
(export "_Z15closest_integerNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE" (func 3)))
| 4 | 64 | 924 | 34 |
CPP/100 | /*
Given a positive integer n, you have to make a pile of n levels of stones.
The first level has n stones.
The number of stones in the next level is:
- the next odd number if n is odd.
- the next even number if n is even.
Return the number of stones in each level in a vector, where element at index
i represents the number of stones in the level (i+1).
Examples:
>>> make_a_pile(3)
{3, 5, 7}
*/
#include<stdio.h>
#include<vector>
using namespace std;
vector<int> make_a_pile(int n){
| #include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#include<algorithm>
#include<stdlib.h>
vector<int> make_a_pile(int n){
| vector<int> out={n};
for (int i=1;i<n;i++)
out.push_back(out[out.size()-1]+2);
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(make_a_pile(3) , {3, 5, 7}));
assert (issame(make_a_pile(4) , {4,6,8,10}));
assert (issame(make_a_pile(5) , {5, 7, 9, 11, 13}));
assert (issame(make_a_pile(6) , {6, 8, 10, 12, 14, 16}));
assert (issame(make_a_pile(8) , {8, 10, 12, 14, 16, 18, 20, 22}));
}
| #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(make_a_pile(3) , {3, 5, 7}));
}
| ; ModuleID = 'c_code_test/code_99.cpp'
source_filename = "c_code_test/code_99.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::initializer_list" = type { ptr, i32 }
%"struct.std::__2::__exception_guard_exceptions" = type <{ %"class.std::__2::vector<int>::__destroy_vector", i8, [3 x i8] }>
%"class.std::__2::vector<int>::__destroy_vector" = type { ptr }
%"struct.std::__2::__split_buffer" = type { ptr, ptr, ptr, %"class.std::__2::__compressed_pair.2" }
%"class.std::__2::__compressed_pair.2" = type { %"struct.std::__2::__compressed_pair_elem", %"struct.std::__2::__compressed_pair_elem.3" }
%"struct.std::__2::__compressed_pair_elem.3" = type { ptr }
$_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em = comdat any
$_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev = 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__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev = comdat any
$_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_ = 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
$_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 mustprogress optsize
define void @_Z11make_a_pilei(ptr noalias nonnull sret(%"class.std::__2::vector") align 4 %0, i32 noundef %1) local_unnamed_addr #0 {
%3 = alloca %"class.std::initializer_list", align 4
%4 = alloca [1 x i32], align 4
%5 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #14
store i32 %1, ptr %4, align 4, !tbaa !3
store ptr %4, ptr %3, align 4, !tbaa !7
%6 = getelementptr inbounds %"class.std::initializer_list", ptr %3, i32 0, i32 1
store i32 1, ptr %6, align 4, !tbaa !11
%7 = call noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull byval(%"class.std::initializer_list") align 4 %3) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #14
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
%9 = call i32 @llvm.smax.i32(i32 %1, i32 1)
br label %10
10: ; preds = %13, %2
%11 = phi i32 [ 1, %2 ], [ %24, %13 ]
%12 = icmp eq i32 %11, %9
br i1 %12, label %25, label %13
13: ; preds = %10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #14
%14 = load ptr, ptr %8, align 4, !tbaa !12
%15 = load ptr, ptr %0, align 4, !tbaa !16
%16 = ptrtoint ptr %14 to i32
%17 = ptrtoint ptr %15 to i32
%18 = sub i32 %16, %17
%19 = ashr exact i32 %18, 2
%20 = add nsw i32 %19, -1
%21 = getelementptr inbounds i32, ptr %15, i32 %20
%22 = load i32, ptr %21, align 4, !tbaa !3
%23 = add nsw i32 %22, 2
store i32 %23, ptr %5, align 4, !tbaa !3
call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %5) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #14
%24 = add nuw i32 %11, 1
br label %10, !llvm.loop !17
25: ; preds = %10
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 noundef ptr @_ZNSt3__26vectorIiNS_9allocatorIiEEEC2B7v160006ESt16initializer_listIiE(ptr noundef nonnull returned align 4 dereferenceable(12) %0, ptr noundef byval(%"class.std::initializer_list") align 4 %1) unnamed_addr #2 comdat {
%3 = alloca %"struct.std::__2::__exception_guard_exceptions", align 4
store ptr null, ptr %0, align 4, !tbaa !16
%4 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr null, ptr %4, align 4, !tbaa !12
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
store ptr null, ptr %5, align 4, !tbaa !19
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #14
store ptr %0, ptr %3, align 4, !tbaa.struct !20, !alias.scope !22
%6 = getelementptr inbounds %"class.std::initializer_list", ptr %1, i32 0, i32 1
%7 = load i32, ptr %6, align 4, !tbaa !11
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %7) #15
%10 = load ptr, ptr %1, align 4, !tbaa !7
%11 = load ptr, ptr %4, align 4, !tbaa !12
%12 = shl nsw i32 %7, 2
tail call void @llvm.memmove.p0.p0.i32(ptr align 4 %11, ptr align 4 %10, i32 %12, i1 false), !noalias !25
%13 = getelementptr inbounds i32, ptr %11, i32 %7
store ptr %13, ptr %4, align 4, !tbaa !12
br label %14
14: ; preds = %9, %2
%15 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %3, i32 0, i32 1
store i8 1, ptr %15, align 4, !tbaa !36
%16 = call noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull align 4 dereferenceable(5) %3) #16
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #14
ret ptr %0
}
; 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 optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE9push_backB7v160006EOi(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 !12
%5 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%6 = load ptr, ptr %5, align 4, !tbaa !21
%7 = icmp ult ptr %4, %6
br i1 %7, label %8, label %11
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_pathIiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) #15
br label %12
12: ; preds = %11, %8
ret void
}
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE11__vallocateB7v160006Em(ptr noundef nonnull align 4 dereferenceable(12) %0, i32 noundef %1) local_unnamed_addr #0 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) #17
unreachable
5: ; preds = %2
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 2
%7 = tail call noundef ptr @_ZNSt3__29allocatorIiE8allocateB7v160006Em(ptr noundef nonnull align 1 dereferenceable(1) %6, i32 noundef %1) #15, !noalias !40
store ptr %7, ptr %0, align 4, !tbaa !16
%8 = getelementptr inbounds %"class.std::__2::vector", ptr %0, i32 0, i32 1
store ptr %7, ptr %8, align 4, !tbaa !12
%9 = getelementptr inbounds i32, ptr %7, i32 %1
store ptr %9, ptr %6, align 4, !tbaa !21
ret void
}
; Function Attrs: minsize nounwind optsize
define linkonce_odr hidden noundef ptr @_ZNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEED2B7v160006Ev(ptr noundef nonnull returned align 4 dereferenceable(5) %0) unnamed_addr #3 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__exception_guard_exceptions", ptr %0, i32 0, i32 1
%3 = load i8, ptr %2, align 4, !tbaa !36, !range !43, !noundef !44
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
tail call void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) #16
br label %6
6: ; preds = %5, %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 #4 comdat {
tail call void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef nonnull @.str) #17
unreachable
}
; Function Attrs: inlinehint minsize mustprogress noreturn optsize
define linkonce_odr hidden void @_ZNSt3__220__throw_length_errorB7v160006EPKc(ptr noundef %0) local_unnamed_addr #5 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) #15
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 #6 comdat {
%3 = tail call noundef ptr @_ZNSt11logic_errorC2EPKc(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef %1) #15
store ptr getelementptr inbounds ({ [5 x ptr] }, ptr @_ZTVSt12length_error, i32 0, inrange i32 0, i32 2), ptr %0, align 4, !tbaa !45
ret ptr %0
}
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt12length_errorD1Ev(ptr noundef nonnull returned align 4 dereferenceable(8)) unnamed_addr #3
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 #6
; 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 #0 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() #17
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 #5 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) #16
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 #3
; Function Attrs: minsize nounwind optsize
declare noundef ptr @_ZNSt20bad_array_new_lengthD1Ev(ptr noundef nonnull returned align 4 dereferenceable(4)) unnamed_addr #3
; Function Attrs: minsize nobuiltin optsize allocsize(0)
declare noundef nonnull ptr @_Znwm(i32 noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1 immarg) #8
; Function Attrs: minsize mustprogress optsize
define linkonce_odr hidden void @_ZNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorclB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(4) %0) local_unnamed_addr #0 comdat {
%2 = load ptr, ptr %0, align 4, !tbaa !47
%3 = load ptr, ptr %2, align 4, !tbaa !16
%4 = icmp eq ptr %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = getelementptr inbounds %"class.std::__2::vector", ptr %2, i32 0, i32 1
store ptr %3, ptr %6, align 4, !tbaa !12
tail call void @_ZdlPv(ptr noundef nonnull %3) #20
br label %7
7: ; preds = %5, %1
ret void
}
; Function Attrs: minsize nobuiltin nounwind optsize
declare void @_ZdlPv(ptr noundef) local_unnamed_addr #9
; Function Attrs: inlinehint minsize mustprogress optsize
define linkonce_odr void @_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #10 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 !16
%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) #15
%14 = load ptr, ptr %5, align 4, !tbaa !12
%15 = load ptr, ptr %0, align 4, !tbaa !16
%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) #15
%21 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %3, i32 0, i32 2
%22 = load ptr, ptr %21, align 4, !tbaa !48
%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 !48
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) #15
%25 = call noundef ptr @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEED2Ev(ptr noundef nonnull align 4 dereferenceable(20) %3) #16
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 #10 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) #17
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 !21
%8 = load ptr, ptr %0, align 4, !tbaa !16
%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 #6 comdat {
%5 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3
store ptr null, ptr %5, align 4, !tbaa !19
%6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 3, i32 1
store ptr %3, ptr %6, align 4, !tbaa !21
%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) #15, !noalias !52
br label %10
10: ; preds = %4, %8
%11 = phi ptr [ %9, %8 ], [ null, %4 ]
store ptr %11, ptr %0, align 4, !tbaa !55
%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 !48
%14 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
store ptr %12, ptr %14, align 4, !tbaa !56
%15 = getelementptr inbounds i32, ptr %11, i32 %1
store ptr %15, ptr %5, align 4, !tbaa !21
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 #6 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 !16
%6 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 1
%7 = load ptr, ptr %6, align 4, !tbaa !56
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 !57
%15 = getelementptr inbounds i32, ptr %10, i32 -1
store i32 %14, ptr %15, align 4, !tbaa !3, !noalias !57
br label %8, !llvm.loop !62
16: ; preds = %8
store ptr %10, ptr %6, align 4, !tbaa !56
%17 = load ptr, ptr %0, align 4, !tbaa !21
store ptr %10, ptr %0, align 4, !tbaa !21
store ptr %17, ptr %6, align 4, !tbaa !21
%18 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %1, i32 0, i32 2
%19 = load ptr, ptr %3, align 4, !tbaa !21
%20 = load ptr, ptr %18, align 4, !tbaa !21
store ptr %20, ptr %3, align 4, !tbaa !21
store ptr %19, ptr %18, align 4, !tbaa !21
%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 !21
%24 = load ptr, ptr %22, align 4, !tbaa !21
store ptr %24, ptr %21, align 4, !tbaa !21
store ptr %23, ptr %22, align 4, !tbaa !21
%25 = load ptr, ptr %6, align 4, !tbaa !56
store ptr %25, ptr %1, align 4, !tbaa !55
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 #3 comdat {
tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) #16
%2 = load ptr, ptr %0, align 4, !tbaa !55
%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 nounwind optsize
define linkonce_odr hidden void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE5clearB7v160006Ev(ptr noundef nonnull align 4 dereferenceable(20) %0) local_unnamed_addr #11 comdat {
%2 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 1
%3 = load ptr, ptr %2, align 4, !tbaa !56
tail call void @_ZNSt3__214__split_bufferIiRNS_9allocatorIiEEE17__destruct_at_endB7v160006EPiNS_17integral_constantIbLb0EEE(ptr noundef nonnull align 4 dereferenceable(20) %0, ptr noundef %3) #16
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 #12 comdat {
%3 = getelementptr inbounds %"struct.std::__2::__split_buffer", ptr %0, i32 0, i32 2
%4 = load ptr, ptr %3, align 4, !tbaa !48
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 !48
br label %5, !llvm.loop !63
10: ; preds = %5
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #13
attributes #0 = { minsize mustprogress 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 = { minsize nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #4 = { minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #5 = { inlinehint minsize mustprogress noreturn optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #6 = { minsize optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #7 = { minsize nobuiltin optsize allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { minsize nobuiltin nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #10 = { inlinehint minsize mustprogress optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #11 = { minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #12 = { inlinehint minsize mustprogress nounwind optsize "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mutable-globals,+sign-ext" }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind }
attributes #15 = { minsize optsize }
attributes #16 = { minsize nounwind optsize }
attributes #17 = { minsize noreturn optsize }
attributes #18 = { noreturn }
attributes #19 = { builtin minsize optsize allocsize(0) }
attributes #20 = { builtin minsize nounwind optsize }
!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 = !{!"_ZTSSt16initializer_listIiE", !9, i64 0, !10, i64 4}
!9 = !{!"any pointer", !5, i64 0}
!10 = !{!"long", !5, i64 0}
!11 = !{!8, !10, i64 4}
!12 = !{!13, !9, i64 4}
!13 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEEE", !9, i64 0, !9, i64 4, !14, i64 8}
!14 = !{!"_ZTSNSt3__217__compressed_pairIPiNS_9allocatorIiEEEE", !15, i64 0}
!15 = !{!"_ZTSNSt3__222__compressed_pair_elemIPiLi0ELb0EEE", !9, i64 0}
!16 = !{!13, !9, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!15, !9, i64 0}
!20 = !{i64 0, i64 4, !21}
!21 = !{!9, !9, i64 0}
!22 = !{!23}
!23 = distinct !{!23, !24, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_: argument 0"}
!24 = distinct !{!24, !"_ZNSt3__222__make_exception_guardB7v160006INS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEENS_28__exception_guard_exceptionsIT_EES7_"}
!25 = !{!26, !28, !30, !32, !34}
!26 = distinct !{!26, !27, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_: argument 0"}
!27 = distinct !{!27, !"_ZNSt3__219__copy_trivial_implB7v160006IKiiEENS_4pairIPT_PT0_EES4_S4_S6_"}
!28 = distinct !{!28, !29, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_: argument 0"}
!29 = distinct !{!29, !"_ZNKSt3__214__copy_trivialclB7v160006IKiiLi0EEENS_4pairIPT_PT0_EES5_S5_S7_"}
!30 = distinct !{!30, !31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_: argument 0"}
!31 = distinct !{!31, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__copy_loopINS_17_ClassicAlgPolicyEEENS_14__copy_trivialEEEPKiS8_PiLi0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!32 = distinct !{!32, !33, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_: argument 0"}
!33 = distinct !{!33, !"_ZNSt3__223__dispatch_copy_or_moveB7v160006INS_17_ClassicAlgPolicyENS_11__copy_loopIS1_EENS_14__copy_trivialEPKiS6_PiEENS_4pairIT2_T4_EES9_T3_SA_"}
!34 = distinct !{!34, !35, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_: argument 0"}
!35 = distinct !{!35, !"_ZNSt3__26__copyB7v160006INS_17_ClassicAlgPolicyEPKiS3_PiEENS_4pairIT0_T2_EES6_T1_S7_"}
!36 = !{!37, !39, i64 4}
!37 = !{!"_ZTSNSt3__228__exception_guard_exceptionsINS_6vectorIiNS_9allocatorIiEEE16__destroy_vectorEEE", !38, i64 0, !39, i64 4}
!38 = !{!"_ZTSNSt3__26vectorIiNS_9allocatorIiEEE16__destroy_vectorE", !9, i64 0}
!39 = !{!"bool", !5, i64 0}
!40 = !{!41}
!41 = distinct !{!41, !42, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!42 = distinct !{!42, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!43 = !{i8 0, i8 2}
!44 = !{}
!45 = !{!46, !46, i64 0}
!46 = !{!"vtable pointer", !6, i64 0}
!47 = !{!38, !9, i64 0}
!48 = !{!49, !9, i64 8}
!49 = !{!"_ZTSNSt3__214__split_bufferIiRNS_9allocatorIiEEEE", !9, i64 0, !9, i64 4, !9, i64 8, !50, i64 12}
!50 = !{!"_ZTSNSt3__217__compressed_pairIPiRNS_9allocatorIiEEEE", !15, i64 0, !51, i64 4}
!51 = !{!"_ZTSNSt3__222__compressed_pair_elemIRNS_9allocatorIiEELi1ELb0EEE", !9, i64 0}
!52 = !{!53}
!53 = distinct !{!53, !54, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m: argument 0"}
!54 = distinct !{!54, !"_ZNSt3__219__allocate_at_leastB7v160006INS_9allocatorIiEEEENS_19__allocation_resultINS_16allocator_traitsIT_E7pointerEEERS5_m"}
!55 = !{!49, !9, i64 0}
!56 = !{!49, !9, i64 4}
!57 = !{!58, !60}
!58 = distinct !{!58, !59, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_: argument 0"}
!59 = distinct !{!59, !"_ZNKSt3__211__move_loopINS_17_ClassicAlgPolicyEEclB7v160006INS_16reverse_iteratorIPiEES6_S6_EENS_4pairIT_T1_EES8_T0_S9_"}
!60 = distinct !{!60, !61, !"_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"}
!61 = distinct !{!61, !"_ZNSt3__221__unwrap_and_dispatchB7v160006INS_10__overloadINS_11__move_loopINS_17_ClassicAlgPolicyEEENS_14__move_trivialEEENS_16reverse_iteratorIPiEES9_S9_Li0EEENS_4pairIT0_T2_EESB_T1_SC_"}
!62 = distinct !{!62, !18}
!63 = distinct !{!63, !18}
| (module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (param i32 i32)))
(type (;2;) (func))
(type (;3;) (func (param i32 i32 i32) (result i32)))
(type (;4;) (func (param i32 i32 i32)))
(type (;5;) (func (param i32 i32) (result i32)))
(type (;6;) (func (param i32)))
(import "env" "memmove" (func (;0;) (type 3)))
(import "env" "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_" (func (;1;) (type 1)))
(import "env" "__cxa_allocate_exception" (func (;2;) (type 0)))
(import "env" "__cxa_throw" (func (;3;) (type 4)))
(import "env" "_ZNSt11logic_errorC2EPKc" (func (;4;) (type 5)))
(import "env" "_Znwm" (func (;5;) (type 0)))
(import "env" "_ZNSt20bad_array_new_lengthC1Ev" (func (;6;) (type 0)))
(import "env" "_ZdlPv" (func (;7;) (type 6)))
(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 (;8;) (type 2))
(func (;9;) (type 1) (param i32 i32)
(local i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 2
global.set 0
local.get 2
i32.const 1
i32.store offset=28
local.get 2
local.get 2
i32.const 20
i32.add
i32.store offset=24
local.get 2
local.get 2
i64.load offset=24 align=4
i64.store offset=8
local.get 2
local.get 1
i32.store offset=20
global.get 0
i32.const 16
i32.sub
local.tee 4
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 4
local.get 0
i32.store offset=8
local.get 2
i32.load offset=12
local.tee 3
if ;; label = @1
local.get 3
i32.const 1073741824
i32.ge_u
if ;; label = @2
call 11
unreachable
end
local.get 0
local.get 3
call 12
local.tee 5
i32.store offset=4
local.get 0
local.get 5
i32.store
local.get 0
local.get 5
local.get 3
i32.const 2
i32.shl
local.tee 3
i32.add
i32.store offset=8
local.get 0
local.get 0
i32.load offset=4
local.get 2
i32.load offset=8
local.get 3
call 0
local.get 3
i32.add
i32.store offset=4
end
i32.const 1
local.get 1
local.get 1
i32.const 1
i32.le_s
select
local.set 5
local.get 4
i32.const 1
i32.store8 offset=12
local.get 4
i32.load8_u offset=12
i32.eqz
if ;; label = @1
local.get 4
i32.load offset=8
local.tee 3
i32.load
local.tee 1
if ;; label = @2
local.get 3
local.get 1
i32.store offset=4
local.get 1
call 7
end
end
local.get 4
i32.const 16
i32.add
global.set 0
i32.const 1
local.set 1
loop ;; label = @1
local.get 1
local.get 5
i32.ne
if ;; label = @2
local.get 2
local.get 0
i32.load offset=4
i32.const 4
i32.sub
i32.load
i32.const 2
i32.add
i32.store offset=20
local.get 2
i32.const 20
i32.add
local.set 3
block ;; label = @3
local.get 0
i32.load offset=4
local.tee 4
local.get 0
i32.load offset=8
i32.lt_u
if ;; label = @4
local.get 4
local.get 3
i32.load
i32.store
local.get 0
local.get 4
i32.const 4
i32.add
i32.store offset=4
br 1 (;@3;)
end
local.get 0
local.get 3
call 1
end
local.get 1
i32.const 1
i32.add
local.set 1
br 1 (;@1;)
end
end
local.get 2
i32.const 32
i32.add
global.set 0)
(func (;10;) (type 1) (param i32 i32)
(local i32 i32 i32 i32 i32)
global.get 0
i32.const 32
i32.sub
local.tee 6
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 2
i32.const 1073741824
i32.ge_u
if ;; label = @1
call 11
unreachable
end
i32.const 1073741823
local.get 0
i32.load offset=8
local.get 0
i32.load
i32.sub
local.tee 3
i32.const 1
i32.shr_s
local.tee 4
local.get 2
local.get 2
local.get 4
i32.lt_u
select
local.get 3
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 6
i32.const 12
i32.add
local.tee 2
i32.const 0
i32.store offset=12
local.get 2
local.get 0
i32.const 8
i32.add
i32.store offset=16
local.get 4
if ;; label = @1
local.get 4
call 12
local.set 3
end
local.get 2
local.get 3
i32.store
local.get 2
local.get 3
local.get 5
i32.const 2
i32.shl
i32.add
local.tee 5
i32.store offset=8
local.get 2
local.get 3
local.get 4
i32.const 2
i32.shl
i32.add
i32.store offset=12
local.get 2
local.get 5
i32.store offset=4
local.get 2
i32.load offset=8
local.tee 3
local.get 1
i32.load
i32.store
local.get 2
local.get 3
i32.const 4
i32.add
i32.store offset=8
local.get 2
i32.load offset=4
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=4
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=4
local.get 0
i32.load offset=4
local.set 1
local.get 0
local.get 2
i32.load offset=8
i32.store offset=4
local.get 2
local.get 1
i32.store offset=8
local.get 0
i32.load offset=8
local.set 1
local.get 0
local.get 2
i32.load offset=12
i32.store offset=8
local.get 2
local.get 1
i32.store offset=12
local.get 2
local.get 2
i32.load offset=4
i32.store
local.get 2
i32.load offset=4
local.set 1
local.get 2
i32.load offset=8
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=8
br 1 (;@1;)
end
end
local.get 2
i32.load
local.tee 0
if ;; label = @1
local.get 0
call 7
end
local.get 6
i32.const 32
i32.add
global.set 0)
(func (;11;) (type 2)
(local i32 i32 i32 i32)
global.get 2
local.set 1
global.get 3
local.set 2
i32.const 8
call 2
global.get 4
local.set 3
global.get 1
call 4
local.tee 0
local.get 3
i32.const 8
i32.add
i32.store
local.get 0
local.get 2
local.get 1
call 3
unreachable)
(func (;12;) (type 0) (param i32) (result i32)
(local i32)
local.get 0
i32.const 1073741824
i32.ge_u
if ;; label = @1
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 0
i32.const 2
i32.shl
call 5)
(export "__wasm_call_ctors" (func 8))
(export "__wasm_apply_data_relocs" (func 8))
(export "_Z11make_a_pilei" (func 9))
(export "_ZNSt3__26vectorIiNS_9allocatorIiEEE21__push_back_slow_pathIiEEvOT_" (func 10))
(data (;0;) (global.get 1) "vector\00"))
| 5 | 113 | 8,686 | 429 |